/* Self-hosted. No third-party origin — a page that promises nobody is
   watching shouldn't phone Google on load. Two files: Source Serif 4's
   variable axis (wght 200–900) covers every weight this build uses, one
   file for upright, one for italic, latin-subset only. */
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('fonts/SourceSerif4-Variable.woff2') format('woff2-variations'), url('fonts/SourceSerif4-Variable.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url('fonts/SourceSerif4-Italic-Variable.woff2') format('woff2-variations'), url('fonts/SourceSerif4-Italic-Variable.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+FEFF, U+FFFD;
}

/* ── tokens ──────────────────────────────────────────────────────────────
   --glow-rgb is the ONLY hand-set fallback in this file (pre-JS paint).
   Every other color in this stylesheet derives from it. main.js overwrites
   --glow-rgb every animation frame — from the TV sample in Act 1, blended
   toward the window sample across THE PULL-BACK. Nothing here is a
   keyframe, nothing here is hand-keyed flicker.                          */
:root {
  --room: #07080A;
  --glow-rgb: 118 148 196;         /* pre-JS fallback only */
  --said: rgb(var(--glow-rgb) / .32);
  --meant: rgb(var(--glow-rgb) / 1);
  --line: rgb(var(--glow-rgb) / .82);  /* verified ≥4.5:1 across the FULL ambient flicker cycle, not a snapshot — see contrast-check.mjs */
  --dim: rgb(var(--glow-rgb) / .78);   /* secondary text — same full-cycle verification */
  --hair: rgb(var(--glow-rgb) / .22);
  --window: #B9C4CE;               /* the fixed target color the flip blends toward */

  --serif: 'Source Serif 4', serif;
  --ease: cubic-bezier(.16,1,.3,1);       /* monotonic, no overshoot — snappy entrances/hovers */
  --ease-dissolve: cubic-bezier(.33,0,.67,1); /* symmetric, evenly paced — for the one motion that's supposed to be watched, not just landed on */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--room);
  color: var(--line);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgb(var(--glow-rgb) / .35); color: var(--window); }

/* ── shared section shell ─────────────────────────────────────────────── */
/* [hidden] must win over .section's own `display: flex` — otherwise a
   gated section (THE BOOK, THE SHIRT, the parade map) renders anyway.
   Author-stylesheet specificity ties resolve by source order, not by
   attribute-vs-class, so this has to be explicit. */
[hidden] { display: none !important; }

.section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8vh 6vw;
  position: relative;
  text-align: left;
}

/* pass-1 upgrade: a hairline at each section's top edge — cheap
   instrument-grid rhythm marking scroll position through the room,
   no added copy, no added weight. */
.section:not(.room)::after {
  content: '';
  position: absolute;
  top: 0; left: 6vw; right: 6vw;
  height: 1px;
  background: var(--hair);
}

.eyebrow {
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 1.4rem;
}

.line {
  margin: 0 0 1.1em;
  font-size: clamp(1rem, 1.6vw + .6rem, 1.25rem);
  line-height: 1.6;
  color: var(--line);
  max-width: 34em;
  text-wrap: pretty;
}

/* ── THE ROOM ────────────────────────────────────────────────────────── */
.room { padding-bottom: 12vh; }

/* the stand-in television — an honest placeholder, deliberately pixelated
   so it reads as a test signal, not a finished shot. Swapped for the real
   Higgsfield push-in clip in a later stage. transform is scroll-driven
   (see main.js) — a genuine push-in on the placeholder, not a lie about
   what's showing. */
.tv-display, .window-display {
  width: min(46vw, 360px);
  aspect-ratio: 16 / 9;
  image-rendering: pixelated;
  border-radius: 3px;
  box-shadow: 0 0 60px 10px rgb(var(--glow-rgb) / .28);
  margin-bottom: 3rem;
  filter: saturate(1.05);
  will-change: transform;
}

.line--room { color: var(--meant); font-style: italic; font-weight: 600; max-width: 28em; }

.scroll-cue {
  position: absolute;
  bottom: 6vh;
  left: 50%;
  transform: translateX(-50%);
  color: rgb(var(--glow-rgb) / .4);
  font-size: 1.4rem;
}

