/* Broadsheet — design-system tokens and component classes. This file is the source of truth for the system's look; retune it here and see readme.md. */
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,wght@0,400;0,600;1,400&display=swap');

:root {
  --color-bg: #f3f2f2;
  --color-surface: #eae9e9;
  --color-text: #201e1d;
  --color-accent: #0088b0;
  --color-accent-2: #d6006c;
  --color-divider: color-mix(in srgb, #201e1d 16%, transparent);

  /* Tonal ramps — generated in OKLCH on one shared lightness scale, so the
     same step of any role matches the others in visual value. */
  --color-neutral-100: #f8f4f4;
  --color-neutral-200: #eae7e7;
  --color-neutral-300: #d7d3d3;
  --color-neutral-400: #bab6b6;
  --color-neutral-500: #9b9797;
  --color-neutral-600: #7d7979;
  --color-neutral-700: #605d5d;
  --color-neutral-800: #444141;
  --color-neutral-900: #2d2b2b;

  --color-accent-100: #e9f8ff;
  --color-accent-200: #cbeeff;
  --color-accent-300: #99e0ff;
  --color-accent-400: #62c5ee;
  --color-accent-500: #38a6cf;
  --color-accent-600: #1186ac;
  --color-accent-700: #006786;
  --color-accent-800: #004961;
  --color-accent-900: #0a303e;

  --color-accent-2-100: #fff1f4;
  --color-accent-2-200: #ffdee6;
  --color-accent-2-300: #ffc0d0;
  --color-accent-2-400: #ff90b1;
  --color-accent-2-500: #ff458e;
  --color-accent-2-600: #d82071;
  --color-accent-2-700: #aa0b56;
  --color-accent-2-800: #790e3d;
  --color-accent-2-900: #4b1528;

  /* The third process ink — review round 3: the deck's print treatments
     (the CMYK separation and the misregistered plate numerals below) need
     the full four-color set. Cyan and magenta are the system's own accents;
     this yellow completes them, muted to the same press-ink register. A
     print treatment color, not an interface accent — body copy and chrome
     never take it. */
  --color-process-yellow: #edbb00;

  --font-heading: "Source Serif 4", system-ui, sans-serif;
  --font-heading-weight: 600;
  --font-body: "Source Serif 4", system-ui, sans-serif;

  --space-1: 5.0px;
  --space-2: 10.0px;
  --space-3: 15.0px;
  --space-4: 20.0px;
  --space-6: 30.0px;
  --space-8: 40.0px;

  /* The reading column. In px, not ch, so a 26px heading and an 18px
     paragraph share one measure instead of each computing its own. */
  --measure: 576px;

  --radius-sm: 1px;
  --radius-md: 2px;
  --radius-lg: 4px;

  /* Elevation — derived from the ground: soft ink-tinted shadows on a
     light theme, a hairline edge + ambient darkness on a dark one. */
  --shadow-sm: 0 1px 2px color-mix(in srgb, #2d2b2b 14%, transparent);
  --shadow-md: 0 3px 10px color-mix(in srgb, #2d2b2b 16%, transparent);
  --shadow-lg: 0 12px 32px color-mix(in srgb, #2d2b2b 22%, transparent);
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
}
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: var(--font-heading-weight); }

.halftone{position:relative;filter:grayscale(0.35) contrast(1.15);overflow:hidden}
.halftone::after{content:"";position:absolute;inset:0;pointer-events:none;
  background-image:radial-gradient(circle,rgba(0,0,0,0.22) 30%,transparent 32%);
  background-size:3px 3px;mix-blend-mode:multiply}

/* The four-color separation treatment (review round 3) — a photograph
   printed as its misregistered process plates, after the Catalogue Three
   grammar. Markup: a figure.cmyk holding five copies of the image — the
   first is the layout sizer (hidden), then one per plate, each tagged
   .sep-c/.sep-m/.sep-y/.sep-k. The plates are extracted live by the SVG
   feColorMatrix filters in print-plates.js, the system's own defs —
   inlined in the compiled bundle every template page loads, and a
   page that links styles.css directly adds
   <script src="print-plates.js"></script> itself (the defs must be in
   the document: a data-URI filter reference would not survive Chromium,
   and external-file references are unreliable across engines) — nudged
   a few pixels out of register, and multiplied
   onto the paper ground; the halftone dot screens the recombined print.
   The plate offsets live with the deck's projection-scale CSS, since
   misregistration is sized to the output. */
.cmyk{position:relative;overflow:hidden;background:var(--color-bg)}
.cmyk img:first-child{opacity:0} /* layout sizer AND the alt-bearing image — opacity
  keeps it in the accessibility tree (visibility:hidden would drop the figure's only
  description); fully transparent, it adds nothing to the multiply backdrop */
.cmyk img+img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;mix-blend-mode:multiply}
.cmyk .sep-c{filter:url(#sep-c)}
.cmyk .sep-m{filter:url(#sep-m)}
.cmyk .sep-y{filter:url(#sep-y)}
.cmyk .sep-k{filter:url(#sep-k)}
.cmyk::after{content:"";position:absolute;inset:0;pointer-events:none;
  background-image:radial-gradient(circle,rgba(0,0,0,0.22) 30%,transparent 32%);
  background-size:3px 3px;mix-blend-mode:multiply}

/* The one-image separation (review round 9, promoted from the deck in the
   landing divergence) — the same four plates as ONE compound filter,
   #sep-all in print-plates.js, for a single swappable image: a .print
   wrapper inside the figure holds one <image-slot>, and the filter
   extracts, offsets and multiplies the plates live from whatever the slot
   shows. Markup: figure.cmyk > .print > image-slot (the page sizes the
   .print — aspect-ratio, or absolute fill for bleeds). Hover resolves
   the print into the photograph — the pressman checking registration on
   the light table — so the source shows crisp and any swap chrome stays
   legible; only the reduced-motion fallback below still lifts as a
   single cut (a url() filter cannot CSS-transition; the press driver
   animates the defs instead). */
.cmyk .print{position:relative;width:100%;filter:url(#sep-all)}
/* no hover end-state swap: the press driver (print-plates.js) eases the
   plates into register while purifying their inks to the pure-process
   separation on the same curve, so the converged four-plate merge IS
   the photograph (their multiply equals SourceGraphic by construction)
   — no cut anywhere on the animated path */
@media (prefers-reduced-motion: reduce), (hover: none), (pointer: coarse) {
  .cmyk .print:hover{filter:none} /* without the driver (it stands down on
    exactly these conditions), hover stays the old single cut to the
    crisp source */
}
.cmyk .print image-slot{width:100%;height:100%;display:block}

/* The plate numeral (review rounds 3-4) — display figures set as
   misregistered process plates, the catalog's cover grammar. Review
   round 4 (Barron): THREE plates — C, M, Y only, no black plate — so the
   dark core comes entirely from the C×M×Y multiply overlap (the inks
   product to exact black), with the fringes the registration drift; and
   the spread pulled in by half (less jumbled: one figure with plate
   fringes rather than figures sliding apart). Markup: a .cmyk-num holding
   a .paper span (the white of the sheet: the glyph's union, built from
   offset text-shadow copies) and three .plate spans. The construction
   carries its own ground (--cmyk-num-ground, defaulting to paper) painted
   on its padding box, so the multiply plates always have their backdrop
   even inside an isolated stacking context (entrance animations); the
   padding bleeds wider than any plate offset and the negative margin
   hands the layout box back. Offsets are em-scaled to the glyph. The
   .paper span carries the text once for assistive tech; the .plate spans
   are aria-hidden repeats. */
.cmyk-num{--cmyk-num-ground:var(--color-bg);
  position:relative;width:fit-content;line-height:0.9;
  font-feature-settings:"pnum" 1;
  background:var(--cmyk-num-ground);padding:0.12em;margin:-0.12em}
.cmyk-num .paper{color:var(--color-bg); /* the white of the sheet — always paper,
  whatever the ground: the plates read as printed on paper even when the
  surrounding page is ink */
  text-shadow:0.036em 0.025em 0 var(--color-bg),-0.031em -0.023em 0 var(--color-bg)}
.cmyk-num .plate{position:absolute;inset:0.12em;mix-blend-mode:multiply;
  text-box:trim-both cap alphabetic /* the host trims to its cap box; each
  absolute plate must trim its own line the same way, or its glyphs sit a
  half-leading below the paper union */}
.cmyk-num .plate-c{color:var(--color-accent)}

/* The plate headline (divergence round 3, Barron: "use both" — the
   photograph's plates AND the cover grammar's text plates, on the same
   page). The same three-plate construction as .cmyk-num — paper span
   carrying the real text, C/M/Y plate repeats, dark core from the
   multiply overlap — at HALF the numeral's round-4 offsets: the serif's
   display hairlines are thinner than the numeral strokes the spread was
   measured on, and the full offsets swallow them whole (probed at the
   hero's 80px — the fringes read as an anaglyph poster, not a breath
   out of register) — recut for display
   headlines that sit in running text blocks on the page's own paper:
   no ground painting and no padding bleed (the numeral's ground exists
   for isolated stacking contexts; a headline on the page multiplies
   straight onto the sheet), no width:fit-content and no line-height
   override (the host display class owns its metrics — apply this to
   each .line, which is position:relative for its plates), and the
   plates are inert to the hand (pointer-events/user-select none, so a
   triple-click selects the headline once, not four times). Plates take
   the same pointer lean as .cmyk-num. */
.cmyk-head{position:relative}
.cmyk-head .paper{color:var(--color-bg);
  text-shadow:0.027em 0.0185em 0 var(--color-bg),-0.0245em -0.0175em 0 var(--color-bg)
  /* the union's copies sit at the construction's halved plate offsets
     PLUS the full lean (0.018+0.009 / 0.0125+0.006, and mirrored), so
     the union still backs the plates at viewport-edge lean — invisible
     on the page's own paper, load-bearing on any other ground */}
.cmyk-head .plate{position:absolute;inset:0;mix-blend-mode:multiply;
  pointer-events:none;user-select:none;
  text-box:trim-both cap alphabetic /* match the host's trim, or the
  plates sit a half-leading below the paper union */}
.cmyk-head .plate-c{color:var(--color-accent)}
.cmyk-head .plate-m{color:var(--color-accent-2);
  translate:calc(0.018em + 0.009em*var(--press-nx, 0)) calc(0.0125em + 0.006em*var(--press-ny, 0))}
.cmyk-head .plate-y{color:var(--color-process-yellow);
  translate:calc(-0.0155em + 0.009em*var(--press-nx, 0)) calc(-0.0115em + 0.006em*var(--press-ny, 0))}
.cmyk-num .plate-m{color:var(--color-accent-2);
  translate:calc(0.036em + 0.018em*var(--press-nx, 0)) calc(0.025em + 0.0125em*var(--press-ny, 0))}
.cmyk-num .plate-y{color:var(--color-process-yellow);
  translate:calc(-0.031em + 0.018em*var(--press-nx, 0)) calc(-0.023em + 0.0125em*var(--press-ny, 0))}
/* --press-nx/--press-ny: the pointer lean as a bare -1..1 factor,
   published on :root by the press driver (print-plates.js) and zero
   whenever the driver stands down. Each construction scales the lean to
   its own spread (half of it, here as everywhere) so the moving plates
   drift a breath toward the cursor and the C plate holds. */

/* ══════════════════════════════════════════════════════════════════════════
   Components — built with the tokens above. Plain CSS
   on plain HTML: no JavaScript, no build step. Each class is documented in
   readme.md and demonstrated in foundations/ and components/.
   ══════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-size: 15px; line-height: 1.55; font-weight: 400; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 var(--space-2);
}
h1 { font-size: 42px; }
h2 { font-size: 32px; }
h3 { font-size: 25px; }
h4 { font-size: 20px; }
h5 { font-size: 16px; }
h6 { font-size: 13px; }
h6 { letter-spacing: 0.08em; text-transform: uppercase; }
p { margin: 0 0 var(--space-3); }
a { color: var(--color-accent); text-underline-offset: 3px; }
img { display: block; max-width: 100%; }
figure { margin: 0; }
figcaption {
  font-size: 11px; margin-top: var(--space-1);
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}
.text-muted { color: color-mix(in srgb, var(--color-text) 55%, transparent); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

/* — rules — */
.hr {
  height: 1px; border: 0; margin: var(--space-4) 0;
  background: var(--color-divider);
}

/* — buttons — */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; text-decoration: none;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 14px; line-height: 1.2; color: var(--color-text); /* matches the .input's 14px —
     the pair sits side by side in sign-up rows */
  background: transparent; border: 1px solid transparent;
  padding: var(--space-2) calc(var(--space-3) * 1.2);
  border-radius: var(--radius-md);
}
.btn svg { display: block; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--color-accent); color: var(--color-bg); }
.btn-primary:hover { background: var(--color-accent-600); }
.btn-primary:active { background: var(--color-accent-700); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.btn-secondary:active { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.btn-ghost { color: var(--color-accent); padding-inline: var(--space-1); }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.btn-ghost:active { background: color-mix(in srgb, var(--color-accent) 18%, transparent); }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-block { width: 100%; margin-top: var(--space-2); }

/* — forms — */
.field > label {
  display: block; font-size: 12px; margin-bottom: 5px;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}
.input {
  width: 100%; min-height: 36px; padding: 6px 10px; font: inherit;
  font-size: 14px; color: var(--color-text); caret-color: var(--color-accent);
  background: var(--color-surface);
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.input::placeholder { color: color-mix(in srgb, var(--color-text) 65%, transparent); opacity: 1; }
  /* explicit, measured: the browser default gray misses the 4.5:1 small-text bar on
     the surface fill; 65% ink measures 4.8:1 there, still a step quieter than typed
     text (opacity:1 overrides Firefox's default placeholder fade) */
.input:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.input:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
textarea.input { min-height: 90px; resize: vertical; }
.radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.radio input, .seg-opt input {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.radio .dot {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--color-divider);
}
.radio:hover .dot { border-color: var(--color-accent); }
.radio input:checked + .dot {
  border-color: var(--color-accent); background: var(--color-accent);
  box-shadow: inset 0 0 0 4px var(--color-bg);
}
.radio input:focus-visible + .dot { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.seg {
  display: inline-flex; overflow: hidden;
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.seg-opt {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; font-size: 13px; cursor: pointer;
}
.seg-opt + .seg-opt { border-left: 1px solid var(--color-divider); }
.seg-opt:has(input:checked) { background: var(--color-accent); color: var(--color-bg); }
.seg-opt:not(:has(input:checked)):hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: -2px; }

/* — cards — */
.card {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3); border-radius: var(--radius-md); background: var(--color-surface);
}
.card-kicker { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent); }
.card-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 17px; line-height: 1.2;
}
.card-body { margin: 0; font-size: 13px; opacity: 0.8; flex: 1; }
.card-meta {
  display: flex; align-items: center; gap: 6px; font-size: 11px;
  color: color-mix(in srgb, var(--color-text) 50%, transparent);
}
.elev-sm { box-shadow: var(--shadow-sm); }
.elev-md { box-shadow: var(--shadow-md); }
.elev-lg { box-shadow: var(--shadow-lg); }

/* — tags — */
.tag {
  display: inline-flex; align-items: center; font-size: 11px;
  letter-spacing: 0.02em; padding: 3px 10px;
  border-radius: calc(var(--radius-md) * 0.75);
}
.tag-accent { background: var(--color-accent-100); color: var(--color-accent-800); }
.tag-accent-2 { background: var(--color-accent-2-100); color: var(--color-accent-2-800); }
.tag-neutral { background: var(--color-neutral-100); color: var(--color-neutral-800); }
.tag-outline { border: 1px solid var(--color-accent); color: var(--color-accent); }

/* — navigation — */
.nav {
  display: flex; align-items: center; gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-bottom: none;
}
.nav-brand {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 18px; margin-right: auto;
}
.nav a { color: inherit; text-decoration: none; font-size: 14px; }
.nav a:hover, .nav a[aria-current='page'] { color: var(--color-accent); }

/* — tables — */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 60%, transparent);
  padding: var(--space-2); border-bottom: 1px solid var(--color-divider);
}
.table td {
  padding: var(--space-2);
  border-bottom: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent);
}
.table tbody tr:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }

/* — dialog — */
.dialog-backdrop {
  position: fixed; inset: 0; display: grid; place-items: center;
  padding: var(--space-4);
  background: color-mix(in srgb, var(--color-neutral-900) 50%, transparent);
}
.dialog {
  width: min(440px, 100%); display: flex; flex-direction: column; gap: var(--space-3);
  padding: var(--space-4); border-radius: var(--radius-lg);
  background: var(--color-surface); box-shadow: var(--shadow-lg);
}
.dialog-title {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 20px;
}
.dialog-body { font-size: 14px; opacity: 0.85; }
.dialog-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }



/* ==========================================================================
   Blog layer — Computer Modern typography and page layout.
   Every color, radius and space below comes from the token block above.
   ========================================================================== */
@font-face { font-family: "CMU Serif"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Main-Regular.woff2") format("woff2"); }
@font-face { font-family: "CMU Serif"; font-weight: 400; font-style: italic; font-display: swap;
  src: url("https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Main-Italic.woff2") format("woff2"); }
@font-face { font-family: "CMU Serif"; font-weight: 600 800; font-style: normal; font-display: swap;
  src: url("https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Main-Bold.woff2") format("woff2"); }
@font-face { font-family: "CMU Serif"; font-weight: 600 800; font-style: italic; font-display: swap;
  src: url("https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Main-BoldItalic.woff2") format("woff2"); }

:root {
  --font-heading: "CMU Serif", "Latin Modern Roman", Georgia, serif;
  --font-body: "CMU Serif", "Latin Modern Roman", Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --leading: 28px;
  --edge: clamp(20px, 5vw, 72px);
}
body { font-family: var(--font-body); font-size: 17px; line-height: var(--leading);
  background: var(--color-bg); color: var(--color-text); text-wrap: pretty; }
.wrap { max-width: 1060px; margin: 0 auto; padding: 0 var(--edge); }
a { color: var(--color-accent-700); text-decoration: none; }
a:hover { color: var(--color-accent-800); text-decoration: underline; }

.nav { padding-inline: var(--edge); }
.nav .nav-brand { color: var(--color-text); text-decoration: none; }

.kicker { margin: 0 0 8px; font-size: 13px; line-height: 14px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--color-accent-700); }
.meta { margin: 0 0 8px; font-size: 13px; line-height: 14px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--color-neutral-600); }
.dek { max-width: 58ch; margin: 14px 0 0; color: var(--color-neutral-800); }

/* — front page — */
.masthead { padding: 84px 0 42px; }
.masthead h1 { font-size: clamp(42px, 6vw, 76px); line-height: 1.07; letter-spacing: -0.02em; margin: 0 0 0 -0.03em;
  color: var(--color-accent-900); }
.tagline { font-size: 19px; line-height: 30px; max-width: 48ch; margin: 24px 0 0; color: var(--color-neutral-800); }
.links { display: flex; gap: var(--space-4); flex-wrap: wrap; margin: 28px 0 0; font-size: 15px; }

.rail { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px 28px; padding: 14px 0;
  border-top: 2px solid var(--color-accent-800); border-bottom: 1px solid var(--color-accent-800);
  font-size: 13px; line-height: 14px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-neutral-700); }

.filters { display: flex; flex-wrap: wrap; gap: 10px; padding: 28px 0 0; }
.filters .tag { cursor: pointer; border: 0; font: inherit; font-size: 13px; letter-spacing: 0.04em; }
.filters .tag-outline { border: 1px solid var(--color-divider); }
.filters .tag:hover { color: var(--color-accent-800); }

.entries { display: grid; gap: 56px; padding: 56px 0 0; }
.entry { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 24px 42px; align-items: start; }
.entry-fig { display: block; aspect-ratio: 4 / 3; border-radius: var(--radius-md); overflow: hidden; }
.entry-title { font-size: 28px; line-height: 1.14; letter-spacing: -0.015em; margin: 0; max-width: 28ch; }
.entry-title a { color: var(--color-accent-900); }
.entry-title a:hover { color: var(--color-accent-700); text-decoration: none; }

/* A real photograph in the lead figure's compound-filter slot. The .cmyk rules
   above expect the five-copy separation markup, whose first image is a
   transparent sizer; a lone <img> in a .print slot is the picture itself, so it
   has to opt back into being visible and to fill the figure's box. */
.cmyk .print > img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 1; }
.entry-fig > img { width: 100%; height: 100%; object-fit: cover; }

/* image placeholders (swap the div for an <img> when you have the picture) */
.imgph { width: 100%; height: 100%; min-height: 120px; display: grid; place-items: center;
  background: var(--color-neutral-200); color: var(--color-neutral-600);
  font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }

/* — post — */
.back { padding: 42px 0 0; margin: 0; }
.post-head { padding: 28px 0 42px; }
.post-head h1 { font-size: clamp(34px, 4.6vw, 58px); line-height: 1.09; letter-spacing: -0.02em;
  margin: 0 0 0 -0.03em; max-width: 28ch; color: var(--color-accent-900); }
.post-dek { font-size: 19px; line-height: 30px; max-width: 54ch; margin: 24px 0 0; font-style: italic;
  color: var(--color-neutral-800); }
.byline { margin: 28px 0 0; padding-top: 14px; border-top: 1px solid var(--color-accent-800);
  font-size: 13px; line-height: 14px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-neutral-700); }
.lead { margin: 0 0 56px; }
.lead .print { aspect-ratio: 3 / 2; }

/* Post layout: the contents rail on the left, the article centred on the page.
   The empty third column is what does the centring — it balances the rail, so
   the reading column sits on the page's own midline rather than being pushed
   right by the width of the nav. */
/* Wide enough that the rail, the 576px reading column and the 720px figures
   all fit without the figures having to overlap the rail. */
.wrap-post { max-width: 1420px; }
.post-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr) 220px; gap: 56px; align-items: start; }

