:root {
  --chroma: #1d3bff;
  --ink: #14151b;
  --paper: #eef0f5;
  --tungsten: #ffb23e;
  --clay: #cfc9bd;
  --muted: #9aa0b4;
  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --body: "Hanken Grotesk", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--chroma);
  color: var(--paper);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 800; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--tungsten); outline-offset: 3px; }

/* The live stage sits behind every section. */
#stage { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: 0; }
.stage-shade {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: var(--ink); opacity: 0; transition: opacity .5s ease;
}
body.calm .stage-shade { opacity: .92; }
main, .nav, .foot { position: relative; z-index: 2; }

/* Navigation */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; gap: 28px;
  padding: 14px var(--gutter);
  background: linear-gradient(var(--ink) 0%, rgba(20, 21, 27, .0) 100%);
}
.nav nav { display: flex; gap: 22px; margin-left: auto; }
.nav nav a { text-decoration: none; font-weight: 600; font-size: 15px; opacity: .85; }
.nav nav a:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.wordmark { font-family: var(--display); font-weight: 900; font-size: 30px; letter-spacing: .01em; text-decoration: none; line-height: 1; }

/* Buttons */
.btn {
  display: inline-block; text-decoration: none; font-weight: 700; font-size: 16px;
  padding: 13px 22px; border: 2px solid transparent; transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-key { background: var(--tungsten); color: var(--ink); }
.btn-ghost { border-color: var(--paper); color: var(--paper); }
.btn-ghost:hover { background: var(--paper); color: var(--ink); }
.btn-ink { background: var(--ink); color: var(--paper); }
.actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; }

/* Hero */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 120px var(--gutter) 56px;
}
.hero h1 {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(64px, 10.5vw, 176px); line-height: .84; letter-spacing: -.005em;
  text-shadow: 0 4px 40px rgba(20, 21, 27, .35);
}
.hero { position: relative; overflow: hidden; background: var(--ink); }
.hero-copy { max-width: 980px; position: relative; z-index: 4; pointer-events: none; }
.hero-copy .actions { pointer-events: auto; }
/* Over the film the title steps down a size, keeping the cast's faces clear. */
.hero .hero-copy h1 { font-size: clamp(56px, 7.4vw, 124px); }
.hero .lede { max-width: 30em; }
.scroll-cue { z-index: 4; }

/* Hero film: full bleed, the generated clip over its 3D direction. */
.hero-film { position: absolute; inset: 0; user-select: none; touch-action: pan-y; }
.hero-film::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(0deg, rgba(20, 21, 27, .92) 0%, rgba(20, 21, 27, .55) 34%, rgba(20, 21, 27, 0) 62%),
    linear-gradient(180deg, rgba(20, 21, 27, .6) 0%, rgba(20, 21, 27, 0) 18%);
}
.hero-film .film-handle, .hero-film .film-tag { z-index: 2; }
.hero-film .film-wipe { z-index: 3; }
.hero-film .film-tag { top: 86px; }
.hero-film .film-tag-final { left: var(--gutter); }
.hero-film .film-tag-previs { right: var(--gutter); }
/* Mouse users steer the line by moving; the knob is for touch and keyboard. */
@media (hover: hover) and (pointer: fine) { .hero-film .film-handle::after, .hero-film .film-handle::before { opacity: 0; } }
.lede { font-size: clamp(18px, 1.6vw, 21px); max-width: 34em; margin-top: 26px; font-weight: 500; }
.scroll-cue { position: absolute; right: var(--gutter); bottom: 56px; font-size: 14px; opacity: .8; writing-mode: vertical-rl; }

/* Model strip */
.models {
  background: var(--ink); display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 24px;
  padding: 22px var(--gutter);
}
.models p { color: var(--muted); font-size: 14px; }
.models ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; padding: 0; }
.models li { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: .01em; }
.models ul + p { margin-left: 18px; }

/* Pinned chapters */
.pin { height: 100vh; height: 100svh; position: relative; }
.pin-inner { height: 100%; position: relative; padding: 96px var(--gutter) 40px; display: flex; align-items: center; }

