/* ==========================================================================
   The Shot List / Interstellar (2014)
   Design system: "IMAX in the dark"
   Deep space black, starlight text and ONE accent, the warm gold of
   Gargantua's disk. A wide display face set enormous, Newsreader for
   reading, IBM Plex Mono for labels, captions and data. Each chapter opens
   on a full-viewport title card; IMAX frames run edge to edge, scope frames
   run the full content width between hairline letterbox rules, and there is
   a lot of plain black between them, because most of the film's space is
   plain black. One theme. The hero is drawn by gargantua.js, the drawings
   and the sign-off by art.js, the gate diagram and the frame demo by page.js.
   Images are simply there: nothing fades in on scroll. Drawings animate once
   (art.js); the gate diagram and the frame demo move only when asked.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --space: #04050a;
  --space-2: #07080f;
  --space-3: #0b0d15;
  --space-4: #12151f;
  --star: #e9e6df;
  --star-2: #bdb9b0;
  --star-3: #8e8a82;
  --gold: #e8b464;
  --gold-hi: #f3d29b;
  --gold-line: rgba(232, 180, 100, 0.55);
  --gold-soft: rgba(232, 180, 100, 0.28);
  --gold-faint: rgba(232, 180, 100, 0.13);
  --rule: rgba(233, 230, 223, 0.11);
  --rule-2: rgba(233, 230, 223, 0.2);
  --ink: var(--space); /* art.js paints its sheets with this */

  --f-display: "Syncopate", "Michroma", "Eurostile", "Arial", sans-serif;
  --f-body: "Newsreader", Georgia, "Times New Roman", serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --fs-body: clamp(18px, 0.5vw + 15.2px, 22px);
  --measure: 64ch;
  --wide: 1360px;
  --gutter: 16px;
  --air: clamp(5rem, 11vw, 10rem);       /* darkness around every picture */
  --ease: cubic-bezier(0.65, 0, 0.35, 1);

  color-scheme: dark;
}

@media (min-width: 720px) {
  :root { --gutter: clamp(24px, 4vw, 56px); }
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--space);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--space);
  color: var(--star);
  font-family: var(--f-body);
  font-size: var(--fs-body);
  font-optical-sizing: auto;
  line-height: 1.72;
  overflow-wrap: break-word;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
@supports (overflow-x: clip) {
  body { overflow-x: clip; }
}

h1, h2, h3, h4, p, figure, blockquote, dl, dd, ol, ul { margin: 0; }
img, svg, canvas { max-width: 100%; }
cite { font-style: italic; }
strong { font-weight: 600; }
button { font: inherit; color: inherit; }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--gold-line);
  text-underline-offset: 0.2em;
}
a:hover { color: var(--gold-hi); }

::selection { background: var(--gold); color: var(--space); }

:focus-visible {
  outline: 1.5px solid var(--gold);
  outline-offset: 4px;
  border-radius: 1px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 60;
  padding: 10px 14px;
  background: var(--gold);
  color: var(--space);
  font: 600 12px/1 var(--f-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Reading progress ---------- */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: 2px;
  pointer-events: none;
}
.progress-bar {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, rgba(232, 180, 100, 0.45), var(--gold));
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* ---------- Draft notice ---------- */
.draft-bar {
  position: relative;
  z-index: 5;
  background: var(--space-3);
  border-bottom: 1px solid var(--rule-2);
  color: var(--star-2);
  font: 400 13px/1.5 var(--f-mono);
}
.draft-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 9px var(--gutter) 10px;
}
.draft-text { display: inline; }
.draft-text strong {
  margin-right: 6px;
  color: var(--gold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.draft-checks { display: inline; }
.draft-checks summary {
  display: inline;
  margin-left: 8px;
  color: var(--gold);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.draft-checks summary::-webkit-details-marker { display: none; }
.draft-checks ol { max-width: 100ch; margin: 12px 0 6px; padding-left: 2.6em; font-size: 12.5px; }

/* ==========================================================================
   Hero: Gargantua, full screen (gargantua.js)
   ========================================================================== */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: var(--space);
}
@media (min-width: 720px) {
  .hero { min-height: max(100svh, 640px); }
}
/* The still from the author's renderer (a frame captured from gargantua.js,
   same camera and grade): shown until (or unless) the live canvas draws
   over it. A portrait frame is picked for tall screens. */
.hero > picture { display: contents; }
.hero-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
}
canvas#gargantua {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
}
/* gargantua.js may mark the canvas as failed; the still then shows */
canvas#gargantua[hidden],
.hero.no-webgl canvas#gargantua,
.hero[data-gl="off"] canvas#gargantua { display: none; }

