/* starlume production studio: site styles.
   Layout: one editorial frame (74rem). Section heads put a mono "slate" in a narrow left column on wide
   screens; figures, tables and charts use the full frame. One dark film strip (the contact sheet) is the
   page's single bold element. No third-party fonts: display serif, system sans, system mono. */

:root {
  --paper: #f3f5f6;        /* page: cool paper, a little ice in it */
  --sheet: #ffffff;        /* raised panels, tables */
  --ink: #142029;          /* text, slate navy */
  --ink-2: #44525d;        /* secondary text */
  --muted: #5d6a75;        /* captions, labels */
  --rule: #d5dce1;
  --rule-strong: #a9b5be;
  --accent: #b3262d;       /* safelight red: gates and the few figures that matter */
  --accent-ink: #ffffff;
  --ice: #2a78d6;          /* The Last Ice Harvest */
  --ice-2: #86b6ef;
  --dot: #e34948;          /* The Little Red Dots */
  --dot-2: #f2a3a2;
  --hatch: #8794a0;
  --badge-bg: #142029;
  --badge-fg: #f3f5f6;
  --strip: #121a21;        /* contact sheet film strip */
  --strip-ink: #c9d3da;
  --strip-muted: #8e9ba6;
  --code-bg: #e8edf0;
  --on-fill: #ffffff;
  --focus: #2a78d6;

  --display: "Palatino Linotype", Palatino, "Book Antiqua", "Iowan Old Style", "URW Palladio L", P052, Georgia, serif;
  --text: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  --step--2: 0.75rem;
  --step--1: 0.8125rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.55rem;
  --step-3: clamp(1.85rem, 1.35rem + 2vw, 2.5rem);
  --step-4: clamp(2.25rem, 1.35rem + 3.6vw, 3.75rem);

  --frame: 74rem;
  --measure: 41rem;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e1419;
    --sheet: #151d24;
    --ink: #e3e9ed;
    --ink-2: #b0bcc5;
    --muted: #8f9ca7;
    --rule: #25313b;
    --rule-strong: #3a4955;
    --accent: #f0646a;
    --accent-ink: #1a0a0b;
    --ice: #3987e5;
    --ice-2: #24558f;
    --dot: #e66767;
    --dot-2: #8a3537;
    --hatch: #6f7d89;
    --badge-bg: #e3e9ed;
    --badge-fg: #0e1419;
    --strip: #1a242d;
    --strip-ink: #d3dce2;
    --strip-muted: #93a1ac;
    --code-bg: #121a21;
    --on-fill: #ffffff;
    --focus: #6fa8ea;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0e1419;
  --sheet: #151d24;
  --ink: #e3e9ed;
  --ink-2: #b0bcc5;
  --muted: #8f9ca7;
  --rule: #25313b;
  --rule-strong: #3a4955;
  --accent: #f0646a;
  --accent-ink: #1a0a0b;
  --ice: #3987e5;
  --ice-2: #24558f;
  --dot: #e66767;
  --dot-2: #8a3537;
  --hatch: #6f7d89;
  --badge-bg: #e3e9ed;
  --badge-fg: #0e1419;
  --strip: #1a242d;
  --strip-ink: #d3dce2;
  --strip-muted: #93a1ac;
  --code-bg: #121a21;
  --on-fill: #ffffff;
  --focus: #6fa8ea;
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(4.5rem + env(safe-area-inset-top, 0px)); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--text);
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 30;
  background: var(--paper);
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 400; line-height: 1.15; margin: 0; text-wrap: balance; color: var(--ink); }
p, ul, ol, dl, figure, table { margin: 0; }
p { text-wrap: pretty; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; text-decoration-color: var(--rule-strong); }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }
strong { font-weight: 650; }
code, .mono { font-family: var(--mono); font-size: 0.86em; }
abbr[title] { text-decoration: underline dotted; text-underline-offset: 0.2em; }
.num { font-variant-numeric: tabular-nums; }

.skip {
  position: absolute; left: var(--gutter-l); top: -3rem; z-index: 40;
  background: var(--ink); color: var(--paper); padding: 0.5rem 0.75rem;
}
.skip:focus { top: calc(0.5rem + env(safe-area-inset-top, 0px)); }

.frame {
  max-width: var(--frame);
  margin-inline: auto;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}
