/* Slashed — a dark room, one light, and Slash's own type.

   Rules of the house:
   · The type is the graphic. A display serif for anything meant to be read as
     a statement, Inter for small copy, a mono for labels and figures.
   · Nothing gets a box. No pills, cards, outlines or panels around text or
     controls: hierarchy comes from size, weight, colour and space.
   · One accent. Everything is ink on black; gold is reserved for the number
     or word that matters on each screen.
   · Dark. The light on screen comes from the cards, not from the page.
   · Mobile first; everything respects safe areas. */

:root {
  --bg: #070402;
  --scrim: 12, 6, 2;   /* what darkens the dunes under type: umber, so gold goes to bronze and not to olive */
  --ink: #f5efe2;
  --ink-2: rgba(245, 239, 226, .62);
  --ink-3: rgba(245, 239, 226, .36);
  --gold: #f0bf52;
  --gold-hi: #ffe2a0;
  --hair: rgba(245, 239, 226, .12);
  /* Ivy Presto is Slash's headline face (licensed); Instrument Serif stands in. */
  --display: "ivypresto-display", "IvyPresto Display", "Ivy Presto Display", "Instrument Serif", ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --pad: 24px;
  --ease: cubic-bezier(.16, .84, .24, 1);
  /* Motion: three curves, used everywhere. `--ease` arrives and settles (long
     tail); `--ease-io` is for anything that travels from one place to another;
     `--spring` lands with one small overshoot. */
  --ease-io: cubic-bezier(.66, 0, .2, 1);
  --spring: linear(0, .009, .035 2.1%, .141 4.4%, .723 12.9%, .938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, .991, .977 51%, .974 53.8%, .975 57.1%, .997 69.8%, 1.003 76.9%, 1);
  --u: 88px; /* one 3D design unit in CSS px; set from JS */
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
body { position: fixed; inset: 0; overflow: hidden; touch-action: manipulation; }
h1, h2, h3, p, ol { margin: 0; padding: 0; font-weight: inherit; }
ol { list-style: none; }
button {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer;
  -webkit-user-select: none; user-select: none;
}
button:focus-visible, [tabindex]:focus-visible { outline: 1px solid var(--gold); outline-offset: 4px; border-radius: 2px; }
canvas { display: block; }
svg { flex: none; }

/* ------------------------------------------------------------------ layers */

#dunes, #stage { position: fixed; inset: 0; width: 100%; height: 100%; }
#dunes { z-index: 0; }
#dunes.no-gl {
  background:
    radial-gradient(90% 46% at 70% 78%, rgba(214, 158, 46, .16), transparent 70%),
    radial-gradient(70% 30% at 22% 56%, rgba(150, 104, 24, .1), transparent 70%),
    var(--bg);
}
#stage { z-index: 1; pointer-events: none; opacity: 0; transition: opacity .9s var(--ease); }
#stage.on { opacity: 1; }
/* Grain over everything, like one more pass through the lens. */
#grain {
  position: fixed; inset: 0; z-index: 80; pointer-events: none;
  background-size: 192px 192px; opacity: .16;
  animation: grain .72s steps(1) infinite;
}
@keyframes grain {
  0% { background-position: 0 0; } 17% { background-position: -61px 37px; } 33% { background-position: 43px -79px; }
  50% { background-position: -17px -53px; } 67% { background-position: 71px 23px; } 83% { background-position: -89px -11px; }
}
@media (prefers-reduced-motion: reduce) { #grain { animation: none; } }
body.spatial #grain { display: none; }
#app { position: fixed; inset: 0; z-index: 2; }

.view {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  transition: opacity .5s var(--ease-io), visibility 0s linear .5s;
}
.view.on { opacity: 1; visibility: visible; transition: opacity .7s var(--ease); }

/* ------------------------------------------------------- shared type pieces */

.eyebrow { font: 500 11px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.eyebrow::before { content: "/"; margin-right: .65em; opacity: .6; }

/* Controls are words, not buttons. */
.cta, .link {
  display: inline-flex; align-items: baseline; gap: .3em;
  font: 400 clamp(26px, 7.4vw, 36px)/1.1 var(--display); letter-spacing: -.01em; color: var(--ink);
  transition: opacity .2s;
}
.cta svg { display: none; }
.cta.gold, .link.gold { color: var(--gold); font-style: italic; }
.cta:active, .link:active, .orb:active, .bare:active { opacity: .5; }
.link.quiet { font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }

.orb, .bare {
  display: grid; place-items: center; min-width: 44px; height: 44px;
  font-size: 22px; color: var(--ink); transition: opacity .2s;
}
.orb.sm { font-size: 19px; }
.orb.gold { color: var(--gold); }

@keyframes rise { from { opacity: 0; transform: translate3d(0, 22px, 0); filter: blur(10px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes up { from { transform: translateY(112%); } to { transform: none; } }
@keyframes stamp { from { opacity: 0; transform: scale(1.5); filter: blur(14px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes cell { from { opacity: 0; transform: scaleX(.2); } to { opacity: 1; transform: none; } }
@keyframes thump { from { transform: scale(.955); } to { transform: none; } }
@keyframes pulse { from { transform: scale(.5); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------- intro */
/* A pack in the light and two words. Everything else is the 3D stage. */

#intro { touch-action: none; -webkit-user-select: none; user-select: none; cursor: crosshair; }
.slash-it {
  position: absolute; left: 0; right: 0; bottom: calc(var(--sab) + 12.5vh); text-align: center; pointer-events: none;
  font: italic 400 clamp(44px, 13vw, 84px)/1 var(--display); letter-spacing: -.02em;
  animation: rise 1.3s var(--ease) 1s both;
}
.slash-it span { display: inline-block; transition: opacity .45s ease, transform .6s var(--ease), filter .45s ease; }
#intro.cut .slash-it span { opacity: 0; transform: translateY(14px); filter: blur(8px); }
.intro-line {
  position: absolute; left: var(--pad); right: var(--pad); bottom: calc(var(--sab) + 12.5vh); text-align: center; pointer-events: none;
  font: 400 clamp(26px, 7.6vw, 44px)/1.1 var(--display); letter-spacing: -.012em;
  opacity: 0; transform: translateY(14px); filter: blur(8px);
  transition: opacity .9s ease, transform 1.1s var(--ease), filter .9s ease;
}
.intro-line em { color: var(--gold); }
#intro.named .intro-line { opacity: 1; transform: none; filter: none; }
#intro.cut .skip { opacity: 0; pointer-events: none; transition: opacity .4s; }
.skip {
  position: absolute; right: 12px; top: calc(var(--sat) + 10px); height: 44px; padding: 0 12px; cursor: pointer;
  font: 500 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3);
  animation: rise 1s var(--ease) 1.6s both;
}
body.no-3d .slash-it { bottom: 46vh; }

/* -------------------------------------------------------------------- reel */

#story { touch-action: none; -webkit-user-select: none; user-select: none; }
#story::before { /* a floor of shadow so type always clears whatever is lit above it */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(var(--scrim), .55) 0, rgba(var(--scrim), 0) 22%, rgba(var(--scrim), 0) 54%, rgba(var(--scrim), .62) 80%, rgba(var(--scrim), .9) 100%);
  transition: opacity .6s;
}
#story[data-slide="mix"]::before, #story[data-slide="agents"]::before { opacity: .45; }

/* The only chrome: slashes for progress — each one a way back to its chapter. */
.reel-chrome { position: absolute; inset: 0; max-width: min(620px, 76vh); margin: 0 auto; z-index: 5; pointer-events: none; transition: opacity .3s; }
.reel-chrome > * { pointer-events: auto; }
#story.held .reel-chrome { opacity: .2; }
.ticks { position: absolute; top: calc(var(--sat) + 14px); left: calc(var(--pad) - 4px); display: flex; }
.tick { position: relative; width: 12px; height: 38px; display: grid; place-items: center; cursor: pointer; }
.tick i { position: relative; display: block; width: 3px; height: 18px; border-radius: 2px; background: rgba(245, 239, 226, .2); transform: skewX(-22deg); overflow: hidden; transition: height .5s var(--spring), background .3s var(--ease); }
.tick b { position: absolute; inset: 0; background: var(--gold); transform-origin: 50% 100%; transform: scaleY(0); }
.tick.now i { height: 24px; }
.reel-actions { position: absolute; top: calc(var(--sat) + 11px); right: 12px; display: flex; align-items: center; }
.exit-btn { display: none; padding: 0 12px; font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.share-btn { visibility: hidden; color: var(--gold); }
#story.can-share .share-btn { visibility: visible; animation: rise .8s var(--ease) 2.2s both; }

/* The column is never wider than the window is tall allows: type is sized off the
   column, so a short window gets smaller type instead of type that runs off it. */
.slides { position: absolute; inset: 0; max-width: min(620px, 76vh); margin: 0 auto; container-type: inline-size; pointer-events: none; }
.slide {
  --top: calc(var(--sat) + 66px);
  --bottom: calc(var(--sab) + 34px);
  position: absolute; inset: 0; display: none;
  text-shadow: 0 1px 30px rgba(0, 0, 0, .8);
}
.slide.on { display: block; }
/* A chapter does not blink off: its words lift away while the stage dips. */
.slide.out { display: block; pointer-events: none; animation: leave .34s cubic-bezier(.5, 0, .9, .4) both; }
.slide.out * { animation-play-state: paused !important; }
@keyframes leave { to { opacity: 0; transform: translate3d(0, -10px, 0); filter: blur(8px); } }

/* Anchors. Each chapter picks its own corners. */
.tl, .bl, .bc, .mid { position: absolute; left: var(--pad); right: var(--pad); }
.tl { top: var(--top); }
.bl, .bc { bottom: var(--bottom); }
.bl.narrow { right: 40%; }
.bc { text-align: center; transition: opacity .9s ease, transform 1.2s var(--ease), filter .9s ease; }
.bc .note { margin-left: auto; margin-right: auto; }
.mid { top: 50%; transform: translateY(-50%); }
.tl > * + *, .bl > * + *, .bc > * + *, .mid > * + * { margin-top: 12px; }
.eyebrow + * { margin-top: 14px !important; }

/* Reel type: a label, one figure, one line, one line of detail. */
.mega { display: inline-block; font: 400 30cqw/.86 var(--display); letter-spacing: -.025em; white-space: nowrap; color: var(--gold); }
.line { font: 400 clamp(23px, 6.7cqw, 38px)/1.1 var(--display); letter-spacing: -.012em; max-width: 17em; text-wrap: balance; }
.bc .line { margin-left: auto; margin-right: auto; }
.note { font: 400 clamp(13px, 3.6cqw, 15.5px)/1.5 var(--sans); color: var(--ink-2); max-width: 34ch; }
.note span { display: inline; }
.fitbox { display: block; }
.dg { display: inline-block; width: .5em; text-align: center; }

/* The setup beat: one sentence alone on screen, then the chapter arrives. */
.setup { position: absolute; left: var(--pad); right: var(--pad); top: 46%; text-align: center; pointer-events: none; opacity: 0; }
.setup::before { /* a pool of shadow, so the sentence reads over anything */
  content: ""; position: absolute; z-index: -1; left: -30%; right: -30%; top: -110%; bottom: -110%;
  background: radial-gradient(closest-side, rgba(var(--scrim), .82), rgba(var(--scrim), .5) 55%, rgba(var(--scrim), 0));
}
.setup-line { font: 400 clamp(32px, 9.6cqw, 56px)/1.04 var(--display); letter-spacing: -.015em; text-wrap: balance; }
.setup-sub { margin-top: 14px; font: 400 clamp(14px, 3.9cqw, 16.5px)/1.4 var(--sans); color: var(--ink-2); }
.slide.on.has-setup .setup { animation: setup var(--lead, 2500ms) linear both; }
/* In on the long tail, held, and out on a short run-up: the same two moves every piece of type makes. */
@keyframes setup {
  0% { opacity: 0; transform: translate3d(0, calc(-50% + 18px), 0); filter: blur(10px); animation-timing-function: cubic-bezier(.16, .84, .24, 1); }
  26% { opacity: 1; transform: translate3d(0, -50%, 0); filter: none; }
  84% { opacity: 1; transform: translate3d(0, -50%, 0); filter: none; animation-timing-function: cubic-bezier(.5, 0, .9, .4); }
  100% { opacity: 0; transform: translate3d(0, calc(-50% - 10px), 0); filter: blur(8px); }
}
.slide.on.has-setup .setup-sub { animation: rise .9s var(--ease) .28s both; }
/* While it holds, nothing pinned to the stage shows either. */
.slide.pre .pin, .slide.pre .tags, .slide.pre .cue, .slide.pre .clip { opacity: 0 !important; }

/* Reveals */
.slide.on .r { animation: rise .95s var(--ease) both; animation-delay: calc(var(--d, 0) * 1ms + var(--lead, 0ms)); }
.late { opacity: 0; }
.slide.landed .late { animation: rise .9s var(--ease) both; animation-delay: calc(var(--d, 0) * 1ms); }

/* 01 volume */
.s-volume .mega { font-size: 37cqw; }

/* 02 spike — the figure rides the tallest bar */
.pin { position: absolute; left: 0; top: 0; white-space: nowrap; opacity: 0; will-change: transform; transition: opacity .5s; }
.pin .mega { font-size: 19cqw; line-height: .9; text-shadow: 0 0 34px rgba(240, 191, 82, .35), 0 1px 30px rgba(0, 0, 0, .8); }
#story.no3d .pin { left: 50%; top: 34%; opacity: 1; transform: translateX(-50%); }

/* 03 issued */
.s-issued .mega { font-size: min(40cqw, 20vh); }   /* never taller than the space above the tower */
.s-issued.landed .mega { animation: thump .7s var(--spring); }

/* 04 vendors — a ranked column */
.s-vendors .mega { font-size: 24cqw; }
.ranks { margin-top: 22px !important; }
.ranks li {
  display: grid; grid-template-columns: minmax(6.6em, auto) 1fr auto; align-items: center; column-gap: 14px; padding: 6px 0;
  font: 500 clamp(14px, 4cqw, 16.5px)/1.2 var(--sans); letter-spacing: -.005em;
}
.slide.on .ranks li { animation: slide .8s var(--ease) both; animation-delay: calc(1250ms + var(--i) * 120ms + var(--lead, 0ms)); }
.ranks i { position: relative; height: 1px; background: var(--hair); }
.ranks i::after { content: ""; position: absolute; left: 0; top: -1px; height: 3px; width: calc(var(--k) * 100%); background: rgba(245, 239, 226, .5); transform-origin: 0 50%; }
.slide.on .ranks i::after { animation: draw .9s var(--ease) both; animation-delay: calc(1450ms + var(--i) * 120ms + var(--lead, 0ms)); }
.ranks .amt { font: 500 11.5px/1 var(--mono); letter-spacing: .04em; color: var(--ink-2); }
.ranks .lit { color: var(--gold); }
.ranks .lit i::after { background: var(--gold); box-shadow: 0 0 14px rgba(240, 191, 82, .7); }
.ranks .lit .amt { color: var(--gold); }

/* 05 mix — labels hang beside their run of cards */
.tags { position: absolute; inset: 0; }
.tag { position: absolute; left: 0; top: 0; display: flex; align-items: baseline; gap: 10px; white-space: nowrap; will-change: transform; }
.tag b { font: 500 11.5px/1 var(--mono); letter-spacing: .06em; color: var(--ink-2); }
.tag span { font: 400 clamp(19px, 5.4cqw, 26px)/1 var(--display); letter-spacing: -.01em; transition: font-size .6s var(--ease), color .4s var(--ease); }
.tag.top { flex-direction: column-reverse; align-items: flex-start; gap: 8px; }
.tag.top span { font-size: 25cqw; line-height: .82; letter-spacing: -.025em; color: var(--gold); }
.tag.top b { font-size: 13px; color: var(--gold); }
.slide.on .tag > * { animation: rise .9s var(--ease) both; animation-delay: calc(1500ms + var(--i) * 130ms + var(--lead, 0ms)); }
#story.no3d .tags { top: 22%; left: var(--pad); display: flex; flex-direction: column; gap: 14px; }
#story.no3d .tag { position: static; }

/* 06 clock — the hour in the middle of the dial */
.pin.centre { display: flex; align-items: baseline; gap: .5em; }
.pin.centre .mega { font-size: 21cqw; line-height: 1; font-variant-numeric: lining-nums; }
.pin.centre .unit { font: 500 12px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.pin.centre { transition: opacity 1s; }
#story.no3d .pin.centre { top: 30%; }

/* 07 map — the count against the three furthest places */
.split { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.split .fitbox { flex: 1; min-width: 0; }
.s-map .mega { font-size: 34cqw; }
.far { flex: none; padding-bottom: .6em; text-align: right; font: 500 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.far li { display: flex; justify-content: flex-end; gap: 12px; padding: 5px 0; }
.far li { transition: color .35s var(--ease); }
.far li:first-child, .far li.on { color: var(--gold); }
.far:has(.on) li:not(.on) { color: var(--ink-3); }
.far b { font-weight: 500; color: inherit; opacity: .7; min-width: 5.6em; }

/* 08 agents */
.s-agents .mega { font-size: 36cqw; text-shadow: 0 0 60px rgba(0, 0, 0, .9), 0 1px 30px rgba(0, 0, 0, .9); }
.s-agents .line, .s-agents .note { text-shadow: 0 0 22px rgba(0, 0, 0, 1), 0 0 40px rgba(0, 0, 0, .9); }

/* 09 standing — a poster, one word per line */
.poster { font: italic 400 25cqw/.86 var(--display); letter-spacing: -.025em; color: var(--gold); }
.poster span { display: block; overflow: hidden; padding: .04em .14em .12em 0; margin: -.04em 0 -.12em; }
.poster b { display: block; font-weight: 400; transform: translateY(112%); }
.slide.on .poster b { animation: up .95s var(--ease) both; animation-delay: calc(450ms + var(--i) * 150ms + var(--lead, 0ms)); }
.s-standing .line { margin-top: 18px; font-size: clamp(19px, 5.4cqw, 30px); }
.chip { font: 500 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-top: 16px !important; }
.chip::before { content: "/"; margin-right: .65em; opacity: .6; }
.chip.rank { transition: opacity .3s ease; }
.slide.probing .chip.rank { opacity: 0 !important; }
.bc .chip { text-align: center; }

/* field — where they stand */
.s-field .mega { font-size: 27cqw; font-variant-numeric: lining-nums; }

/* twin */
.s-twin .mega { font-size: 30cqw; }

/* thanks — a clip from a person */
.clip { position: absolute; left: 0; right: 0; top: calc(var(--top) + 6px); bottom: 27%; display: grid; place-items: center; transition: opacity .6s; }
.clip video { width: 100%; height: 100%; object-fit: contain; display: none; pointer-events: auto; -webkit-mask-image: radial-gradient(120% 100% at 50% 50%, #000 70%, transparent); mask-image: radial-gradient(120% 100% at 50% 50%, #000 70%, transparent); }
.s-thanks.has-clip video { display: block; }
.s-thanks.has-clip .clip-empty { display: none; }
.clip-empty { max-width: 30ch; padding: 0 var(--pad); text-align: center; animation: rise 1s var(--ease) both; animation-delay: var(--lead, 0ms); }
.clip-empty .note { margin: 12px auto 0; }
.clip-empty b { font: 500 .92em/1 var(--mono); color: var(--ink); font-weight: 500; }

/* 10 returned — the words leave before the last frame */
.s-returned .mega { font-size: 26cqw; }
.s-returned.held .bc { opacity: 0; transform: translateY(16px); filter: blur(10px); }

/* Words that change because something on stage was touched flip in. */
.slide.on .flip { animation: flip .34s var(--ease) both !important; }
@keyframes flip { from { opacity: 0; transform: translate3d(0, 9px, 0); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

/* 04 vendors — pick a month */
.cue {
  position: absolute; left: 0; top: 0; white-space: nowrap; pointer-events: none; will-change: transform;
  font: 500 10px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2);
  transition: opacity .4s;
}
.cue span { display: inline-block; }
.cue span::before { content: "↑"; margin-right: .8em; color: var(--gold); }
.s-vendors.picked .cue { opacity: 0; }
#story.no3d .cue { display: none; }
.s-vendors .bl { transition: opacity .15s ease, transform .3s var(--ease); }
.s-vendors .bl.swap { opacity: 0; transform: translateY(8px); }
.s-vendors .bl.quick .ranks li { animation-delay: calc(var(--i) * 45ms); }
.s-vendors .bl.quick .ranks i::after { animation-delay: calc(90ms + var(--i) * 45ms); }
.s-vendors .bl.quick > .eyebrow, .s-vendors .bl.quick > .fitbox, .s-vendors .bl.quick > .line, .s-vendors .bl.quick > .note { animation: flip .4s var(--ease) both; }

/* 08 agents — the two counts are words you can press */
.segs { display: flex; gap: 22px; pointer-events: auto; }
.segs button {
  padding: 8px 0; cursor: pointer; font: 500 11.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2);
  text-shadow: 0 0 22px #000, 0 0 40px #000; transition: color .2s;
}
.segs button::before { content: "/"; margin-right: .6em; opacity: .5; }
.segs button.on { color: var(--gold); }

/* A word about whatever is under the pointer. */
.probe {
  position: absolute; left: 0; top: 0; z-index: 6; pointer-events: none; white-space: nowrap; opacity: 0; transition: opacity .18s;
  font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--gold-hi);
  text-shadow: 0 0 12px rgba(0, 0, 0, 1), 0 0 24px rgba(0, 0, 0, .9);
}
.probe.on { opacity: 1; }

@keyframes slide { from { opacity: 0; transform: translate3d(-28px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes draw { from { transform: scaleX(0); } to { transform: none; } }

/* ----------------------------------------------------------- chapter cards */
/* The index: one small card per chapter, on the last screen of the reel and
   on the overview. They are cards because the product is. */

.cc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; perspective: 900px; }
.cc {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 0%;
  position: relative; aspect-ratio: 1.586; min-width: 0; overflow: hidden; border-radius: 9px; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between; padding: 11px 12px 10px;
  background: linear-gradient(140deg, #1a1918 0%, #0d0c0c 55%, #151413 100%);
  box-shadow: inset 0 1px 0 rgba(255, 244, 226, .07), 0 10px 30px rgba(0, 0, 0, .5);
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .5s var(--ease), box-shadow .3s;
  pointer-events: auto;
}
.cc::before { /* a band of light that follows the pointer across the metal */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(120% 90% at var(--mx) var(--my), rgba(255, 226, 170, .16), rgba(255, 226, 170, 0) 55%);
}
.cc.lit { transition: transform .08s linear, box-shadow .3s; box-shadow: inset 0 1px 0 rgba(255, 244, 226, .12), 0 18px 40px rgba(0, 0, 0, .6); }
.cc.lit::before { opacity: 1; }
.cc:active { transform: rotateX(var(--rx)) rotateY(var(--ry)) scale(.97); }
.cc-k { position: relative; display: flex; gap: .8em; font: 500 9.5px/1.25 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.cc-k i { font-style: normal; color: var(--gold); opacity: .8; }
.cc { container-type: inline-size; }
/* The figure shrinks to fit its card: long words get smaller type, nothing is cut off. */
.cc-v { position: relative; font: 400 min(30px, calc(158cqw / var(--len, 6)))/1.05 var(--display); letter-spacing: -.015em; color: var(--ink); white-space: nowrap; }
.cc.lit .cc-v, .cc.now .cc-v { color: var(--gold); }

/* The reel's last screen */
.s-index .idx {
  position: absolute; left: var(--pad); right: var(--pad); top: var(--top); bottom: var(--bottom);
  display: flex; flex-direction: column; justify-content: center; gap: 18px; container-type: inline-size;
}
/* The grid takes the height it would like (cards at their true proportion) and
   gives some back when the screen is short, so the header and the actions
   always stay on screen however many chapters there are. */
.s-index .cc-grid {
  --cols: 2; --rows: 5; --gap: 8px;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: var(--gap);
  min-height: 0;
  flex: 0 1 calc(var(--rows) * ((100cqw - (var(--cols) - 1) * var(--gap)) / var(--cols) / 1.586) + (var(--rows) - 1) * var(--gap));
}
.s-index .cc { aspect-ratio: auto; min-height: 0; padding: 9px 11px 8px; }
.s-index .eyebrow, .s-index .actions { flex: none; }
.slide.on .cc { animation: rise .8s var(--ease) both; animation-delay: calc(150ms + var(--i) * 55ms); }
.s-index .actions { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 26px; pointer-events: auto; animation: rise .9s var(--ease) .9s both; }
.s-index .actions .link { font-size: clamp(24px, 7cqw, 38px); }
#story.no3d.at-index::before { background: rgba(var(--scrim), .55); }

/* With the stage up, the last screen is the cases themselves: the grid steps
   aside and the words sit under whichever case is in the middle. */
#story:not(.no3d) .s-index .cc-grid { display: none; }
#story.no3d .s-index .pick { display: none; }
#story:not(.no3d) .s-index .idx { display: block; }
.s-index .pick { position: absolute; left: 0; right: 0; bottom: 64px; text-align: center; }
.s-index .pick > * + * { margin-top: 10px; }
.s-index .pick .mega { font-size: 22cqw; line-height: .9; }
.pk-open { pointer-events: auto; cursor: pointer; padding: 4px 0; transition: transform .5s var(--spring); }
.pk-open:active { transform: scale(.96); }
.pk-r.none { visibility: hidden; }
.pk-cue { font: 500 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); transition: opacity .6s ease; animation: rise 1s var(--ease) 2.4s both; }
.s-index.touched .pk-cue { opacity: 0 !important; }
#story:not(.no3d) .s-index .actions { position: absolute; left: 0; right: 0; bottom: 0; justify-content: center; gap: 4px 20px; }
#story:not(.no3d) .s-index .actions .link { font-size: clamp(20px, 5.9cqw, 30px); }
#story:not(.no3d) .s-index .idx > .eyebrow { text-align: center; }

/* ------------------------------------------------------------------- party */
/* Slashed Party: a question, a row of cards, numbers that count up. */

#party { touch-action: none; -webkit-user-select: none; user-select: none; }
#party::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(var(--scrim), .6) 0, rgba(var(--scrim), 0) 26%, rgba(var(--scrim), 0) 60%, rgba(var(--scrim), .8) 100%);
}
.party { position: absolute; inset: 0; max-width: min(620px, 76vh); margin: 0 auto; container-type: inline-size; --top: calc(var(--sat) + 66px); --bottom: calc(var(--sab) + 34px); text-shadow: 0 1px 30px rgba(0, 0, 0, .8); }
.party-top { position: absolute; z-index: 3; top: calc(var(--sat) + 11px); left: 12px; right: 12px; display: flex; align-items: center; justify-content: space-between; }
.party-top .bare { padding: 0 12px; font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.party-step { padding-right: 12px; font: 500 11px/1 var(--mono); letter-spacing: .14em; color: var(--ink-3); }
.party [data-phase] { display: none; }
#party[data-phase="lobby"] .party-lobby, #party[data-phase="awards"] .party-awards { display: flex; }
#party[data-phase="round"] .party-round { display: block; }
.party-lobby, .party-awards { position: absolute; left: var(--pad); right: var(--pad); top: var(--top); bottom: var(--bottom); flex-direction: column; justify-content: flex-end; gap: 14px; }
/* With a full party on a short phone the lists scroll inside the screen, never off it. */
.party-roster, .party-list { flex: 0 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: none; touch-action: pan-y; }
.party-roster::-webkit-scrollbar, .party-list::-webkit-scrollbar { display: none; }
.party-lobby > :not(.party-roster), .party-awards > :not(.party-list) { flex: none; }
.party-h { font: 400 clamp(32px, 9.6cqw, 54px)/1.04 var(--display); letter-spacing: -.015em; animation: rise .9s var(--ease) .1s both; }
.party-roster li { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 7px 0; animation: slide .7s var(--ease) both; animation-delay: calc(200ms + var(--i) * 90ms); }
.party-roster b { font: 500 clamp(15px, 4.2cqw, 17px)/1.2 var(--sans); }
.party-roster span { font: 500 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.party-roster li:first-child b { color: var(--gold); }
.party .actions { display: flex; align-items: baseline; gap: 26px; margin-top: 8px; }
.party .actions .link { font-size: clamp(26px, 7.8cqw, 40px); }
.party-note { min-height: 2.8em; font: 400 13px/1.45 var(--sans); color: var(--ink-2); max-width: 36ch; }
.party-link { display: block; margin-top: 6px; font: 400 11px/1.4 var(--mono); color: var(--ink); word-break: break-all; -webkit-user-select: all; user-select: all; }

.party-round { position: absolute; inset: 0; }
.party-round .eyebrow { position: absolute; left: 0; right: 0; top: var(--top); text-align: center; }
.party-q { position: absolute; left: var(--pad); right: var(--pad); top: calc(var(--top) + 30px); text-align: center; font: 400 clamp(30px, 9.2cqw, 52px)/1.05 var(--display); letter-spacing: -.015em; text-wrap: balance; animation: rise .8s var(--ease) both; }
.party-hint { position: absolute; left: var(--pad); right: var(--pad); bottom: calc(var(--bottom) + 64px); text-align: center; font: 400 clamp(14px, 3.9cqw, 16px)/1.4 var(--sans); color: var(--ink-2); }
.party-round .actions { position: absolute; left: 0; right: 0; bottom: var(--bottom); justify-content: center; margin: 0; }
.party-labels { position: absolute; inset: 0; }
.pl { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 6px 4px; cursor: pointer; will-change: transform; transition: opacity .4s; }
.pl-v { font: 400 clamp(18px, 6.2cqw, 34px)/1 var(--display); letter-spacing: -.01em; color: var(--ink); min-height: 1em; white-space: nowrap; transition: color .4s; }
.pl-n { width: 27cqw; text-align: center; font: 500 9.5px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); transition: color .3s; }
.pl.picked .pl-n { color: var(--gold); }
.pl.picked .pl-n::before { content: "↑ "; }
.pl.won .pl-v { color: var(--gold); }
#party.shown .pl:not(.won) { opacity: .5; }

.party-list li { display: grid; grid-template-columns: 1fr; gap: 3px; padding: min(9px, 1.1vh) 0; animation: slide .7s var(--ease) both; animation-delay: calc(150ms + var(--i) * 120ms); }
.aw-n { font: 500 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
/* Titles shrink as the party grows, so a full table still fits a short screen. */
.aw-t { font: 400 min(clamp(24px, 8cqw, 42px), calc((100vh - 300px) / var(--n, 3) * .42))/1 var(--display); letter-spacing: -.015em; }
.aw-w { font: 400 13px/1.3 var(--sans); color: var(--ink-2); }
.party-list .you .aw-t { color: var(--gold); font-style: italic; }
.party-list .you .aw-n { color: var(--gold); }
.party-score { font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }

/* ----------------------------------------------------------------- spatial */
/* The scene carries its own sky and floating captions, so the flat type
   steps back. (Inside a headset the DOM isn't visible at all.) */
body.spatial #dunes { visibility: hidden; }
body.spatial #story::before, body.spatial .slides, body.spatial .probe { display: none; }
body.spatial #story { cursor: grab; }
body.spatial .exit-btn { display: grid; }

/* ---------------------------------------------------------------- sideways */
/* The reel is an upright format. A phone on its side gets asked to turn back. */
#rotate { display: none; position: fixed; inset: 0; z-index: 90; place-items: center; padding: 24px; text-align: center; background: var(--bg); }
#rotate p { font: italic 400 clamp(26px, 6vw, 40px)/1.1 var(--display); letter-spacing: -.012em; }
@media (orientation: landscape) and (max-height: 480px) {
  #rotate { display: grid; }
  #app, #stage, #sheet-root, .view, .view.on { visibility: hidden !important; }
}

/* ------------------------------------------------------------- adaptations */

@media (max-height: 700px) {
  .slide { --top: calc(var(--sat) + 58px); --bottom: calc(var(--sab) + 22px); }
  .poster { font-size: 21cqw; }
  .ranks li { padding: 4px 0; }
  .cc { padding: 8px 10px; border-radius: 7px; }
  .s-index .idx { gap: 12px; }
}
@media (max-height: 740px) {
  /* Short phones: three across, smaller labels. */
  .s-index .cc-grid { --cols: 3; }
  .s-index .cc { padding: 7px 8px 6px; }
  .s-index .cc-k { font-size: 8px; letter-spacing: .08em; gap: .5em; }
}
@media (min-aspect-ratio: 1/1) {
  /* Wide screens: four cards across so the index never outgrows the height. */
  .s-index .cc-grid { --cols: 4; }
}
@media (hover: hover) {
  .cta:hover, .link:hover, .orb:hover, .bare:hover, .skip:hover { opacity: .7; }
  .segs button:hover { color: var(--ink); }
  .tick:hover i { height: 26px; background: rgba(245, 239, 226, .5); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}