.hero-shade {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(4, 5, 10, 0.72) 0%, rgba(4, 5, 10, 0) 18%),
    linear-gradient(0deg, rgba(4, 5, 10, 0.97) 0%, rgba(4, 5, 10, 0.84) 18%, rgba(4, 5, 10, 0.34) 40%, rgba(4, 5, 10, 0) 58%);
}

.masthead {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 20px var(--gutter);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--star);
  text-decoration: none;
}
.brand:hover { color: var(--gold-hi); }
.brand-mark {
  position: relative;
  flex: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
}
.brand-mark::after {
  content: "";
  position: absolute;
  left: -6px;
  right: -6px;
  top: 50%;
  height: 1.5px;
  margin-top: -0.75px;
  background: var(--gold);
  transform: rotate(-8deg);
}
.brand-name {
  font: 700 12px/1 var(--f-display);
  letter-spacing: 0.32em;
  text-transform: uppercase;
}
.masthead-meta {
  font: 500 11px/1 var(--f-mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--star-2);
}
@media (max-width: 420px) {
  .brand-name { font-size: 11px; letter-spacing: 0.26em; }
  .masthead-meta { display: none; }
}

.hero-inner {
  position: relative;
  z-index: 3;
  width: 100%;
  margin-top: auto;
  padding: 0 var(--gutter);
  text-align: center;
  container-type: inline-size;
}
/* a dark halo, invisible on black, keeps small type legible over the disk */
.hero-film,
.hero-dek,
.hero-meta { text-shadow: 0 0 2px rgba(4, 5, 10, 0.9), 0 0 14px rgba(4, 5, 10, 0.85), 0 0 30px rgba(4, 5, 10, 0.6); }
.hero-film {
  font: 500 clamp(11px, 0.35vw + 9.6px, 13.5px)/1.4 var(--f-mono);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
  margin-right: -0.34em;
}
/* INTERSTELLAR fills the width between the gutters: with the tracking and
   its balancing pad the line is ~13em wide, so 100cqi / 13.4 leaves a
   little air either side. */
.hero-title {
  margin: 0.28em 0 0.42em;
  font: 400 min(calc(100cqi / 13.4), 184px)/1 var(--f-display);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--star);
  text-shadow: 0 0 0.6em rgba(4, 5, 10, 0.55);
}
.ht { display: inline-block; padding-left: 0.32em; } /* balances the tracking after the last letter */
.hero-dek {
  max-width: 44ch;
  margin: 0 auto;
  font-size: clamp(17px, 0.5vw + 15px, 21px);
  line-height: 1.55;
  color: var(--star);
  text-wrap: balance;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 22px;
  margin-top: 22px;
  font: 500 11px/1.4 var(--f-mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--star-2);
}
.hero-meta > * { white-space: nowrap; }
.hero-by { color: var(--star); }
.hero-credit {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: clamp(30px, 6vh, 64px) auto 0;
  padding: 0 var(--gutter) calc(18px + env(safe-area-inset-bottom, 0px));
  font: 400 10.5px/1.5 var(--f-mono);
  letter-spacing: 0.08em;
  color: var(--star-3);
  text-align: center;
}
.hero-credit::before {
  content: "";
  display: block;
  width: 1px;
  height: clamp(26px, 5vh, 54px);
  margin: 0 auto 14px;
  background: linear-gradient(180deg, transparent, var(--gold-line));
}

