:root {
  color-scheme: light;
  --paper: oklch(96% 0.018 92);
  --paper-deep: oklch(91% 0.026 91);
  --ink: oklch(24% 0.025 158);
  --ink-soft: oklch(43% 0.025 158);
  --moss: oklch(38% 0.07 151);
  --moss-light: oklch(86% 0.055 147);
  --orange: oklch(65% 0.15 52);
  --rule: oklch(79% 0.032 92);
  --danger: oklch(48% 0.14 28);
  --max: 72rem;
  --reading: 46rem;
  --radius: 0.75rem;
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); line-height: 1.65; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--moss); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--orange); outline-offset: 4px; border-radius: 0.2rem; }
.skip-link { position: fixed; left: 1rem; top: 1rem; z-index: 10; padding: 0.6rem 0.9rem; background: var(--ink); color: var(--paper); transform: translateY(-180%); }
.skip-link:focus { transform: translateY(0); }

.site-header { border-bottom: 1px solid var(--rule); }
.nav { width: min(calc(100% - 2rem), var(--max)); margin: auto; min-height: 4.6rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { color: var(--ink); text-decoration: none; font-weight: 750; letter-spacing: -0.02em; }
.brand-mark { display: inline-block; width: 0.8rem; height: 0.8rem; margin-right: 0.55rem; background: var(--orange); border-radius: 0.18rem; transform: rotate(-7deg); }
.nav-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; font-size: 0.9rem; }
.nav-links a { color: var(--ink-soft); text-decoration: none; }
.nav-links a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; }

main { min-height: 70vh; }
.shell { width: min(calc(100% - 2rem), var(--max)); margin-inline: auto; }
.hero { padding: clamp(4.5rem, 10vw, 8.5rem) 0 clamp(3.5rem, 7vw, 6rem); display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(16rem, 0.5fr); gap: 3rem; align-items: end; }
.eyebrow { margin: 0 0 1rem; color: var(--moss); font-size: 0.77rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
h1, h2, h3 { font-family: Iowan Old Style, Baskerville, "Times New Roman", serif; text-wrap: balance; }
h1 { max-width: 16ch; margin: 0; font-size: clamp(3rem, 7.5vw, 6.8rem); line-height: 0.94; letter-spacing: -0.04em; font-weight: 600; }
h2 { margin: 0 0 1.5rem; font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.03; letter-spacing: -0.025em; font-weight: 600; }
h3 { margin: 0 0 0.55rem; font-size: 1.35rem; line-height: 1.2; }
p { margin: 0 0 1rem; text-wrap: pretty; }
.lede { max-width: 34rem; margin: 0; color: var(--ink-soft); font-size: clamp(1.05rem, 2vw, 1.25rem); }
.hero-note { padding-left: 1.25rem; border-left: 3px solid var(--orange); color: var(--ink-soft); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.8rem; padding: 0.6rem 1rem; border: 1px solid var(--moss); border-radius: 999px; color: var(--paper); background: var(--moss); text-decoration: none; font-weight: 700; }
.button.secondary { color: var(--moss); background: transparent; }
.button:hover { color: var(--paper); background: var(--ink); border-color: var(--ink); }

.band { padding: clamp(3.5rem, 7vw, 6rem) 0; border-top: 1px solid var(--rule); }
.band.deep { background: var(--ink); color: var(--paper); }
.band.deep a { color: var(--moss-light); }
.section-head { display: grid; grid-template-columns: 0.65fr 1.35fr; gap: 2rem; margin-bottom: 2.5rem; }
.section-head p { max-width: 38rem; color: var(--ink-soft); font-size: 1.08rem; }
.deep .section-head p { color: oklch(81% 0.02 155); }
.mode-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--rule); }
.mode { padding: 1.6rem 1.6rem 1.8rem 0; border-bottom: 1px solid var(--rule); }
.mode + .mode { padding-left: 1.6rem; border-left: 1px solid var(--rule); }
.mode-number { color: var(--orange); font-variant-numeric: tabular-nums; font-weight: 800; }
.mode p { color: var(--ink-soft); }
.proof-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 1.25rem; align-items: start; }
.proof-grid figure { margin: 0; }
.proof-grid figure:first-child { grid-row: span 2; }
.proof-grid img { border: 1px solid var(--rule); border-radius: var(--radius); background: white; }
figcaption { margin-top: 0.65rem; color: var(--ink-soft); font-size: 0.84rem; }
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; counter-reset: flow; }
.flow > div { min-height: 9rem; padding-top: 1rem; border-top: 3px solid var(--moss-light); }
.flow strong { display: block; margin-bottom: 0.5rem; color: var(--moss-light); }
.flow p { color: oklch(80% 0.02 155); font-size: 0.92rem; }

.page-head { max-width: var(--reading); padding: clamp(4rem, 8vw, 7rem) 0 3rem; }
.page-head h1 { max-width: 13ch; font-size: clamp(2.8rem, 6vw, 5.3rem); }
.page-head .lede { margin-top: 1.5rem; }
.doc-layout { display: grid; grid-template-columns: 14rem minmax(0, var(--reading)); gap: clamp(2rem, 6vw, 6rem); align-items: start; padding-bottom: 6rem; }
.toc { position: sticky; top: 1.5rem; padding-top: 0.3rem; }
.toc strong { display: block; margin-bottom: 0.6rem; font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; }
.toc a { display: block; padding: 0.3rem 0; color: var(--ink-soft); text-decoration: none; font-size: 0.9rem; }
.prose h2 { margin-top: 3.5rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-size: clamp(1.8rem, 4vw, 2.7rem); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 2rem; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.55rem; }
.callout { margin: 1.6rem 0; padding: 1.25rem 1.4rem; border-left: 4px solid var(--orange); background: var(--paper-deep); }
.callout strong { display: block; margin-bottom: 0.25rem; }
.callout.danger { border-color: var(--danger); }
code { padding: 0.12rem 0.35rem; border-radius: 0.25rem; background: var(--paper-deep); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88em; overflow-wrap: anywhere; }
.status-table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.status-table th, .status-table td { padding: 0.8rem 0.65rem; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.status-table th { color: var(--ink-soft); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }

.site-footer { padding: 2.5rem 0; border-top: 1px solid var(--rule); }
.footer-row { display: flex; justify-content: space-between; gap: 1.5rem; color: var(--ink-soft); font-size: 0.88rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; }

@media (max-width: 760px) {
  .nav { padding: 1rem 0; align-items: flex-start; }
  .nav-links { justify-content: flex-end; }
  .hero, .section-head, .doc-layout { grid-template-columns: 1fr; }
  .hero { gap: 2rem; }
  .mode-list, .flow { grid-template-columns: 1fr; }
  .mode + .mode { padding-left: 0; border-left: 0; }
  .proof-grid { grid-template-columns: 1fr; }
  .proof-grid figure:first-child { grid-row: auto; }
  .toc { position: static; padding-bottom: 1.25rem; border-bottom: 1px solid var(--rule); }
  .toc a { display: inline-block; margin-right: 0.8rem; }
  .footer-row { flex-direction: column; }
}

@media (max-width: 460px) {
  .nav { display: block; }
  .nav-links { margin-top: 0.8rem; justify-content: flex-start; }
  .nav-links a { padding: 0.2rem 0; }
  h1 { font-size: 2.85rem; }
  .actions { display: grid; }
  .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
