/*
Theme Name: Backstory Sidecar
Description: WordPress translation of The Backstory of Art's static site. Direct port of the same CSS/JS/HTML; text and fonts are editable via ACF, everything else (layout, motion, color) is fixed by design.
Author: Claude Code
Version: 1.0.0
*/

:root{
  --ink:        oklch(0.14 0.04 25);
  --paper:      oklch(0.95 0.015 50);
  --blood:      oklch(0.33 0.20 26);
  --bone:       oklch(0.90 0.02 55);
  --gold:       oklch(0.78 0.13 85);
  --rose:       oklch(0.62 0.09 30);
  --blood-ink:  oklch(0.14 0.04 25);

  --sp-1: 0.5rem;
  --sp-2: 1rem;
  --sp-3: 1.5rem;
  --sp-4: 2rem;
  --sp-5: 3rem;
  --sp-6: 4rem;
  --sp-7: 6rem;
  --sp-8: 8rem;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  /* Font variables — overridden by bsa_font_face_css() in functions.php
     when a custom font file has been uploaded via ACF. Until then these
     fallbacks (the theme's original Google Fonts) apply. */
  --font-display-custom: 'Big Shoulders Display', sans-serif;
  --font-body-custom: 'Fraunces', serif;
  --font-utility-custom: 'JetBrains Mono', monospace;
  --font-scrawl-custom: 'Sedgwick Ave Display', cursive;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
body{
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body-custom);
  font-size: 17px;
  line-height: 1.6;
}
img, svg{ max-width: 100%; display: block; }
a{ color: inherit; }

h1, h2, h3{
  font-family: var(--font-display-custom);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.98;
  letter-spacing: 0.005em;
  margin: 0;
}

.eyebrow{
  font-family: var(--font-utility-custom);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rose);
}

.wrap{
  max-width: 1240px;
  margin: 0 auto;
  padding-left: var(--sp-4);
  padding-right: var(--sp-4);
  width: 100%;
}

img.media{
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  border: none;
}
.hero-media img.media{ height: 100%; }

/* ---------- grain (static texture, never animated) ---------- */
.grain{
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0;
  background-repeat: repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-reduced-motion: no-preference) and (pointer: fine){
  .grain{ opacity: 0.045; mix-blend-mode: overlay; }
}

/* ---------- custom cursor (desktop / fine pointer only, added via JS) ---------- */
.cursor-dot, .cursor-ring{
  position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999;
  border-radius: 50%; will-change: transform; opacity: 0;
  transition: opacity 200ms var(--ease);
}
.cursor-dot.is-visible, .cursor-ring.is-visible{ opacity: 1; }
.cursor-ring.is-visible{ transition: opacity 200ms var(--ease), width 200ms var(--ease), height 200ms var(--ease), margin 200ms var(--ease), border-color 200ms var(--ease), background 200ms var(--ease); }
.cursor-dot{ width: 8px; height: 8px; margin: -4px 0 0 -4px; background: var(--gold); }
.cursor-ring{
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 1.5px solid color-mix(in oklch, var(--gold) 65%, transparent);
  transition: width 200ms var(--ease), height 200ms var(--ease), margin 200ms var(--ease), border-color 200ms var(--ease), background 200ms var(--ease);
}
.cursor-ring.is-active{
  width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-color: var(--gold);
  background: color-mix(in oklch, var(--gold) 12%, transparent);
}
body.has-cursor{ cursor: none; }
body.has-cursor a{ cursor: none; }
body.has-cursor .notify-form input{ cursor: text; }

/* ---------- nav ---------- */
.site-nav{
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in oklch, var(--ink) 88%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid transparent;
  transition: background 240ms var(--ease), border-color 240ms var(--ease), backdrop-filter 240ms var(--ease);
}
.site-nav.is-scrolled{
  background: color-mix(in oklch, var(--ink) 94%, transparent);
  backdrop-filter: blur(10px);
  border-bottom-color: color-mix(in oklch, var(--paper) 12%, transparent);
}
.site-nav .wrap{ display: flex; align-items: center; justify-content: space-between; padding-top: var(--sp-2); padding-bottom: var(--sp-2); }
.wordmark{
  font-family: var(--font-display-custom);
  font-weight: 800; text-transform: uppercase; font-size: 1.05rem; letter-spacing: 0.02em; text-decoration: none;
}
.nav-cta{
  font-family: var(--font-utility-custom);
  font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none;
  border-bottom: 1px solid currentColor; padding-bottom: 2px; transition: color 200ms var(--ease);
}
.nav-cta:hover, .nav-cta:focus-visible{ color: var(--gold); }
a:focus-visible, button:focus-visible{ outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- buttons / forms ---------- */
.btn{
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gold); color: var(--ink);
  font-family: var(--font-utility-custom);
  font-size: 0.78rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  border: none; padding: 0.95rem 1.5rem; border-radius: 2px; cursor: pointer;
  transition: transform 180ms var(--ease), background 180ms var(--ease); white-space: nowrap;
}
.btn:hover{ background: color-mix(in oklch, var(--gold) 85%, white); transform: translateY(-1px); }