/* the title opens out once, on load */
@media (prefers-reduced-motion: no-preference) {
  .js .hero-title .ht { animation: ht-open 3.2s cubic-bezier(0.2, 0.7, 0.15, 1) 0.15s both; }
  .js .hero-credit::before { animation: plumb-in 1.8s var(--ease) 1.4s both; transform-origin: 50% 0; }
}
@keyframes ht-open {
  from { opacity: 0; letter-spacing: 0.16em; padding-left: 0.16em; filter: blur(7px); }
  to { opacity: 1; letter-spacing: 0.32em; padding-left: 0.32em; filter: blur(0); }
}
@keyframes plumb-in {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

/* ==========================================================================
   The flow grid
   full : edge to edge          wide : the content width (up to 1360px)
   text : the reading measure
   ========================================================================== */
.flow {
  --wide-extra: calc((var(--wide) - var(--measure)) / 2);
  position: relative;
  display: grid;
  grid-template-columns:
    [full-start] minmax(var(--gutter), 1fr)
    [wide-start] minmax(0, var(--wide-extra))
    [text-start] min(var(--measure), 100% - 2 * var(--gutter))
    [text-end] minmax(0, var(--wide-extra))
    [wide-end] minmax(var(--gutter), 1fr)
    [full-end];
}
.flow > * { grid-column: text; min-width: 0; }
.flow > * + * { margin-top: 1.25em; }

.chapter { scroll-margin-top: 0; }
.chapter--intro { padding-top: clamp(6rem, 13vw, 11rem); }
.chapter + .chapter { margin-top: var(--air); }

.flow > p {
  text-wrap: pretty;
  hanging-punctuation: first;
}
@media (max-width: 559px) {
  .flow > p { hyphens: auto; -webkit-hyphens: auto; }
}
.flow > .lede {
  font-size: clamp(1.18em, 0.9vw + 0.9em, 1.42em);
  line-height: 1.5;
  color: var(--star);
}

.flow > :is(figure, aside) { margin-top: var(--air); }
.flow > :is(figure, aside) + * { margin-top: var(--air); }
.flow > :is(figure, aside) + :is(figure, aside) { margin-top: calc(var(--air) * 1.15); }

/* ==========================================================================
   Chapter openers: a title card on a full-viewport still
   ========================================================================== */
.flow > .opener {
  grid-column: full;
  margin-top: 0;
}
.flow > .opener + * { margin-top: clamp(4rem, 9vw, 7.5rem); }

.opener {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: var(--space);
  container-type: inline-size;
}
@media (min-width: 720px) {
  .opener { min-height: max(100svh, 620px); }
}
.op-plate {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--space-2);
}
.opener--blank .op-plate { background: var(--space); }
.op-plate img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus, 50% 50%);
}
/* the frame comes up out of the black at the top and falls slowly back
   to black under the type */
.op-plate::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, var(--space) 0%, rgba(4, 5, 10, 0.55) 5%, rgba(4, 5, 10, 0) 16%),
    linear-gradient(180deg, rgba(4, 5, 10, 0) 30%, rgba(4, 5, 10, 0.34) 46%, rgba(4, 5, 10, 0.72) 62%, rgba(4, 5, 10, 0.93) 80%, var(--space) 100%);
}
/* tall screens: the picture keeps the top of the card, the type sits in
   the black below it */
@media (max-aspect-ratio: 4/5) {
  .op-plate { bottom: 20%; }
  .op-plate::after {
    background:
      linear-gradient(180deg, var(--space) 0%, rgba(4, 5, 10, 0.5) 5%, rgba(4, 5, 10, 0) 14%),
      linear-gradient(180deg, rgba(4, 5, 10, 0) 38%, rgba(4, 5, 10, 0.5) 62%, rgba(4, 5, 10, 0.88) 84%, var(--space) 100%);
  }
}

.op-body {
  /* the type lines up with the content width; the longest word in the
     title (--lw, from the build) always fits its line */
  --op-pad: max(var(--gutter), calc((100cqi - var(--wide)) / 2));
  --op-k: 0.96;
  --op-size: min(calc((100cqi - 2 * var(--op-pad)) / (var(--lw, 10) * var(--op-k) + 0.3)), 11.5cqi);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: 0 var(--op-pad) calc(clamp(26px, 5vh, 60px) + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 720px) {
  .op-body {
    --op-size: min(calc((100cqi - 2 * var(--op-pad) - 44px) / ((var(--lw, 10) + 1.7) * var(--op-k) + 0.3)), 7.4cqi, 150px);
    grid-template-columns: calc(var(--op-size) * 1.7) minmax(0, 1fr);
    column-gap: clamp(20px, 2.4vw, 44px);
    align-items: start;
  }
}
.op-num {
  font: 400 calc(var(--op-size) * 0.62)/1 var(--f-display);
  letter-spacing: 0.04em;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 24px rgba(4, 5, 10, 0.6);
}
@media (min-width: 720px) {
  .op-num { font-size: var(--op-size); line-height: 1.02; }
}
@supports (-webkit-text-stroke: 1px) {
  .op-num {
    color: transparent;
    -webkit-text-stroke: 1px var(--gold);
    text-shadow: none;
  }
}
@media (max-width: 719px) {
  .op-num {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 0.18em;
  }
  .op-num::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--gold-line), rgba(232, 180, 100, 0));
  }
}
.op-title {
  font: 400 var(--op-size)/1.02 var(--f-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--star);
  text-shadow: 0 0 0.5em rgba(4, 5, 10, 0.5);
}

