/* styles.css — claude-motion.nawaf.solutions
   Tokens mirror the reel's own palette (reel/timeline.json) so the page reads
   as the film's world continued. Per-scene strip rules are appended by build.mjs. */

:root {
  /* Colour — taken from the film */
  --ink: #0B0B0E;
  --bone: #F2EEE6;
  --orange: #FF4F1F;
  --cobalt: #2C47FF;
  --lime: #D2FF3C;
  --text-dim: rgba(242, 238, 230, 0.62);
  --text-faint: rgba(242, 238, 230, 0.42);
  --rule: rgba(242, 238, 230, 0.14);

  /* Type — the reel's condensed heavy for display, its humanist sans for reading */
  --font-display: "Avenir Next Condensed", "Arial Narrow", "Roboto Condensed", "Helvetica Neue", sans-serif-condensed, sans-serif;
  --font-text: "Avenir Next", "Segoe UI", "Helvetica Neue", Roboto, sans-serif;

  /* Type scale — perfect fourth (1.333) from an 18px body */
  --fs-small: 0.8125rem;
  --fs-body: 1.125rem;
  --fs-lead: clamp(1.125rem, 1rem + 0.5vw, 1.3125rem);
  --fs-h2: 1.5rem;
  --fs-display: clamp(3.25rem, 1.5rem + 7.8vw, 8.5rem);

  /* Space scale */
  --s1: 4px;
  --s2: 8px;
  --s3: 16px;
  --s4: 24px;
  --s5: 40px;
  --s6: 64px;
  --s7: 104px;

  --gutter: clamp(16px, 4vw, 56px);
  --maxw: 1440px;
  --radius-pill: 999px;
  --radius-frame: 4px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--bone);
  font: 400 var(--fs-body) / 1.55 var(--font-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- stage ---- */
.stage {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--gutter) var(--gutter) 0;
}

.frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-frame);
  overflow: hidden;
}

.frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Player toolbar sits under the strip: nothing covers the film's own HUD. */
.player {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin-top: var(--s4);
}
.player .btn-sound { margin-inline-end: auto; }
.player[hidden] { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  border: 0;
  cursor: pointer;
  font: 600 0.9375rem / 1 var(--font-text);
  color: var(--ink);
  background: var(--bone);
  border-radius: var(--radius-pill);
  padding: 12px 18px;
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out);
}
.btn:active { transform: scale(0.96); }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn svg path:first-child { fill: currentColor; stroke: none; }

.btn-sound[aria-pressed="true"] { background: var(--orange); color: var(--ink); }
.btn-sound[aria-pressed="false"] .waves { opacity: 0.35; }

.btn-icon {
  padding: 12px;
  background: transparent;
  color: var(--bone);
  box-shadow: inset 0 0 0 1px var(--rule);
}
.btn-icon:hover { box-shadow: inset 0 0 0 1px var(--text-dim); }
.btn-icon svg path { fill: currentColor; stroke: none; }
#fullscreen svg path { fill: none; stroke: currentColor; }
#playpause .i-play { display: none; }
#playpause[data-state="paused"] .i-play { display: inline; }
#playpause[data-state="paused"] .i-pause { display: none; }

/* ---------------------------------------------------------------- strip ---- */
/* The reel's real timeline: segment widths are scene durations (set in build). */
.strip {
  position: relative;
  margin-top: var(--s3);
}
.strip ol {
  display: flex;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.strip li { flex: 1 1 0; min-width: 0; }

.seg {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-faint);
  text-align: start;
  cursor: pointer;
  font: inherit;
}
.seg .bar {
  display: block;
  height: 8px;
  border-radius: 1px;
  background: var(--scene);
  opacity: 0.28;
  transition: opacity 200ms var(--ease-out), height 200ms var(--ease-out);
}
.seg .cap {
  display: flex;
  gap: 6px;
  margin-top: var(--s2);
  font-size: var(--fs-small);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.seg .num { font-variant-numeric: tabular-nums; }
.seg:hover .bar { opacity: 0.6; }
.seg[aria-current="true"] { color: var(--bone); }
.seg[aria-current="true"] .bar { opacity: 1; height: 12px; margin-top: -4px; }

/* Playhead: a 2px bone line positioned by app.js via --p (0..1). */
.playhead {
  position: absolute;
  top: -6px;
  left: calc(var(--p, 0) * 100%);
  width: 2px;
  height: 20px;
  background: var(--bone);
  border-radius: 1px;
  pointer-events: none;
}

/* ---------------------------------------------------------------- intro ---- */
.intro {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s6) var(--gutter) var(--s6);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--s4);
  row-gap: var(--s5);
  align-items: end;
}

