/* =============================================================================
   ZaCoastal — design system
   Single stylesheet for every page. Tokens only; page markup uses these classes.
   ========================================================================== */

/* ------------------------------------------------------------- design tokens */
:root {
  /* ink (brand navy) */
  --ink-950: #07101f;
  --ink-900: #0b1626;
  --ink-800: #122036;
  --ink-700: #1a2f4d;
  --ink-600: #274063;
  --ink-500: #3a537a;
  --ink-400: #5d7599;
  --ink-300: #879dbd;
  --ink-200: #b6c5d9;
  --ink-100: #d9e2ee;
  --ink-50: #eef2f8;

  /* sand (coastal accent) */
  --sand-600: #a97a24;
  --sand-500: #c4963a;
  --sand-400: #d8a64c;
  --sand-300: #e7bf6f;
  --sand-200: #f0d6a3;
  --sand-100: #f7ead0;

  /* semantic */
  --pos-600: #157554;
  --pos-500: #1f9e6e;
  --pos-400: #35b684;
  --pos-100: #d8efe6;
  --neg-600: #a33b2e;
  --neg-500: #c14f3f;
  --neg-400: #d96a58;
  --neg-100: #f6dfda;
  --amber-500: #c9922f;
  --amber-100: #f3e7cc;
  --neutral-500: #6b7a92;

  /* light theme (default) */
  --bg: #f6f3ec;
  --bg-elev: #fdfcf9;
  --surface: #ffffff;
  --surface-2: #f0ede4;
  --surface-3: #e7e2d6;
  --text: #122036;
  --text-soft: #31435f;
  --text-muted: #5b6b85;
  --border: #ddd6c6;
  --border-strong: #c9c0ad;
  --glass: rgba(253, 252, 249, 0.82);
  --shadow: 0 1px 2px rgba(7, 16, 31, 0.05), 0 8px 24px rgba(7, 16, 31, 0.07);
  --shadow-lg: 0 4px 12px rgba(7, 16, 31, 0.08), 0 20px 48px rgba(7, 16, 31, 0.14);
  --radius: 12px;
  --radius-sm: 8px;
  --ring: 0 0 0 3px rgba(39, 64, 99, 0.35);

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia,
    "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  --maxw: 1160px;
  --maxw-read: 760px;
  --nav-h: 64px;
}

/* ------------------------------------------------------------- dark theme */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1626;
    --bg-elev: #0d1a2e;
    --surface: #122036;
    --surface-2: #172a48;
    --surface-3: #1d3357;
    --text: #e8eef7;
    --text-soft: #c3cfe0;
    --text-muted: #93a4bd;
    --border: #223650;
    --border-strong: #304764;
    --glass: rgba(11, 22, 38, 0.8);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.35), 0 20px 48px rgba(0, 0, 0, 0.5);
    --ring: 0 0 0 3px rgba(135, 157, 189, 0.4);
  }
}
:root[data-theme="dark"] {
  --bg: #0b1626;
  --bg-elev: #0d1a2e;
  --surface: #122036;
  --surface-2: #172a48;
  --surface-3: #1d3357;
  --text: #e8eef7;
  --text-soft: #c3cfe0;
  --text-muted: #93a4bd;
  --border: #223650;
  --border-strong: #304764;
  --glass: rgba(11, 22, 38, 0.8);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.35), 0 20px 48px rgba(0, 0, 0, 0.5);
  --ring: 0 0 0 3px rgba(135, 157, 189, 0.4);
}

/* --------------------------------------------------------------- base */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* long-read pages use serif, larger type */
body.serif { font-family: var(--font-serif); font-size: 18px; }
body.serif h1, body.serif h2, body.serif h3,
body.serif h4, body.serif h5 { font-family: var(--font-sans); }
body.serif p, body.serif li { line-height: 1.72; }
body.serif .read { max-width: var(--maxw-read); }

h1, h2, h3, h4, h5 {
  font-family: var(--font-sans);
  color: var(--text);
  line-height: 1.22;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 650; }
h3 { font-size: 1.18rem; font-weight: 650; }
h4 { font-size: 1.02rem; font-weight: 650; }
p { margin: 0 0 1em; }
a { color: var(--ink-500); text-decoration: none; }
a:hover { text-decoration: underline; }
:root[data-theme="dark"] a { color: var(--sand-300); }
:root[data-theme="dark"] a:hover { color: var(--sand-200); }