.toc { position: sticky; top: 28px; font-size: 14px; }
.toc-h { margin: 0 0 12px; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-neutral-600); }
.toc ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.toc a {
  display: block; padding-left: 12px; line-height: 1.35; color: var(--color-neutral-700);
  border-left: 2px solid var(--color-neutral-300); text-decoration: none;
}
.toc a:hover { color: var(--color-accent-800); border-left-color: var(--color-accent-400); text-decoration: none; }
.toc a[aria-current="true"] { color: var(--color-accent-900); border-left-color: var(--color-accent); }

@media (max-width: 1080px) {
  .post-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
}

/* One column, pinned to the article's width: an auto track would be widened by
   the 720px figures and every centred item would then be centred on that
   overflowing track instead of on the column. */
.prose { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.prose > p { margin: 0 auto; width: min(var(--measure), 100%); font-size: 18px; line-height: 30px; text-align: justify; hyphens: auto; }
/* The reading column is centred; figures keep the full width of the article,
   which is the contrast the page is built on. */
/* width, not max-width: a grid item with auto side margins shrinks to its
   content, which would centre a short heading's text instead of aligning it
   with the column. Pinning the box to the measure keeps every left edge equal. */
.prose > h2, .prose > h3, .prose > ul, .prose > ol,
.prose > blockquote, .prose > .math, .prose > .notes, .prose > .where {
  width: min(var(--measure), 100%); margin-inline: auto;
}
/* ...and the furniture above and below it sits on the same axis. */
.back, .post-head, .post-nav { max-width: var(--measure); margin-inline: auto; }
.prose h2 { font-size: 26px; line-height: 32px; letter-spacing: -0.012em; margin: 28px auto 0; color: var(--color-accent-900); }
.math { padding: 14px 0; overflow-x: auto; }

/* The legend under a formula: one row per symbol, the symbol set in the column
   the eye already uses for the equation above it. */
.where { margin: 0; padding: 16px 0 4px; border-top: 1px solid var(--color-neutral-300);
  display: grid; grid-template-columns: minmax(6ch, max-content) minmax(0, 1fr);
  column-gap: 18px; row-gap: 10px; align-items: baseline;
  font-size: 15.5px; line-height: 26px; color: var(--color-neutral-800); }
.where dt { color: var(--color-accent-900); }
.where dd { margin: 0; }
@media (max-width: 620px) {
  .where { grid-template-columns: minmax(0, 1fr); row-gap: 4px; }
  .where dd { margin-bottom: 8px; }
}
figure { margin: 0; }
figcaption { margin-top: 10px; font-size: 14px; line-height: 24px; color: var(--color-neutral-600); }

.code > pre { margin: 0; padding: 20px 24px; overflow-x: auto; background: var(--color-neutral-100);
  border-left: 2px solid var(--color-accent); border-radius: var(--radius-md); }
.code code { font-family: var(--font-mono); font-size: 14.5px; line-height: 24px; }
/* Syntax highlighting — highlight.js classes, applied at build time by
   src/build/markdown.ts. Only the roles this blog's samples use are mapped;
   an unmapped hljs class simply inherits the body ink. */
.hljs-keyword, .hljs-built_in, .hljs-literal, .hljs-type { color: var(--color-accent-700); font-weight: 700; }
.hljs-string, .hljs-meta .hljs-string { color: var(--color-accent-800); }
.hljs-number { color: var(--color-accent-600); }
.hljs-title, .hljs-title.function_, .hljs-title.class_, .hljs-section { color: var(--color-accent-900); }
.hljs-comment, .hljs-quote { color: var(--color-neutral-600); font-style: italic; }
.hljs-attr, .hljs-property, .hljs-variable, .hljs-params { color: var(--color-text); }
.hljs-meta, .hljs-punctuation, .hljs-operator { color: var(--color-neutral-700); }

/* The interactive simulation figure — controls, readout and the d3 histogram.
   Built by src/client/tank-demo.ts; without JavaScript the figure is empty and
   the surrounding prose and code still carry the argument. */
.demo { margin: var(--space-6) 0; }
.demo-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
.demo-controls label { display: flex; align-items: center; gap: var(--space-2); font-size: 14px; }
.demo-controls input[type="range"] { width: 160px; accent-color: var(--color-accent); }
.demo-controls output { min-width: 2ch; font-variant-numeric: tabular-nums; color: var(--color-accent-800); }
.demo-controls select {
  font-family: var(--font-body); font-size: 14px; padding: 4px 6px;
  border: 1px solid var(--color-neutral-400); border-radius: var(--radius-md);
  background: var(--color-neutral-100); color: var(--color-text);
}
.demo-controls button {
  font-family: var(--font-body); font-size: 14px; line-height: 1; padding: 7px 14px;
  border: 1px solid var(--color-accent-700); border-radius: var(--radius-md);
  background: var(--color-accent-700); color: var(--color-neutral-100); cursor: pointer;
}
.demo-controls button:hover { background: var(--color-accent-800); border-color: var(--color-accent-800); }
.demo-read { margin: var(--space-3) 0 0; font-size: 14px; color: var(--color-neutral-700); }
.demo-read b { font-variant-numeric: tabular-nums; color: var(--color-text); }
.demo-read .k-est { color: var(--color-accent-700); }
.demo-read .k-max { color: var(--color-accent-900); }
.demo svg { display: block; width: 100%; height: auto; margin-top: var(--space-2); }
.demo .chart-axis line, .demo .chart-axis path { stroke: var(--color-neutral-400); }


.tablefig .table { width: 100%; font-size: 16px; }
.tablefig td { font-variant-numeric: tabular-nums; }
.diagram svg { display: block; width: 100%; height: auto; max-width: 720px; }
.dg-t { font-family: var(--font-heading); font-size: 16px; font-weight: 700; fill: var(--color-accent-900); }
.dg-s { font-family: var(--font-body); font-size: 13px; fill: var(--color-neutral-600); }

.notes { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--color-neutral-300); max-width: var(--measure); }
.notes-h { margin: 0 0 10px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-neutral-600); }
.note { display: flex; gap: 10px; margin: 0 0 8px; font-size: 15px; line-height: 26px; }
.note-n { font-weight: 700; color: var(--color-accent-700); }