.notify-form{ display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-4); }
.notify-form input[type="email"]{
  flex: 1 1 260px; background: transparent;
  border: 1.5px solid color-mix(in oklch, currentColor 40%, transparent); color: inherit;
  font-family: var(--font-utility-custom);
  font-size: 0.85rem; padding: 0.95rem 1.1rem; border-radius: 2px;
}
.notify-form input[type="email"]::placeholder{ color: color-mix(in oklch, currentColor 55%, transparent); }
.form-note{
  font-family: var(--font-utility-custom);
  font-size: 0.68rem; letter-spacing: 0.04em; color: var(--rose); margin-top: var(--sp-2);
}

/* ---------- hero ---------- */
.hero{ background: var(--blood); color: var(--paper); padding-top: calc(var(--sp-7) + var(--sp-2)); padding-bottom: var(--sp-8); overflow: hidden; }
.hero .wrap{ display: grid; grid-template-columns: 1.15fr 0.85fr; gap: var(--sp-6); align-items: center; }
.hero-eyebrow{ color: color-mix(in oklch, var(--paper) 70%, transparent); margin-bottom: var(--sp-3); }
.hero h1{ font-size: clamp(2.6rem, 6vw, 5.4rem); }
.hero h1 .mark{
  font-family: var(--font-scrawl-custom);
  text-transform: none; font-weight: 400; font-size: 1.05em; color: var(--gold);
  display: inline-block; transform: rotate(-4deg); position: relative;
}
.hero h1 .mark .stroke{ display: inline-block; overflow: hidden; white-space: nowrap; padding: 0.06em 0.1em; margin: -0.06em -0.1em; animation: draw-on 700ms 500ms var(--ease) both; }
@keyframes draw-on{ from{ clip-path: inset(0 100% 0 0); } to{ clip-path: inset(0 0 0 0); } }
.hero-lede{ margin-top: var(--sp-4); font-size: 1.15rem; max-width: 42ch; color: color-mix(in oklch, var(--paper) 88%, transparent); }
.hero-media{ aspect-ratio: 3 / 4; align-self: stretch; position: relative; }

/* ---------- image credits ---------- */
.credit{
  font-family: var(--font-utility-custom);
  font-size: 0.62rem; letter-spacing: 0.01em; line-height: 1.4;
}
.hero-credit{
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: var(--sp-2) var(--sp-3) var(--sp-1);
  background: linear-gradient(to top, color-mix(in oklch, var(--ink) 75%, transparent), transparent);
  color: color-mix(in oklch, var(--paper) 75%, transparent);
}
.step-credit{ margin-top: -0.3rem; margin-bottom: var(--sp-2); color: color-mix(in oklch, var(--ink) 50%, transparent); }

@media (max-width: 860px){
  .hero .wrap{ grid-template-columns: 1fr; }
  .hero-media{ order: -1; aspect-ratio: 16/10; }
}

/* ---------- reveal-on-scroll ---------- */
.reveal{ opacity: 0; transform: translateY(18px); transition: opacity 600ms var(--ease), transform 600ms var(--ease); }
.reveal.is-visible{ opacity: 1; transform: translateY(0); }
.how-steps .step:nth-child(1){ transition-delay: 0ms; }
.how-steps .step:nth-child(2){ transition-delay: 80ms; }
.how-steps .step:nth-child(3){ transition-delay: 160ms; }

