/* ==========================================================================
   Saishutsu — its own identity (owner, 2026-10-06), minimalist: a ledger.
   Paper and ink, one accent for money that can be followed, greys for the
   rest. Body in Atkinson Hyperlegible Next, figures in IBM Plex Mono.
   Still a Systems Atlas project, and still under its rules: no JavaScript,
   no inline styles, no third-party origins (see _headers).
   Class names are the generator's (build.py); "field--night" is the page's
   emphasis field, not a dark one.
   ========================================================================== */

@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("/fonts/AtkinsonHyperlegibleNext-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("/fonts/AtkinsonHyperlegibleNext-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/fonts/IBMPlexMono-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --paper: #FAF9F6;          /* the page */
  --sheet: #FFFFFF;          /* the emphasis field */
  --ink: #15171A;
  --ink-2: #4C5157;
  --ink-3: #868B91;
  --rule: #E4E2DC;
  --track: #EFEDE8;

  /* One accent: money followed to who received it. Tints of it for its kinds. */
  --accent: #1D4ED8;
  --accent-benefit: #6C8FEA;
  --accent-total: #4F6BB0;
  --accent-named: #C7D3F6;
  /* What is not followed, in greys: withheld names, debt interest, adjustments, the gap. */
  --grey-withheld: #8F959B;
  --grey-debt: #BFBCB4;
  --grey-adjust: #D6D3CC;
  --grey-gap: #E6E3DD;
  /* Flags: the draft banner, notes on assumptions. Used sparingly. */
  --flag: #B4400E;

  --body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px; --s5: 32px; --s6: 48px; --s7: 64px; --s8: 96px;
  --reading: 680px;
  --layout: 1200px;
  --gutter: clamp(16px, 5vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(16px, 15px + 0.25vw, 18px);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: underline; text-decoration-color: var(--ink-3); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--s3); top: var(--s3); background: var(--sheet); color: var(--ink); padding: var(--s2) var(--s3); z-index: 20; }

/* Fields: paper for reading, a white sheet for the figures that matter. */
.field--night { background: var(--sheet); color: var(--ink); border-bottom: 1px solid var(--rule); }
.field--paper { background: var(--paper); color: var(--ink); }
.field--structure { background: var(--paper); color: var(--ink); }

.wrap { width: 100%; max-width: var(--layout); margin-inline: auto; padding-inline: var(--gutter); }
.reading { max-width: var(--reading); }
.band { padding-block: clamp(var(--s6), 7vw, var(--s8)); }
.band--tight { padding-block: clamp(var(--s5), 5vw, var(--s6)); }

/* Masthead */
.masthead { background: var(--paper); border-bottom: 1px solid var(--ink); }
.masthead__inner { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s3); padding-block: var(--s3); }
.brand { font-family: var(--mono); font-size: 17px; letter-spacing: 0.04em; text-decoration: none; }
.brand::before { content: ""; display: inline-block; width: 10px; height: 10px; background: var(--accent); margin-right: var(--s2); }
.brand__sub { font-family: var(--body); font-size: 14px; letter-spacing: 0; color: var(--ink-3); margin-left: var(--s3); }
.nav { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); font-size: 15px; }
.nav a { text-decoration: none; color: var(--ink-2); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); }

.draft { background: var(--paper); color: var(--flag); border-bottom: 1px solid var(--flag); font-family: var(--mono); font-size: 13px; }
.draft p { padding-block: var(--s2); }