.slate {
  font: 500 var(--step--2)/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.measure { max-width: var(--measure); }
.stack { display: grid; gap: 1rem; }
.stack-lg { display: grid; gap: clamp(2rem, 4vw, 3rem); }

/* ------------------------------------------------------------------ masthead */
.masthead {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.masthead-inner {
  display: flex;
  align-items: center;
  gap: 1rem 1.5rem;
  min-height: 3.5rem;
}
.wordmark {
  display: inline-flex; align-items: baseline; gap: 0.5rem;
  font-family: var(--display); font-size: 1.3rem; letter-spacing: 0.01em;
  text-decoration: none; white-space: nowrap; color: var(--ink);
}
.wordmark:hover { color: var(--ink); }
.wm-dot {
  width: 0.55rem; height: 0.55rem; border-radius: 50%;
  background: var(--dot); align-self: center;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot) 22%, transparent);
}
.wm-sub { font: 500 var(--step--2)/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.masthead nav { min-width: 0; flex: 1; overflow-x: auto; scrollbar-width: none; }
.masthead nav::-webkit-scrollbar { display: none; }
.masthead nav ul { display: flex; gap: 0.25rem; list-style: none; padding: 0; justify-content: flex-end; }
.masthead nav a {
  display: block; padding: 0.4rem 0.6rem; border-radius: 3px;
  font-size: 0.9rem; text-decoration: none; color: var(--ink-2); white-space: nowrap;
}
.masthead nav a:hover { color: var(--ink); background: var(--code-bg); }
.theme-toggle {
  flex: none;
  font: 500 var(--step--2)/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-2); background: transparent;
  border: 1px solid var(--rule-strong); border-radius: 3px;
  padding: 0.45rem 0.6rem; cursor: pointer; min-width: 4.2rem;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-2); }
@media (max-width: 47.99rem) {
  .wm-sub { display: none; }
  .masthead-inner { gap: 0.75rem; }
  .masthead nav ul { justify-content: flex-start; }
}

