@font-face { font-family: "Barlow"; src: url("../fonts/barlow-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Barlow Semi Condensed"; src: url("../fonts/barlow-semi-condensed-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Semi Condensed"; src: url("../fonts/barlow-semi-condensed-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #1b2429;
  --pencil: #3f4950;
  --rule: #c9d2d7;
  --water: #d9eff5;
  --tape: #f0bf2a;
  --method: #1d4f91;
  --fork: #0f6b66;
  --caution: #b8237a;
  --excluded: #a4402a;
  --gutter: clamp(16px, 4vw, 48px);
  --measure: 36em;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 18px/1.55 "Barlow", system-ui, sans-serif;
}

a { color: var(--method); }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}

.top {
  display: flex;
  gap: 0.9em;
  padding: 14px var(--gutter);
  font: 500 15px/1.2 "Barlow Semi Condensed", sans-serif;
  color: var(--pencil);
}

.top a { color: var(--ink); font-weight: 600; text-decoration: none; }
.top a:hover { text-decoration: underline; }

/* Pinned scenes: the scene's height is its scroll travel; the stage fits the screen. */
.scene { position: relative; }
/* Two and a half screens each: whole pixels on even-height screens, so every scene starts and ends on a whole pixel. */
.scene[data-scene] { height: 250svh; }

.stage {
  position: sticky;
  top: 0;
  height: 100svh;
  width: 100%;
  overflow: hidden;
}

.stage .drawing {
  display: block;
  width: 100%;
  height: 100%;
}

.title {
  position: absolute;
  max-width: 34rem;
  pointer-events: none;
}

.title h1 {
  margin: 0;
  font: 600 clamp(2.2rem, 5.2vw, 3.8rem)/1.02 "Barlow Semi Condensed", sans-serif;
  letter-spacing: -0.01em;
}

.title .thesis {
  margin: 0.5em 0 0;
  font: 600 clamp(1.15rem, 2vw, 1.4rem)/1.3 "Barlow Semi Condensed", sans-serif;
  color: var(--method);
}

.title .lede { margin: 0.35em 0 0; font-size: clamp(1rem, 1.6vw, 1.15rem); }

.caption {
  max-width: var(--measure);
  margin: 24px auto 64px;
  padding: 0 var(--gutter);
  font-size: 20px;
  line-height: 30px;
  box-sizing: content-box;
}

section > h2:not(.visually-hidden) {
  max-width: var(--measure);
  margin: 0 auto 0.6em;
  padding: 0 var(--gutter);
  box-sizing: content-box;
  font: 600 1.5rem/1.2 "Barlow Semi Condensed", sans-serif;
}

#lineage { padding-top: 2.4em; }

.tree { margin: 0 auto; max-width: 1200px; padding: 0 var(--gutter); }
.tree .drawing { display: block; width: 100%; height: auto; }
.tree figcaption { max-width: var(--measure); margin: 0.8em auto 0; font-size: 1.05rem; }

#close { padding: 3em 0 4em; }

.sheets {
  max-width: 1100px;
  margin: 0 auto 2.4em;
  padding: 0 var(--gutter);
  display: grid;
  gap: 1.4em;
}

.sheets .run { display: grid; gap: 0.5em; }

.sheets .run-label {
  font: 600 0.95rem/1.2 "Barlow Semi Condensed", sans-serif;
  color: var(--pencil);
}

.sheets .tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.2em, 1fr));
  gap: 0.5em;
}

.sheets .tile {
  border: 1px solid var(--rule);
  border-top: 3px solid var(--method);
  padding: 0.45em 0.6em 0.5em;
  font: 500 0.95rem/1.35 "Barlow Semi Condensed", sans-serif;
  background: var(--paper);
}

.sheets .tile b { display: block; font-weight: 600; font-size: 1.15rem; }

.sheets .tile.excluded {
  border-top-color: var(--excluded);
  color: var(--excluded);
}

.sheets .tile.excluded b { text-decoration: line-through; }

.sheets .reason {
  font: 500 0.95rem/1.4 "Barlow Semi Condensed", sans-serif;
  color: var(--excluded);
}

.note,
.back,
.film {
  max-width: var(--measure);
  margin: 0 auto 1.2em;
  padding: 0 var(--gutter);
  box-sizing: content-box;
}

.film video { display: block; width: 100%; height: auto; background: var(--water); }
.film figcaption { margin-top: 0.5em; font-size: 0.98rem; color: var(--pencil); }

.back a { font-weight: 600; }

/* Reduced motion: stills, no pinning. */
.stills { display: grid; gap: 1.2em; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.stills .drawing { display: block; width: 100%; height: auto; border: 1px solid var(--rule); }
.stills .title-still { max-width: 34rem; }
.stills .title-still h1 { margin: 0.4em 0 0; font: 600 clamp(2.2rem, 5.2vw, 3.8rem)/1.02 "Barlow Semi Condensed", sans-serif; }
.stills .title-still p { margin: 0.4em 0 0; }
.stills .title-still .thesis { font-weight: 600; color: var(--method); }

/* Capture mode: only the film stage. */
html[data-capture] body > :not(#film) { display: none !important; }
#film { position: fixed; inset: 0; background: var(--paper); overflow: hidden; }
#film .layer { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
#film .captions { position: absolute; left: 0; right: 0; bottom: 0; border-top: 1px solid var(--rule); }
#film .captions p {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: calc(var(--u) * 5px) calc(var(--u) * 6px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  font: 600 calc(var(--u) * 4.9px)/1.16 "Barlow Semi Condensed", sans-serif;
  color: var(--ink);
}
#film .captions p[data-tone="caution"] { color: var(--caution); }
#film .captions p[data-tone="method"] b { color: var(--method); }
#film .captions p[data-tone="fork"] b { color: var(--fork); }
#film .captions s { text-decoration-thickness: 0.08em; color: var(--pencil); }
#film .captions b { font-weight: 600; color: var(--method); }
#film .captions .big { font-size: calc(var(--u) * 7.4px); line-height: 1.05; }
#film .captions .sub { margin-top: 0.4em; font-size: calc(var(--u) * 3.6px); color: var(--method); }
#film .title { z-index: 2; max-width: none; }
#film .title h1 { font-size: calc(var(--f) * 2.3px); }
#film .title .thesis { font-size: calc(var(--f) * 1.05px); }
#film .title .lede { font-size: calc(var(--f) * 0.9px); }
