/* ==========================================================================
   The Shot List / Top Gun: Maverick (2022)
   Design system: "Carrier deck, golden hour, through the HUD"
   A near-black blue-grey ground, off-white type and ONE accent: afterburner
   orange, which is also the colour of every HUD line. Saira Condensed for
   titles, Source Serif 4 for reading, JetBrains Mono for labels, captions
   and readouts. The hero (sky and HUD), the cockpit diagram and the frame
   shape demo are drawn by page.js; the drawings and the sign-off by art.js.
   Text and pictures are simply there: nothing fades in on scroll. The hero
   settles once on load, the drawings draw on once (art.js), and the two
   interactives move only when the reader asks.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --bg: #0f1317;
  --bg-2: #131920;
  --bg-3: #182029;
  --bg-4: #1f2934;
  --text: #eef0f2;
  --text-2: #b9c1c9;
  --text-3: #8a949e;
  --accent: #f08a24;
  --accent-hi: #f7aa55;
  --accent-line: rgba(240, 138, 36, 0.55);
  --accent-soft: rgba(240, 138, 36, 0.28);
  --accent-faint: rgba(240, 138, 36, 0.12);
  --rule: rgba(238, 240, 242, 0.1);
  --rule-2: rgba(238, 240, 242, 0.2);
  /* names art.js may read */
  --ink: var(--bg);
  --line: var(--accent);
  --orange: var(--accent);

  --f-display: "Saira Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --f-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --fs-body: clamp(18px, 0.45vw + 15.4px, 21px);
  --measure: 66ch;
  --wide: 1360px;
  --gutter: 16px;
  --air: clamp(4.5rem, 10vw, 9rem);
  --ease: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 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(--bg);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: var(--fs-body);
  font-optical-sizing: auto;
  line-height: 1.7;
  overflow-wrap: break-word;
  font-kerning: normal;
  -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; }
.nw { white-space: nowrap; }
button { font: inherit; color: inherit; }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 0.2em;
}
a:hover { color: var(--accent-hi); }

::selection { background: var(--accent); color: var(--bg); }

:focus-visible {
  outline: 1.5px solid var(--accent);
  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(--accent);
  color: var(--bg);
  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: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* ---------- The brand mark: a flight path marker ---------- */
.brand-mark {
  position: relative;
  flex: none;
  width: 28px;
  height: 16px;
  background: linear-gradient(var(--accent), var(--accent)) 50% 0 / 1.5px 5px no-repeat;
}
.brand-mark::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 5px;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
}
.brand-mark::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 9.25px;
  height: 1.5px;
  background: linear-gradient(90deg, var(--accent) 0 8px, transparent 8px 20px, var(--accent) 20px);
}