/* ---------- hero load-in ---------- */
@media (prefers-reduced-motion: no-preference){
  .hero-eyebrow, .hero h1, .hero-lede, .hero .notify-form, .hero .form-note{
    opacity: 0; transform: translateY(14px);
    transition: opacity 700ms var(--ease), transform 700ms var(--ease);
  }
  .hero.is-loaded .hero-eyebrow{ transition-delay: 100ms; }
  .hero.is-loaded h1{ transition-delay: 180ms; }
  .hero.is-loaded .hero-lede{ transition-delay: 320ms; }
  .hero.is-loaded .notify-form{ transition-delay: 420ms; }
  .hero.is-loaded .form-note{ transition-delay: 500ms; }
  .hero.is-loaded .hero-eyebrow, .hero.is-loaded h1, .hero.is-loaded .hero-lede,
  .hero.is-loaded .notify-form, .hero.is-loaded .form-note{ opacity: 1; transform: translateY(0); }

  .thanks-copy > *{
    opacity: 0; transform: translateY(14px);
    transition: opacity 700ms var(--ease), transform 700ms var(--ease);
  }
  .thanks.is-loaded .thanks-copy > *{ opacity: 1; transform: translateY(0); }
  .thanks.is-loaded .thanks-copy > *:nth-child(1){ transition-delay: 100ms; }
  .thanks.is-loaded .thanks-copy > *:nth-child(2){ transition-delay: 220ms; }
  .thanks.is-loaded .thanks-copy > *:nth-child(3){ transition-delay: 340ms; }
  .thanks.is-loaded .thanks-copy > *:nth-child(4){ transition-delay: 460ms; }
}

/* ---------- problem section ---------- */
.problem{ padding-top: var(--sp-8); padding-bottom: var(--sp-8); }
.problem h2{ font-size: clamp(1.9rem, 3.6vw, 3rem); max-width: 18ch; }
.problem-copy{ margin-top: var(--sp-4); max-width: 55ch; font-size: 1.0625rem; color: color-mix(in oklch, var(--paper) 85%, transparent); }

/* ---------- how it works ---------- */
.how{ background: var(--bone); color: var(--ink); padding-top: var(--sp-8); padding-bottom: var(--sp-8); }
.how .section-head{ display: flex; justify-content: space-between; align-items: flex-end; gap: var(--sp-4); margin-bottom: var(--sp-6); flex-wrap: wrap; }
.how h2{ font-size: clamp(1.9rem, 3.4vw, 2.8rem); margin-top: 0.4rem; }
.how-intro{ font-family: var(--font-utility-custom); font-size: 0.78rem; letter-spacing: 0.04em; color: color-mix(in oklch, var(--ink) 65%, transparent); }
.how-steps{ display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
.step{ border-top: 2px solid var(--ink); padding-top: var(--sp-3); transition: transform 220ms var(--ease); }
.step:hover{ transform: translateY(-4px); }
.step-num{ font-family: var(--font-utility-custom); font-size: 0.75rem; letter-spacing: 0.1em; color: var(--blood); margin-bottom: var(--sp-2); }
.step h3{ font-size: 1.3rem; font-family: var(--font-display-custom); font-weight: 800; text-transform: uppercase; margin-bottom: var(--sp-2); }
.step img.media{ aspect-ratio: 5/3; margin-bottom: var(--sp-2); transition: filter 220ms var(--ease); }
.step:hover img.media{ filter: brightness(1.05); }
.step-copy{ font-size: 0.95rem; color: color-mix(in oklch, var(--ink) 80%, transparent); }

@media (max-width: 860px){ .how-steps{ grid-template-columns: 1fr; } }

/* ---------- proof ---------- */
.proof{ padding-top: var(--sp-8); padding-bottom: var(--sp-8); }
.proof .wrap{ display: grid; grid-template-columns: 0.85fr 1.15fr; gap: var(--sp-6); align-items: center; }
.proof-quote{
  font-family: var(--font-body-custom);
  font-style: italic; font-weight: 400; font-size: clamp(1.3rem, 2.6vw, 2rem); line-height: 1.35; color: var(--paper);
}
.proof-fact{ margin-top: var(--sp-5); display: flex; gap: var(--sp-5); flex-wrap: wrap; }
.proof-fact .stat{ font-family: var(--font-display-custom); font-weight: 900; font-size: 2.6rem; color: var(--gold); line-height: 1; }
.proof-fact .stat-label{ font-family: var(--font-utility-custom); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--rose); margin-top: 0.4rem; }
.proof-media img.media{ aspect-ratio: 4/5; }

@media (max-width: 860px){ .proof .wrap{ grid-template-columns: 1fr; } .proof-media{ order: -1; } }