/* Slate card: the one container style on the page. */
.card {
  background: var(--ink); color: var(--paper);
  max-width: 440px; padding: 28px 30px 30px;
  border-left: 6px solid var(--tungsten);
}
.card.wide { max-width: 520px; }
.card h2 { font-family: var(--display); font-weight: 900; font-size: clamp(38px, 4vw, 56px); line-height: .92; margin-bottom: 16px; }
.card p { color: #d7dae4; }

.style-ticks { list-style: none; padding: 0; margin: 22px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.style-ticks li { font-size: 15px; color: var(--muted); padding-left: 16px; position: relative; transition: color .3s; }
.style-ticks li::before { content: ""; position: absolute; left: 0; top: .6em; width: 8px; height: 8px; background: currentColor; opacity: .5; }
.style-ticks li.on { color: var(--paper); font-weight: 700; }
.style-ticks li.on::before { background: var(--tungsten); opacity: 1; }

.style-name {
  position: absolute; right: var(--gutter); bottom: 44px; text-align: right; pointer-events: none;
  font-family: var(--display); font-weight: 900; line-height: .82;
  font-size: clamp(64px, 11vw, 200px); color: var(--paper);
  text-shadow: 0 6px 50px rgba(20, 21, 27, .45);
}
.style-name span { display: inline-block; }
.style-name.on-light { color: var(--ink); text-shadow: none; }

/* Style reference reel: paper ground, the one light section on the page. */
.gallery {
  position: relative; z-index: 3; background: var(--paper); color: var(--ink);
  height: 100vh; height: 100svh; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; gap: 28px;
  padding: 88px 0 32px;
}
.gallery-head { padding: 0 var(--gutter); display: flex; align-items: baseline; gap: 28px; flex-wrap: wrap; }
.gallery-head h2 { font-family: var(--display); font-weight: 900; font-size: clamp(48px, 6vw, 96px); line-height: .9; }
.gallery-head p { max-width: 30em; color: #4a4e5c; }
.reel { display: flex; gap: 22px; padding: 0 var(--gutter); width: max-content; will-change: transform; }
/* Cards fit the viewport height too, so short windows never crop them. */
.reel figure { margin: 0; width: clamp(150px, min(24vw, calc((100svh - 250px) * .75)), 340px); flex: none; }
.reel img {
  display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: #d9dbe2;
  border: 3px solid var(--ink);
}
.reel figcaption { margin-top: 10px; font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1; }

/* Pipeline steps: a real sequence, so numbered. */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 8px 0 0; }
.steps li {
  counter-increment: step; position: relative; padding: 12px 0 12px 54px;
  border-top: 1px solid #2c2f3b; opacity: .38; transition: opacity .35s ease;
}
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 8px;
  font-family: var(--display); font-weight: 900; font-size: 38px; line-height: 1; color: var(--muted);
}
.steps li h3 { font-size: 18px; font-weight: 700; }
.steps li p { font-size: 15px; max-height: 0; overflow: hidden; transition: max-height .4s ease, margin .4s ease; }
.steps li.on { opacity: 1; }
.steps li.on::before { color: var(--tungsten); }
.steps li.on p { max-height: 6em; margin-top: 4px; }
.aside { margin-top: 18px; font-size: 15px; color: var(--muted) !important; }

/* Review checklist */
.checks { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 8px; }
.checks li { position: relative; padding-left: 30px; color: var(--muted); transition: color .3s; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: .25em; width: 18px; height: 18px;
  border: 2px solid #3a3e4d; transition: background .3s, border-color .3s;
}
.checks li.ok { color: var(--paper); }
.checks li.ok::before { background: var(--tungsten); border-color: var(--tungsten); }
.checks li.ok::after {
  content: ""; position: absolute; left: 6px; top: calc(.25em + 3px); width: 5px; height: 9px;
  border: solid var(--ink); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}

/* Modes */
.mode { margin-top: 18px; opacity: .35; transition: opacity .35s; }
.mode h3 { font-family: var(--display); font-weight: 900; font-size: 34px; line-height: 1; margin-bottom: 6px; }
.mode.on { opacity: 1; }
.mode.on h3 { color: var(--tungsten); }

/* Film: a real generated run over its 3D direction. Ink ground, like a screening room. */
.film {
  position: relative; z-index: 3; background: var(--ink);
  padding: 120px var(--gutter) 110px;
}
.film-head { display: flex; align-items: baseline; gap: 18px 40px; flex-wrap: wrap; max-width: 1280px; margin: 0 auto 36px; }
.film-head h2 { font-family: var(--display); font-weight: 900; font-size: clamp(48px, 6vw, 96px); line-height: .9; max-width: 9em; }
.film-head p { max-width: 30em; color: #cdd1dc; }

.film-frame {
  position: relative; max-width: 1280px; margin: 0 auto; aspect-ratio: 1344 / 768;
  background: #0b0c10; overflow: hidden; user-select: none; touch-action: pan-y;
  box-shadow: 0 0 0 1px #2c2f3b, 0 40px 120px -40px rgba(255, 178, 62, .35);
}
.film-frame video, .hero-film video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
/* The film covers the direction up to the wipe line. */
.film-final { clip-path: inset(0 calc(100% - var(--wipe)) 0 0); }
.film-handle {
  position: absolute; top: 0; bottom: 0; left: var(--wipe); width: 3px; margin-left: -1.5px;
  background: var(--tungsten); pointer-events: none;
}
.film-handle::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  background: var(--tungsten); border-radius: 50%;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .45);
}
.film-handle::before {
  content: "\2039\00a0\203a"; position: absolute; top: 50%; left: 50%; z-index: 1; transform: translate(-50%, -54%);
  font: 900 26px/1 var(--display); color: var(--ink); white-space: nowrap;
}
.film-wipe {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize;
  -webkit-appearance: none; appearance: none; background: transparent;
}
.film-wipe::-webkit-slider-thumb { -webkit-appearance: none; width: 2px; height: 100vh; }
.film-wipe::-moz-range-thumb { width: 2px; height: 100vh; border: 0; }
.film-frame:has(.film-wipe:focus-visible) { outline: 3px solid var(--tungsten); outline-offset: 4px; }
.film-tag {
  position: absolute; top: 16px; padding: 6px 10px; font-weight: 700; font-size: 14px; pointer-events: none;
  background: rgba(20, 21, 27, .78); color: var(--paper); transition: opacity .3s;
}
.film-tag-previs { right: 16px; }
.film-tag-final { left: 16px; color: var(--tungsten); }
[data-side="final"] > .film-tag-previs, [data-side="previs"] > .film-tag-final { opacity: 0; }

