/* ============================================================
   FRAMED WITH AI — tokens per DESIGN.md §2/§3. Flat color only.
   ============================================================ */
@font-face { font-family: 'Archivo Black'; src: url('../fonts/archivo-black-v23-latin-regular.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Space Mono'; src: url('../fonts/space-mono-v17-latin-regular.woff2') format('woff2'); font-display: swap; }
@font-face { font-family: 'Space Mono'; src: url('../fonts/space-mono-v17-latin-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --ink: #0B0D11; --bone: #F2EFE6;
  --cobalt: #2B65F2; --violet: #7C4EEF; --lime: #9BFA04; --teal: #4FD6C5;
  --display: 'Archivo Black', Impact, 'Arial Black', sans-serif;
  --mono: 'Space Mono', ui-monospace, Menlo, monospace;
  --hud-h: 34px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--ink); }
body { background: var(--ink); color: var(--bone); font-family: var(--mono); }

.display-xl { font-family: var(--display); font-size: 64px; line-height: .95; letter-spacing: -.01em; text-transform: uppercase; }
.display-l  { font-family: var(--display); font-size: 40px; line-height: .95; text-transform: uppercase; }
.display-m  { font-family: var(--display); font-size: 28px; line-height: 1; text-transform: uppercase; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; }

:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; }

/* ---- HUD ---- */
.hud { position: fixed; z-index: 40; top: 0; left: 0; right: 0; height: var(--hud-h);
  display: flex; align-items: center; gap: 8px; padding: 0 12px;
  font-size: 10px; text-transform: uppercase; color: var(--bone);
  background: linear-gradient(var(--ink), transparent); pointer-events: none; }
.hud-transport { display: flex; gap: 3px; }
.glyph-box { width: 7px; height: 7px; background: var(--bone); display: block; }
.glyph-play { width: 0; height: 0; border-left: 6px solid var(--bone);
  border-top: 4px solid transparent; border-bottom: 4px solid transparent; display: block; }
.hud-space { flex: 1; }
.hud-credit { color: var(--lime); font-size: 9px; letter-spacing: .14em; white-space: nowrap; }
#hud-timecode { color: var(--lime); }

/* Film-strip rail: the transport's track turned vertical (2026-08-14 polish).
   Sprocket dashes down the edge; the lime thread is the playhead fill. */
.film-rail { position: fixed; z-index: 40; top: calc(var(--hud-h) + 62px); bottom: 24px;
  right: 8px; width: 10px; transition: opacity .4s ease; }
.film-rail::before { content: ''; position: absolute; left: 50%; transform: translateX(-50%);
  top: 0; bottom: 0; width: 4px;
  background: repeating-linear-gradient(180deg, rgb(242 239 230 / 30%) 0 4px, transparent 4px 14px); }
.rail-fill { position: absolute; left: 50%; transform: translateX(-50%); top: 0; width: 1px;
  height: 0%; background: var(--lime); box-shadow: 0 0 6px rgb(198 242 17 / 50%); display: block; }
.film-rail.parked { opacity: 0; }
html.rm .film-rail, html.nofilm .film-rail { display: none; }

/* ---- Loader ---- */
.loader { position: fixed; inset: 0; z-index: 50; background: var(--ink);
  display: flex; flex-direction: column; justify-content: center; padding: 0 8vw; gap: 18px; }
.loader.done { display: none; }
.hatch-text { color: var(--bone); }
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .hatch-text { background: repeating-linear-gradient(45deg, var(--bone), var(--bone) 4px, var(--ink) 4px, var(--ink) 8px);
    -webkit-background-clip: text; background-clip: text; color: transparent; }
}
.render-bar { border: 2px solid var(--bone); height: 18px; }
.render-fill { height: 100%; width: 0;
  background: repeating-linear-gradient(45deg, var(--cobalt), var(--cobalt) 5px, var(--ink) 5px, var(--ink) 10px); }
.loader-meta { display: flex; justify-content: space-between; font-size: 10px; text-transform: uppercase; }
#loader-pct { color: var(--lime); }
.loader-foot { font-size: 9px; color: rgb(242 239 230 / 45%); text-align: center; }