/* ---------- credentials ---------- */
.credentials{
  background: var(--blood-ink);
  border-top: 1px solid color-mix(in oklch, var(--paper) 10%, transparent);
  border-bottom: 1px solid color-mix(in oklch, var(--paper) 10%, transparent);
  padding-top: var(--sp-6); padding-bottom: var(--sp-6);
}
.credentials .wrap{ display: flex; justify-content: center; align-items: center; gap: var(--sp-5); flex-wrap: wrap; text-align: center; }
.credentials .role{ font-family: var(--font-display-custom); font-weight: 800; text-transform: uppercase; font-size: 1.4rem; white-space: nowrap; }
.credentials .divider{ width: 1px; height: 2rem; background: color-mix(in oklch, var(--paper) 20%, transparent); }
.credentials-copy{ max-width: 32ch; font-size: 0.95rem; color: color-mix(in oklch, var(--paper) 80%, transparent); margin: 0; }
@media (max-width: 560px){ .credentials .divider{ display: none; } }

/* ---------- notify band ---------- */
.notify{ background: var(--blood); color: var(--paper); padding-top: var(--sp-8); padding-bottom: var(--sp-8); text-align: center; }
.notify h2{ font-size: clamp(2rem, 4.5vw, 3.6rem); max-width: 20ch; margin: 0 auto; }
.notify .notify-form{ justify-content: center; max-width: 480px; margin-left: auto; margin-right: auto; }
.notify .form-note{ text-align: center; }
.notify .eyebrow{ margin-bottom: var(--sp-2); color: color-mix(in oklch, var(--paper) 70%, transparent); justify-content: center; display: flex; }

/* ---------- thank-you page ----------
   Scoped to the Thank You page specifically (via WordPress's own
   page-template body class) — these must NOT apply globally, since the
   homepage's <main> also wraps multiple sections that need to stack
   normally, not lay out as a flex row. */
body.page-template-template-thank-you-php{ min-height: 100vh; display: flex; flex-direction: column; }
body.page-template-template-thank-you-php main{ flex: 1; display: flex; }
.thanks{ background: var(--blood); color: var(--paper); padding-top: var(--sp-8); padding-bottom: var(--sp-8); width: 100%; }
.thanks .wrap{ display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--sp-6); align-items: center; }
.thanks h1{ font-size: clamp(2.4rem, 5.5vw, 4.6rem); }
.thanks p{ margin-top: var(--sp-4); font-size: 1.15rem; max-width: 42ch; color: color-mix(in oklch, var(--paper) 88%, transparent); }
.thanks p:first-of-type{ margin-top: var(--sp-3); }
.thanks .mark{
  font-family: var(--font-scrawl-custom);
  text-transform: none; font-weight: 400; font-size: 1.15em; color: var(--gold);
  display: inline-block; transform: rotate(-3deg); position: relative;
}
.thanks .mark .stroke{ display: inline-block; overflow: hidden; white-space: nowrap; padding: 0.06em 0.1em; margin: -0.06em -0.1em; animation: draw-on 700ms 500ms var(--ease) both; }
.back-home{ display: inline-block; margin-top: var(--sp-5); }
.thanks-media{ aspect-ratio: 2 / 3; align-self: stretch; position: relative; }
.thanks-media img{ display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }

@media (max-width: 860px){ .thanks .wrap{ grid-template-columns: 1fr; } .thanks-media{ order: -1; aspect-ratio: 16/10; } }

/* ---------- footer ---------- */
footer{ padding-top: var(--sp-5); padding-bottom: var(--sp-5); }
footer .wrap{ display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.footer-links{ display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; font-family: var(--font-utility-custom); font-size: 0.72rem; letter-spacing: 0.03em; }
.footer-links a{ text-decoration: none; color: var(--rose); transition: color 200ms var(--ease); }
.footer-links a:hover, .footer-links a:focus-visible{ color: var(--gold); }
.footer-links .sep{ color: color-mix(in oklch, var(--paper) 20%, transparent); }
.footer-social{ display: flex; align-items: center; gap: var(--sp-2); }
.footer-social a{ display: flex; align-items: center; }
.footer-social svg{ width: 17px; height: 17px; fill: currentColor; display: block; }
.footer-line{ font-family: var(--font-utility-custom); font-size: 0.72rem; letter-spacing: 0.03em; color: var(--rose); }

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  .reveal{ opacity: 1; transform: none; transition: none; }
  .hero h1 .stroke, .thanks .mark .stroke{ animation: none; clip-path: inset(0 0 0 0); }
  .btn:hover{ transform: none; }
  .step:hover{ transform: none; }
  .step:hover img.media{ filter: none; }
}