strong { font-weight: 650; }
code, .mono { font-family: var(--font-mono); font-size: 0.92em; }
ul, ol { padding-left: 1.3em; margin: 0 0 1em; }
li { margin-bottom: 0.35em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2.2em 0; }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 4px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink-900); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ------------------------------------------------------------- layout */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: 900px; }
.container--read { max-width: 820px; }

main { display: block; }

.section { padding: 72px 0; position: relative; }
.section--tight { padding: 40px 0; }
.section--alt { background: var(--surface-2); }
:root[data-theme="dark"] .section--alt { background: var(--bg-elev); }

.section-head { max-width: 720px; margin-bottom: 40px; }
.section-head .kicker {
  font-family: var(--font-sans); font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--sand-600);
}
:root[data-theme="dark"] .section-head .kicker { color: var(--sand-300); }

.lead { font-size: 1.12rem; color: var(--text-soft); }

/* ------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: var(--glass);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--maxw); margin: 0 auto; height: 100%;
  padding: 0 24px; display: flex; align-items: center; gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); font-size: 1.02rem; }
.brand:hover { text-decoration: none; }
.brand svg { width: 26px; height: 26px; }
.brand .brand-mark { color: var(--ink-900); }
:root[data-theme="dark"] .brand .brand-mark { color: var(--sand-300); }

.draft-flag {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--neg-600); background: var(--neg-100);
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
:root[data-theme="dark"] .draft-flag { color: var(--neg-400); background: rgba(193, 79, 63, 0.16); }

.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 8px; font-size: 0.92rem; font-weight: 550;
  color: var(--text-soft); white-space: nowrap;
}
.nav-links a:hover { text-decoration: none; background: var(--surface-2); color: var(--text); }
.nav-links a[aria-current="page"] { background: var(--ink-900); color: #fff; }
:root[data-theme="dark"] .nav-links a[aria-current="page"] { background: var(--sand-500); color: #141414; }

.nav-cta {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  font-size: 0.9rem; font-weight: 650; color: #fff;
  background: var(--ink-900); padding: 9px 16px; border-radius: 999px;
}
.nav-cta:hover { text-decoration: none; background: var(--ink-700); color: #fff; }
:root[data-theme="dark"] .nav-cta { background: var(--sand-500); color: #141414; }
:root[data-theme="dark"] .nav-cta:hover { background: var(--sand-400); color: #141414; }

.theme-toggle {
  border: 1px solid var(--border); background: transparent; color: var(--text-soft);
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.theme-toggle:hover { background: var(--surface-2); color: var(--text); }

.hamburger {
  display: none; border: 1px solid var(--border); background: transparent; color: var(--text);
  width: 40px; height: 40px; border-radius: 10px; cursor: pointer; font-size: 1.1rem;
}

/* mobile drawer */
.drawer {
  display: none; position: fixed; inset: 0; z-index: 60;
}
.drawer.open { display: block; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(7, 16, 31, 0.5); }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(320px, 86vw);
  background: var(--surface); border-left: 1px solid var(--border);
  padding: 20px; display: flex; flex-direction: column; gap: 6px; overflow: auto;
  box-shadow: var(--shadow-lg);
}
.drawer-panel a { padding: 12px 14px; border-radius: 10px; font-weight: 600; color: var(--text-soft); }
.drawer-panel a:hover { background: var(--surface-2); text-decoration: none; }
.drawer-panel a[aria-current="page"] { background: var(--ink-900); color: #fff; }
:root[data-theme="dark"] .drawer-panel a[aria-current="page"] { background: var(--sand-500); color: #141414; }

@media (max-width: 800px) {
  .js .nav-links { display: none; }
  .js .hamburger { display: inline-flex; }
  .nav-cta { display: none; }
}
/* no-JS mobile fallback: keep the nav visible and let it wrap */
html:not(.js) .site-header { height: auto; }
html:not(.js) .header-inner { flex-wrap: wrap; height: auto; padding-top: 8px; padding-bottom: 8px; }
html:not(.js) .nav-links { flex-wrap: wrap; order: 3; width: 100%; }
/* no-JS fallback: reveal the hidden data tables and modal detail content so
   every number stays readable without JavaScript, and hide the JS-only
   "Show data" / "Details" buttons that cannot work without it. */
html:not(.js) [hidden] { display: block; }
html:not(.js) [data-show-data],
html:not(.js) [data-modal-open] { display: none; }

/* ------------------------------------------------------------- hero */
.hero { padding: 72px 0 48px; }
.hero .kicker { display: inline-block; margin-bottom: 18px; }
.hero h1 { max-width: 18ch; margin-bottom: 18px; }
.hero .thesis { font-size: 1.25rem; color: var(--text-soft); max-width: 60ch; margin-bottom: 28px; }

/* ------------------------------------------------------------- badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-sans); font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; vertical-align: middle; white-space: nowrap;
}
.badge--pos { color: var(--pos-600); background: var(--pos-100); }
.badge--neg { color: var(--neg-600); background: var(--neg-100); }
.badge--mixed { color: var(--amber-500); background: var(--amber-100); }
.badge--neutral { color: var(--neutral-500); background: var(--ink-100); }
.badge--est {
  color: var(--sand-600); background: var(--sand-100); cursor: help;
  border: 1px dashed var(--sand-400);
}
:root[data-theme="dark"] .badge--pos { color: var(--pos-400); background: rgba(31, 158, 110, 0.16); }
:root[data-theme="dark"] .badge--neg { color: var(--neg-400); background: rgba(193, 79, 63, 0.16); }
:root[data-theme="dark"] .badge--mixed { color: var(--sand-300); background: rgba(201, 146, 47, 0.16); }
:root[data-theme="dark"] .badge--neutral { color: var(--ink-300); background: rgba(135, 157, 189, 0.14); }
:root[data-theme="dark"] .badge--est { color: var(--sand-300); background: rgba(216, 166, 76, 0.14); border-color: var(--sand-500); }

/* ------------------------------------------------------------- cards */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }
.card-grid { display: grid; gap: 20px; }
.card-grid--3 { grid-template-columns: repeat(3, 1fr); }
.card-grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 880px) {
  .card-grid--3, .card-grid--2 { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------- verdict */
.verdict-card { border-left: 4px solid var(--neutral-500); }
.verdict-card--pos { border-left-color: var(--pos-500); }
.verdict-card--neg { border-left-color: var(--neg-500); }
.verdict-card--mixed { border-left-color: var(--amber-500); }
.verdict-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.verdict-dot {
  width: 22px; height: 22px; border-radius: 50%; flex: none; display: grid; place-items: center;
  color: #fff; font-size: 0.8rem; font-weight: 700;
}
.verdict-dot--pos { background: var(--pos-500); }
.verdict-dot--neg { background: var(--neg-500); }
.verdict-dot--mixed { background: var(--amber-500); }
.verdict-who { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.verdict-label { font-weight: 700; font-size: 1.05rem; }
.verdict-why { font-size: 0.95rem; color: var(--text-soft); margin: 0; }

/* ------------------------------------------------------------- stat */
.stat { font-family: var(--font-sans); }
.stat .stat-value { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.stat .stat-label { font-size: 0.86rem; color: var(--text-muted); }
.stat--pos .stat-value { color: var(--pos-600); }
.stat--neg .stat-value { color: var(--neg-600); }
:root[data-theme="dark"] .stat--pos .stat-value { color: var(--pos-400); }
:root[data-theme="dark"] .stat--neg .stat-value { color: var(--neg-400); }

/* ------------------------------------------------------------- callout */
.callout {
  border: 1px solid var(--border); border-left: 4px solid var(--ink-400);
  background: var(--surface); border-radius: var(--radius-sm); padding: 18px 20px;
}
.callout--warn { border-left-color: var(--amber-500); }
.callout--danger { border-left-color: var(--neg-500); }
.callout--info { border-left-color: var(--ink-500); }
.callout p:last-child { margin-bottom: 0; }
.callout .callout-title { font-weight: 700; margin-bottom: 4px; display: block; }

/* ------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.table-hint { display: none; }
@media (max-width: 720px) {
  .table-hint { display: block; font-size: 0.78rem; color: var(--text-muted); padding: 8px 14px 0; }
}
table.data-table {
  width: 100%; border-collapse: collapse; font-family: var(--font-sans);
  font-size: 0.92rem; min-width: 560px;
}
.data-table caption {
  caption-side: top; text-align: left; padding: 14px 16px 8px;
  font-weight: 700; font-size: 0.95rem; color: var(--text);
}
.data-table th, .data-table td {
  padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.data-table thead th {
  position: sticky; top: 0; background: var(--surface-2); font-weight: 700;
  font-size: 0.8rem; letter-spacing: 0.02em; color: var(--text-soft);
  border-bottom: 2px solid var(--border-strong); z-index: 1;
}
.data-table tbody tr:nth-child(even) { background: var(--surface-2); }
.data-table tbody tr:hover { background: var(--sand-100); }
:root[data-theme="dark"] .data-table tbody tr:hover { background: rgba(216, 166, 76, 0.08); }
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table td.pos { color: var(--pos-600); font-weight: 650; }
.data-table td.neg { color: var(--neg-600); font-weight: 650; }
:root[data-theme="dark"] .data-table td.pos { color: var(--pos-400); }
:root[data-theme="dark"] .data-table td.neg { color: var(--neg-400); }
.data-table td.na { color: var(--text-muted); font-style: italic; }

/* ------------------------------------------------------------- figures */
figure.chart { margin: 0 0 24px; }
figure.chart figcaption {
  font-size: 0.82rem; color: var(--text-muted); margin-top: 8px;
}
figure.chart .chart-canvas {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px; min-height: 120px;
}
.chart-note { font-size: 0.78rem; color: var(--text-muted); }

/* generic bars (also used by charts.js fallbacks) */
.bar-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.bar-label { width: 128px; flex: none; font-size: 0.82rem; color: var(--text-soft); text-align: right; }
.bar-track { flex: 1; height: 14px; background: var(--surface-3); border-radius: 7px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 7px; background: var(--ink-400); }
.bar-fill--pos { background: var(--pos-500); }
.bar-fill--neg { background: var(--neg-500); }
.bar-fill--sand { background: var(--sand-500); }
.bar-fill--neutral { background: var(--neutral-500); }
.bar-value { width: 84px; flex: none; font-size: 0.82rem; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- glossary term */
.term {
  border-bottom: 1px dashed var(--sand-500); cursor: help; color: inherit;
  text-decoration: none; font-weight: 550;
}
.term:hover { text-decoration: none; color: var(--sand-600); }
:root[data-theme="dark"] .term:hover { color: var(--sand-300); }

/* tooltip (keyboard + hover) */
.tooltip {
  position: absolute; z-index: 70; max-width: 320px;
  background: var(--ink-900); color: #fff; border-radius: 10px;
  padding: 12px 14px; font-family: var(--font-sans); font-size: 0.86rem; line-height: 1.5;
  box-shadow: var(--shadow-lg);
}
.tooltip .tt-term { display: block; font-weight: 700; color: var(--sand-300); margin-bottom: 4px; }
.tooltip .tt-learn { display: inline-block; margin-top: 8px; color: var(--sand-300); font-weight: 650; font-size: 0.82rem; }

/* ------------------------------------------------------------- modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 80; background: rgba(7, 16, 31, 0.6);
  display: flex; align-items: flex-start; justify-content: center; padding: 7vh 20px 20px;
  overflow: auto;
}
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  max-width: 640px; width: 100%; padding: 28px; box-shadow: var(--shadow-lg);
  animation: modal-in 0.18s ease-out;
}
.modal h3 { margin-top: 0; }
.modal .modal-close {
  float: right; border: 1px solid var(--border); background: transparent; color: var(--text-soft);
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer; font-size: 1rem;
}
.modal .modal-close:hover { background: var(--surface-2); }
@keyframes modal-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------- reveal */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease-out, transform 0.5s ease-out; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ------------------------------------------------------------- jump rail / toc */
.jump-rail {
  position: fixed; right: 20px; top: 50%; transform: translateY(-50%); z-index: 40;
  display: flex; flex-direction: column; gap: 2px;
}
.jump-rail a {
  font-size: 0.72rem; color: var(--text-muted); padding: 3px 8px;
  border-left: 2px solid var(--border-strong); transition: color 0.15s, border-color 0.15s;
}
.jump-rail a:hover { text-decoration: none; color: var(--text); }
.jump-rail a.active { color: var(--ink-500); border-left-color: var(--sand-500); font-weight: 650; }
:root[data-theme="dark"] .jump-rail a.active { color: var(--sand-300); }
@media (max-width: 1100px) { .jump-rail { display: none; } }

.toc { position: sticky; top: calc(var(--nav-h) + 24px); }
.toc h4 { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc a { display: block; padding: 5px 0; font-size: 0.9rem; color: var(--text-soft); border-left: 2px solid var(--border-strong); padding-left: 12px; }
.toc a:hover { text-decoration: none; color: var(--text); border-left-color: var(--sand-500); }
.toc a.active { color: var(--ink-500); border-left-color: var(--sand-500); font-weight: 650; }
:root[data-theme="dark"] .toc a.active { color: var(--sand-300); }

/* reading progress */
.read-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 90;
  background: var(--sand-500);
}

/* long-read two-column layout (toc + content) */
.report-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; align-items: start; }
@media (max-width: 920px) {
  .report-layout { grid-template-columns: 1fr; }
  .report-layout .toc { display: none; }
}

/* ------------------------------------------------------------- footer */
.site-footer {
  border-top: 1px solid var(--border); background: var(--surface);
  padding: 40px 0 56px; margin-top: 40px;
}
.site-footer .disclaimer {
  font-size: 0.82rem; color: var(--text-muted); max-width: 760px;
  border-top: 1px solid var(--border); padding-top: 18px; margin-top: 22px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { font-size: 0.9rem; }

/* ------------------------------------------------------------- anchor links */
.anchor {
  opacity: 0; margin-left: 6px; font-size: 0.8em; color: var(--text-muted);
  transition: opacity 0.15s; vertical-align: middle;
}
h2:hover .anchor, h3:hover .anchor, h4:hover .anchor { opacity: 1; }
.anchor:hover { color: var(--sand-600); }

/* ------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: var(--font-sans); font-size: 0.92rem; font-weight: 650;
  padding: 10px 18px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text);
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn--primary { background: var(--ink-900); border-color: var(--ink-900); color: #fff; }
.btn--primary:hover { background: var(--ink-700); color: #fff; }
:root[data-theme="dark"] .btn--primary { background: var(--sand-500); border-color: var(--sand-500); color: #141414; }
:root[data-theme="dark"] .btn--primary:hover { background: var(--sand-400); }
.btn--sm { padding: 6px 12px; font-size: 0.82rem; border-radius: 8px; }

/* ------------------------------------------------------------- segmented / filter */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.segmented button {
  font-family: var(--font-sans); font-size: 0.88rem; font-weight: 600;
  padding: 8px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-soft);
}
.segmented button[aria-pressed="true"] { background: var(--ink-900); border-color: var(--ink-900); color: #fff; }
:root[data-theme="dark"] .segmented button[aria-pressed="true"] { background: var(--sand-500); border-color: var(--sand-500); color: #141414; }
.segmented button:hover { background: var(--surface-2); }

/* ------------------------------------------------------------- misc */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 880px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.flex { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 24px; } .mb-2 { margin-bottom: 24px; }
.text-muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }
.small { font-size: 0.86rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* key/value */
.kv { display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; }
.kv .k { color: var(--text-muted); font-size: 0.9rem; }
.kv .v { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }

/* ------------------------------------------------------------- print */
@media print {
  .site-header, .site-footer, .jump-rail, .read-progress, .toc, .theme-toggle,
  .hamburger, .drawer, .nav-cta, .skip-link { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  body.serif { font-size: 12pt; }
  .section { padding: 20px 0; }
  .container { max-width: 100%; padding: 0; }
  a { color: #000; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; word-break: break-all; }
  .reveal { opacity: 1; transform: none; }
  .card { box-shadow: none; border: 1px solid #ccc; page-break-inside: avoid; }
  table.data-table { min-width: 0; }
  thead th { position: static; }
  h2, h3 { page-break-after: avoid; }
}
