/* ============================================================
   Rewired — card-deck edition (Foudre-conform)
   Intro bolt → full-viewport scenes → cards cycling center
   ============================================================ */

/* ---------- Fonts (self-hosted, Fontshare) ---------- */
@font-face { font-family: 'Clash Display'; src: url('../fonts/clash-display-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Clash Display'; src: url('../fonts/clash-display-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Clash Grotesk'; src: url('../fonts/clash-grotesk-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Clash Grotesk'; src: url('../fonts/clash-grotesk-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Clash Grotesk'; src: url('../fonts/clash-grotesk-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }

/* ---------- Tokens ---------- */
:root {
  --ink: #16130f;
  --cream: #f6efe5;
  --card-face: #f9f3ea;
  --font-display: 'Clash Display', 'Arial Narrow', sans-serif;
  --font-body: 'Clash Grotesk', system-ui, sans-serif;
  --gutter: clamp(1.25rem, 3.5vw, 3.5rem);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-card: cubic-bezier(.3, 1.1, .35, 1);

  /* theme accents (headline duo on light scenes + intro bg) */
  --acc-deep: #b93267;
  --acc-mid: #c16c90;
  --intro-bg: #c73a72;
}
.theme-green  { --acc-deep: #2f5626; --acc-mid: #6c8c52; --intro-bg: #2f5626; }
.theme-ink    { --acc-deep: #16130f; --acc-mid: #8a8274; --intro-bg: #16130f; }
.theme-blue   { --acc-deep: #2b4a8b; --acc-mid: #6e84b0; --intro-bg: #2b4a8b; }
.theme-rust   { --acc-deep: #b8451f; --acc-mid: #bd754f; --intro-bg: #b8451f; }
.theme-violet { --acc-deep: #6b3fa0; --acc-mid: #947db7; --intro-bg: #6b3fa0; }

/* per-era scene palettes — theme "pink" is the base; the other themes
   re-skin backgrounds and font colors so Re-roll changes the whole page */
.era-1 { --scene-bg: #f2ede4; --scene-fg: var(--ink);   --hl-a: var(--acc-deep); --hl-b: var(--acc-mid); --pill-bg: var(--ink);   --pill-fg: #f2ede4; }
.era-2 { --scene-bg: #bc2d63; --scene-fg: #fdf1e7;      --hl-a: #fdf1e7;         --hl-b: #f0a9c6;        --pill-bg: #fdf1e7;      --pill-fg: #bc2d63; }
.era-3 { --scene-bg: #5d6851; --scene-fg: #f4efe3;      --hl-a: #f4efe3;         --hl-b: #c3cbaf;        --pill-bg: #f4efe3;      --pill-fg: #5d6851; }
.era-4 { --scene-bg: #cfcce8; --scene-fg: #221d33;      --hl-a: #b93267;         --hl-b: #736ca6;        --pill-bg: #221d33;      --pill-fg: #cfcce8; }
.era-5 { --scene-bg: #2c4226; --scene-fg: #f0eddc;      --hl-a: #f0eddc;         --hl-b: #96b478;        --pill-bg: #f0eddc;      --pill-fg: #2c4226; }
.era-6 { --scene-bg: #bc2d63; --scene-fg: #fdf1e7;      --hl-a: #fdf1e7;         --hl-b: #f0a9c6;        --pill-bg: #fdf1e7;      --pill-fg: #bc2d63; }

.theme-green .era-1 { --scene-bg: #e9efda; }
.theme-green .era-2 { --scene-bg: #3a6b2e; --scene-fg: #f1f2e0; --hl-a: #f1f2e0; --hl-b: #a9c88f; }
.theme-green .era-3 { --scene-bg: #657148; --scene-fg: #f4f2e2; --hl-a: #f4f2e2; --hl-b: #d6dcae; }
.theme-green .era-4 { --scene-bg: #d5e3c3; --scene-fg: #22301c; --hl-a: #2f5626; --hl-b: #608747; }
.theme-green .era-5 { --scene-bg: #24381f; --scene-fg: #edeeda; --hl-a: #edeeda; --hl-b: #8fb573; }
.theme-green .era-6 { --scene-bg: #3a6b2e; --scene-fg: #f1f2e0; --hl-a: #f1f2e0; --hl-b: #a9c88f; }

.theme-ink .era-1 { --scene-bg: #ece7dc; }
.theme-ink .era-2 { --scene-bg: #2a2620; --scene-fg: #f0ebdf; --hl-a: #f0ebdf; --hl-b: #a89e8c; }
.theme-ink .era-3 { --scene-bg: #55503f; --scene-fg: #f2ede1; --hl-a: #f2ede1; --hl-b: #c2b9a4; }
.theme-ink .era-4 { --scene-bg: #d7d1c4; --scene-fg: #16130f; --hl-a: #16130f; --hl-b: #746c5c; }
.theme-ink .era-5 { --scene-bg: #1c1914; --scene-fg: #ede8db; --hl-a: #ede8db; --hl-b: #97907e; }
.theme-ink .era-6 { --scene-bg: #2a2620; --scene-fg: #f0ebdf; --hl-a: #f0ebdf; --hl-b: #a89e8c; }

.theme-blue .era-1 { --scene-bg: #e8ecf2; }
.theme-blue .era-2 { --scene-bg: #2e4f96; --scene-fg: #eef1e6; --hl-a: #eef1e6; --hl-b: #9fb4dd; }
.theme-blue .era-3 { --scene-bg: #4f6178; --scene-fg: #edf0e4; --hl-a: #edf0e4; --hl-b: #b3c4d6; }
.theme-blue .era-4 { --scene-bg: #ccd8ea; --scene-fg: #14213d; --hl-a: #2b4a8b; --hl-b: #6076a1; }
.theme-blue .era-5 { --scene-bg: #1a2b4a; --scene-fg: #e9ecdf; --hl-a: #e9ecdf; --hl-b: #7d97c9; }
.theme-blue .era-6 { --scene-bg: #2e4f96; --scene-fg: #eef1e6; --hl-a: #eef1e6; --hl-b: #9fb4dd; }

.theme-rust .era-1 { --scene-bg: #f4e9dc; }
.theme-rust .era-2 { --scene-bg: #b8451f; --scene-fg: #fdf0e2; --hl-a: #fdf0e2; --hl-b: #f0b790; }
.theme-rust .era-3 { --scene-bg: #7c6142; --scene-fg: #f4ecdc; --hl-a: #f4ecdc; --hl-b: #d3b892; }
.theme-rust .era-4 { --scene-bg: #f0d5b9; --scene-fg: #3a2413; --hl-a: #b8451f; --hl-b: #a06a3c; }
.theme-rust .era-5 { --scene-bg: #4a2513; --scene-fg: #f2e6d4; --hl-a: #f2e6d4; --hl-b: #d89a6a; }
.theme-rust .era-6 { --scene-bg: #b8451f; --scene-fg: #fdf0e2; --hl-a: #fdf0e2; --hl-b: #f0b790; }

.theme-violet .era-1 { --scene-bg: #efeaf4; }
.theme-violet .era-2 { --scene-bg: #6b3fa0; --scene-fg: #f4eee2; --hl-a: #f4eee2; --hl-b: #c9b3e8; }
.theme-violet .era-3 { --scene-bg: #55496b; --scene-fg: #efeae0; --hl-a: #efeae0; --hl-b: #b8aacb; }
.theme-violet .era-4 { --scene-bg: #ded4ec; --scene-fg: #241640; --hl-a: #6b3fa0; --hl-b: #816ca6; }
.theme-violet .era-5 { --scene-bg: #2a1c44; --scene-fg: #ece6da; --hl-a: #ece6da; --hl-b: #a98fd0; }
.theme-violet .era-6 { --scene-bg: #6b3fa0; --scene-fg: #f4eee2; --hl-a: #f4eee2; --hl-b: #c9b3e8; }

/* chrome accent: the saturated color of the current page, used by the
   top bar, step arrows, and dropdown (copied to --stage-acc by JS) */
.era-1 { --chrome-acc: var(--acc-deep); }
.era-2, .era-3, .era-5, .era-6 { --chrome-acc: var(--scene-bg); }
.era-4 { --chrome-acc: var(--hl-a); }

/* ---------- Reset-ish ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto; }

html, body { overflow-anchor: none; }
body {
  background: #f2ede4;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html.intro-lock, html.intro-lock body { overflow: hidden; }
/* paged mode (narrow screens): the page never scrolls — scenes are swiped */
html.paged, html.paged body { overflow: hidden; height: 100%; }
html.paged .deck { height: 100svh; }
html.paged .stage { touch-action: none; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: var(--ink); color: var(--cream); }
:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; border-radius: 2px; }

.bolt { width: 1.1em; height: 1.1em; fill: currentColor; flex: none; }
.bolt--big { width: 3.4rem; height: 3.4rem; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; top: -100%; left: var(--gutter);
  background: var(--ink); color: var(--cream);
  padding: .75rem 1.25rem; z-index: 200; border-radius: 0 0 .5rem .5rem;
  font-weight: 500; text-decoration: none; transition: top .2s;
}
.skip-link:focus { top: 0; }

/* ---------- Intro overlay ---------- */
.intro { display: none; }
html.js .intro {
  display: grid; place-items: center;
  position: fixed; inset: 0; z-index: 150;
  background: var(--intro-bg);
  overflow: hidden;
}
html.js.intro-done .intro { display: none; }
.intro__manifesto {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.3rem, 3vw, 2.4rem);
  line-height: 1.25; text-transform: uppercase; letter-spacing: .01em;
  color: #fdf1e7; text-align: center;
  max-width: 34ch;
  padding: 0 var(--gutter);
  text-wrap: balance;
}
@media (max-width: 899px) {
  .intro__line { display: inline; }
  .intro__line::after { content: " "; }
}
.intro__manifesto em { font-style: normal; color: #f0a9c6; }
.theme-green .intro__manifesto em { color: #a9c88f; }
.theme-ink .intro__manifesto em { color: #b0a894; }
.intro__line {
  display: block;
  opacity: 0; transform: translateY(1rem);
  animation: intro-line .7s var(--ease-out) forwards;
}
.intro__line:nth-child(2) { animation-delay: .25s; }
.intro__line:nth-child(3) { animation-delay: .5s; }
@keyframes intro-line { to { opacity: 1; transform: none; } }

.intro.is-leaving .intro__manifesto { animation: intro-out .4s ease forwards; }
@keyframes intro-out { to { opacity: 0; } }
.intro.is-open { animation: intro-fade .45s ease forwards; }
@keyframes intro-fade { to { opacity: 0; visibility: hidden; } }

.intro__skip {
  position: absolute; right: var(--gutter); bottom: 1.5rem;
  font: 600 .85rem var(--font-body);
  color: var(--ink); background: var(--card-face);
  border: 1.5px solid var(--card-face); border-radius: 999px;
  padding: .6rem 1.2rem; min-height: 44px; cursor: pointer;
}
.intro__skip:hover { background: var(--ink); color: var(--card-face); border-color: var(--ink); }


/* ---------- Progress bar ---------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 4px; z-index: 90; }
.progress__bar {
  height: 100%; width: 100%;
  background: var(--ink);
  transform-origin: 0 50%; transform: scaleX(0);
}

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; inset: 4px 0 auto 0; z-index: 80;
  transition: transform .35s var(--ease-out);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .8rem var(--gutter);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
html.topbar-hidden .topbar { transform: translateY(-130%); }
.topbar__brand {
  display: flex; align-items: center; gap: .4rem;
  font-family: var(--font-display); font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; font-size: 1rem;
  background: var(--ink); color: var(--card-face);
  border: 1.5px solid var(--ink); border-radius: 999px;
  padding: .45rem 1rem;
  cursor: pointer;
  transition: background .25s, border-color .25s;
}
.topbar__brand:hover { background: var(--stage-acc, var(--acc-deep)); border-color: var(--stage-acc, var(--acc-deep)); }

.topbar__brand[aria-expanded="true"] { background: var(--stage-acc, var(--acc-deep)); border-color: var(--stage-acc, var(--acc-deep)); }
.topbar__range {
  font-size: .85rem; font-weight: 500;
  background: var(--card-face); color: var(--ink);
  border-radius: 999px; padding: .45rem 1rem;
}
.topbar__theme {
  font: 500 .85rem var(--font-body);
  color: var(--card-face); background: var(--ink);
  border: 1.5px solid var(--ink); border-radius: 999px;
  padding: .55rem 1.1rem; min-height: 44px; cursor: pointer;
  transition: background .25s, border-color .25s;
}
.topbar__theme:hover { background: var(--stage-acc, var(--acc-deep)); border-color: var(--stage-acc, var(--acc-deep)); }
@media (max-width: 600px) { .topbar__range { display: none; } }

/* ---------- Era rail ---------- */
.rail { position: fixed; right: calc(var(--gutter) * .5); top: 50%; transform: translateY(-50%); z-index: 70; color: var(--scene-fg, var(--ink)); }
.rail ol { list-style: none; display: grid; gap: 0; }
.rail a {
  display: flex; align-items: center; justify-content: flex-end; gap: .6rem;
  text-decoration: none; min-height: 32px; min-width: 44px; padding: .15rem;
}
.rail__year {
  font-size: .68rem; font-weight: 600; letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
  opacity: 0; transform: translateX(6px);
  transition: opacity .25s, transform .25s;
}
.rail a:hover .rail__year, .rail a:focus-visible .rail__year, .rail a[aria-current] .rail__year { opacity: 1; transform: none; }
.rail__dot {
  width: 8px; height: 8px; border-radius: 50%;
  border: 2px solid currentColor; background: transparent;
  transition: background .25s, transform .25s;
}
.rail a[aria-current] .rail__dot { background: currentColor; transform: scale(1.25); }
@media (max-width: 899px) { .rail { display: none; } }

/* ============================================================
   SCENES
   Static flow by default (no-JS, mobile, reduced motion).
   html.deck switches to the sticky paged deck.
   ============================================================ */
.scene {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  background: var(--scene-bg);
  color: var(--scene-fg);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(17rem, 24rem) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1.5rem, 3.5vw, 4rem);
  padding: 5.5rem var(--gutter) 4rem;
}
@media (min-width: 900px) {
  .scene { padding-right: calc(var(--gutter) + 4rem); }
}
.scene::after {
  content: attr(data-label);
  position: absolute; left: var(--gutter); bottom: 1.4rem;
  font: 600 .78rem var(--font-body);
  letter-spacing: .1em; text-transform: uppercase;
  border: 1.5px solid currentColor; border-radius: 999px;
  padding: .35rem .9rem;
}
.scene[data-label=""]::after { display: none; }
.scene--era::after, .scene--chapter::after { display: none; }

/* finale production credit (replaces the label chip there) */
.scene__plant {
  position: absolute; left: var(--gutter); bottom: 1.4rem;
  font: 600 .78rem var(--font-body);
  letter-spacing: .1em; text-transform: uppercase;
  background: var(--ink); color: var(--card-face);
  border: 1.5px solid var(--ink); border-radius: 999px;
  padding: .55rem .9rem;
  text-decoration: none;
  min-height: 44px; display: inline-flex; align-items: center;
  transition: background .25s, border-color .25s;
}
.scene__plant:hover { background: var(--stage-acc, var(--acc-deep)); border-color: var(--stage-acc, var(--acc-deep)); }

/* left headline */
.scene__title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.2rem, 3.7vw, 4.1rem);
  line-height: .95; text-transform: uppercase; letter-spacing: -.01em;
  text-wrap: balance;
}
.tone-a { color: var(--hl-a); }
.tone-b { color: var(--hl-b); }

/* right copy */
.scene__right { max-width: 46ch; }
.scene__leadin { font-weight: 600; font-size: 1.05rem; margin-bottom: .9rem; }
.scene--chapter .scene__leadin { font-weight: 400; }
.scene__right > p:not(.scene__leadin) { margin-bottom: .9rem; }

/* ---------- Reactive facet line under the headline ---------- */
.scene__facet {
  margin-top: 1.2rem;
  font: 600 .82rem var(--font-body);
  letter-spacing: .12em; text-transform: uppercase;
  min-height: 1.4em;
  color: var(--hl-b);
}
.era-1 .scene__facet, .era-4 .scene__facet { color: var(--acc-deep); }

/* ---------- Card stack ---------- */
.scene__stack {
  position: relative;
  justify-self: center;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: min(56vh, 27rem);
  max-width: calc(min(56vh, 27rem) * .8);
  perspective: 1600px;
  z-index: 1;
}
.card {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: var(--card-face); color: var(--ink);
  border-radius: 1.1rem;
  box-shadow: 0 24px 60px rgba(22, 19, 15, .28);
  overflow: hidden;
  transform: rotate(-2deg);
}
.card--img img { width: 100%; height: 100%; object-fit: cover; }

/* cover card: image + info bar */
.card--cover { cursor: pointer; }
.card--cover img { width: 100%; height: 100%; object-fit: cover; }
.card__bar {
  position: absolute; left: .8rem; right: .8rem; bottom: .8rem;
  display: flex; align-items: center; gap: .6rem;
  background: var(--card-face);
  border-radius: .7rem;
  padding: .55rem .8rem;
  box-shadow: 0 6px 18px rgba(22, 19, 15, .15);
  font: 500 .85rem var(--font-body);
}
.card__bar b {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.5rem; line-height: 1;
  color: var(--acc-deep);
}
.card__bar span { flex: 1; text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; font-weight: 600; }
.card__bar i {
  font-style: normal;
  border: 1.5px solid var(--ink); border-radius: 999px;
  padding: .15rem .6rem;
  font-variant-numeric: tabular-nums; font-size: .78rem;
}

/* facet card: colored, text on the card */
.card--facet {
  background: var(--fcard-bg); color: var(--fcard-fg);
  padding: 1.5rem 1.5rem 1.7rem;
  gap: 1rem;
  cursor: pointer;
}
.era-1 .card--facet, .era-4 .card--facet { --fcard-bg: var(--acc-deep); --fcard-fg: #f9f3ea; }
.era-2 .card--facet, .era-3 .card--facet, .era-5 .card--facet { --fcard-bg: #f9f3ea; --fcard-fg: #16130f; }
.card__pill {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: .45rem;
  font: 600 .78rem var(--font-body);
  text-transform: uppercase; letter-spacing: .12em;
  border: 1.5px solid currentColor; border-radius: 999px;
  padding: .35rem .9rem;
}
.card--facet p {
  font-size: clamp(.86rem, 1.05vw, 1rem);
  line-height: 1.5;
  overflow-y: auto;
}
.card--rhyme .card__pill { border-style: dashed; }
.card--rhyme::after {
  content: '';
  position: absolute; right: -6%; bottom: -8%;
  width: 55%; height: 55%;
  background: currentColor;
  opacity: .08;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M19 2 6 18h7l-2 12L25 12h-8z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M19 2 6 18h7l-2 12L25 12h-8z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* echo cards: the hero fan (positions are animated by JS in deck mode) */
.card--echo-r, .card--echo-l, .card--echo-fl, .card--echo-fr {
  box-shadow: 0 16px 40px rgba(22, 19, 15, .18);
  background: var(--card-face);
}
.card--echo-l  { transform: rotate(-8deg)  translateX(-44%) scale(.93); }
.card--echo-r  { transform: rotate(8deg)   translateX(44%)  scale(.93); }
.card--echo-fl { transform: rotate(-16deg) translateX(-84%) scale(.86); }
.card--echo-fr { transform: rotate(16deg)  translateX(84%)  scale(.86); }
.card--echo-r img, .card--echo-l img, .card--echo-fl img, .card--echo-fr img { opacity: .92; }

/* reveal button under the chapter lead-in */
.scene__more { margin-top: 1.1rem; }
.more-btn {
  font: 600 .95rem var(--font-body);
  color: var(--scene-fg);
  background: transparent;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  padding: .7rem 1.4rem;
  min-height: 44px;
  cursor: pointer;
  transition: background .2s, color .2s, opacity .3s;
}
.more-btn:hover:not(:disabled) { background: var(--scene-fg); color: var(--scene-bg); }
.more-btn:disabled { opacity: .55; cursor: default; }

/* ---------- Hero scene ---------- */
.scene--hero { grid-template-columns: 1fr; place-items: center; }
.scene__mega {
  position: absolute; top: 4.5rem; left: 0; right: 0;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(4.5rem, 17.5vw, 17rem);
  line-height: .8; text-transform: uppercase; letter-spacing: -.01em;
  text-align: center; color: var(--acc-deep);
  user-select: none;
}
.scene--hero .scene__stack { margin-top: clamp(2rem, 8vh, 6rem); }
.scene__punch {
  position: absolute; left: var(--gutter); bottom: 4.5rem; z-index: 2;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.6rem, 3.6vw, 3.4rem);
  line-height: .98; text-transform: uppercase;
}
.scene__punch .tone-a { color: var(--acc-deep); }
.scene__punch .tone-b { color: var(--acc-mid); }
.scene--hero .card--echo-l { transform: rotate(-10deg) translateX(-46%) scale(.9); }
.scene--hero .card--echo-r { transform: rotate(9deg) translateX(46%) scale(.9); }

/* ---------- Era + finale scenes ---------- */
.scene--era .scene__title { font-size: clamp(2.5rem, 4.4vw, 4.8rem); }
.scene--finale {
  grid-template-columns: 1fr; place-items: center; text-align: center;
  row-gap: 2rem;
  grid-template-rows: auto auto auto;
  align-content: center;
}
.scene__manifesto {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.5rem, 3.4vw, 2.8rem);
  line-height: 1.2; text-transform: uppercase;
  max-width: 30ch;
}
.scene__manifesto span { display: block; }
.scene__manifesto em { font-style: normal; color: var(--hl-b); }
.scene__credits { font-size: .85rem; max-width: 92vw; }
.scene__credits .roll__label { display: block; margin-bottom: .4rem; }
.scene__roll { display: grid; gap: 1.1rem; justify-items: center; }
.roll__line { display: grid; gap: .15rem; justify-items: center; }
.roll__label {
  font: 600 .72rem var(--font-body);
  text-transform: uppercase; letter-spacing: .16em;
  color: var(--hl-b);
}
.roll__name {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.1rem, 2.2vw, 1.7rem);
  line-height: 1.15; text-transform: uppercase;
  max-width: 26ch; text-wrap: balance;
}
/* the director gets the marquee size; supporting credits run smaller */
.roll__line:not(:first-child) .roll__name {
  font-size: clamp(.95rem, 1.4vw, 1.2rem);
}
.roll__line:not(:first-child) .roll__label { font-size: .62rem; }
.roll__links { font: 500 .85rem var(--font-body); margin-top: .1rem; }
.roll__links a { color: inherit; text-underline-offset: 3px; }
.roll__links a:hover { color: var(--hl-b); }

/* ---------- Step nav buttons (deck mode only) ---------- */
.stepnav {
  position: fixed; right: var(--gutter); bottom: 1.4rem; z-index: 85;
  display: flex; gap: .5rem;
}
.stepnav button {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: var(--ink); color: var(--card-face);
  font-size: 1.1rem; cursor: pointer;
  transition: background .25s, border-color .25s;
}
.stepnav button:hover { background: var(--stage-acc, var(--acc-deep)); border-color: var(--stage-acc, var(--acc-deep)); }

/* ============================================================
   DECK MODE (JS + wide viewport + motion OK)
   ============================================================ */
html.deck .deck { height: calc(var(--step-count) * 100vh); height: calc(var(--step-count) * 100svh); }
html.deck .stage {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  overflow: hidden;
  background: var(--stage-bg, #f2ede4);
  transition: background .8s ease;
}
html.deck .scene {
  position: absolute; inset: 0;
  background: transparent;
  min-height: 0;
  visibility: hidden;
  transition: visibility 0s .8s;
}
html.deck .scene.is-active { visibility: visible; transition: visibility 0s 0s; }

/* text choreography */
html.deck .scene__left, html.deck .scene__right,
html.deck .scene__punch,
html.deck .scene__manifesto, html.deck .scene__credits,
html.deck .scene--finale .bolt--big,
html.deck .scene__plant {
  opacity: 0; transform: translateY(2.2rem);
  transition: opacity .55s var(--ease-out), transform .55s var(--ease-out);
}
html.deck .scene.is-active .scene__left, html.deck .scene.is-active .scene__right,
html.deck .scene.is-active .scene__punch,
html.deck .scene.is-active .scene__manifesto, html.deck .scene.is-active .scene__credits,
html.deck .scene.is-active .bolt--big,
html.deck .scene.is-active .scene__plant {
  opacity: 1; transform: none;
  transition-delay: .2s;
}
/* the hero title is animated by JS (drops from the top after the deck lands) */
html.deck:not(.mega-dropped) .scene__mega { opacity: 0; }
html.deck .scene.is-active .scene__right { transition-delay: .3s; }

/* label chip: in deck mode one persistent fixed chip replaces per-scene chips,
   so it never blinks out between chapters of the same era */
html.deck .scene::after { display: none; }
.stagechip {
  display: none;
  position: fixed; left: var(--gutter); bottom: 1.4rem; z-index: 85;
  font: 600 .78rem var(--font-body);
  letter-spacing: .1em; text-transform: uppercase;
  padding: .35rem 0;
  color: var(--stage-fg, var(--ink));
  transition: color .8s ease, opacity .4s ease;
}
html.deck .stagechip { display: inline-flex; align-items: center; }
html.deck .stagechip.is-empty { opacity: 0; visibility: hidden; }
html.deck:not(.hero-revealed) .stagechip { opacity: 0; }

/* quick navigation: dropdown under the top-left logo, one sub-list per era */
.quicknav {
  position: fixed; left: var(--gutter); top: 4.4rem; z-index: 95;
  background: var(--card-face); color: var(--ink);
  border: 1.5px solid var(--ink); border-radius: 1rem;
  box-shadow: 0 24px 60px rgba(22, 19, 15, .3);
  padding: .7rem;
  display: grid; gap: .15rem;
  width: min(21rem, 80vw);
  max-height: min(74vh, 36rem); overflow-y: auto;
  opacity: 0; transform: translateY(-8px);
  transition: opacity .25s var(--ease-out), transform .25s var(--ease-out);
  pointer-events: none;
}
.quicknav.is-open { opacity: 1; transform: none; pointer-events: auto; }
.quicknav[hidden] { display: none; }
.quicknav__group { display: grid; }
.quicknav__era {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  font: 600 .82rem var(--font-display);
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--stage-acc, var(--ink)); background: transparent;
  border: 0; border-radius: .55rem;
  padding: .55rem .6rem;
  min-height: 40px;
  cursor: pointer;
  text-align: left;
}
.quicknav__era:hover { background: var(--stage-acc, var(--ink)); color: var(--card-face); }
.quicknav__caret { font-size: .7rem; transition: transform .25s var(--ease-out); }
.quicknav__era[aria-expanded="true"] .quicknav__caret { transform: rotate(180deg); }
.quicknav__subs { display: grid; padding: .1rem 0 .35rem .5rem; }
.quicknav__subs[hidden] { display: none; }
.quicknav a {
  text-decoration: none;
  color: var(--ink);
  font: 500 .88rem var(--font-body);
  padding: .32rem .55rem; border-radius: .45rem;
  display: flex; gap: .5rem; align-items: baseline;
}
.quicknav a b {
  font-family: var(--font-display); font-weight: 700; font-size: .8rem;
  color: var(--stage-acc, var(--acc-deep));
}
.quicknav a:hover { background: var(--stage-acc, var(--ink)); color: var(--card-face); }
.quicknav a:hover b { color: var(--card-face); }
@media (max-width: 899px) { .quicknav { display: none; } }

/* accent return-to-top button in the step cluster */
.stepnav #stepTop {
  background: var(--acc-deep);
  border-color: var(--card-face);
  color: var(--card-face);
  font-size: 1.15rem;
  opacity: 0; transform: translateY(8px);
  transition: opacity .35s var(--ease-out), transform .35s var(--ease-out), background .2s;
}
.stepnav #stepTop.is-show { opacity: 1; transform: none; }
.stepnav #stepTop:hover { background: var(--ink); }
.stepnav #stepTop[hidden] { display: none; }

/* card motion in deck mode is driven by Anime.js (inline styles).
   CSS provides only the resting baselines: facet cards start hidden. */
html.js .card--facet {
  opacity: 0;
  visibility: hidden;
}
html.deck .scene--chapter .card--cover { cursor: pointer; }
html:not(.js) .scene__more { display: none; }

/* progress bar follows scene fg */
html.deck .progress__bar { background: var(--stage-fg, var(--ink)); }
html:not(.deck) .stepnav { display: none; }

/* ---------- Staged hero reveal (punchline; title + cards are JS-driven) ---------- */
.scene--hero .scene__punch {
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
}
html.js:not(.hero-revealed) .scene--hero .scene__punch,
html.js:not(.hero-revealed) .scene--hero.is-active .scene__punch {
  opacity: 0 !important;
  transform: translateY(1.5rem) !important;
}
html.hero-revealed .scene--hero .scene__punch { transition-delay: .05s; }

/* Desktop static fallback (no JS, or reduced motion): stacks become lists */
@media (min-width: 900px) {
  html:not(.js) .scene__stack {
    aspect-ratio: auto;
    max-height: none;
    max-width: 24rem;
    display: grid; gap: 1.1rem;
    perspective: none;
  }
  html:not(.js) .scene__stack .card { position: relative; inset: auto; transform: rotate(0); }
  html:not(.js) .card--img, html:not(.js) .card--cover { aspect-ratio: 4 / 5; }
  html:not(.js) .scene { min-height: 0; padding-top: 6rem; padding-bottom: 6rem; }
  html:not(.js) .scene--hero .scene__stack { display: block; aspect-ratio: 4 / 5; position: relative; }
  html:not(.js) .scene--hero .scene__stack .card { position: absolute; inset: 0; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .intro__line { animation-duration: .01s; }
}

/* ---------- Mobile / narrow: static stacked layout ---------- */
@media (max-width: 899px) {
  .scene {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 1.75rem;
    padding: 5rem var(--gutter) 5rem;
  }
  .scene__stack {
    order: -1;
    max-width: min(66vw, 17.5rem);
    margin-inline: auto;
    margin-top: .8rem;
  }
  /* no-JS fallback: stack becomes a plain vertical list of cards */
  html:not(.js) .scene__stack {
    aspect-ratio: auto;
    max-height: none; max-width: min(78vw, 21rem);
    display: grid; gap: 1.1rem;
    perspective: none;
  }
  html:not(.js) .card { position: relative; inset: auto; transform: rotate(0); }
  html:not(.js) .card--img, html:not(.js) .card--cover { aspect-ratio: 4 / 5; }
  .scene--hero .scene__stack { margin-top: 5rem; display: block; aspect-ratio: 4 / 5; position: relative; }
  .scene--hero .scene__stack .card { position: absolute; inset: 0; }
  .scene__mega { font-size: clamp(3.4rem, 16vw, 8rem); top: 5.2rem; }
  .scene__punch { position: static; margin-top: .5rem; }
  .scene::after { position: static; order: 5; margin-top: .5rem; }
  .scene__title { font-size: clamp(1.4rem, 7.4vw, 2.2rem); white-space: nowrap; }
  .scene__title br { display: none; }
  .scene__title .tone-a::after { content: " "; }
  .stepnav { display: none; }
  .scene { padding-top: 4.2rem; padding-bottom: 2.5rem; }
  .scene { gap: 1rem; }
  html.js:not(.deck) { scroll-snap-type: y proximity; }
  html.js:not(.deck) .scene { scroll-snap-align: start; }
  /* hero chip centered; plant chip in flow and centered */
  .scene::after { justify-self: center; }
  .scene__plant { position: static; order: 6; justify-self: center; margin-top: .5rem; }
  /* reveal counter collapses to zero height and slides open on first reveal,
     nudging the lead-in down to make room */
  .scene__facet {
    margin-top: .4rem;
    min-height: 0; max-height: 0; overflow: hidden;
    transition: max-height .45s var(--ease-out);
  }
  .scene__facet.has-text { max-height: 2.6em; }
  .scene--hero .card--echo-l  { transform: rotate(-8deg)  translateX(-22%) scale(.92); }
  .scene--hero .card--echo-r  { transform: rotate(8deg)   translateX(22%)  scale(.92); }
  .scene--hero .card--echo-fl { transform: rotate(-14deg) translateX(-38%) scale(.85); }
  .scene--hero .card--echo-fr { transform: rotate(14deg)  translateX(38%)  scale(.85); }
}

/* compact tier for short/small phones: paged scenes must fit with no scroll */
@media (max-width: 899px) and (max-height: 640px) {
  .scene { padding-top: 3.2rem; padding-bottom: 1.4rem; gap: .65rem; }
  .scene__stack { max-width: min(52vw, 13rem); margin-top: .3rem; }
  .scene__leadin { font-size: .95rem; margin-bottom: .5rem; }
  .scene__right > p:not(.scene__leadin) { font-size: .88rem; margin-bottom: .5rem; }
  .scene__title { font-size: clamp(1.2rem, 6.4vw, 1.8rem); }
  .more-btn { padding: .5rem 1.1rem; min-height: 40px; font-size: .88rem; }
  .scene__roll { gap: .55rem; }
  .roll__name { font-size: 1rem; }
  .roll__line:not(:first-child) .roll__name { font-size: .85rem; }
  .scene__credits { font-size: .7rem; }
  .bolt--big { width: 2rem; height: 2rem; }
  .scene__punch { font-size: clamp(1.2rem, 5.4vw, 1.7rem); bottom: 3.2rem; }
  .scene__mega { font-size: clamp(2.6rem, 14vw, 5rem); top: 3.6rem; }
}