/* ==========================================================================
   Hero: a golden-hour sky seen through the HUD (page.js draws .hero-art)
   ========================================================================== */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  /* until (or unless) page.js draws the sky */
  background:
    radial-gradient(ellipse 46% 22% at 64% 50%, rgba(247, 170, 85, 0.5), rgba(240, 138, 36, 0) 70%),
    linear-gradient(180deg, #0f1317 0%, #18202a 26%, #2c2a2d 40%, #6a3e22 47%, #b8662a 50.5%, #1d1c1f 51%, #13171b 64%, #0f1317 100%);
}
@media (min-width: 720px) {
  .hero { min-height: max(100svh, 660px); }
}
.hero-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero-art > svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.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(--text);
  text-decoration: none;
}
.brand:hover { color: var(--accent-hi); }
.brand-name {
  font: 600 15px/1 var(--f-display);
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.masthead-meta {
  font: 500 11px/1 var(--f-mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-2);
}
@media (max-width: 420px) {
  .brand-name { font-size: 14px; letter-spacing: 0.24em; }
  .masthead-meta { display: none; }
}

/* the HUD's field of view; the title sits in its lower part, under the
   horizon page.js lays on the painted one */
.hero-hud {
  position: relative;
  z-index: 2;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: clamp(300px, 54svh, 600px);
  padding: 0 var(--gutter);
  container-type: inline-size;
}
.hero-title {
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
  font-family: var(--f-display);
  font-weight: 600;
  line-height: 0.88;
  text-align: center;
  text-transform: uppercase;
  color: var(--text);
  text-shadow: 0 0 0.35em rgba(15, 19, 23, 0.55);
}
.ht-1 {
  display: block;
  margin-bottom: 0.32em;
  padding-left: 0.42em;
  font-size: clamp(17px, 2.2cqi + 8px, 40px);
  font-weight: 500;
  letter-spacing: 0.42em;
  color: var(--accent);
}
/* MAVERICK fills the field: 8 condensed capitals are about 4.4em with the
   tracking, so 100cqi / 4.7 leaves air either side */
.ht-2 {
  display: block;
  padding-left: 0.06em;
  font-size: min(calc(100cqi / 4.7), 212px);
  letter-spacing: 0.06em;
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: clamp(18px, 3.2vh, 34px) var(--gutter) calc(clamp(26px, 5vh, 54px) + env(safe-area-inset-bottom, 0px));
  text-align: center;
}
.hero-film,
.hero-dek,
.hero-meta { text-shadow: 0 0 2px rgba(15, 19, 23, 0.9), 0 0 16px rgba(15, 19, 23, 0.8); }
.hero-film {
  margin-right: -0.3em;
  font: 500 clamp(11px, 0.3vw + 9.8px, 13px)/1.4 var(--f-mono);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
}
.hero-dek {
  max-width: 52ch;
  margin: 0.8em auto 0;
  font-size: clamp(17px, 0.5vw + 15px, 21px);
  line-height: 1.55;
  color: var(--text);
  text-wrap: balance;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 22px;
  margin-top: 20px;
  font: 500 11px/1.4 var(--f-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-2);
}
.hero-meta > * { white-space: nowrap; }
.hero-by { color: var(--text); }

/* the title comes up once, with the HUD, on load */
@media (prefers-reduced-motion: no-preference) {
  .js .hero-title { animation: ht-in 1.2s var(--ease-out) 1.1s both; }
}
@keyframes ht-in {
  from { opacity: 0; clip-path: inset(0 50% 0 50%); }
  to { opacity: 1; clip-path: inset(0 0 0 0); }
}

/* HUD drawing classes (page.js) */
.hud-line,
.hud-halo { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.hud-line { stroke: var(--accent); stroke-width: 1.6; }
.hud-line--thin { stroke-width: 1.1; }
.hud-dash { stroke-dasharray: 7 6; }
.hud-halo { stroke: rgba(12, 15, 18, 0.5); stroke-width: 4.2; }
.hud-text {
  font-family: var(--f-mono);
  font-weight: 500;
  fill: var(--accent);
  paint-order: stroke;
  stroke: rgba(12, 15, 18, 0.55);
  stroke-width: 3px;
  stroke-linejoin: round;
  letter-spacing: 0.04em;
}
.hud-text--k { fill: var(--accent); opacity: 0.8; letter-spacing: 0.16em; }
.hud-fill { fill: var(--accent); }
.hud-jet { fill: #0b0f12; }
.hud-carrier { fill: #0c1013; }
.hud-glint { stroke: #f7aa55; stroke-linecap: round; }

/* ==========================================================================
   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.2em; }

.chapter { scroll-margin-top: 0; }
.chapter--intro { padding-top: clamp(5rem, 11vw, 9rem); }
.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.16em, 0.9vw + 0.9em, 1.38em);
  line-height: 1.5;
  color: var(--text);
}

.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.1); }

/* ==========================================================================
   Chapter openers: the frame edge to edge at its own ratio, the number and
   title set over its foot, the slate under them
   ========================================================================== */
.flow > .opener {
  grid-column: full;
  margin-top: 0;
}
.flow > .opener + * { margin-top: clamp(3.5rem, 8vw, 6.5rem); }

.opener {
  position: relative;
  isolation: isolate;
  container-type: inline-size;
}
.op-plate {
  position: relative;
  z-index: -1;
}
.op-plate .still-frame { aspect-ratio: var(--ar, 1.9); }
.opener--scope { --ar: 2.39; }
.opener--imax { --ar: 1.9; }
/* the frame comes up out of the ground at the top and falls back into it
   under the title */
.op-plate .still-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, var(--bg) 0%, rgba(15, 19, 23, 0) 9%),
    linear-gradient(180deg, rgba(15, 19, 23, 0) 58%, rgba(15, 19, 23, 0.55) 78%, rgba(15, 19, 23, 0.9) 93%, var(--bg) 100%);
}
.op-plate.is-missing { display: none; }
.opener--blank { padding-top: clamp(3rem, 8vw, 6rem); border-top: 1px solid var(--rule-2); }

.op-body {
  --op-pad: max(var(--gutter), calc((100cqi - var(--wide)) / 2));
  position: relative;
  padding: 0 var(--op-pad);
}
@media (min-width: 720px) {
  /* the title rides up onto the faded foot of the frame */
  .opener:not(.opener--blank) .op-body { margin-top: calc(-1 * clamp(70px, 9cqi, 170px)); }
}
@media (max-width: 719px) {
  .op-body { margin-top: 14px; }
}
.op-num {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font: 500 clamp(12px, 0.4vw + 10px, 14px)/1 var(--f-mono);
  letter-spacing: 0.16em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.op-num::before {
  content: "";
  align-self: center;
  width: 26px;
  height: 1.5px;
  margin-right: 10px;
  background: var(--accent);
}
.op-of { color: var(--text-3); }
.op-title {
  margin-top: 0.12em;
  font: 600 clamp(44px, 9.4cqi, 168px)/0.92 var(--f-display);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--text);
  text-shadow: 0 0 0.4em rgba(15, 19, 23, 0.45);
}

/* the slate: a strip of HUD labels along a ticked rule */
.op-slate {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 10px;
  margin: clamp(18px, 3vh, 32px) 0 0;
  padding: 15px 0 0;
  list-style: none;
  border-top: 1px solid var(--rule-2);
  font: 500 10.5px/1.3 var(--f-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-2);
}
/* heading-tape ticks along the top rule: short every 12px, long every 60px */
.op-slate::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 7px;
  background:
    repeating-linear-gradient(90deg, var(--accent-line) 0 1px, transparent 1px 60px) 0 0 / auto 7px no-repeat,
    repeating-linear-gradient(90deg, rgba(238, 240, 242, 0.2) 0 1px, transparent 1px 12px) 0 0 / auto 4px no-repeat;
}
.op-slate li {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.op-slate li + li::before {
  content: "";
  flex: none;
  width: 5px;
  height: 5px;
  margin: 0 14px;
  border: 1px solid var(--accent);
  transform: rotate(45deg);
}
.sl-key { color: var(--accent); }
.sl-k { margin-right: 0.6em; color: var(--text-3); }
.sl-fmt { margin-left: 0.9em; color: var(--text); }
@media (max-width: 479px) {
  .op-slate { font-size: 9.5px; letter-spacing: 0.14em; }
  .op-slate li + li::before { margin: 0 9px; }
}
.op-cap {
  max-width: 82ch;
  margin-top: 14px;
  font: 400 12px/1.65 var(--f-mono);
  color: var(--text-3);
  text-wrap: pretty;
}
.op-cap cite { font-style: italic; }

/* 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.3em;
  font: 500 12px/1 var(--f-mono);
  letter-spacing: 0.16em;
  color: var(--accent);
}
.ch-of { color: var(--text-3); }
.ch-title {
  margin-top: 0.4em;
  font: 600 clamp(36px, 5vw + 12px, 110px)/0.95 var(--f-display);
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--text);
}

/* ---------- 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(--accent-line);
  border-radius: 2px;
  background: transparent;
  color: var(--accent);
  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(--accent); color: var(--bg); }

.sn-note {
  display: none;
  font-size: 0.8em;
  line-height: 1.56;
  color: var(--text-2);
  text-wrap: pretty;
  hyphens: manual;
}
.sn-num {
  margin-right: 0.6em;
  font: 500 0.82em/1 var(--f-mono);
  color: var(--accent);
}
.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(--accent);
  color: var(--text-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(--text-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(--accent);
  font-size: 0.8em;
  line-height: 1.56;
  color: var(--text-2);
}
.sn-margin .sn.is-hot .sn-note { color: var(--text); border-left-color: var(--accent); }

/* ==========================================================================
   Frames from the film, at their own ratio: 1.90:1 (IMAX) or 2.39:1 (scope),
   cropped to it, never stretched
   ========================================================================== */
.flow > .still { grid-column: full; }
@media (min-width: 720px) {
  .flow > .still { grid-column: wide; }
  .flow > .still--bleed { grid-column: full; }
}
.still-frame {
  position: relative;
  overflow: hidden;
  background: var(--bg-2);
}
.still--imax .still-frame { aspect-ratio: 1.9 / 1; }
.still--scope .still-frame { aspect-ratio: 2.39 / 1; }
.still-frame > img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.still-frame > img:not([src]) { visibility: hidden; }

/* a still with no file: gone, with no gap (DRAFT = false), or a labelled
   placeholder with ?placeholders */
.still.is-missing,
.set--ratio.is-missing { display: none; }
.show-placeholders .still.is-missing,
.show-placeholders .set--ratio.is-missing,
.show-placeholders .op-plate.is-missing { display: block; }
/* and the text closes up over the gap it leaves */
:root:not(.show-placeholders) .flow > p + .is-missing + p { margin-top: 1.2em; }
.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(--accent-faint), var(--accent-faint)) 50% 50% / 1px 100% no-repeat,
    linear-gradient(var(--accent-faint), var(--accent-faint)) 50% 50% / 100% 1px no-repeat,
    linear-gradient(180deg, var(--bg-3), var(--bg-2));
  color: var(--text-2);
}
.ph-no {
  font: 600 clamp(24px, 5vw, 72px)/0.9 var(--f-display);
  letter-spacing: 0.06em;
  color: var(--accent);
}
.ph-desc {
  max-width: 60ch;
  font: 400 clamp(12px, 0.5vw + 10px, 15px)/1.45 var(--f-mono);
  color: var(--text);
}
.ph-file { font: 400 11px/1.4 var(--f-mono); color: var(--text-3); }

/* ---------- Captions: small mono HUD lines, the tag first ---------- */
.still figcaption,
.art figcaption,
.set figcaption {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  width: min(var(--wide), 100% - 2 * var(--gutter));
  margin: clamp(14px, 1.8vw, 22px) auto 0;
  font: 400 12.5px/1.68 var(--f-mono);
  color: var(--text-2);
}
@media (min-width: 720px) {
  .still:not(.still--bleed) figcaption,
  .art figcaption,
  .set figcaption { width: 100%; }
}
@media (min-width: 900px) {
  .still figcaption,
  .art figcaption,
  .set figcaption {
    grid-template-columns: clamp(170px, 15vw, 220px) minmax(0, 74ch);
    column-gap: clamp(20px, 2.4vw, 40px);
  }
}
.tag {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 1.1em;
  padding-top: 0.15em;
  font: 500 10.5px/1.6 var(--f-mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.tag-no { display: inline-flex; align-items: center; }
.tag-no::before {
  content: "";
  width: 14px;
  height: 1.5px;
  margin-right: 9px;
  background: var(--accent);
}
@media (min-width: 900px) {
  .tag { flex-direction: column; align-items: flex-start; gap: 2px; }
  .tag-fmt { padding-left: 23px; }
}
.tag-fmt { color: var(--text-3); }
.cap { text-wrap: pretty; }
.cap cite { font-style: italic; }

/* ==========================================================================
   Drawings (art.js: orange line on the dark ground, drawn on once)
   ========================================================================== */
.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: 16 / 9;
  background:
    linear-gradient(var(--accent-faint), var(--accent-faint)) 50% 50% / 1px 100% no-repeat,
    linear-gradient(var(--accent-faint), var(--accent-faint)) 50% 50% / 100% 1px no-repeat,
    var(--bg-2);
}

/* ==========================================================================
   Interactive set pieces: the cockpit cameras and the frame shape
   ========================================================================== */
.flow > .set { grid-column: full; }
@media (min-width: 720px) {
  .flow > .set { grid-column: wide; }
}

/* shared controls */
.ck-chip,
.rd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--accent-line);
  border-radius: 2px;
  background: transparent;
  color: var(--text);
  font: 500 11px/1 var(--f-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}
.ck-chip:hover,
.rd-btn:hover { border-color: var(--accent); color: var(--accent-hi); }
.ck-chip[aria-pressed="true"],
.rd-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--bg); }