/* Foot of a post: older left, home centred, newer right. The outer columns hold
   an empty span at the ends of the run, so Home never drifts off centre. */
.post-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: stretch;
  margin-top: 84px; padding-top: 28px; border-top: 2px solid var(--color-accent-800); }
.post-nav > * { border: 1px solid var(--color-neutral-300); border-radius: var(--radius-md);
  padding: 14px 18px; background: var(--color-neutral-100); }
.post-nav a { display: grid; gap: 4px; align-content: center; text-decoration: none; color: var(--color-accent-900); }
.post-nav a:hover { border-color: var(--color-accent); background: var(--color-accent-100); text-decoration: none; }
.post-nav span { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-neutral-600); }
.post-nav b { font-family: var(--font-heading); font-weight: 700; font-size: 17px; line-height: 24px; }
.post-nav .nav-next { text-align: right; }
.post-nav .nav-home { align-self: center; font-family: var(--font-heading); font-weight: 700;
  font-size: 15px; white-space: nowrap; }
.post-nav > span:empty { border: 0; background: none; padding: 0; }

@media (max-width: 620px) {
  .post-nav { grid-template-columns: minmax(0, 1fr); }
  .post-nav .nav-next { text-align: left; }
  .post-nav > span:empty { display: none; }
}

/* — interactive chart (built by blog.js) — */
.chart svg { display: block; width: 100%; height: 300px; overflow: visible; }
.chart-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 10px 28px; }
.chart-title { font-family: var(--font-heading); font-weight: 700; font-size: 19px; line-height: 28px; margin: 0;
  color: var(--color-accent-900); }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; }
