:root {
  color-scheme: light dark;
  --surface-1: #fcfcfb;
  --page: #f9f9f7;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-1-soft: #86b6ef;
  --band: rgba(11, 11, 11, 0.04);
  --code-bg: #f3f2ee;
  --link: #1c5cab;
  --measure: 72ch;
  --donate-bg: #ffd5c2;
  --donate-text: #582715;
  --donate-hover: #ffc1a5;
}
@media (prefers-color-scheme: dark) {
  :root {
    --surface-1: #1a1a19;
    --page: #0d0d0d;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --axis: #383835;
    --border: rgba(255, 255, 255, 0.10);
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-1-soft: #1c5cab;
    --band: rgba(255, 255, 255, 0.05);
    --code-bg: #222221;
    --link: #86b6ef;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.55;
}
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface-1); padding: 8px 12px; }
.skip:focus { left: 8px; z-index: 10; }

.site-header {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 24px;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; letter-spacing: 0.04em; color: var(--text-primary); text-decoration: none; }
.site-header nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-header nav a { color: var(--text-secondary); text-decoration: none; font-size: 15px; }
.site-header nav a:hover { color: var(--text-primary); }

main { max-width: 1184px; margin: 0 auto; padding: 32px 24px 80px; }
section { margin: 0 0 56px; }
.spec-section > h2, .toc-section > h2 {
  font-size: 30px; line-height: 1.2; margin: 48px 0 16px; letter-spacing: -0.01em;
}
h2 .num { color: var(--muted); font-weight: 500; margin-right: 6px; }
h3 { font-size: 21px; margin: 32px 0 10px; }
p, li { max-width: var(--measure); }
.kw { font-weight: 600; font-variant: all-small-caps; letter-spacing: 0.03em; }
.pid { color: var(--text-secondary); }
.muted { color: var(--text-secondary); }
.caption { color: var(--muted); font-size: 14px; }

.hero { display: grid; grid-template-columns: 0.95fr 1.15fr; align-items: center; gap: 40px; padding-top: 36px; margin-bottom: 40px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.13em; font-size: 12px; font-weight: 650; color: var(--text-secondary); margin: 0 0 16px; }
.hero h1 { font-size: clamp(38px, 4.2vw, 58px); line-height: 1.06; margin: 0 0 22px; letter-spacing: -0.045em; font-weight: 650; }
.hero h1 span { color: var(--link); }
.hero-description { color: var(--text-secondary); font-size: 19px; line-height: 1.6; margin: 0; max-width: 38ch; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 28px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 12px; padding: 12px 18px; border-radius: 8px; font-size: 14px; font-weight: 650; text-decoration: none; line-height: 1.4; }
.button.primary { background: var(--text-primary); color: var(--page); }
.button.primary:hover { background: var(--link); color: var(--page); }
.site-header nav { align-items: center; }
.site-header nav .donate { background: var(--donate-bg); color: var(--donate-text); padding: 10px 16px; }
.site-header nav .donate:hover { background: var(--donate-hover); color: var(--donate-text); }
.text-link { font-size: 14px; font-weight: 600; color: var(--text-primary); }
a:focus-visible, video:focus-visible { outline: 3px solid var(--link); outline-offset: 5px; }
.hero-note { margin: 22px 0 0; color: var(--text-secondary); font-size: 12px; }
.hero-video { margin: 0; min-width: 0; background: var(--surface-1); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: 0 20px 55px rgba(11, 11, 11, 0.09); scroll-margin-top: 20px; }
.hero-video video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #101010; }
.hero-video figcaption { display: flex; align-items: center; gap: 9px; padding: 16px 18px; font-size: 13px; font-weight: 600; }
.video-dot { width: 7px; height: 7px; background: var(--link); border-radius: 50%; }
.video-caption { margin-left: auto; font-size: 12px; font-weight: 400; color: var(--text-secondary); }
.hero-principles { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; padding: 28px 0 0; border-top: 1px solid var(--border); }
.hero-principles p { margin: 0; font-size: 14px; }
.hero-principles b { display: block; margin-bottom: 4px; font-weight: 600; }
.hero-principles span { color: var(--text-secondary); }
.progress-section { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 48px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 14px; padding: 28px 32px; }
.progress-heading .eyebrow { margin-bottom: 8px; }
.progress-heading h2 { margin: 0; font-size: 23px; font-weight: 600; line-height: 1.25; letter-spacing: -0.02em; }
.progress-label { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.progress-label strong { font-size: 32px; font-weight: 600; font-variant-numeric: tabular-nums; }
.progress-label a { font-size: 12px; }
.progress-status progress { display: block; appearance: none; width: 100%; height: 6px; margin: 8px 0 12px; border: 0; border-radius: 8px; overflow: hidden; background: var(--grid); color: var(--link); }
.progress-status progress::-webkit-progress-bar { background: var(--grid); }
.progress-status progress::-webkit-progress-value { background: var(--link); border-radius: 8px; }
.progress-status progress::-moz-progress-bar { background: var(--link); border-radius: 8px; }
.progress-status p { margin: 0; color: var(--text-secondary); font-size: 12px; }
.lead p { font-size: 19px; }

.table-wrap { overflow-x: auto; margin: 16px 0 24px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; background: var(--surface-1); }
th, td { text-align: left; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid var(--grid); }
th { font-weight: 600; color: var(--text-secondary); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:hover { background: var(--band); }

pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; overflow-x: auto; font-size: 14px; line-height: 1.5; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.toc { columns: 2; column-gap: 32px; padding-left: 0; list-style: none; }
.toc li { break-inside: avoid; margin: 4px 0; }
.sources { padding-left: 0; list-style: none; }
.sources .ref { color: var(--muted); margin-right: 6px; }

.toc-section .lead { margin: 8px 0 20px; }
.toc-section .intro { font-size: 18px; }
.site-footer { border-top: 1px solid var(--border); color: var(--text-secondary); font-size: 14px; padding: 24px; max-width: 1184px; margin: 0 auto; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 12px; }
  .hero-copy { max-width: 640px; }
  .hero h1 { font-size: clamp(38px, 7vw, 62px); }
  .hero-video { width: 100%; }
  .progress-section { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  main { padding: 24px 18px 60px; }
  .site-header { padding: 12px 18px; }
  .site-header nav { gap: 14px; }
  .site-header nav a { font-size: 14px; }
  .hero { margin-bottom: 32px; }
  .hero h1 { font-size: clamp(34px, 9vw, 52px); }
  .hero-description { font-size: 18px; }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 18px; }
  .hero-principles { grid-template-columns: 1fr; gap: 16px; padding-top: 24px; }
  .video-caption { display: none; }
  .progress-section { padding: 24px; }
  .toc { columns: 1; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