/* the slate: a thin strip of camera-roll data, edged like film */
.op-slate {
  position: relative;
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 10px;
  margin: clamp(24px, 4.5vh, 48px) 0 0;
  padding: 16px 0 0;
  list-style: none;
  border-top: 1px solid rgba(233, 230, 223, 0.24);
  font: 500 10.5px/1.3 var(--f-mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--star-2);
}
/* edge-code ticks along the top rule: a short tick every 12px, a long one every 60px */
.op-slate::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 7px;
  background:
    repeating-linear-gradient(90deg, rgba(233, 230, 223, 0.42) 0 1px, transparent 1px 60px) 0 0 / auto 7px no-repeat,
    repeating-linear-gradient(90deg, rgba(233, 230, 223, 0.22) 0 1px, transparent 1px 12px) 0 0 / auto 4px no-repeat;
}
.op-slate li {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
/* small perforations between the fields */
.op-slate li + li::before {
  content: "";
  flex: none;
  width: 7px;
  height: 5px;
  margin: 0 16px;
  border: 1px solid var(--gold-line);
  border-radius: 1.5px;
}
.sl-k { margin-right: 0.7em; color: var(--star-3); }
.sl-part { color: var(--gold); }
.sl-of { margin-left: 0.15em; color: var(--star-3); }
.sl-fmt { color: var(--star); }
@media (max-width: 479px) {
  .op-slate { font-size: 9.5px; letter-spacing: 0.16em; }
  .op-slate li + li::before { margin: 0 10px; }
}

/* a plain title card, for a chapter that has no opener */
.ch-head {
  grid-column: wide;
  padding: clamp(3rem, 8vw, 6rem) 0 0;
  border-top: 1px solid var(--rule-2);
}
.ch-idx {
  display: flex;
  gap: 0.9em;
  font: 500 11.5px/1 var(--f-mono);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
}
.ch-of { color: var(--star-3); }
.ch-title {
  margin-top: 0.6em;
  font: 400 clamp(28px, 5vw + 8px, 96px)/1.08 var(--f-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--star);
}

/* ---------- Sidenotes ---------- */
.sn { white-space: normal; }
.sn-ref {
  position: relative;
  top: -0.5em;
  margin: 0 0.04em 0 0.1em;
  padding: 0.12em 0.34em;
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  background: transparent;
  color: var(--gold);
  font: 500 0.56em/1 var(--f-mono);
  cursor: pointer;
  vertical-align: baseline;
  transition: background-color 160ms ease, color 160ms ease;
}
.sn-ref::after {
  content: "";
  position: absolute;
  inset: -10px -7px;
}
.sn-ref:hover,
:root:not(.sn-margin) .sn-ref[aria-expanded="true"],
.sn.is-hot .sn-ref { background: var(--gold); color: var(--space); }

.sn-note {
  display: none;
  font-size: 0.8em;
  line-height: 1.56;
  color: var(--star-2);
  text-wrap: pretty;
  hyphens: manual;
}
.sn-num {
  margin-right: 0.6em;
  font: 500 0.82em/1 var(--f-mono);
  color: var(--gold);
}
.no-js .sn-note,
.sn.is-open .sn-note {
  display: block;
  margin: 0.85em 0 0.95em;
  padding: 0.15em 0 0.15em 1.05em;
  border-left: 1px solid var(--gold);
  color: var(--star-2);
}
.sn-margin .sn-note {
  display: block;
  position: absolute;
  top: 0;
  margin: 0;
  padding: 0 0 0 14px;
  border: 0;
  border-left: 1px solid var(--rule-2);
  font-size: 0.72em;
  line-height: 1.52;
  color: var(--star-3);
  transition: color 200ms ease, border-color 200ms ease;
}
.sn-margin .sn.sn-inline .sn-note {
  position: static;
  width: auto;
  margin: 0.85em 0 0.95em;
  padding: 0.15em 0 0.15em 1.05em;
  border-left: 1px solid var(--gold);
  font-size: 0.8em;
  line-height: 1.56;
  color: var(--star-2);
}
.sn-margin .sn.is-hot .sn-note { color: var(--star); border-left-color: var(--gold); }

/* ==========================================================================
   Frames from the film
   imax  : edge to edge at 1.43:1
   scope : the full content width at 2.39:1, between hairline letterbox rules
   ========================================================================== */
.flow > .still--imax { grid-column: full; }
.flow > .still--scope { grid-column: full; }
@media (min-width: 720px) {
  .flow > .still--scope { grid-column: wide; }
}
.still-frame {
  position: relative;
  overflow: hidden;
  background: var(--space-2);
}
.still--imax .still-frame { aspect-ratio: 1.43 / 1; }
.still--scope .still-frame {
  box-sizing: content-box;
  aspect-ratio: 2.39 / 1;
  border-block: clamp(5px, 0.8vw, 10px) solid #000;
  box-shadow: 0 -1px 0 rgba(233, 230, 223, 0.2), 0 1px 0 rgba(233, 230, 223, 0.2);
}
.still-frame img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Placeholder (draft only): the frame number and the scene to grab */
.ph {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: clamp(14px, 3vw, 40px);
  background:
    linear-gradient(var(--gold-faint), var(--gold-faint)) 50% 50% / 1px 100% no-repeat,
    linear-gradient(var(--gold-faint), var(--gold-faint)) 50% 50% / 100% 1px no-repeat,
    linear-gradient(180deg, #0b0d15, #06070c);
  color: var(--star-2);
}
.ph-no {
  font: 700 clamp(22px, 5vw, 72px)/0.9 var(--f-display);
  letter-spacing: 0.12em;
  color: var(--gold);
}
.ph-desc {
  max-width: 60ch;
  font: 400 clamp(12px, 0.5vw + 10px, 15px)/1.45 var(--f-mono);
  color: var(--star);
}
.ph-file { font: 400 11px/1.4 var(--f-mono); color: var(--star-3); }

/* ---------- Captions: small mono, the format tag first ---------- */
.still figcaption,
.plate figcaption,
.art figcaption,
.set figcaption {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  width: min(var(--wide), 100% - 2 * var(--gutter));
  margin: clamp(16px, 2vw, 24px) auto 0;
  font: 400 12.5px/1.7 var(--f-mono);
  color: var(--star-2);
}
@media (min-width: 720px) {
  .still--scope figcaption,
  .art figcaption,
  .set figcaption { width: 100%; }
}
@media (min-width: 900px) {
  .still figcaption,
  .plate figcaption,
  .art figcaption,
  .set figcaption {
    grid-template-columns: clamp(170px, 16vw, 230px) minmax(0, 72ch);
    column-gap: clamp(20px, 2.4vw, 40px);
  }
}
.tag {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 1.2em;
  padding-top: 0.2em;
  font: 500 10.5px/1.6 var(--f-mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}
@media (min-width: 900px) {
  .tag { flex-direction: column; gap: 2px; }
}
.tag-fmt { color: var(--star-3); }
.cap { text-wrap: pretty; }
.cap cite { font-style: italic; }
.plate-credit {
  grid-column: -2 / -1;
  font: 400 11px/1.6 var(--f-mono);
  letter-spacing: 0.03em;
  color: var(--star-3);
}
.plate-credit cite { font-style: normal; }

/* ==========================================================================
   Plates: public-domain photographs, full bleed, never cropped
   ========================================================================== */
.flow > .plate { grid-column: full; }
.plate-frame {
  position: relative;
  overflow: hidden;
  background: var(--space);
}
.plate-frame img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 100vh;
  max-height: 100svh;
  object-fit: contain;
}

/* ==========================================================================
   Drawings (art.js: gold line on black, drawn on once when first seen)
   ========================================================================== */
.flow > .art {
  grid-column: full;
}
@media (min-width: 720px) {
  .flow > .art { grid-column: wide; }
}
.art-canvas { position: relative; width: 100%; }
.art-canvas > svg,
.art-canvas > canvas { display: block; width: 100%; height: auto; }
.art-canvas:empty { aspect-ratio: 14 / 9; background: var(--space-2); }

/* ==========================================================================
   Interactive set pieces: the gate diagram and the frame shape
   ========================================================================== */
.flow > .set {
  grid-column: full;
}
@media (min-width: 720px) {
  .flow > .set { grid-column: wide; }
}

/* shared controls */
.fs-btn,
.fs-run,
.rd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  background: transparent;
  color: var(--star);
  font: 500 11px/1 var(--f-mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}
.fs-btn:hover,
.fs-run:hover,
.rd-btn:hover { border-color: var(--gold); color: var(--gold-hi); }
.fs-btn[aria-pressed="true"],
.fs-run[aria-pressed="true"],
.rd-btn[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--space); }

/* ---------- The gates, to scale ---------- */
.framesize {
  padding: clamp(18px, 2.4vw, 30px) 0 0;
  border-top: 1px solid var(--rule-2);
}
@media (max-width: 719px) {
  .fs-bar,
  .fs-read,
  .fs-table { margin-left: var(--gutter); margin-right: var(--gutter); }
  .framesize .fs-table { width: calc(100% - 2 * var(--gutter)); }
}
.fs-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  margin-bottom: clamp(16px, 2.4vw, 28px);
}
.fs-title {
  font: 500 11px/1.4 var(--f-mono);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
}
.fs-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}
.fs-toggle { display: inline-flex; gap: 8px; }
.fs-run-icon {
  width: 0;
  height: 0;
  border-left: 8px solid currentColor;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}
