/* ============================================================
   nothing here was filmed — a reel.
   Motion picture first: the frame is the design, the type stays
   out of its way. No webfont; the video is the payload.
   ============================================================ */

:root {
  --step--2: clamp(0.69rem, 0.67rem + 0.09vw, 0.75rem);
  --step--1: clamp(0.81rem, 0.78rem + 0.14vw, 0.91rem);
  --step-0:  clamp(0.96rem, 0.93rem + 0.19vw, 1.09rem);
  --step-1:  clamp(1.16rem, 1.09rem + 0.32vw, 1.39rem);
  --step-2:  clamp(1.44rem, 1.30rem + 0.60vw, 1.87rem);
  --step-3:  clamp(1.82rem, 1.54rem + 1.20vw, 2.72rem);
  --display: clamp(2.6rem, 1.0rem + 6.6vw, 6.4rem);

  --space-3xs: .25rem; --space-2xs: .5rem; --space-xs: .75rem;
  --space-s: 1rem;  --space-m: 1.5rem; --space-l: 2.5rem;
  --space-xl: 4rem; --space-2xl: 6rem;
  --space-3xl: clamp(5rem, 11vh, 9rem);

  --gutter: clamp(1.15rem, .6rem + 2.1vw, 3rem);
  --page: min(100% - var(--gutter) * 2, 1280px);

  --film:    oklch(11% 0.005 260);
  --film-2:  oklch(15% 0.007 258);
  --ink:     oklch(96% 0.004 250);
  --ink-2:   oklch(74% 0.008 250);
  --ink-3:   oklch(62% 0.010 250);
  --rule:    oklch(28% 0.008 255);
  --rule-2:  oklch(21% 0.007 257);
  /* the one accent, and it means exactly one thing: this was generated */
  --synth:   oklch(76% 0.16 52);
  --focus:   oklch(82% 0.13 220);

  --dur-fast: .18s; --dur-base: .4s; --dur-slow: .9s;
  --ease-out: cubic-bezier(.22, 1, .36, 1);

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body, h1, h2, h3, p, dl, dd, ul, figure, table { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; }

body {
  background: var(--film);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--synth); color: var(--film); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; left: var(--space-s); top: -4rem; z-index: 60;
  background: var(--ink); color: var(--film);
  padding: .7rem 1.1rem; font-family: var(--mono); font-size: var(--step--1);
  text-decoration: none;
  transition: top var(--dur-fast) var(--ease-out);
}
.skip:focus-visible { top: var(--space-s); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

/* ---- header ---- */
.head {
  width: var(--page); margin-inline: auto;
  padding-block: var(--space-m);
  display: flex; flex-wrap: wrap; gap: var(--space-s);
  align-items: baseline; justify-content: space-between;
  font-family: var(--mono); font-size: var(--step--1);
}
.head__back { text-decoration: none; }
.head__back:hover { color: var(--synth); }
.dim { color: var(--ink-3); }
.head__meta {
  font-size: var(--step--2); color: var(--ink-3);
  letter-spacing: .10em; text-transform: uppercase;
}

/* ---- shared ---- */
.eyebrow {
  font-family: var(--mono); font-size: var(--step--2);
  letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3);
}
code {
  font-family: var(--mono); font-size: .92em;
  background: var(--film-2); padding: .1em .35em; border-radius: 2px;
}
.synth { color: var(--synth); }

.section {
  width: var(--page); margin-inline: auto;
  padding-block: var(--space-3xl);
  border-top: 1px solid var(--rule-2);
}
.section__head { margin-bottom: var(--space-l); }
.section__title {
  font-size: var(--step-3); line-height: 1.08;
  letter-spacing: -.025em; font-weight: 620;
  margin-block: var(--space-2xs) var(--space-s);
  max-width: 20ch; text-wrap: balance;
}
.section__sub { max-width: 54ch; color: var(--ink-2); font-size: var(--step-0); }

/* ── beat 1 · the transport ────────────────────────────────────── */
/* Pinned with sticky, not a library and not a wheel handler: native scroll
   position is mapped to the film's time, so the page still scrolls exactly
   as the user expects and nothing is hijacked. */
.scene { height: 340svh; position: relative; }
.stage {
  position: sticky; top: 0;
  height: 100svh;
  width: 100%;
  background: var(--film);
  overflow: hidden;
}
.hero { padding-bottom: var(--space-2xl); }
.hero__type {
  width: var(--page); margin-inline: auto;
  padding-top: var(--space-l);
  display: grid; gap: var(--space-m);
}
.stage__poster,
.stage__video {
  position: absolute; inset: 0;
  display: block; width: 100%; height: 100%; object-fit: cover;
}
/* visibility, not opacity: an opacity-0 <video> is still an LCP candidate in
   Chrome, and a painted 1080p film beat the poster it sits on, taking LCP from
   1.48s to 3.32s. visibility:hidden keeps it out of paint entirely while it
   still loads and seeks. */