.chart-legend button { display: flex; align-items: center; gap: 7px; background: transparent; border: 0; padding: 0;
  cursor: pointer; font: inherit; font-size: 14px; color: var(--color-text); }
.chart-legend button[aria-pressed="false"] { opacity: 0.4; }
.chart-legend i { width: 14px; height: 3px; display: block; }
.chart-plot { position: relative; margin-top: 14px; }
.chart-tip { position: absolute; top: 0; pointer-events: none; min-width: 132px; padding: 8px 12px;
  background: var(--color-bg); border: 1px solid var(--color-accent-800); border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm); }
.chart-tip p { margin: 0; display: flex; justify-content: space-between; gap: 14px; font-size: 15px; line-height: 24px; }
.chart-tip .chart-tip-h { display: block; margin-bottom: 4px; font-size: 12px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--color-neutral-600); }
.chart-tip .v { font-variant-numeric: tabular-nums; }
.chart-axis { font-family: var(--font-body); font-size: 12px; fill: var(--color-neutral-600); }

/* — archive / about / footer — */
.page-title { font-size: clamp(34px, 4.6vw, 54px); line-height: 1.1; letter-spacing: -0.02em;
  margin: 70px 0 42px -0.03em; color: var(--color-accent-900); }
.archive-list { display: grid; gap: 14px; max-width: 66ch; }
.arch { display: flex; align-items: baseline; gap: 8px; margin: 0; }
.arch a { font-family: var(--font-heading); font-weight: 700; font-size: 19px; color: var(--color-accent-900); }
.arch .leader { flex: 1; min-width: 28px; align-self: flex-end; margin-bottom: 0.34em;
  border-bottom: 1px dotted var(--color-neutral-400); }
.arch-date { font-size: 15px; color: var(--color-neutral-700); }
.about-grid { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 42px; align-items: start; }
.portrait { aspect-ratio: 4 / 5; border-radius: var(--radius-md); overflow: hidden; }
.about-grid .prose > p { text-align: left; }
.site-foot { padding: 84px var(--edge) 42px; font-size: 13px; color: var(--color-neutral-700); }

@media (max-width: 720px) {
  .entry, .about-grid { grid-template-columns: 1fr; }
  .entry-fig { max-width: 420px; }
  .prose > p { text-align: left; }
}