/* Type roles */
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: var(--s3); }
.title { font-weight: 700; font-size: clamp(32px, 4.4vw, 56px); line-height: 1.08; letter-spacing: -0.02em; max-width: 22ch; text-wrap: balance; }
.section-title { font-weight: 700; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.15; letter-spacing: -0.01em; margin-bottom: var(--s3); max-width: 30ch; text-wrap: balance; }
.sub-title { font-weight: 700; font-size: clamp(18px, 1.5vw, 21px); line-height: 1.3; margin: var(--s5) 0 var(--s2); }
.lede { font-size: clamp(18px, 1.35vw, 20px); line-height: 1.5; max-width: 54ch; margin-top: var(--s4); color: var(--ink-2); }
.prose { max-width: var(--reading); color: var(--ink-2); }
.prose p + p, .prose p + ul, .prose ul + p { margin-top: var(--s3); }
.prose ul { padding-left: 1.2em; }
.prose li + li { margin-top: var(--s2); }
.prose strong { color: var(--ink); }
.prose blockquote { margin: var(--s3) 0; padding-left: var(--s3); border-left: 2px solid var(--rule); color: var(--ink); }
.mono, .data { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.small { font-size: 14px; }
.muted { color: var(--ink-3); }

/* The headline figure */
.headline { display: grid; gap: var(--s3); margin-top: var(--s6); }
.headline__pct { font-family: var(--mono); font-size: clamp(72px, 13vw, 176px); line-height: 0.9; letter-spacing: -0.04em; color: var(--accent); }
.headline__text { font-size: clamp(18px, 1.5vw, 21px); max-width: 52ch; color: var(--ink-2); }
.headline__text strong { color: var(--ink); }

/* Bars: inline SVG, widths as SVG attributes (not style attributes). */
.bar { width: 100%; height: 28px; margin-top: var(--s4); }
.bar--small { height: 10px; margin-top: 0; }
.bar__track { fill: var(--track); }
.seg--identified { fill: var(--accent); }
.seg--benefits { fill: var(--accent-benefit); }
.seg--named { fill: var(--accent-named); }
.seg--withheld { fill: var(--grey-withheld); }
.seg--total { fill: var(--accent-total); }
.seg--gap { fill: var(--grey-gap); }

.key { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin-top: var(--s3); font-size: 14px; color: var(--ink-2); padding: 0; }
.key li { display: flex; align-items: center; gap: var(--s2); list-style: none; }
.swatch { width: 12px; height: 12px; flex: none; }
.swatch rect { width: 14px; height: 14px; }

/* Stat grid: figures in mono, a thin rule above each. */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s4); margin-top: var(--s5); }
.stat { border-top: 1px solid var(--ink); padding-top: var(--s2); }
.stat__value { font-family: var(--mono); font-size: clamp(24px, 2.4vw, 32px); line-height: 1.15; letter-spacing: -0.02em; }
.stat__label { font-size: 14px; margin-top: var(--s1); color: var(--ink-2); }
.stat--evidence, .stat--applied { border-top: 2px solid var(--accent); }
.stat--structural { border-top-color: var(--ink-3); }
.stat--revision { border-top-color: var(--flag); }

/* Tables: a ledger. */
.table-scroll { overflow-x: auto; margin-top: var(--s4); border-top: 1px solid var(--ink); }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { text-align: left; padding: var(--s2) var(--s3) var(--s2) 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.table th { font-family: var(--mono); font-weight: 400; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.table td.num, .table th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.table td.barcell { min-width: 140px; width: 22%; padding-top: 15px; }
.table a { text-decoration: none; }
.table a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.table tfoot td { font-weight: 700; border-bottom: none; border-top: 1px solid var(--ink); }

/* Gap reasons */
.reasons { list-style: none; padding: 0; margin-top: var(--s4); display: grid; gap: var(--s3); max-width: 860px; }
.reason { border-left: 2px solid var(--ink-3); padding: var(--s1) 0 var(--s1) var(--s3); }
.reason--measured { border-left-color: var(--ink); }
.reason--structural { border-left-color: var(--rule); }
.reason__head { font-weight: 700; }
.reason__fig { font-family: var(--mono); font-size: 14px; margin-left: var(--s2); white-space: nowrap; color: var(--ink-2); }
.reason p { color: var(--ink-2); margin-top: var(--s1); }
.tag { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; padding: 1px 6px; border: 1px solid currentColor; margin-left: var(--s2); white-space: nowrap; color: var(--ink-3); }

.note { border-left: 2px solid var(--flag); padding-left: var(--s3); margin-top: var(--s4); max-width: var(--reading); color: var(--ink-2); }

details { margin-top: var(--s3); }
summary { cursor: pointer; font-family: var(--mono); font-size: 13px; color: var(--ink-2); }

.cols { display: grid; gap: var(--s6); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.footer { padding-block: var(--s6); font-size: 14px; color: var(--ink-2); background: var(--paper); border-top: 1px solid var(--ink); border-bottom: none; }
.footer p + p { margin-top: var(--s2); }
.footer a { color: var(--ink); }

@media (max-width: 640px) {
  .table { font-size: 14px; }
  .table td.barcell, .table th.barcell { display: none; }
  .hide-sm { display: none; }
  .brand__sub { display: none; }
}

/* A page whose wrap is itself prose: full layout width, reading-width children, left-aligned. */
.wrap.prose { max-width: var(--layout); }
.wrap.prose > * { max-width: var(--reading); }
.wrap.prose > .title { max-width: 22ch; }
.prose .title, .prose .section-title, .prose .sub-title { color: var(--ink); }