.fs-run[aria-pressed="true"] .fs-run-icon {
  width: 8px;
  height: 10px;
  border: 0;
  border-left: 2.5px solid currentColor;
  border-right: 2.5px solid currentColor;
}
@media (max-width: 479px) {
  .fs-controls,
  .fs-toggle { width: 100%; }
  .fs-btn,
  .fs-run { flex: 1 1 0; padding: 0 10px; letter-spacing: 0.14em; }
}
.no-js .fs-controls,
.no-js .fs-stage,
.no-js .fs-read { display: none; }

.fs-stage {
  position: relative;
  min-height: 200px;
  background: var(--space);
  -webkit-user-select: none;
  user-select: none;
}
.fs-stage > svg { display: block; width: 100%; height: auto; overflow: hidden; }

/* drawing classes (page.js) */
.fs-grid { stroke: rgba(232, 180, 100, 0.06); stroke-width: 1; }
.fs-film { fill: #0e0f15; stroke: rgba(233, 230, 223, 0.16); stroke-width: 1; }
.fs-perf { fill: var(--space); stroke: rgba(233, 230, 223, 0.22); stroke-width: 0.8; }
.fs-fline { fill: none; stroke: rgba(232, 180, 100, 0.3); stroke-width: 0.8; }
.fs-edge {
  font-family: var(--f-mono);
  font-weight: 500;
  letter-spacing: 0.12em;
  fill: rgba(232, 180, 100, 0.55);
}
.fs-dim-shade { fill: rgba(4, 5, 10, 0.6); }
.fs-gate { fill: none; stroke: var(--gold); stroke-width: 1.4; }
.fs-gate-c { fill: none; stroke: var(--gold); stroke-width: 2.2; stroke-linecap: square; }
.fs-dim { fill: none; stroke: var(--gold); stroke-width: 1; }
.fs-ext { fill: none; stroke: rgba(232, 180, 100, 0.5); stroke-width: 0.8; stroke-dasharray: 3 3; }
.fs-num {
  font-family: var(--f-mono);
  font-weight: 500;
  letter-spacing: 0.08em;
  fill: var(--star);
  paint-order: stroke;
  stroke: var(--space);
  stroke-width: 4px;
  stroke-linejoin: round;
}
.fs-lab {
  font-family: var(--f-mono);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  fill: var(--gold);
}
.fs-lab--dim { fill: var(--star-3); }
.fs-arrow { fill: var(--gold); }
.fs-tile { fill: none; stroke: rgba(233, 230, 223, 0.55); stroke-width: 1; stroke-dasharray: 4 4; }
.fs-copy { fill: rgba(232, 180, 100, 0.18); stroke: var(--gold); stroke-width: 1.6; }
.fs-veil { fill: rgba(4, 5, 10, 0.55); }
.fs-big {
  font-family: var(--f-display);
  font-weight: 400;
  letter-spacing: 0.04em;
  fill: var(--star);
  paint-order: stroke;
  stroke: rgba(4, 5, 10, 0.7);
  stroke-width: 6px;
  stroke-linejoin: round;
}
.fs-over { opacity: 0; }
.fs-copy-g { opacity: 0; }
.framesize[data-mode="over"] .fs-over,
.framesize[data-mode="over"] .fs-copy-g { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .fs-over { transition: opacity 500ms ease; }
  .framesize[data-mode="over"] .fs-over { transition-delay: 750ms; }
  .fs-copy-g { transition: transform 900ms var(--ease), opacity 300ms ease; }
}

.fs-read {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 16px;
  font: 400 12.5px/1.6 var(--f-mono);
  color: var(--star-2);
}
.fs-now { max-width: 64ch; }
.fs-count {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--star-3);
  font-variant-numeric: tabular-nums;
}
.fs-count b { font-weight: 500; color: var(--star); }
.fs-speed { color: var(--gold); }

