/* v11 The Trailer: black, film grain, letterbox, slow serif titles. Tokens + the parts every page shares. */
:root {
  --ink: #050505;
  --ink-2: #0e0d0c;
  --ink-3: #1a1816;
  --bone: #f2ede3;
  --bone-dim: rgba(242, 237, 227, .68);
  --bone-faint: rgba(242, 237, 227, .34);
  --line: rgba(242, 237, 227, .16);
  --amber: #f2b544;
  --amber-hi: #ffd27a;
  --amber-glow: rgba(242, 181, 68, .45);
  --good: #9be3a5;
  --almost: #ff8a73;
  --blood: #c8262b;
  --serif: "Didot", "Bodoni 72", "Bodoni MT", "Playfair Display", ui-serif, Georgia, serif;
  --serif-text: "Baskerville", "Big Caslon", "Iowan Old Style", ui-serif, Georgia, serif;
  --cond: "Avenir Next Condensed", "Avenir Next", "Helvetica Neue", "Arial Narrow", system-ui, sans-serif;
  --sans: "Avenir Next", "Helvetica Neue", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --slow: cubic-bezier(.45, 0, .1, 1);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--bone); }
body { font: 16px/1.45 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---- the stage (engine canvas lives here) ---- */
.stage { position: fixed; inset: 0; z-index: 1; }
.stage.is-off { visibility: hidden; }

/* ---- every page ---- */
.screen { position: fixed; inset: 0; z-index: 10; overflow-x: clip; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.screen.is-empty { pointer-events: none; }
.page { min-height: 100%; position: relative; overflow-x: clip; }

/* ---- film grain: a still noise tile that jitters on its own layer (non-play pages only) ---- */
.grain {
  position: fixed; inset: -60px; z-index: 40; pointer-events: none; opacity: .085; will-change: transform;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1.4 -.25'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
  animation: grain 0.9s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 17% { transform: translate(-22px, 14px); } 33% { transform: translate(18px, -26px); }
  50% { transform: translate(-30px, -8px); } 67% { transform: translate(26px, 22px); } 83% { transform: translate(-8px, 30px); }
  100% { transform: translate(0, 0); }
}
body[data-phase="play"] .grain, body[data-phase="reveal"] .grain { display: none; }

/* ---- the one forward button ---- */
.cta {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 58px; width: 100%; max-width: 360px; padding: 0 28px; border: 0; border-radius: 2px; cursor: pointer;
  background: var(--amber); color: #120c02; font: 700 15px/1 var(--cond); letter-spacing: .26em; text-transform: uppercase;
  box-shadow: 0 0 0 1px rgba(255, 210, 122, .5), 0 14px 40px -12px var(--amber-glow);
  transition: transform .18s var(--ease), background .2s, box-shadow .3s, opacity .3s;
}
.cta::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%); background-size: 250% 100%; background-position: 120% 0; pointer-events: none; }
.cta.is-ready::after { animation: glint 2.8s var(--slow) .4s infinite; }
@keyframes glint { 0% { background-position: 120% 0; } 45%, 100% { background-position: -120% 0; } }
.cta:hover:not([disabled]) { background: var(--amber-hi); }
.cta:active:not([disabled]) { transform: scale(.97); }
.cta[disabled] { cursor: default; background: transparent; color: var(--bone-dim); box-shadow: inset 0 0 0 1px var(--line); }
.cta .arrow { width: 22px; height: 10px; flex: none; }
.cta.is-tapped { transform: scale(.96); background: var(--bone); }

/* a small film reel that turns while the pitch loads */
.reel { display: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid currentColor; position: relative; animation: spin 1.1s linear infinite; }
.reel::before, .reel::after { content: ''; position: absolute; width: 5px; height: 5px; border-radius: 50%; background: currentColor; top: 3px; left: 6.5px; box-shadow: 0 9px 0 currentColor, -5px 4.5px 0 currentColor, 5px 4.5px 0 currentColor; }
.reel::after { width: 3px; height: 3px; top: 7.5px; left: 7.5px; box-shadow: none; }
.cta[disabled] .reel { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- the quiet buttons (never data-cta) ---- */
.mute {
  position: fixed; z-index: 60; top: calc(10px + var(--sat)); right: 10px; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(5, 5, 5, .55); color: var(--bone-dim); display: grid; place-items: center; cursor: pointer;
}
.mute .mute__off { display: none; }
.mute[aria-pressed="true"] .mute__on { display: none; }
.mute[aria-pressed="true"] .mute__off { display: block; }
body[data-phase="results"] .mute { display: none; }

/* small caps label used everywhere */
.kicker { font: 600 12px/1.2 var(--cond); letter-spacing: .34em; text-transform: uppercase; color: var(--bone-dim); margin: 0; }
.kicker--amber { color: var(--amber); }
.rule { display: flex; align-items: center; gap: 14px; justify-content: center; }
.rule::before, .rule::after { content: ''; height: 1px; width: 38px; background: currentColor; opacity: .45; }

/* entrances: everything fades up slowly, like a title card */
.in { opacity: 0; animation: fadeUp .9s var(--ease) forwards; animation-delay: calc(var(--d, 0) * 1ms); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.in-track { opacity: 0; animation: track 1.6s var(--slow) forwards; animation-delay: calc(var(--d, 0) * 1ms); }
@keyframes track { from { opacity: 0; letter-spacing: .5em; filter: blur(6px); } to { opacity: 1; filter: none; } }
.page.is-leaving { animation: fadeOut .38s ease forwards; }
@keyframes fadeOut { to { opacity: 0; transform: scale(.985); } }

@media (prefers-reduced-motion: reduce) {
  .in, .in-track { animation-duration: .01s; }
  .grain { animation: none; }
}

/* a fresh screen's button: looks ready, ignores taps for a beat */
.cta.is-arming[disabled] { background: var(--amber); color: #120c02; box-shadow: 0 0 0 1px rgba(255, 210, 122, .5); }
.cta.is-arming .reel { display: none; }