/* ── THE CONFESSIONAL ───────────────────────────────────────────────── */
.confessional-wrap { width: 100%; max-width: 40rem; }

.line--open { font-style: italic; font-weight: 600; color: var(--meant); }

.confessional {
  margin-top: 2.6rem;
  display: grid;
  gap: 1.4rem;
  /* pass 4 (motion) finding: var(--ease) front-loads its progress, so at .9s
     it read as "gone by 600ms, then nothing" — the classic bad-timing-
     distribution fail condition. --ease-dissolve paces evenly across the
     full duration instead, since this is the one motion meant to be watched. */
  transition: opacity .9s var(--ease-dissolve), filter .9s var(--ease-dissolve), transform .9s var(--ease-dissolve);
}
.confessional.dissolving {
  opacity: 0;
  filter: blur(9px);
  transform: translateY(-10px);
  pointer-events: none;
}

.field { display: flex; flex-direction: column; gap: .5rem; }
.field label {
  font-family: var(--serif);
  font-size: .82rem;
  letter-spacing: .04em;
  text-transform: lowercase;
  color: var(--dim);
}
.field textarea, .field input {
  background: transparent;
  border: 1px solid var(--hair);
  border-radius: 2px;
  padding: .85em 1em;
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.5;
  outline: none;
  color: var(--line);
  transition: border-color .4s var(--ease);
}
.field textarea { resize: vertical; }
.field textarea:focus, .field input:focus { border-color: rgb(var(--glow-rgb) / .6); }

.field--said textarea { color: var(--said); caret-color: rgb(var(--glow-rgb) / .6); }
.field--meant textarea { color: var(--meant); font-weight: 600; caret-color: rgb(var(--glow-rgb) / 1); }