h1 {
  grid-column: 1 / span 7;
  margin: 0;
  font: 800 var(--fs-display) / 0.86 var(--font-display);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
/* The film's signature: the orange full stop the ball becomes at the end. */
.stop { color: var(--orange); }

.lede { grid-column: 9 / span 4; }
.lede p {
  margin: 0 0 var(--s4);
  font-size: var(--fs-lead);
  color: var(--text-dim);
  max-width: 36ch;
}

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4); }
.btn-primary { background: var(--orange); }
.btn-primary:hover { background: #ff6a3f; }
.link {
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: var(--text-faint);
}
.link:hover { text-decoration-color: var(--orange); }

/* ---------------------------------------------------------------- scenes --- */
.scenes {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter) var(--s7);
}
.scenes ol { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }

.row {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 14rem) minmax(0, 1fr) auto;
  gap: var(--s4);
  align-items: baseline;
  width: 100%;
  padding: var(--s4) 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: none;
  color: var(--text-dim);
  text-align: start;
  font: inherit;
  cursor: pointer;
  transition: color 200ms var(--ease-out);
}
.row .num {
  font: 800 1.75rem / 1 var(--font-display);
  color: var(--scene);
  font-variant-numeric: tabular-nums;
}
.row .name { font: 800 1.75rem / 1 var(--font-display); color: var(--bone); }
.row .desc { max-width: 60ch; }
.row .time { font-size: var(--fs-small); color: var(--text-faint); font-variant-numeric: tabular-nums; }
.row:hover, .row[aria-current="true"] { color: var(--bone); }
.row[aria-current="true"] .time { color: var(--orange); }

/* ---------------------------------------------------------------- how ------ */
.how {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter) var(--s7);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--s4);
}
.how h2 {
  grid-column: 1 / span 4;
  margin: 0 0 var(--s4);
  font: 800 var(--fs-h2) / 1.1 var(--font-display);
  font-size: 2.25rem;
}
.how dl {
  grid-column: 5 / span 8;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s5);
}
.how dt { font-weight: 600; margin-bottom: var(--s2); }
.how dd { margin: 0; color: var(--text-dim); font-size: 1rem; }

/* ---------------------------------------------------------------- footer --- */
footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s5) var(--gutter) var(--s6);
  border-top: 1px solid var(--rule);
  font-size: var(--fs-small);
  color: var(--text-dim);
}
footer p { margin: 0 0 var(--s1); }
footer .quiet { color: var(--text-faint); }

/* 404 */
.lost { min-height: 100vh; display: grid; place-content: center; gap: var(--s4); padding: var(--gutter); }
.lost h1 { font-size: clamp(2.5rem, 8vw, 5rem); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 960px) {
  .intro { padding-top: var(--s6); }
  h1, .lede { grid-column: 1 / -1; }
  .how h2, .how dl { grid-column: 1 / -1; }
  .how dl { grid-template-columns: 1fr; gap: var(--s4); }
  .row { grid-template-columns: 2.5rem minmax(0, 1fr) auto; }
  .row .time { grid-column: 3; grid-row: 1; }
  .row .desc { grid-column: 2 / -1; grid-row: 2; }
}

@media (max-width: 640px) {
  .seg .cap .name { display: none; } /* numbers only on phones */
  .btn-sound span { font-size: 0.875rem; }
  .btn { padding: 10px 14px; }
  .btn-icon { padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* ---- generated by build.mjs from reel/timeline.json ---- */
[data-scene="genesis"] { --scene: var(--orange); }
.strip li:nth-child(1) { flex-grow: 2; }
[data-scene="type"] { --scene: var(--cobalt); }
.strip li:nth-child(2) { flex-grow: 2; }
[data-scene="systems"] { --scene: var(--bone); }
.strip li:nth-child(3) { flex-grow: 2.5; }
[data-scene="particles"] { --scene: var(--lime); }
.strip li:nth-child(4) { flex-grow: 2.5; }
[data-scene="depth"] { --scene: var(--cobalt); }
.strip li:nth-child(5) { flex-grow: 2; }
[data-scene="easing"] { --scene: var(--bone); }
.strip li:nth-child(6) { flex-grow: 1.5; }
[data-scene="signature"] { --scene: var(--orange); }
.strip li:nth-child(7) { flex-grow: 2.5; }