.film-bar { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding-top: 14px; }
.film-bar > button {
  font: 700 15px var(--body); padding: 10px 16px; cursor: pointer; border: 2px solid var(--paper);
  background: transparent; color: var(--paper);
}
.film-bar > button[aria-pressed="true"] { background: var(--paper); color: var(--ink); }
.film-play { min-width: 82px; }
.film-track { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; min-width: 0; }
.film-track button {
  position: relative; text-align: left; cursor: pointer; border: 0; padding: 8px 0 12px; background: none;
  color: var(--muted); font: 600 14px var(--body);
}
.film-track button.on { color: var(--paper); }
.film-track i { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: #343846; overflow: hidden; }
.film-track i::after {
  content: ""; position: absolute; inset: 0; background: var(--tungsten);
  transform-origin: left; transform: scaleX(var(--p, 0));
}
.film-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; min-width: 7.5em; text-align: right; }

.film-sheet { max-width: 1280px; margin: 34px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.film-sheet article { border-top: 3px solid #343846; padding-top: 14px; opacity: .5; transition: opacity .35s, border-color .35s; }
.film-sheet article.on { opacity: 1; border-color: var(--tungsten); }
.film-sheet h3 { font-family: var(--display); font-weight: 900; font-size: 30px; line-height: 1; margin-bottom: 12px; }
.film-sheet h3 span { font-family: var(--body); font-weight: 500; font-size: 14px; color: var(--muted); margin-left: 8px; }
.film-sheet dl { display: grid; grid-template-columns: 7.5em 1fr; gap: 6px 14px; margin: 0; font-size: 15px; }
.film-sheet dt { color: var(--muted); }
.film-sheet dd { margin: 0; color: #d7dae4; }
.film-note { max-width: 1280px; margin: 26px auto 0; font-size: 14px; color: var(--muted); }

/* Cast references: the pinned pictures beside the clip they shaped. */
.refs { padding-top: 40px; }
.refs-body { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 28px; align-items: start; }
.refs-cast { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.refs-cast li { position: relative; background: #1d1f28; box-shadow: 0 0 0 1px #2c2f3b; transition: opacity .35s; }
.refs-cast li:first-child { grid-column: 1 / -1; display: grid; grid-template-columns: 96px 1fr; align-items: center; }
.refs-cast img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; }
.refs-cast p { padding: 8px 10px 10px; font-size: 14px; line-height: 1.3; }
.refs-cast b { display: block; font-family: var(--display); font-weight: 900; font-size: 22px; }
.refs-cast span { color: var(--muted); font-size: 13px; }
.refs-cast .refs-on { box-shadow: 0 0 0 2px var(--tungsten); }
.refs-cast .refs-on span { color: var(--tungsten); }
.refs-cast .refs-off { opacity: .55; }
.refs-stage .film-frame { margin: 0; }
.refs-stage .film-bar { padding-top: 14px; }
.refs-sheet article { opacity: 1; }

/* Calm sections: the stage dims behind them. */
.control, .faq, .start { padding: 120px var(--gutter); }
.control h2, .faq h2, .start h2 {
  font-family: var(--display); font-weight: 900; font-size: clamp(48px, 6vw, 96px); line-height: .9; max-width: 12em;
}
.cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 36px; margin-top: 56px; }
.cols h3 { font-size: 20px; margin-bottom: 8px; color: var(--tungsten); }
.cols p { color: #cdd1dc; max-width: 30em; }

.faq { max-width: 1100px; }
.faq h2 { margin-bottom: 40px; }
.faq details { border-top: 1px solid #343846; }
.faq details:last-of-type { border-bottom: 1px solid #343846; }
.faq summary {
  cursor: pointer; list-style: none; padding: 20px 40px 20px 0; position: relative;
  font-size: 20px; font-weight: 700;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 12px; height: 12px;
  border: solid var(--tungsten); border-width: 0 3px 3px 0; transform: translateY(-70%) rotate(45deg);
  transition: transform .25s ease;
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(225deg); }
.faq details p { padding: 0 0 22px; max-width: 46em; color: #cdd1dc; }

.start { background: var(--chroma); position: relative; z-index: 3; }
.start ol { list-style: none; counter-reset: s; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; padding: 0; margin: 48px 0 0; max-width: 1100px; }
.start li { counter-increment: s; border-top: 3px solid var(--paper); padding-top: 14px; }
.start li::before { content: counter(s); font-family: var(--display); font-weight: 900; font-size: 56px; line-height: 1; display: block; margin-bottom: 8px; }
.start li h3 { font-size: 20px; margin-bottom: 4px; }

.foot {
  background: var(--ink); display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 28px var(--gutter); color: var(--muted); font-size: 14px;
}
.foot .wordmark { color: var(--paper); font-size: 24px; }

/* Small screens: the card docks to the bottom so the stage stays visible. */
@media (max-width: 860px) {
  .nav nav { display: none; }
  .nav .btn { margin-left: auto; padding: 10px 16px; }
  /* The card stays short so the stage, framed above it (app.js), shows through. */
  .pin-inner { align-items: flex-end; padding: 72px var(--gutter) 14px; }
  .card { max-width: none; width: 100%; padding: 16px 18px 18px; border-left-width: 4px; }
  .card.wide { max-width: none; }
  .card h2 { font-size: 32px; margin-bottom: 8px; }
  .card > p { font-size: 15px; line-height: 1.45; }
  .style-ticks, .aside { display: none; }
  .style-name { top: 68px; bottom: auto; font-size: 44px; }
  .steps li { padding: 6px 0 6px 38px; }
  .steps li::before { font-size: 26px; top: 5px; }
  .steps li h3 { font-size: 16px; }
  .steps li p { font-size: 14px; }
  .checks { margin-top: 12px; gap: 4px; font-size: 14px; }
  .checks li { padding-left: 26px; }
  .checks li::before { width: 16px; height: 16px; }
  .checks li.ok::after { left: 5px; top: calc(.25em + 2px); }
  .mode { margin-top: 10px; }
  .mode h3 { font-size: 26px; margin-bottom: 2px; }
  .mode p { font-size: 14px; max-height: 0; overflow: hidden; transition: max-height .4s ease; }
  .mode.on p { max-height: 12em; }
  .cols, .start ol, .film-sheet, .refs-body { grid-template-columns: 1fr; }
  /* Phones: the three pictures sit in one row above the clip. */
  .refs-cast { grid-template-columns: repeat(3, 1fr); }
  .refs-cast li:first-child { grid-column: auto; display: block; }
  .refs-cast b { font-size: 18px; }
  .refs-cast span { font-size: 12px; }
  /* Phones: the hero film becomes a full-width 16:9 frame above the copy. */
  .hero { justify-content: flex-start; padding-top: 0; min-height: 0; }
  .hero-film { position: relative; inset: auto; margin: 64px calc(-1 * var(--gutter)) 28px; aspect-ratio: 1344 / 768; }
  .hero-film::after { background: linear-gradient(180deg, rgba(20, 21, 27, .45) 0%, rgba(20, 21, 27, 0) 30%); }
  .hero-film .film-tag { top: 10px; }
  .film-bar { flex-wrap: wrap; }
  .film-track { order: 3; flex-basis: 100%; }
  .film-time { margin-left: auto; }
  .film-tag { top: 10px; font-size: 12px; }
  .film-handle::after { width: 34px; height: 34px; margin: -17px 0 0 -17px; }
  .reel figure { width: min(62vw, calc((100svh - 260px) * .75)); }
  .scroll-cue { display: none; }
}
@media (max-width: 1100px) and (min-width: 861px) { .cols { grid-template-columns: 1fr 1fr; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .steps li, .steps li p, .checks li, .mode, .mode p, .stage-shade { transition: none; }
}