.fs-table {
  width: 100%;
  margin-top: clamp(18px, 2.4vw, 30px);
  table-layout: fixed;
  border-collapse: collapse;
  font: 400 12.5px/1.45 var(--f-mono);
  color: var(--star-2);
  font-variant-numeric: tabular-nums;
}
.fs-table th,
.fs-table td {
  padding: 10px 14px 10px 0;
  border-top: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
.fs-table thead th {
  border-top: 0;
  padding-bottom: 8px;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}
.fs-table thead th:first-child { width: 22%; }
.fs-table tbody th {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--star-3);
}
.fs-table td { color: var(--star); }
.fs-table tr:last-child > * { border-bottom: 1px solid var(--rule); }
@media (max-width: 559px) {
  .fs-table { font-size: 11.5px; }
  .fs-table th,
  .fs-table td { padding-right: 8px; }
  .fs-table thead th:first-child { width: 24%; }
  .fs-table thead th,
  .fs-table tbody th { font-size: 9.5px; letter-spacing: 0.12em; }
}

/* ---------- The frame: 2.39:1 against 1.43:1 ---------- */
/* sized so the whole screen fits in the window at once */
.flow > .set--ratio {
  justify-self: center;
  width: 100%;
  max-width: min(var(--wide), calc((100vh - 230px) * 1.43));
}
@supports (height: 100svh) {
  .flow > .set--ratio { max-width: min(var(--wide), calc((100svh - 230px) * 1.43)); }
}
@media (max-width: 719px) {
  .flow > .set--ratio { max-width: none; }
}
.ratio-demo {
  --scope: 2.39;
  --imax: 1.43;
  --inset: calc((1 - var(--imax) / var(--scope)) * 50%);
  padding-top: clamp(18px, 2.4vw, 30px);
  border-top: 1px solid var(--rule-2);
}
.rd-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  margin-bottom: clamp(16px, 2.4vw, 28px);
}
@media (max-width: 719px) {
  .rd-bar,
  .rd-credit { margin-left: var(--gutter); margin-right: var(--gutter); }
}
.rd-title {
  font: 500 11px/1 var(--f-mono);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
}
.rd-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rd-btn { gap: 12px; padding: 0 16px; }
.rd-num { color: var(--gold); letter-spacing: 0.08em; }
.rd-btn[aria-pressed="true"] .rd-num { color: var(--space); }
.no-js .rd-toggle { display: none; }
@media (max-width: 479px) {
  .rd-toggle { width: 100%; }
  .rd-btn { flex: 1 1 0; flex-direction: column; gap: 5px; padding: 8px 10px; }
}