.confess-btn, .parade-btn {
  justify-self: start;
  background: transparent;
  border: 1px solid rgb(var(--glow-rgb) / .5);
  color: var(--meant);
  font-family: var(--serif);
  font-size: .95rem;
  letter-spacing: .03em;
  padding: .6em 1.4em;
  border-radius: 2px;
  cursor: pointer;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.confess-btn:hover, .confess-btn:focus-visible,
.parade-btn:hover, .parade-btn:focus-visible { background: rgb(var(--glow-rgb) / .1); }

.dissolve-note, .blink-line, .parade-note {
  max-width: 34em;
  font-size: 1.02rem;
  line-height: 1.6;
  opacity: 0;
  transition: opacity 1.1s var(--ease);
  margin: 1.1em 0 0;
  text-wrap: pretty;
}
.dissolve-note.show, .blink-line.show, .parade-note.show { opacity: 1; }
.blink-line { font-style: italic; font-weight: 600; color: var(--meant); }
.parade-note { font-size: .85rem; color: var(--dim); }

/* the shirt — §5's frame. Renders always; only the purchasable product
   section (THE SHIRT, below) is gated. */
.shirt-object { max-width: 20rem; margin: 4rem auto 0; text-align: center; }
.shirt-object svg { width: 100%; height: auto; overflow: visible; }
.shirt-print {
  font-family: var(--serif);
  font-size: 10px;
  line-height: 1.3;
  color: rgb(var(--glow-rgb) / .88);
  text-align: center;
}
.shirt-object figcaption {
  margin-top: .9em;
  font-size: .85rem;
  font-style: italic;
  color: var(--dim);
}

/* ── THE COUNT / THE PARADE ────────────────────────────────────────────
   Both are sparse — a few lines centered in a full 100vh frame reads as
   a dead void (the exact failure the skill's own precedent flagged: an
   unlit frame with nothing for the eye to land on). Pass 1 fix: a soft
   ambient glow, sourced from the same --glow-rgb everything else uses,
   fills the frame instead of leaving it black. It's the room's light
   doing the work, not a decorative add-on — thematically load-bearing
   here in a way it wouldn't be on an unrelated site.                    */
.count-section, .parade-section { min-height: 74vh; }
.count-section::before, .parade-section::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: min(85vw, 760px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgb(var(--glow-rgb) / .14), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.count-section > *, .parade-section > * { position: relative; z-index: 1; }

.count-section { align-items: center; text-align: center; }
.count-line { font-size: clamp(1.4rem, 2.4vw + .8rem, 2.2rem); color: var(--line); margin: 0 0 .6em; }
.count-line span { color: var(--meant); font-weight: 600; }
.count-status { font-size: .82rem; color: var(--dim); margin: 0; }

/* ── THE PARADE ─────────────────────────────────────────────────────── */
.parade-section .parade-form {
  margin-top: 1.8rem;
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}
.field--parade { min-width: 16rem; }
.parade-map { margin-top: 3rem; }

/* ── THE SHIRT / THE BOOK — gated sections, no extra styling needed;
   [hidden] already removes them from render and from the a11y tree.    */

/* ── THE PULL-BACK ──────────────────────────────────────────────────── */
.pullback { padding-top: 12vh; }
.line--pullback { color: var(--meant); font-style: italic; font-weight: 600; text-align: center; max-width: 26em; }

.site-footer {
  padding: 4vh 6vw 6vh;
  text-align: center;
}
.site-footer a {
  color: var(--dim);
  font-size: .78rem;
  letter-spacing: .06em;
  text-decoration: none;
  border-bottom: 1px solid rgb(var(--glow-rgb) / .25);
  padding-bottom: 2px;
  transition: color .3s var(--ease);
}
.site-footer a:hover, .site-footer a:focus-visible { color: rgb(var(--glow-rgb) / .8); }

@media (max-width: 640px) {
  .section { padding: 6vh 6vw; }
  .tv-display, .window-display { width: 70vw; margin-bottom: 2.2rem; }
  .parade-section .parade-form { flex-direction: column; align-items: stretch; }
}

/* ── THE SOLUTIONS — the commons ──────────────────────────────────────────
   Sits beside THE PARADE in the same register: same serif, same ambient
   --glow-rgb, same eyebrow/line vocabulary. The only new move is a card grid,
   which the narrative beats don't need. Card headings + the "way out" accents
   borrow --window (the flip's daylight target) — the solutions ARE the window. */
.solutions-wrap { width: 100%; max-width: 68rem; }
.line--solutions-open { color: var(--meant); font-style: italic; font-weight: 600; max-width: 30em; }
.line--solutions-sub { color: var(--dim); max-width: 34em; }

.solutions-grid {
  list-style: none; margin: 2.6rem 0 0; padding: 0;
  display: grid; gap: 1.1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr));
}
.solution-card {
  border: 1px solid var(--hair);
  border-radius: 3px;
  padding: 1.5rem 1.6rem;
  background: rgb(var(--glow-rgb) / .035);
  display: flex; flex-direction: column;
}
.sc-title {
  margin: 0 0 .5rem; font-size: 1.12rem; line-height: 1.28;
  font-weight: 600; color: var(--window);
}
.sc-premise {
  margin: 0 0 .3rem; font-size: .96rem; line-height: 1.55;
  color: var(--line); font-style: italic;
}
.sc-row { display: flex; flex-direction: column; gap: .1rem; margin-top: .85rem; }
.sc-label {
  font-size: .6rem; letter-spacing: .15em; text-transform: uppercase;
  color: var(--dim); opacity: .85;
}
.sc-text { margin: 0; font-size: .88rem; line-height: 1.5; color: var(--line); }

.sc-subs { list-style: none; margin: .45rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.sc-sub { padding-left: .8rem; border-left: 1px solid var(--hair); display: flex; flex-direction: column; gap: .1rem; }
.sc-sub-name { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--window); }
.sc-sub-idea { font-size: .84rem; line-height: 1.45; color: var(--dim); }

.sc-meta { margin-top: .4rem; }

.sc-commons {
  margin: 1.2rem 0 0; padding-top: .9rem;
  border-top: 1px solid var(--hair);
  font-size: .82rem; line-height: 1.45; color: var(--window);
  letter-spacing: .01em;
}

.solutions-note { margin-top: 1.4rem; font-size: .9rem; color: var(--dim); opacity: 0; transition: opacity .5s; }
.solutions-note.show { opacity: 1; }

@media (max-width: 600px) {
  .solution-card { padding: 1.3rem 1.3rem; }
  .solutions-grid { gap: 1rem; }
}