/* ---------- The cockpit cameras ---------- */
.cockpit {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding-top: clamp(18px, 2.4vw, 30px);
  border-top: 1px solid var(--rule-2);
}
@media (min-width: 1100px) {
  .cockpit {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    grid-template-areas:
      "bar bar"
      "stage read"
      "stage legend";
    grid-template-rows: auto 1fr auto;
    column-gap: clamp(28px, 3vw, 48px);
  }
  .ck-bar { grid-area: bar; }
  .ck-stage { grid-area: stage; }
  .ck-read { grid-area: read; align-self: start; margin-top: 0; }
  .ck-legend { grid-area: legend; }
}
@media (max-width: 719px) {
  .ck-bar,
  .ck-read,
  .ck-legend,
  .ck-list { margin-left: var(--gutter); margin-right: var(--gutter); }
}
.ck-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  margin-bottom: clamp(16px, 2.4vw, 28px);
}
.ck-title,
.rd-title {
  font: 500 11px/1.4 var(--f-mono);
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
}
.ck-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ck-chip { min-width: 54px; padding: 0 10px; flex-direction: column; gap: 3px; }
.ck-chip-id { letter-spacing: 0.1em; font-weight: 600; }
.ck-chip-dir { font-size: 8.5px; letter-spacing: 0.16em; color: var(--text-3); }
.ck-chip[aria-pressed="true"] .ck-chip-dir { color: var(--bg); opacity: 0.75; }
.ck-chip--undoc { border-style: dashed; }
.ck-chip--bodies { min-width: 0; padding: 0 14px; }
@media (max-width: 559px) {
  .ck-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
  .ck-chip { min-width: 0; }
}
.no-js .ck-chips,
.no-js .ck-stage,
.no-js .ck-read,
.no-js .ck-legend { display: none; }