.rd-screen {
  position: relative;
  container-type: inline-size;
  aspect-ratio: var(--imax) / 1;
  overflow: hidden;
  background: #000;
  cursor: pointer;
}
.rd-picture {
  position: absolute;
  inset: 0;
  clip-path: inset(var(--inset) 0 var(--inset) 0);
  transition: clip-path 1.25s var(--ease);
}
.ratio-demo[data-mode="imax"] .rd-picture { clip-path: inset(0 0 0 0); }
.rd-picture img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.2);
}
.rd-guide {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 1px dashed rgba(233, 230, 223, 0.5);
  opacity: 0;
  transition: opacity 600ms ease;
  pointer-events: none;
}
.rd-guide--top { top: var(--inset); }
.rd-guide--bottom { bottom: var(--inset); }
.ratio-demo[data-mode="imax"] .rd-guide { opacity: 1; transition-delay: 900ms; }
.rd-readout {
  position: absolute;
  left: clamp(14px, 3cqi, 34px);
  right: clamp(14px, 3cqi, 34px);
  bottom: clamp(12px, 2.6cqi, 30px);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  pointer-events: none;
}
.rd-now {
  font: 400 clamp(18px, 4.4cqi, 48px)/1 var(--f-display);
  letter-spacing: 0.1em;
  color: var(--star);
}
.rd-gain {
  font: 500 clamp(9.5px, 1.2cqi + 6px, 12px)/1.3 var(--f-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0;
  transition: opacity 600ms ease;
}
.ratio-demo[data-mode="imax"] .rd-gain { opacity: 1; transition-delay: 700ms; }
.rd-credit {
  margin-top: 12px;
  font: 400 10.5px/1.4 var(--f-mono);
  letter-spacing: 0.08em;
  color: var(--star-3);
  text-align: right;
}

/* ==========================================================================
   Sign-off (art.js)
   ========================================================================== */
.signoff-wrap {
  max-width: calc(1100px + 2 * var(--gutter));
  margin: clamp(6rem, 16vw, 12rem) auto 0;
  padding: 0 var(--gutter) clamp(4rem, 9vw, 7rem);
  text-align: center;
}
.signoff { position: relative; width: 100%; }
.signoff > svg,
.signoff > canvas { display: block; width: 100%; height: auto; }
/* until art.js has drawn it (or if it never does), the name is set plainly */
.signoff:empty {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 7;
  background: radial-gradient(ellipse 30% 70% at 50% 0%, rgba(232, 180, 100, 0.1), transparent 70%);
}
.signoff:empty::before {
  content: "REZA";
  margin-right: -0.5em;
  font: 400 clamp(44px, 11vw, 140px)/1 var(--f-display);
  letter-spacing: 0.5em;
  color: var(--star);
  opacity: 0.85;
}
.signoff-line {
  margin-top: 22px;
  margin-right: -0.3em;
  font: 500 11px/1 var(--f-mono);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--star-3);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--space);
}
.footer-inner {
  display: grid;
  gap: 18px;
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 36px var(--gutter) calc(36px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 900px) {
  .footer-inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 44px;
  }
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  justify-self: start;
  color: var(--star);
  text-decoration: none;
}
.footer-name {
  font: 700 12px/1 var(--f-display);
  letter-spacing: 0.32em;
  text-transform: uppercase;
}
.colophon {
  max-width: 70ch;
  font: 400 12.5px/1.6 var(--f-mono);
  color: var(--star-3);
}
.back-top {
  justify-self: start;
  padding: 8px 0;
  font: 500 11px/1 var(--f-mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
}
.back-top:hover { color: var(--star); }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .rd-picture,
  .rd-guide,
  .rd-gain,
  .fs-over,
  .fs-copy-g { transition: none !important; }
  .ratio-demo[data-mode="imax"] .rd-guide,
  .ratio-demo[data-mode="imax"] .rd-gain { transition-delay: 0s; }
}

/* ---------- Print ---------- */
@media print {
  :root { --star: #111; --star-2: #333; --star-3: #555; }
  html, body { background: #fff; color: #111; font-size: 11.5pt; }
  .progress, .skip-link, .draft-bar, canvas#gargantua, .hero-shade, .back-top, .signoff, .fs-controls, .fs-stage, .fs-read, .rd-toggle { display: none; }
  .hero { min-height: 0; color: #111; }
  .hero-fallback { position: static; height: auto; filter: none; }
  .opener { min-height: 0; color: #111; }
  .op-plate { position: static; }
  .op-plate::after { display: none; }
  .op-title, .op-slate { color: #111; text-shadow: none; }
  .sn-note { display: block; }
}