/* ------------------------------------------------------------------ hero */
.hero { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2.5rem, 5vw, 4rem); }
.hero-grid { display: grid; gap: 1.25rem; }
.hero h1 {
  font-size: var(--step-4);
  line-height: 1.06;
  letter-spacing: -0.015em;
  max-width: 21ch;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.lede { font-size: var(--step-1); line-height: 1.55; color: var(--ink-2); max-width: 44rem; }
.hero-facts {
  display: flex; flex-wrap: wrap; gap: 0.5rem 2rem;
  font: 500 var(--step--1)/1.5 var(--mono); color: var(--muted);
  padding-top: 0.25rem;
}
.hero-facts b { color: var(--ink); font-weight: 600; }

.films {
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
  margin-top: clamp(2rem, 4vw, 3rem);
}
@media (min-width: 52rem) { .films { grid-template-columns: 1fr 1fr; } }
.film { display: grid; gap: 1rem; align-content: start; min-width: 0; }
.film-still { position: relative; display: block; border-radius: 2px; overflow: hidden; }
.film-still img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--strip); }
.film-still::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
}
.film--ice .film-still::after { background: var(--ice); }
.film--dot .film-still::after { background: var(--dot); }
.film-title { font-size: var(--step-2); }
.film-title a { text-decoration: none; }
.film-line { color: var(--ink-2); }
.film-facts {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding-block: 0.75rem;
}
.film-facts dt { font: 500 var(--step--2)/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.film-facts dd { margin: 0.2rem 0 0; font-family: var(--display); font-size: 1.35rem; font-variant-numeric: tabular-nums lining-nums; }
@media (max-width: 30rem) { .film-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.film-note { font-size: 0.95rem; color: var(--muted); }

/* badges drawn on images */
.badge {
  position: absolute; top: 0.6rem; left: 0.6rem; z-index: 2;
  font: 600 0.6875rem/1 var(--mono); letter-spacing: 0.07em; text-transform: uppercase;
  background: var(--badge-bg); color: var(--badge-fg);
  padding: 0.38rem 0.5rem 0.36rem; border-radius: 2px;
  display: inline-flex; align-items: center; gap: 0.4rem;
}
.badge--ai::before {
  content: ""; width: 0.45rem; height: 0.45rem; border-radius: 1px;
  border: 1.5px solid currentColor; transform: rotate(45deg);
}

/* ------------------------------------------------------------------ contact sheet (the film strip) */
.contact {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  background: var(--strip);
  color: var(--strip-ink);
  border-radius: 3px;
  padding: clamp(0.9rem, 2vw, 1.4rem);
  display: grid; gap: 0.9rem;
}
.contact-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem;
  font: 500 var(--step--2)/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--strip-muted);
}
.key { display: inline-flex; flex-wrap: wrap; gap: 0.4rem 1rem; align-items: center; }
.key span { display: inline-flex; align-items: center; gap: 0.45rem; }
.key i { width: 0.6rem; height: 0.6rem; border-radius: 50%; display: inline-block; }
.k-ice { background: var(--ice); }
.k-dot { background: var(--dot); }
.contact-grid {
  list-style: none; padding: 0;
  display: grid; gap: clamp(0.5rem, 1.2vw, 0.9rem);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 48rem) { .contact-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cell { display: grid; gap: 0.4rem; min-width: 0; }
.cell-img { position: relative; }
.cell-img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 1px; background: #000; }
.cell-img .badge { top: 0.35rem; left: 0.35rem; font-size: 0.625rem; padding: 0.3rem 0.4rem; }
.contact .badge { background: var(--strip-ink); color: var(--strip); }
.cell-cap {
  display: flex; justify-content: space-between; gap: 0.5rem; align-items: baseline;
  font: 500 0.6875rem/1.35 var(--mono); letter-spacing: 0.03em; color: var(--strip-muted);
}
.cell-cap b { color: var(--strip-ink); font-weight: 600; }
.cell-cap .film-key { display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; }
.cell-cap .film-key::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; flex: none; }
.is-ice .film-key::before { background: var(--ice); }
.is-dot .film-key::before { background: var(--dot); }
.cell-src { font: 400 0.6875rem/1.35 var(--mono); color: var(--strip-muted); overflow-wrap: anywhere; }
.contact-note { font-size: 0.875rem; color: var(--strip-muted); max-width: 52rem; }
.contact-note a { color: var(--strip-ink); text-decoration-color: var(--strip-muted); }
.contact-note a:hover { color: #ffffff; }

/* ------------------------------------------------------------------ sections */
.section { padding-block: clamp(3rem, 7vw, 5.5rem); border-top: 1px solid var(--rule); }
.section--sheet { background: var(--sheet); --chart-bg: var(--sheet); }
.section-head { display: grid; gap: 0.75rem; margin-bottom: clamp(1.75rem, 4vw, 2.75rem); }
.section-head h2 { font-size: var(--step-3); letter-spacing: -0.01em; max-width: 24ch; }
.section-head .intro { color: var(--ink-2); max-width: var(--measure); }
.section-head .intro + .intro { margin-top: -0.25rem; }
@media (min-width: 62rem) {
  .section-head { grid-template-columns: 13rem minmax(0, 1fr); column-gap: 2.5rem; }
  .section-head .slate { grid-row: 1 / span 3; padding-top: 0.85rem; border-top: 2px solid var(--ink); align-self: start; }
  .section-head > :not(.slate) { grid-column: 2; }
}
@media (max-width: 61.99rem) {
  .section-head .slate { border-top: 2px solid var(--ink); padding-top: 0.6rem; justify-self: start; }
}
.sub { display: grid; gap: 1rem; align-content: start; }
.frame > * + .sub { margin-top: clamp(2.5rem, 5vw, 3.5rem); }
.sub h3 { font-size: var(--step-2); }
.sub > p { max-width: var(--measure); color: var(--ink-2); }
h4 { font-family: var(--text); font-size: var(--step--1); font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }

.cols-2 { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); }
@media (min-width: 52rem) { .cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cols-2 > * { min-width: 0; }

.ticks { list-style: none; padding: 0; display: grid; gap: 0.55rem; }
.ticks li { position: relative; padding-left: 1.25rem; }
.ticks li::before {
  content: ""; position: absolute; left: 0.1rem; top: 0.62em;
  width: 0.45rem; height: 0.45rem; border: 1.5px solid var(--ink-2); border-radius: 50%;
}
.note { font-size: 0.9rem; color: var(--muted); max-width: var(--measure); }
.callout {
  border-left: 3px solid var(--accent);
  padding: 0.25rem 0 0.25rem 1rem;
  max-width: var(--measure);
}
.callout p { font-family: var(--display); font-size: var(--step-1); line-height: 1.45; }

/* ------------------------------------------------------------------ process */
.flow {
  position: relative;
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  margin-bottom: clamp(2rem, 4vw, 3rem);
  padding-top: 1.6rem;
}
.flow::before {
  content: ""; position: absolute; left: 4.5%; right: 4.5%; top: calc(1.6rem + 0.9rem);
  height: 2px; background: var(--rule-strong);
}
.flow-step { position: relative; display: grid; justify-items: center; gap: 0.5rem; text-align: center; min-width: 0; }
.node {
  position: relative; z-index: 1;
  width: 1.8rem; height: 1.8rem; display: grid; place-items: center;
  font: 600 0.75rem/1 var(--mono); border-radius: 50%;
  background: var(--paper); color: var(--ink); border: 2px solid var(--ink-2);
}
.flow-step.is-producer .node { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.flow-step.is-gate .node { border-radius: 3px; transform: rotate(45deg); background: var(--accent); border-color: var(--accent); color: var(--accent-ink); width: 1.6rem; height: 1.6rem; }
.flow-step.is-gate .node span { transform: rotate(-45deg); }
.flow-step.is-auto .node { border-style: dashed; color: var(--ink-2); }
.flow-label { font-size: 0.78rem; line-height: 1.25; color: var(--ink-2); overflow-wrap: anywhere; }
.flow-step.is-gate .flow-label { color: var(--accent); font-weight: 600; }
.flow-spend {
  position: absolute; top: 0; bottom: -0.25rem; left: calc(100% / 11 * 5);
  border-left: 1.5px dashed var(--accent);
}
.flow-spend span {
  position: absolute; top: -0.1rem; left: 0.4rem; white-space: nowrap;
  font: 600 var(--step--2)/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent);
}
@media (max-width: 40rem) {
  .flow-label { display: none; }
  .node { width: 1.45rem; height: 1.45rem; font-size: 0.6875rem; }
  .flow-step.is-gate .node { width: 1.25rem; height: 1.25rem; }
  .flow::before { top: calc(1.6rem + 0.72rem); }
}
.flow-legend {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: -1rem 0 2rem;
  font-size: 0.85rem; color: var(--ink-2);
}
.flow-legend span { display: inline-flex; align-items: center; gap: 0.5rem; }
.flow-legend i { width: 0.9rem; height: 0.9rem; border-radius: 50%; border: 2px solid var(--ink-2); display: inline-block; }
.flow-legend .lg-producer { background: var(--ink); border-color: var(--ink); }
.flow-legend .lg-gate { background: var(--accent); border-color: var(--accent); border-radius: 2px; transform: rotate(45deg) scale(0.85); }
.flow-legend .lg-auto { border-style: dashed; }

.stages { list-style: none; padding: 0; display: grid; }
.stage {
  display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: 0 1rem;
  padding-block: 1.15rem; border-top: 1px solid var(--rule);
}
.stage:last-child { border-bottom: 1px solid var(--rule); }
.stage-num { font: 400 1.6rem/1 var(--display); color: var(--muted); font-variant-numeric: lining-nums tabular-nums; padding-top: 0.15rem; }
.stage.is-gate .stage-num { color: var(--accent); }
.stage-body { display: grid; gap: 0.4rem; min-width: 0; }
@media (min-width: 56rem) {
  .stage-body { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) 13rem; gap: 0.3rem 2rem; align-items: start; }
  .stage-body h3, .stage-body .stage-what { grid-column: 1; }
  .stage-out { grid-column: 2; grid-row: 1 / span 2; }
  .who { grid-column: 3; grid-row: 1 / span 2; justify-self: start; }
}
.stage h3 { font-size: var(--step-1); }
.stage-what { color: var(--ink-2); font-size: 0.98rem; }
.stage-out { font: 400 0.82rem/1.5 var(--mono); color: var(--ink-2); overflow-wrap: anywhere; }
.stage-out b { display: block; font: 600 var(--step--2)/1.4 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.15rem; }
.who {
  display: inline-block; justify-self: start;
  font: 600 var(--step--2)/1.3 var(--mono); letter-spacing: 0.05em; text-transform: uppercase;
  padding: 0.35rem 0.55rem; border-radius: 2px;
  border: 1px solid var(--ink-2); color: var(--ink);
}
.who--gate { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.who--producer { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.who--auto { border-style: dashed; color: var(--ink-2); }
.who--agents { border-color: var(--ice); color: var(--ink); }
.spend-line {
  display: flex; align-items: center; gap: 0.75rem;
  padding-block: 0.9rem;
  font: 600 var(--step--2)/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent);
}
.spend-line::before, .spend-line::after { content: ""; flex: 1; border-top: 1.5px dashed var(--accent); }
.spend-line::before { flex: 0 0 2.5rem; }

.practice { display: grid; gap: 1.25rem; margin-top: clamp(2.5rem, 5vw, 3.5rem); }
@media (min-width: 48rem) { .practice { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 72rem) { .practice { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.practice > div { border-top: 2px solid var(--ink); padding-top: 0.75rem; display: grid; gap: 0.4rem; align-content: start; }
.practice h3 { font-size: 1.15rem; }
.practice p { font-size: 0.95rem; color: var(--ink-2); }

/* ------------------------------------------------------------------ tools */
.tools { display: grid; gap: clamp(1.75rem, 3vw, 2.5rem) clamp(1.5rem, 3vw, 2.75rem); }
@media (min-width: 54rem) { .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tool { display: grid; gap: 0.6rem; align-content: start; border-top: 1px solid var(--rule-strong); padding-top: 1rem; min-width: 0; }
.tool-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 1rem; }
.tool h3 { font-size: var(--step-2); }
.tool .role { font: 500 var(--step--2)/1.4 var(--mono); letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.tool > p { color: var(--ink-2); }
.specs { display: grid; gap: 0; font-size: 0.95rem; }
.specs > div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.75rem; padding-block: 0.45rem; border-top: 1px dotted var(--rule-strong); }
.specs dt { font: 500 var(--step--2)/1.6 var(--mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.specs dd { margin: 0; min-width: 0; }
@media (max-width: 26rem) { .specs > div { grid-template-columns: minmax(0, 1fr); gap: 0.1rem; } }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-top: 2px solid var(--ink); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
caption { text-align: left; caption-side: bottom; padding-top: 0.6rem; font-size: 0.85rem; color: var(--muted); }
th, td { text-align: left; vertical-align: top; padding: 0.62rem 0.9rem 0.62rem 0; border-bottom: 1px solid var(--rule); }
th:last-child, td:last-child { padding-right: 0; }
thead th { font: 600 var(--step--2)/1.35 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); border-bottom-color: var(--rule-strong); }
tbody th { font-weight: 600; color: var(--ink); }
td.r, th.r { text-align: right; }
tr.total th, tr.total td { border-top: 1.5px solid var(--ink); font-weight: 650; }
.t-wide { min-width: 40rem; }
.t-mid { min-width: 32rem; }
td code { font-size: 0.82rem; }
.film-th { display: inline-flex; align-items: center; gap: 0.45rem; }
.film-th::before { content: ""; width: 0.6rem; height: 0.6rem; border-radius: 50%; flex: none; }
.film-th.ice::before { background: var(--ice); }
.film-th.dot::before { background: var(--dot); }

/* ------------------------------------------------------------------ charts (HTML bars, drawn to scale) */
.chart { display: grid; gap: 0.9rem; }
.chart-head { display: grid; gap: 0.25rem; }
.chart-title { font-family: var(--display); font-size: var(--step-1); }
.chart-sub { font-size: 0.88rem; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; font-size: 0.85rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 0.45rem; }
.sw { width: 0.85rem; height: 0.85rem; border-radius: 2px; display: inline-block; flex: none; }
.sw-main { background: linear-gradient(90deg, var(--ice) 50%, var(--dot) 50%); }
.sw-agents { background: linear-gradient(90deg, var(--ice-2) 50%, var(--dot-2) 50%); }
.sw-hatch { background: repeating-linear-gradient(45deg, var(--hatch) 0 2px, transparent 2px 5px); outline: 1px solid var(--hatch); outline-offset: -1px; }
.sw-ice { background: var(--ice); }
.sw-dot { background: var(--dot); }
.sw-range { background: var(--rule-strong); }

.axis { position: relative; height: 1.2rem; font: 500 0.6875rem/1 var(--mono); color: var(--muted); }
.axis span { position: absolute; top: 0.3rem; transform: translateX(-50%); white-space: nowrap; }
.axis span:first-child { transform: none; }
.axis span:last-child { transform: translateX(-100%); }
.plot { position: relative; }
.grid-lines { position: absolute; inset: 0; pointer-events: none; }
.grid-lines i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--rule); }

/* stacked cost bars */
.stack-rows { display: grid; gap: 1.1rem; }
.srow { display: grid; gap: 0.4rem; }
.srow-label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; font-size: 0.95rem; }
.srow-label b { font-weight: 600; }
.srow-label .total { font-family: var(--display); font-size: 1.2rem; font-variant-numeric: lining-nums tabular-nums; }
.track { position: relative; height: 2rem; }
.seg {
  position: absolute; top: 0; bottom: 0;
  display: flex; align-items: center; padding-left: 0.45rem;
  font: 600 0.75rem/1 var(--mono); white-space: nowrap; overflow: visible;
  box-shadow: inset -2px 0 0 var(--chart-bg, var(--paper));
}
.seg.end { border-radius: 0 4px 4px 0; box-shadow: none; }
.seg-main.ice { background: var(--ice); color: var(--on-fill); }
.seg-main.dot { background: var(--dot); color: var(--on-fill); }
.seg-agents.ice { background: var(--ice-2); color: var(--ink); }
.seg-agents.dot { background: var(--dot-2); color: var(--ink); }
.seg-svc { background: repeating-linear-gradient(45deg, var(--hatch) 0 2px, transparent 2px 5px); outline: 1px solid var(--hatch); outline-offset: -1px; }

/* labelled bar rows: label | bar | value */
.brows { display: grid; gap: 0.55rem; }
.brow { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr) 8.5rem; gap: 0.9rem; align-items: center; }
.brow-label { font-size: 0.92rem; line-height: 1.3; }
.brow-val { font: 500 0.8rem/1.35 var(--mono); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.brow-val b { color: var(--ink); font-weight: 650; }
.brow .track { height: 1.35rem; }
.bar { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-accent { background: var(--ink-2); }
.brow-axis { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr) 8.5rem; gap: 0.9rem; }
.brow-axis .axis { grid-column: 2; }
@media (max-width: 40rem) {
  .brow, .brow-axis { grid-template-columns: minmax(0, 1fr) 6.5rem; gap: 0.3rem 0.75rem; }
  .brow-label { grid-column: 1 / -1; }
  .brow-axis .axis { grid-column: 1; }
}

/* grouped time bars */
.tgroup { display: grid; gap: 0.3rem; padding-block: 0.35rem; }
.tgroup + .tgroup { border-top: 1px solid var(--rule); padding-top: 0.75rem; }
.tgroup-name { font-size: 0.92rem; font-weight: 600; }
.tbar { display: grid; grid-template-columns: minmax(0, 1fr) 11.5rem; gap: 0.9rem; align-items: center; }
.tbar .track { height: 1.1rem; }
.bar.ice { background: var(--ice); }
.bar.dot { background: var(--dot); }
.taxis { display: grid; grid-template-columns: minmax(0, 1fr) 11.5rem; gap: 0.9rem; }
@media (max-width: 40rem) {
  .tbar, .taxis { grid-template-columns: minmax(0, 1fr) 7.5rem; gap: 0.6rem; }
  .taxis .axis span:nth-child(even) { display: none; }
}

/* range chart on a log scale */
.rrow { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 1rem; align-items: center; min-height: 2.6rem; }
.rrow-label { font-size: 0.92rem; line-height: 1.3; }
.rrow-label small { display: block; color: var(--muted); font-size: 0.8rem; }
.rrow .track { height: 2.6rem; }
.range { position: absolute; top: 0.85rem; height: 0.9rem; background: var(--rule-strong); border-radius: 2px; }
.range-lab { position: absolute; top: -0.05rem; font: 500 0.72rem/1 var(--mono); color: var(--ink-2); white-space: nowrap; }
.pt { position: absolute; top: 0.85rem; width: 0.9rem; height: 0.9rem; margin-left: -0.45rem; border-radius: 50%; box-shadow: 0 0 0 2px var(--chart-bg, var(--paper)); }
.pt.ice { background: var(--ice); }
.pt.dot { background: var(--dot); }
.pt-lab { position: absolute; top: 2rem; font: 600 0.72rem/1 var(--mono); color: var(--ink); white-space: nowrap; }
.raxis { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 1rem; }
.raxis .axis { grid-column: 2; }
@media (max-width: 40rem) {
  .rrow, .raxis { grid-template-columns: minmax(0, 1fr); gap: 0.2rem; }
  .raxis .axis { grid-column: 1; }
}

/* meters */
.meters { display: grid; gap: 1.25rem; }
@media (min-width: 56rem) { .meters { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; } }
.meter { display: grid; gap: 0.45rem; align-content: start; min-width: 0; }
.meter-name { font-family: var(--display); font-size: var(--step-1); }
.meter-price { font: 500 var(--step--1)/1.3 var(--mono); color: var(--muted); }
.meter-track { position: relative; height: 0.6rem; background: var(--code-bg); border-radius: 0 3px 3px 0; overflow: hidden; }
.meter-fill { position: absolute; inset: 0 auto 0 0; background: var(--ink-2); border-radius: 0 3px 3px 0; }
.meter p { font-size: 0.92rem; color: var(--ink-2); }

/* ------------------------------------------------------------------ estimator */
.estimator {
  background: var(--sheet);
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  display: grid;
}
.section--sheet .estimator { background: var(--paper); }
@media (min-width: 60rem) { .estimator { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); } }
.est-in, .est-out { padding: clamp(1.1rem, 3vw, 1.75rem); display: grid; gap: 1.2rem; align-content: start; min-width: 0; }
.est-out { border-top: 1px solid var(--rule); }
@media (min-width: 60rem) { .est-out { border-top: 0; border-left: 1px solid var(--rule); } }
.field { display: grid; gap: 0.35rem; }
.field-top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.field label { font-weight: 600; font-size: 0.95rem; }
.field output { font: 600 0.95rem/1 var(--mono); font-variant-numeric: tabular-nums; }
.field small { color: var(--muted); font-size: 0.82rem; line-height: 1.4; }
input[type="range"] { width: 100%; accent-color: var(--accent); margin: 0.2rem 0; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; }
.check input { margin-top: 0.3rem; accent-color: var(--accent); width: 1rem; height: 1rem; flex: none; }
.check label { font-weight: 600; font-size: 0.95rem; }
.check small { display: block; font-weight: 400; color: var(--muted); font-size: 0.82rem; }
.est-total { display: grid; gap: 0.2rem; }
.est-total .big { font-family: var(--display); font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3rem); line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.est-total .big small { font-size: 0.45em; color: var(--muted); }
.est-lines { display: grid; }
.est-lines > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.25rem 1rem; padding-block: 0.55rem; border-top: 1px solid var(--rule); }
.est-lines dt { font-size: 0.95rem; }
.est-lines dt small { display: block; color: var(--muted); font-size: 0.8rem; }
.est-lines dd { margin: 0; font: 600 0.92rem/1.4 var(--mono); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.est-warn { font-size: 0.88rem; color: var(--ink-2); border-left: 3px solid var(--accent); padding-left: 0.75rem; }
.est-compare { font-size: 0.88rem; color: var(--muted); }

/* ------------------------------------------------------------------ figures */
.fig { display: grid; gap: 0.6rem; min-width: 0; }
.fig-img { position: relative; }
.fig-img img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 2px; background: var(--code-bg); }
.fig figcaption { font-size: 0.88rem; color: var(--ink-2); line-height: 1.5; }
.fig figcaption .credit { display: block; font: 400 0.75rem/1.45 var(--mono); color: var(--muted); margin-top: 0.25rem; overflow-wrap: anywhere; }
.pair { display: grid; gap: 1rem; align-items: start; }
@media (min-width: 48rem) { .pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pair-arrow { display: none; }

/* ------------------------------------------------------------------ case studies */
.case { display: grid; gap: clamp(1.5rem, 3vw, 2.25rem); }
.case + .case { margin-top: clamp(3.5rem, 7vw, 5rem); padding-top: clamp(2.5rem, 5vw, 3.5rem); border-top: 1px solid var(--rule-strong); }
.case-head { display: grid; gap: 0.6rem; }
.case-head h3 { font-size: var(--step-3); font-style: italic; }
.case-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; font: 500 var(--step--1)/1.4 var(--mono); color: var(--muted); }
.case-meta .film-th { color: var(--ink); }
.quote {
  font-family: var(--display); font-size: var(--step-2); line-height: 1.3; font-style: italic;
  max-width: 34rem; color: var(--ink); margin: 0;
}
.quote cite { display: block; margin-top: 0.4rem; font: normal 500 var(--step--1)/1.4 var(--mono); color: var(--muted); }
.fix-table td:first-child { width: 34%; }