.ck-stage {
  display: grid;
  gap: clamp(10px, 1.6vw, 18px);
  min-width: 0;
}
.ck-view {
  position: relative;
  padding: clamp(8px, 1vw, 12px) 0 0;
  background:
    linear-gradient(rgba(240, 138, 36, 0.05) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(240, 138, 36, 0.05) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--bg-2);
  border: 1px solid var(--rule);
}
.ck-view-k {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  left: 12px;
  top: 10px;
  font: 500 10px/1 var(--f-mono);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-3);
}
.ck-svg { position: relative; }
.ck-svg > svg { display: block; width: 100%; height: auto; overflow: hidden; -webkit-user-select: none; user-select: none; }

/* drawing classes (page.js) */
.ck-air { fill: rgba(238, 240, 242, 0.025); stroke: rgba(238, 240, 242, 0.42); stroke-width: 1.2; stroke-linejoin: round; }
.ck-canopy { fill: rgba(240, 138, 36, 0.035); stroke: rgba(238, 240, 242, 0.32); stroke-width: 1; stroke-dasharray: 5 4; }
.ck-break { fill: none; stroke: rgba(238, 240, 242, 0.42); stroke-width: 1.2; }
.ck-centre { fill: none; stroke: rgba(238, 240, 242, 0.22); stroke-width: 1; stroke-dasharray: 14 5 3 5; }
.ck-seat { fill: var(--bg-3); stroke: rgba(238, 240, 242, 0.5); stroke-width: 1.1; stroke-linejoin: round; }
.ck-person { fill: rgba(238, 240, 242, 0.12); stroke: rgba(238, 240, 242, 0.62); stroke-width: 1.1; stroke-linejoin: round; }
.ck-shield { fill: none; stroke: var(--text-2); stroke-width: 2.4; stroke-linecap: round; }
.ck-panel { fill: rgba(238, 240, 242, 0.06); stroke: rgba(238, 240, 242, 0.4); stroke-width: 1; }
.ck-eject { fill: none; stroke: rgba(238, 240, 242, 0.3); stroke-width: 1; stroke-dasharray: 3 4; }
.ck-eject-head { fill: rgba(238, 240, 242, 0.3); }
.ck-lab {
  font-family: var(--f-mono);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  fill: var(--text-3);
}
.ck-lab--hi { fill: var(--text-2); }
.ck-lead { fill: none; stroke: rgba(238, 240, 242, 0.28); stroke-width: 0.9; }
.ck-cable { fill: none; stroke: var(--accent); stroke-width: 1; stroke-dasharray: 2 3; opacity: 0.4; transition: opacity 200ms ease; }
.ck-cone {
  fill: var(--accent);
  fill-opacity: 0;
  stroke: var(--accent);
  stroke-opacity: 0.16;
  stroke-width: 1;
  stroke-dasharray: 3 3;
  transition: fill-opacity 260ms ease, stroke-opacity 260ms ease;
}
.ck-cam { cursor: pointer; }
.ck-cam .ck-hit { fill: transparent; }
.ck-cam .ck-box { fill: var(--bg); stroke: var(--accent); stroke-width: 1.5; transition: fill 200ms ease; }
.ck-cam--undoc .ck-box { stroke-dasharray: 3 2.4; }
.ck-cam .ck-lens { fill: var(--accent); }
.ck-cam .ck-id {
  font-family: var(--f-mono);
  font-weight: 600;
  letter-spacing: 0.06em;
  fill: var(--accent);
  paint-order: stroke;
  stroke: var(--bg-2);
  stroke-width: 4px;
  stroke-linejoin: round;
}
.ck-cam:hover .ck-box { fill: var(--accent-soft); }
.ck-body { fill: var(--bg); stroke: var(--accent); stroke-width: 1.3; }
.ck-bodies { cursor: pointer; }
.ck-bodies .ck-hit { fill: transparent; }
.ck-bodies:hover .ck-body { fill: var(--accent-soft); }
.cockpit .is-on .ck-cone { fill-opacity: 0.2; stroke-opacity: 1; stroke-dasharray: none; }
.cockpit .is-on .ck-box,
.cockpit .is-on .ck-body { fill: var(--accent); }
.cockpit .is-on .ck-lens { fill: var(--bg); }
.cockpit .ck-cable.is-on { opacity: 1; }