.stage__video { visibility: hidden; opacity: 0; }
.stage__video.is-ready {
  visibility: visible; opacity: 1;
  transition: opacity var(--dur-slow) var(--ease-out);
}
.stage__fallback {
  position: absolute; inset: auto 0 0 0; padding: var(--space-s);
  font-family: var(--mono); font-size: var(--step--2); color: var(--ink-3);
  background: linear-gradient(to top, var(--film), transparent);
}
.stage__hint {
  position: absolute; left: 50%; bottom: var(--space-l);
  transform: translateX(-50%);
  font-family: var(--mono); font-size: var(--step--2);
  letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2);
  text-shadow: 0 1px 12px oklch(11% 0.005 260 / .9);
  transition: opacity var(--dur-base) var(--ease-out);
}
.stage.is-running .stage__hint { opacity: 0; }

/* The transport readout. The reference is explicit: a pinned scene needs a
   visible progress signal or it reads as scroll-jacking. */
.transport {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: var(--space-l) var(--gutter) var(--space-m);
  display: grid; gap: var(--space-2xs);
  grid-template-columns: 1fr auto;
  align-items: end;
  font-family: var(--mono);
  background: linear-gradient(to top, oklch(11% 0.005 260 / .85), transparent);
  opacity: 0; transition: opacity var(--dur-base) var(--ease-out);
}
.stage.is-running .transport { opacity: 1; }
.transport__chapter {
  font-size: var(--step-1); letter-spacing: -.01em; color: var(--ink);
}
.transport__time {
  font-size: var(--step--1); color: var(--ink-2);
  font-variant-numeric: tabular-nums; text-align: right;
}
.transport__rule {
  grid-column: 1 / -1;
  height: 2px; background: var(--rule); position: relative;
}
.transport__rule i {
  display: block; height: 100%; width: 0; background: var(--synth);
}
.transport__marks { grid-column: 1 / -1; position: relative; height: 10px; }
.transport__marks span {
  position: absolute; left: calc(var(--at) * 100%); top: 0;
  width: 1px; height: 6px; background: var(--rule);
}
.title {
  font-size: var(--display); line-height: .92;
  letter-spacing: -.04em; font-weight: 700;
  text-wrap: balance;
}
.lede { font-size: var(--step-1); max-width: 46ch; color: var(--ink-2); line-height: 1.45; }
.hero__silent {
  max-width: 46ch;
  padding-left: var(--space-s);
  border-left: 2px solid var(--synth);
  font-size: var(--step--1); color: var(--ink-2);
}
.hero__silent b { color: var(--ink); }

@media (min-width: 62rem) {
  .hero__type {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    column-gap: var(--space-2xl);
    align-items: start;
  }
  .hero__type .eyebrow { grid-column: 1; grid-row: 1; }
  .title { grid-column: 1; grid-row: 2; margin: 0; }
  .lede { grid-column: 2; grid-row: 1 / span 2; }
  .hero__silent { grid-column: 2; }
}
.hero__silent--quiet { border-left-color: var(--rule); color: var(--ink-3); }

/* ── beat 2 · the reel index ───────────────────────────────────── */
.cards { display: grid; gap: var(--space-m); }
@media (min-width: 40rem) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.card { position: relative; }
.card__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--film-2);
  border: 1px solid var(--rule-2);
}
.card__frame video, .card__frame img {
  display: block; width: 100%; height: 100%; object-fit: cover;
}
.card__frame video { position: absolute; inset: 0; opacity: 0; transition: opacity var(--dur-base) var(--ease-out); }
.card.is-live .card__frame video { opacity: 1; }
.card__badge {
  position: absolute; left: var(--space-2xs); top: var(--space-2xs); z-index: 2;
  font-family: var(--mono); font-size: var(--step--2);
  letter-spacing: .1em; text-transform: uppercase;
  background: var(--film); color: var(--synth);
  padding: .25em .6em; border: 1px solid var(--rule);
}
.card__scrub {
  position: absolute; inset: auto 0 0 0; height: 2px; z-index: 2;
  background: var(--rule);
}
.card__scrub i {
  display: block; height: 100%; width: 0; background: var(--synth);
}
.card__meta {
  display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-s);
  margin-top: var(--space-2xs);
  font-family: var(--mono); font-size: var(--step--2); color: var(--ink-3);
}
.card__title { font-size: var(--step-0); font-weight: 560; margin-top: var(--space-2xs); }
.card__prompt {
  margin-top: var(--space-2xs);
  font-size: var(--step--1); color: var(--ink-2); line-height: 1.5;
}
.card__hint {
  font-family: var(--mono); font-size: var(--step--2); color: var(--ink-3);
  margin-top: var(--space-2xs);
}
/* On touch this is a real control, so it gets a real target: measured 19px
   before this, against a 44px floor. */