/* ------------------------------------------------------------------ rules */
.rules { list-style: none; padding: 0; display: grid; gap: 0; counter-reset: rule; }
@media (min-width: 56rem) { .rules { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2.75rem; } }
.rules li { counter-increment: rule; display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); gap: 0.75rem; padding-block: 1rem; border-top: 1px solid var(--rule); }
.rules li::before { content: counter(rule); font: 400 1.5rem/1 var(--display); color: var(--accent); padding-top: 0.1rem; }
.rules h3 { font-size: 1.15rem; margin-bottom: 0.25rem; }
.rules p { font-size: 0.95rem; color: var(--ink-2); }
.specline { display: grid; gap: 0; border-top: 2px solid var(--ink); }
.specline > div { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 1rem; padding-block: 0.8rem; border-bottom: 1px solid var(--rule); align-items: baseline; }
.specline .v { font-family: var(--display); font-size: 1.45rem; line-height: 1.1; font-variant-numeric: lining-nums; }
.specline p { color: var(--ink-2); font-size: 0.95rem; }
@media (max-width: 30rem) { .specline > div { grid-template-columns: minmax(0, 1fr); gap: 0.25rem; } }

pre.code {
  margin: 0; overflow-x: auto; background: var(--code-bg); border-radius: 3px;
  padding: 1rem 1.1rem; font: 400 0.8rem/1.6 var(--mono); color: var(--ink); tab-size: 2;
}
pre.code .k { color: var(--muted); }
pre.code .c { color: var(--muted); font-style: italic; }
pre.code .hl { color: var(--accent); }