.ck-read {
  margin-top: clamp(16px, 2vw, 22px);
  padding: 14px 0 0 16px;
  border-left: 1.5px solid var(--accent);
  font: 400 12.5px/1.6 var(--f-mono);
  color: var(--text-2);
  min-height: 9.2em;
}
.ck-now { display: flex; align-items: baseline; gap: 12px; color: var(--text); font-size: 13.5px; line-height: 1.45; }
.ck-now-id {
  flex: none;
  font: 600 22px/1 var(--f-display);
  letter-spacing: 0.04em;
  color: var(--accent);
}
.ck-cap,
.ck-pl { margin-top: 8px; }
.ck-k {
  display: inline-block;
  min-width: 6.6em;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.ck-pl { color: var(--text-3); }
.ck-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 16px;
  font: 500 10px/1.4 var(--f-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}
@media (min-width: 1100px) {
  .ck-legend { flex-direction: column; align-self: end; }
}
.ck-leg { display: inline-flex; align-items: center; gap: 10px; }
.ck-leg::before {
  content: "";
  flex: none;
  width: 12px;
  height: 9px;
  border: 1.5px solid var(--accent);
}
.ck-leg--undoc::before { border-style: dashed; }
.ck-leg--scale::before { width: 12px; height: 0; border-width: 1px 0 0; border-color: var(--text-3); }
.ck-list {
  margin-top: 14px;
  padding-left: 0;
  list-style: none;
  font: 400 12.5px/1.6 var(--f-mono);
  color: var(--text-2);
}
.ck-list li + li { margin-top: 8px; }
.ck-li-id { color: var(--accent); font-weight: 600; }
.ck-li-pl { color: var(--text-3); }
.js .ck-list { display: none; }

/* ---------- The frame shape: 2.39:1 inside the 1.90:1 frame ---------- */
/* 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 - 240px) * 1.9));
}
@supports (height: 100svh) {
  .flow > .set--ratio { max-width: min(var(--wide), calc((100svh - 240px) * 1.9)); }
}
@media (max-width: 719px) {
  .flow > .set--ratio { max-width: none; }
}
.ratio-demo {
  --scope: 2.39;
  --imax: 1.9;
  --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, 26px);
}
@media (max-width: 719px) {
  .rd-bar,
  .rd-readout { margin-left: var(--gutter); margin-right: var(--gutter); }
}
.rd-toggle { display: inline-flex; flex-wrap: wrap; gap: 8px; }
.rd-btn { gap: 12px; padding: 0 16px; }
.rd-num { color: var(--accent); letter-spacing: 0.06em; }
.rd-btn[aria-pressed="true"] .rd-num { color: var(--bg); }
.no-js .rd-toggle { display: none; }
@media (max-width: 479px) {
  .rd-toggle { width: 100%; }
  .rd-btn { flex: 1 1 0; }
}

.rd-screen {
  position: relative;
  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);
}
.ratio-demo[data-mode="imax"] .rd-picture { clip-path: inset(0 0 0 0); }
.rd-frame {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--inset);
  bottom: var(--inset);
  pointer-events: none;
}
.ratio-demo[data-mode="imax"] .rd-frame { top: 0; bottom: 0; }
.rd-frame i {
  position: absolute;
  width: clamp(18px, 3vw, 34px);
  height: clamp(14px, 2.2vw, 26px);
  border: 0 solid var(--accent);
}
.rd-frame i:nth-child(1) { left: 10px; top: 10px; border-width: 1.5px 0 0 1.5px; }
.rd-frame i:nth-child(2) { right: 10px; top: 10px; border-width: 1.5px 1.5px 0 0; }
.rd-frame i:nth-child(3) { left: 10px; bottom: 10px; border-width: 0 0 1.5px 1.5px; }
.rd-frame i:nth-child(4) { right: 10px; bottom: 10px; border-width: 0 1.5px 1.5px 0; }
.rd-guide {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 1px dashed rgba(240, 138, 36, 0.75);
  opacity: 0;
  pointer-events: none;
}
.rd-guide--top { top: var(--inset); }
.rd-guide--bottom { bottom: var(--inset); }
.ratio-demo[data-mode="imax"] .rd-guide { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .rd-picture { transition: clip-path 1.1s var(--ease); }
  .rd-frame { transition: top 1.1s var(--ease), bottom 1.1s var(--ease); }
  .rd-guide { transition: opacity 500ms ease; }
  .ratio-demo[data-mode="imax"] .rd-guide { transition-delay: 800ms; }
}
.rd-readout {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 18px;
  margin-top: 14px;
}
.rd-now {
  font: 600 clamp(26px, 2.6vw + 12px, 44px)/1 var(--f-display);
  letter-spacing: 0.04em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.rd-state {
  font: 500 11px/1.5 var(--f-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.ratio-demo[data-mode="scope"] .rd-state--imax,
.ratio-demo[data-mode="imax"] .rd-state--scope { display: none; }

/* ==========================================================================
   Sign-off (art.js)
   ========================================================================== */
.signoff-wrap {
  max-width: calc(1100px + 2 * var(--gutter));
  margin: clamp(5rem, 14vw, 11rem) auto 0;
  padding: 0 var(--gutter) clamp(4rem, 9vw, 7rem);
  text-align: center;
}
.art--signoff { position: relative; width: 100%; }
/* until art.js has drawn it (or if it never does), the name is set plainly */
.art--signoff .art-canvas:empty {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 6;
  background: radial-gradient(ellipse 30% 60% at 50% 50%, rgba(240, 138, 36, 0.08), transparent 70%);
}
.art--signoff .art-canvas:empty::before {
  content: "REZA";
  margin-right: -0.2em;
  font: 600 clamp(56px, 13vw, 168px)/1 var(--f-display);
  letter-spacing: 0.2em;
  color: var(--text);
}
.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(--text-3);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--bg);
}
.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(--text);
  text-decoration: none;
}
.footer-brand:hover { color: var(--accent-hi); }
.footer-name {
  font: 600 15px/1 var(--f-display);
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.colophon {
  max-width: 70ch;
  font: 400 12.5px/1.6 var(--f-mono);
  color: var(--text-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(--accent);
  text-decoration: none;
}
.back-top:hover { color: var(--text); }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .rd-picture,
  .rd-frame,
  .rd-guide,
  .ck-cone,
  .ck-cable { transition: none !important; }
}

/* ---------- Print ---------- */
@media print {
  :root { --text: #111; --text-2: #333; --text-3: #555; }
  html, body { background: #fff; color: #111; font-size: 11.5pt; }
  .progress, .skip-link, .hero-art, .back-top, .art--signoff, .ck-chips, .ck-stage, .ck-read, .ck-legend, .rd-toggle { display: none; }
  .js .ck-list { display: block; }
  .hero { min-height: 0; background: none; color: #111; }
  .hero-title, .op-title { color: #111; text-shadow: none; }
  .op-plate .still-frame::after { display: none; }
  .sn-note { display: block; }
}