/* ---- The film: one scroll track, one sticky stage ---- */
#film-scroll { height: 2100vh; position: relative; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.bar { position: absolute; left: 0; right: 0; height: 4%; background: var(--ink); z-index: 5; }
.bar.top { top: 0; } .bar.bottom { bottom: 0; }

/* Copy overlay windows: cards stack, JS drives opacity per global progress.
   The scrim is a sibling, not a ::before, so it can track the strongest card —
   it exists only while a card is up (max .55 at full card opacity). */
.overlays { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
.overlays .scrim { position: absolute; inset: 0; background: var(--ink); opacity: 0; }
.card { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; padding: 10vh 24px; opacity: 0; pointer-events: none; }
.card.on { pointer-events: auto; }

.receipt { position: absolute; z-index: 8; left: 16px; right: 16px; bottom: calc(4% + 12px);
  font-size: 9px; line-height: 1.6; color: var(--bone); opacity: .55; }

/* ---- Scroll cue: the film-track dot — a standing nudge, back after every rest ---- */
.scroll-cue { position: absolute; bottom: 6%; left: 50%; transform: translateX(-50%);
  z-index: 12; display: flex; flex-direction: column; align-items: center; gap: 14px;
  transition: opacity .5s ease; pointer-events: none; }
.cue-track { display: block; width: 3px; height: 110px; border-radius: 2px;
  background: rgb(242 239 230 / 25%); position: relative; }
.cue-dot { position: absolute; left: 50%; transform: translateX(-50%); bottom: 0;
  width: 12px; height: 12px; border-radius: 50%; background: var(--lime);
  box-shadow: 0 0 14px rgb(198 242 17 / 70%); animation: cue-travel 1.6s ease-out infinite; }
.cue-dot::after { content: ''; position: absolute; left: 50%; transform: translateX(-50%);
  top: 10px; width: 4px; height: 26px; border-radius: 2px;
  background: linear-gradient(180deg, rgb(198 242 17 / 55%), transparent); }
.cue-label { font-family: 'Space Mono', monospace; font-size: 11px; letter-spacing: .2em;
  color: var(--bone); opacity: .75; }
@keyframes cue-travel { 0% { bottom: 0; opacity: 0; } 15% { opacity: 1; }
  85% { opacity: 1; } 100% { bottom: 98px; opacity: 0; } }
.scroll-cue.off { opacity: 0; }
.scroll-cue.off .cue-dot { animation-play-state: paused; } /* invisible ≠ free */

/* ---- Ticket / title cards ---- */
.ticket { position: relative; border: 2px solid var(--bone); background: var(--ink);
  width: min(340px, 100%); padding: 12px; }
.ticket-top { display: flex; justify-content: space-between; font-size: 9px; }
.ticket .time { color: var(--lime); font-size: 10px; margin: 14px 0 6px; }
.ticket-rows { border-top: 1px solid rgb(242 239 230 / 20%);
  margin-top: 12px; padding-top: 8px; }
.row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 11px; }
.row.highlight { border: 1px solid var(--lime); color: var(--lime); padding: 4px 6px; margin: 3px -6px 0; }
.ticket .note { margin-top: 8px; font-size: 10px; color: rgb(242 239 230 / 70%); }
.ticket-foot { display: flex; justify-content: space-between; align-items: flex-end;
  border-top: 1px solid rgb(242 239 230 / 20%); margin-top: 10px; padding-top: 8px; }
.barcode { display: flex; gap: 1px; align-items: flex-end; height: 16px; }
.barcode i { display: block; width: 2px; height: 100%; background: var(--bone); }
.barcode i:nth-child(3n) { width: 1px; } .barcode i:nth-child(4n) { height: 70%; }
.foot-label { font-size: 9px; }

.titlecard { position: relative; text-align: left; max-width: 340px; }
.titlecard .tagline { margin-top: 8px; color: var(--lime); text-shadow: 0 0 9px rgb(155 250 4 / 35%); }
.titlecard .time { color: var(--lime); font-size: 10px; }
.titlecard .display-m { margin-top: 6px; }
.titlecard .intertitle { font-size: 14px; margin-top: 12px; }
.cursor { display: inline-block; width: 9px; height: 16px; background: var(--lime);
  margin-left: 4px; animation: blink 1.1s steps(1) infinite; }