.checklist { list-style: none; padding: 0; display: grid; gap: 0.5rem; }
.checklist li { display: grid; grid-template-columns: 1.25rem minmax(0, 1fr); gap: 0.6rem; font-size: 0.95rem; }
.checklist li::before { content: ""; width: 0.85rem; height: 0.85rem; border: 1.5px solid var(--ink-2); border-radius: 2px; margin-top: 0.3rem; }

/* ------------------------------------------------------------------ next: monopoly beats */
.beats { display: grid; gap: 0.6rem; }
.beat-track { display: flex; height: 2.4rem; }
.beat-track > span {
  position: relative; display: grid; place-items: center;
  font: 600 0.72rem/1 var(--mono); color: var(--ink);
  background: var(--code-bg); box-shadow: inset -2px 0 0 var(--paper);
}
.beat-track > span:nth-child(odd) { background: color-mix(in srgb, var(--rule-strong) 55%, var(--code-bg)); }
.beat-track > span.silent { background: repeating-linear-gradient(45deg, var(--hatch) 0 2px, transparent 2px 5px); color: transparent; }
.beat-axis { position: relative; height: 1.1rem; font: 500 0.6875rem/1 var(--mono); color: var(--muted); }
.beat-axis span { position: absolute; transform: translateX(-50%); }
.beat-axis span:first-child { transform: none; }
.beat-axis span:last-child { transform: translateX(-100%); }
.status {
  display: inline-block; font: 600 var(--step--2)/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px dashed var(--ink-2); padding: 0.3rem 0.5rem; border-radius: 2px; color: var(--ink-2); justify-self: start;
}
.questions { padding-left: 1.25rem; display: grid; gap: 0.4rem; }
.questions li::marker { font-family: var(--mono); color: var(--muted); }

/* ------------------------------------------------------------------ footer */
.footer { border-top: 1px solid var(--rule); padding-block: clamp(2.5rem, 6vw, 4rem); background: var(--sheet); }
.footer .cols-2 { align-items: start; }
.credits-list { list-style: none; padding: 0; display: grid; gap: 0.6rem; font-size: 0.86rem; color: var(--ink-2); }
.credits-list b { color: var(--ink); font-weight: 600; }
.footer p { font-size: 0.9rem; color: var(--ink-2); max-width: var(--measure); }
.footer .fine { font: 400 var(--step--2)/1.6 var(--mono); color: var(--muted); }