button.card__hint {
  display: inline-flex; align-items: center;
  min-height: 44px; padding-inline: var(--space-s);
  background: none; border: 1px solid var(--rule);
  color: var(--ink-2); cursor: pointer;
}
button.card__hint[aria-pressed="true"] { border-color: var(--synth); color: var(--synth); }

/* ── beat 3 · the player ───────────────────────────────────────── */
.player { border: 1px solid var(--rule-2); background: var(--film-2); }
.player__frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.player__video { display: block; width: 100%; height: 100%; object-fit: contain; }
.player__big {
  position: absolute; inset: 0; margin: auto;
  width: 84px; height: 84px; border-radius: 50%;
  display: grid; place-items: center;
  background: oklch(11% 0.005 260 / .6);
  border: 1px solid var(--ink);
  color: var(--ink); font-size: 1.6rem; cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.player__big:hover { background: var(--synth); color: var(--film); transform: scale(1.04); }
.player.is-playing .player__big { display: none; }

.player__bar {
  display: flex; align-items: center; gap: var(--space-s);
  padding: var(--space-xs) var(--space-s);
  border-top: 1px solid var(--rule-2);
  font-family: var(--mono); font-size: var(--step--1);
}
.pbtn {
  display: grid; place-items: center;
  min-width: 44px; min-height: 44px;
  background: none; border: 1px solid var(--rule);
  color: var(--ink); cursor: pointer; font-size: var(--step-0);
  transition: border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.pbtn:hover { border-color: var(--synth); color: var(--synth); }
.player__time { font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.player__seek { flex: 1; display: block; min-width: 0; }
[data-seek] {
  -webkit-appearance: none; appearance: none;
  width: 100%; background: transparent; cursor: pointer;
  padding-block: 21px; margin-block: -21px;   /* 44px hit area, 2px bar */
}
[data-seek]::-webkit-slider-runnable-track { height: 2px; background: var(--rule); }
[data-seek]::-moz-range-track { height: 2px; background: var(--rule); }
[data-seek]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; margin-top: -6px; border-radius: 50%;
  background: var(--synth);
}
[data-seek]::-moz-range-thumb {
  width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--synth);
}
.player__note {
  padding: var(--space-s);
  border-top: 1px solid var(--rule-2);
  font-size: var(--step--2); color: var(--ink-3);
}

/* ── beat 4 · the ledger ───────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.ledger { border-collapse: collapse; width: 100%; min-width: 44rem; }
.ledger th, .ledger td {
  text-align: left; padding: var(--space-xs) var(--space-s) var(--space-xs) 0;
  border-bottom: 1px solid var(--rule-2);
  font-size: var(--step--1);
}
.ledger thead th {
  font-family: var(--mono); font-size: var(--step--2);
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); border-bottom-color: var(--rule);
}
.ledger td { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.ledger td:first-child { color: var(--ink); }
.ledger tfoot td { color: var(--synth); border-top: 1px solid var(--rule); }

/* ── beat 5 · colophon ─────────────────────────────────────────── */
.colophon__grid { display: grid; gap: var(--space-l); }
.creds > div {
  display: grid; grid-template-columns: 7rem minmax(0, 1fr);
  gap: var(--space-s); padding-block: var(--space-2xs);
  border-bottom: 1px solid var(--rule-2);
}
.creds dt {
  font-family: var(--mono); font-size: var(--step--2);
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
}
.creds dd { font-size: var(--step--1); color: var(--ink-2); }
.colophon__note p { max-width: 48ch; color: var(--ink-2); font-size: var(--step--1); line-height: 1.6; }
.colophon__note p + p { margin-top: var(--space-s); }
.cta {
  display: inline-block; margin-top: var(--space-m);
  font-family: var(--mono); font-size: var(--step--1);
  text-decoration: none; border-bottom: 2px solid var(--synth); padding-bottom: 2px;
}
.cta:hover { color: var(--synth); }
@media (min-width: 56rem) {
  .colophon__grid { grid-template-columns: 1fr 1fr; column-gap: var(--space-2xl); }
}

.foot {
  width: var(--page); margin-inline: auto;
  padding-block: var(--space-l) var(--space-2xl);
  border-top: 1px solid var(--rule-2);
  display: flex; flex-wrap: wrap; gap: var(--space-s); justify-content: space-between;
  font-family: var(--mono); font-size: var(--step--2); color: var(--ink-3);
}

/* ---- reduced motion: no autoplay anywhere, posters and a play button ---- */
@media (prefers-reduced-motion: reduce) {
  .stage__video { opacity: 1; transition: none; }
  .card__frame video { display: none; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