/* While the tagline types, its cursor is SOLID by rule, not by the side effect
   of re-append restarting the animation; .blink hands the blink back. */
.tagline .cursor { animation: none; }
.tagline .cursor.blink { animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---- Below the film: ink only — no white anywhere on the site ---- */
.below { padding: 72px 24px; background: var(--ink); color: var(--bone); }
.venue .btn { display: inline-block; border: 2px solid var(--bone); padding: 10px 16px;
  margin-top: 16px; color: var(--bone); text-decoration: none; text-transform: uppercase; }
.venue .btn:hover { background: var(--bone); color: var(--ink); }
.dish { border-top: 1px solid rgb(242 239 230 / 20%); display: flex; justify-content: center; }
.dish-ticket { display: block; text-decoration: none; color: var(--bone); }
.dish-ticket:hover, .dish-ticket:focus-visible { border-color: var(--lime); }
.dish-ticket .display-m { margin-top: 6px; }
.dish-ticket .eyebrow { color: var(--lime); font-size: 10px; letter-spacing: .18em; margin-top: 10px; }
.credits { text-align: left; }
.credits .mono { line-height: 2; text-transform: lowercase; }
.credits .barcode { margin: 18px 0 8px; }

html.nofilm #film { display: none; }
html.nofilm .hud { display: none; }

/* Floating GAME link (C5): one word, quiet, sits under the HUD line. */
.game-link { position: fixed; z-index: 41; top: calc(var(--hud-h) + 10px); right: 12px;
  font-size: 12px; letter-spacing: .16em; color: var(--bone); text-decoration: none;
  border: 1px solid rgb(242 239 230 / 25%); padding: 9px 18px;
  background: rgb(11 13 17 / 55%); backdrop-filter: blur(2px); }
.game-link:hover, .game-link:focus-visible { border-color: var(--lime); color: var(--lime); }

/* Idle shine: breathes lime in sync with the scroll cue (main.js toggles it). */
.game-link.shine { animation: game-breathe 3.2s infinite; }
@keyframes game-breathe {
  0%, 55%, 100% { border-color: rgb(242 239 230 / 25%); box-shadow: none; color: var(--bone); }
  72% { border-color: var(--lime); box-shadow: 0 0 16px rgb(198 242 17 / 60%); color: var(--lime); }
  88% { border-color: rgb(198 242 17 / 60%); box-shadow: 0 0 8px rgb(198 242 17 / 30%); }
}
html.rm .game-link { animation: none; }

/* ---- Desktop: native 9:16 quiet column, centered on ink ---- */
@media (min-width: 900px) {
  .display-xl { font-size: 110px; } .display-l { font-size: 64px; }
  .ticket { width: 380px; }
  .stage canvas { left: 50%; transform: translateX(-50%); width: calc(100svh * 9 / 16); }
  .receipt { left: 50%; transform: translateX(-50%); right: auto; width: calc(100svh * 9 / 16 - 32px); max-width: 380px; }
}

/* ---- Reduced motion: five static boundary stills, no scrub (spec §4) ---- */
@media (prefers-reduced-motion: reduce) {
  html.rm .hud { display: none; } /* no film to transport — a frozen instrument is worse than none */
  html.rm .scroll-cue { display: none; } /* nothing to scrub — no invitation to scrub it */
  html.rm .rm-still:first-child::after { content: '▼'; position: absolute; bottom: 6%; left: 50%;
    transform: translateX(-50%); color: var(--bone); font-size: 18px; }
  html.rm #film-scroll { height: auto; }
  html.rm .rm-still { position: relative; height: 100svh; overflow: hidden;
    background: center / cover no-repeat; }
  html.rm .rm-still .scrim { position: absolute; inset: 0; background: var(--ink); opacity: .55; }
  html.rm .rm-still .card { opacity: 1; pointer-events: auto; }
  html.rm .cursor { animation: none; }
}
