/*
 * ka2a.dev: one shared stylesheet. No remote assets, no scripts.
 *
 * A research journal on warm parchment: ivory and oat surfaces, serif body
 * and headlines, sans only for interface chrome, hairline borders instead of
 * shadows. Clay appears once per page, on the one action that matters.
 */

@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4-latin-opsz.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-latin-wght.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* Brand: the single chromatic accent. Filled call to action only. */
  --clay: #d97757;
  --clay-deep: #c6613f;

  /* Neutrals. */
  --slate: #141413;
  --slate-medium: #3d3d3a;
  --cloud-dark: #87867f;
  --cloud-medium: #b0aea5;
  --stone: #cccbc8;
  --oat: #e3dacc;
  --manilla: #f5e3c7;
  --canvas: #f0eee6;
  --ivory: #faf9f5;

  /* Text tones. The third tone keeps small text readable. */
  --text: var(--slate);
  --text-2: var(--slate-medium);
  --text-3: #5e5d58;

  --serif: "Source Serif 4", Georgia, "Source Serif Pro", Charter, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  --radius-card: 24px;
  --radius-button: 8px;
  --radius-outline: 12px;
  --hairline: 1px solid var(--stone);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 5.5rem;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font: 400 1.25rem/1.4 var(--serif);
  font-optical-sizing: auto;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { max-width: 100%; }

/* Type. The serif carries the voice; the sans is interface chrome. */

h1, h2, h3, h4 { margin: 0; color: var(--text); }

h1 {
  font: 400 clamp(2.75rem, 1.6rem + 4.2vw, 4.25rem)/1.1 var(--serif);
  text-wrap: balance;
}

h2 {
  font: 400 clamp(2rem, 1.45rem + 2.1vw, 2.875rem)/1.1 var(--serif);
  text-wrap: balance;
}

h3 { font: 600 1.5rem/1.3 var(--serif); }
h4 { font: 600 1rem/1.4 var(--sans); letter-spacing: -.005em; }

/* The dual display: a bold sans for declarative statements. */
.declare {
  font: 700 clamp(2.5rem, 1.35rem + 4.1vw, 3.8125rem)/1.05 var(--sans);
  letter-spacing: -.02em;
  text-wrap: balance;
}

p { margin: 0 0 .8em; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 600; color: var(--text); }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: currentColor;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}

a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--slate);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--manilla); color: var(--slate); }

code, kbd, samp, pre {
  font-family: var(--mono);
  font-variant-ligatures: none;
  font-feature-settings: "calt" 0, "liga" 0;
}

:not(pre) > code, kbd {
  font-size: .8em;
  padding: .08em .32em;
  border: var(--hairline);
  border-radius: 6px;
  background: var(--ivory);
  color: var(--text);
  overflow-wrap: anywhere;
}

ul, ol { margin: 0 0 .8em; padding-left: 1.2em; }
li { margin-bottom: .35em; }
li::marker { color: var(--cloud-dark); }

.eyebrow {
  margin: 0 0 1rem;
  font: 500 .8125rem/1.4 var(--sans);
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-2);
}

.lede {
  max-width: 36rem;
  margin: 1.5rem 0 0;
  font: 400 clamp(1.25rem, 1.12rem + .5vw, 1.5rem)/1.4 var(--serif);
  color: var(--text-2);
}

.muted { color: var(--text-2); }

.skip {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: .6rem 1rem;
  border: var(--hairline);
  border-radius: 0 0 var(--radius-button) var(--radius-button);
  background: var(--ivory);
  color: var(--text);
  font: 500 1rem var(--sans);
}

.skip:focus { top: 0; }

/* Layout. */

.wrap { width: min(100% - 2rem, 76rem); margin-inline: auto; }

@media (min-width: 48rem) {
  .wrap { width: min(100% - 4rem, 76rem); }
}

.section { padding-block: clamp(5rem, 3.8rem + 3.8vw, 7.5rem); }
.section + .section { border-top: var(--hairline); }

.section-head { max-width: 46rem; margin-bottom: clamp(2.5rem, 2rem + 1.5vw, 3.5rem); }
.section-head h2 + p, .section-head .declare + p { margin-top: 1.25rem; }
.section-head p:not(.eyebrow) { color: var(--text-2); }

.grid { display: grid; gap: 1rem; }

@media (min-width: 44rem) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 64rem) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Header. */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--canvas);
  border-bottom: var(--hairline);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 1.5rem;
  min-height: 4rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding-block: .6rem;
  color: var(--text);
  font: 600 1.125rem/1 var(--sans);
  letter-spacing: -.01em;
  text-decoration: none;
}

.brand:hover { text-decoration: none; }
.brand svg { width: 1.75rem; height: 1.75rem; flex: none; }

.nav {
  display: flex;
  gap: .25rem;
  width: calc(100% + 1.2rem);
  margin-inline: -.6rem;
  padding-bottom: .5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar { display: none; }

.nav a {
  flex: none;
  padding: .4rem .6rem;
  border-radius: 6px;
  color: var(--text-2);
  font: 400 .9375rem/1.4 var(--sans);
  letter-spacing: -.005em;
  text-decoration: none;
}

.nav a:hover { color: var(--text); text-decoration: underline; text-decoration-thickness: 1px; }

@media (min-width: 62rem) {
  .nav { width: auto; margin: 0 -.6rem 0 auto; padding-bottom: 0; }
}

/* Hero. */

.hero { padding-block: clamp(3.5rem, 2.25rem + 4.5vw, 6.5rem) clamp(4rem, 3rem + 3vw, 6rem); }
.hero .wrap { display: grid; gap: clamp(2.5rem, 2rem + 2vw, 4rem); align-items: center; }

@media (min-width: 62rem) {
  .hero .wrap { grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); }
}

.feature-card {
  margin: 0;
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  border-radius: var(--radius-card);
  background: var(--manilla);
}

.art { display: block; width: 100%; height: auto; }

.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

/* Buttons. Clay is the one filled action of a page. */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 3rem;
  padding: .75rem 1.25rem;
  border: 1px solid transparent;
  font: 500 1rem/1 var(--sans);
  letter-spacing: -.005em;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover { text-decoration: none; }

.btn-clay {
  background: var(--clay);
  border-color: var(--clay);
  border-radius: 0 0 var(--radius-button) var(--radius-button);
  color: var(--slate);
}

.btn-clay:hover, .btn-clay:active { background: var(--clay-deep); border-color: var(--clay-deep); color: var(--slate); }

.btn-outline {
  background: transparent;
  border-color: var(--cloud-dark);
  border-radius: var(--radius-outline);
  color: var(--text);
}

.btn-outline:hover { background: var(--ivory); color: var(--text); }

.btn-ivory {
  background: var(--ivory);
  border-color: var(--ivory);
  border-radius: 0 0 var(--radius-button) var(--radius-button);
  color: var(--slate);
}

.btn-ivory:hover { background: var(--canvas); color: var(--slate); }

.status {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .25rem .5rem;
  margin: 1.75rem 0 0;
  color: var(--text-2);
  font: 400 .9375rem/1.45 var(--sans);
  letter-spacing: -.005em;
}

.status strong { color: var(--text); font-weight: 600; }

/* Illustration primitives: ink on paper. */

.ink { fill: none; stroke: var(--slate); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ink-thin { fill: none; stroke: var(--slate); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ink-dash { fill: none; stroke: var(--slate); stroke-width: 1.8; stroke-linecap: round; stroke-dasharray: 2 7; }
.f-ivory { fill: var(--ivory); }
.f-canvas { fill: var(--canvas); }
.f-oat { fill: var(--oat); }
.f-manilla { fill: var(--manilla); }
.f-stone { fill: var(--stone); }
.f-cloud { fill: var(--cloud-medium); }
.f-slate { fill: var(--slate); }
.f-slate2 { fill: var(--slate-medium); }
.svg-label { font: 600 15px var(--sans); fill: var(--slate); }
.svg-small { font: 400 12.5px var(--mono); fill: var(--slate-medium); }
.svg-mono { font: 500 13px var(--mono); fill: var(--slate); }
.svg-on-dark { fill: var(--ivory); }
.svg-halo { paint-order: stroke; stroke: var(--ivory); stroke-width: 5px; stroke-linejoin: round; }

/* Facts strip. */

.facts { border-bottom: var(--hairline); }
.facts ul { list-style: none; margin: 0; padding: 0; display: grid; }
.facts li { display: flex; align-items: center; gap: .9rem; margin: 0; padding: 1.25rem 0; border-top: var(--hairline); }
.facts li:first-child { border-top: 0; }
.facts svg { width: 2.25rem; height: 2.25rem; flex: none; }
.facts strong { display: block; font: 600 .9375rem/1.3 var(--sans); letter-spacing: -.005em; }
.facts span { display: block; color: var(--text-2); font-size: 1rem; line-height: 1.35; }

@media (min-width: 44rem) {
  .facts ul { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; }
  .facts li:nth-child(2) { border-top: 0; }
}

@media (min-width: 70rem) {
  .facts ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .facts li { border-top: 0; }
}

/* Cards: flat paper, a hairline and 24px corners. */

.card {
  padding: clamp(1.5rem, 1.25rem + .6vw, 2rem);
  border: var(--hairline);
  border-radius: var(--radius-card);
  background: var(--ivory);
}

.card h3 { font-size: 1.375rem; }
.card p { margin-top: .6rem; color: var(--text-2); font-size: 1.125rem; }
.card .icon { display: block; width: 3rem; height: 3rem; margin-bottom: 1.25rem; }

.panel {
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  border-radius: var(--radius-card);
  background: var(--oat);
}

/* Examples: an explanation beside numbered listings. */

.example {
  display: grid;
  gap: 1.5rem 3rem;
  align-items: start;
  padding-block: clamp(2.5rem, 2rem + 1.5vw, 3.5rem);
  border-top: var(--hairline);
}

.example:first-of-type { border-top: 0; padding-top: 0; }
.example > * { min-width: 0; }
.example-copy h3 { font: 400 clamp(1.6rem, 1.4rem + .7vw, 2rem)/1.15 var(--serif); margin-bottom: .75rem; }
.example-copy p { color: var(--text-2); }
.example-copy ul { color: var(--text-2); font-size: 1.125rem; }
.example-copy .eyebrow { margin-bottom: .75rem; }

@media (min-width: 62rem) {
  .example { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .example-copy { position: sticky; top: 5.5rem; }
}

/* Listings of code and terminal sessions: quiet ink, no syntax hue. */

.listing {
  margin: 0;
  overflow: hidden;
  border: var(--hairline);
  border-radius: var(--radius-card);
  background: var(--ivory);
}

.listing + .listing { margin-top: 1rem; }

.listing-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .25rem 1rem;
  padding: .8rem 1.25rem;
  border-bottom: var(--hairline);
  color: var(--text-2);
  font: 500 .75rem/1.4 var(--sans);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.listing-head .file { color: var(--text); font: 500 .8125rem/1.4 var(--mono); letter-spacing: 0; text-transform: none; }

.listing pre {
  margin: 0;
  padding: 1.1rem 1.25rem 1.25rem;
  overflow-x: auto;
  color: var(--text);
  font: 400 .8125rem/1.6 var(--mono);
  tab-size: 4;
}

.listing pre.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.listing pre.tall { max-height: 34rem; overflow: auto; }
.listing pre:focus-visible { outline: 2px solid var(--slate); outline-offset: -4px; }

.listing figcaption, .figure figcaption {
  padding: .85rem 1.25rem 1rem;
  border-top: var(--hairline);
  color: var(--text-2);
  font: 400 1rem/1.4 var(--serif);
}

.fig-no { margin-right: .35rem; color: var(--text); font: 600 .75rem/1 var(--sans); letter-spacing: .04em; text-transform: uppercase; }

/* Token classes of pre-rendered listings: weight and tone, no hue. */
.k { font-weight: 700; }
.f { font-weight: 600; }
.t { font-style: italic; }
.s, .n, .p, .o { color: var(--slate-medium); }
.c { color: var(--text-3); font-style: italic; }
.pr, .dim { color: var(--text-3); }
.ok { font-weight: 600; }
.warn { font-weight: 600; font-style: italic; }
.bad { font-weight: 700; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; }
.listing strong { font-weight: 700; }

/* Figures: screenshots and drawings. */

.figure { margin: 0; overflow: hidden; border: var(--hairline); border-radius: var(--radius-card); background: var(--ivory); }
.figure img { display: block; width: 100%; height: auto; }
.figure .diagram { border: 0; border-radius: 0; }

.diagram { overflow-x: auto; padding: clamp(1rem, .5rem + 2vw, 2rem); border: var(--hairline); border-radius: var(--radius-card); background: var(--ivory); }
.diagram svg { display: block; width: 100%; min-width: 46rem; height: auto; }
.figure .diagram svg { min-width: 34rem; }

/* Tables. */

.table-wrap { overflow-x: auto; border: var(--hairline); border-radius: var(--radius-card); background: var(--ivory); }
.table { width: 100%; border-collapse: collapse; font-size: 1.0625rem; line-height: 1.4; }
.table th, .table td { padding: .9rem 1.25rem; border-bottom: var(--hairline); text-align: left; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table thead th { color: var(--text-2); font: 500 .75rem/1.4 var(--sans); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.table td { color: var(--text-2); }
.table td:first-child { color: var(--text); white-space: nowrap; }
.table-compact th, .table-compact td { padding: .65rem 1rem; }

/* Badges: fills and borders carry meaning, never hue. */

.badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .6rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--slate);
  font: 500 .8125rem/1.4 var(--mono);
  white-space: nowrap;
}

.badge-solid { background: var(--slate); color: var(--ivory); }
.badge-oat { background: var(--oat); }
.badge-manilla { background: var(--manilla); border-color: var(--cloud-dark); border-style: dashed; }
.badge-line { background: var(--ivory); border-color: var(--cloud-dark); }
.badge-dashed { background: transparent; border-color: var(--cloud-dark); border-style: dashed; }

/* Numbered steps. */

.steps { list-style: none; counter-reset: step; display: grid; gap: 1rem; margin: 0; padding: 0; }
.steps li { position: relative; counter-increment: step; margin: 0; padding: 1.5rem 1.5rem 1.6rem 4.5rem; border: var(--hairline); border-radius: var(--radius-card); background: var(--ivory); }
.steps li::before { content: counter(step); position: absolute; left: 1.5rem; top: 1.45rem; display: grid; place-items: center; width: 2rem; height: 2rem; border: 1.5px solid var(--slate); border-radius: 50%; color: var(--slate); font: 600 .9375rem/1 var(--sans); }
.steps h3 { margin-bottom: .35rem; font-size: 1.25rem; }
.steps p { margin: 0; color: var(--text-2); font-size: 1.0625rem; }

@media (min-width: 62rem) {
  .steps-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .steps-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .steps-4 li, .steps-5 li { padding: 4.4rem 1.4rem 1.5rem; }
  .steps-4 li::before, .steps-5 li::before { left: 1.4rem; top: 1.4rem; }
}

/* Definition lists. */

.defs { display: grid; margin: 0; }
.defs div { display: grid; gap: .3rem 2rem; padding: 1rem 0; border-top: var(--hairline); }
.defs dt { font-weight: 600; }
.defs dd { margin: 0; color: var(--text-2); font-size: 1.125rem; }

@media (min-width: 48rem) {
  .defs div { grid-template-columns: 15rem minmax(0, 1fr); }
  .grid .defs div { grid-template-columns: minmax(0, 1fr); }
}

/* Notes. */

.note { padding: 1.1rem 1.4rem; border: var(--hairline); border-radius: var(--radius-card); background: var(--ivory); color: var(--text-2); font-size: 1.125rem; }
.note strong { color: var(--text); }

/* Status lists. */

.checklist { list-style: none; display: grid; gap: .6rem; margin: 0; padding: 0; }
.checklist li { position: relative; margin: 0; padding-left: 2rem; color: var(--text-2); font-size: 1.125rem; }
.checklist li::before { content: ""; position: absolute; left: 0; top: .3rem; width: 1.15rem; height: 1.15rem; border: 1.5px solid var(--slate); border-radius: 50%; background: var(--oat); }
.checklist li::after { content: ""; position: absolute; left: .4rem; top: .5rem; width: .32rem; height: .55rem; border: solid var(--slate); border-width: 0 2px 2px 0; transform: rotate(40deg); }
.checklist.open li::before { background: var(--ivory); }
.checklist.open li::after { left: .33rem; top: .88rem; width: .5rem; height: 0; border-width: 0 0 2px; transform: none; }
.checklist.later li::before { border: 1.5px dashed var(--cloud-dark); background: transparent; }
.checklist.later li::after { display: none; }

/* Metrics. */

.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 0; }
.metrics div { display: flex; flex-direction: column-reverse; padding: 1.25rem 1.4rem; border: var(--hairline); border-radius: var(--radius-card); background: var(--ivory); }
.metrics dt { margin-top: .35rem; color: var(--text-2); font: 400 .9375rem/1.35 var(--sans); letter-spacing: -.005em; }
.metrics dd { margin: 0; font: 400 clamp(2rem, 1.6rem + 1.4vw, 2.875rem)/1.05 var(--serif); }

@media (min-width: 62rem) {
  .metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Requirement trace. */

.trace-title { margin: 3rem 0 1.25rem; font: 400 clamp(1.6rem, 1.4rem + .7vw, 2rem)/1.15 var(--serif); }
.trace { display: grid; gap: 1rem; }
.trace .listing + .listing { margin-top: 0; }
.trace-note { margin-top: 1.25rem; color: var(--text-2); font-size: 1.125rem; }

@media (min-width: 62rem) {
  .trace { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trace .listing:first-child { grid-row: span 2; }
}

/* Five questions. */

.questions { list-style: none; display: grid; gap: 1rem; margin: 0; padding: 0; }
.questions li { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); gap: 1rem; margin: 0; padding: 1.5rem; border: var(--hairline); border-radius: var(--radius-card); background: var(--ivory); }
.questions h3 { margin-bottom: .45rem; font: 400 clamp(1.4rem, 1.25rem + .5vw, 1.7rem)/1.2 var(--serif); }
.questions p { margin: 0; color: var(--text-2); font-size: 1.125rem; }
.q-num { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border: 1.5px solid var(--slate); border-radius: 50%; color: var(--slate); font: 400 1.3rem/1 var(--serif); }

@media (min-width: 62rem) {
  .questions { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .questions li { grid-column: span 2; grid-template-columns: minmax(0, 1fr); }
  .questions li:nth-child(4) { grid-column: 2 / span 2; }
}

/* Featured teaser: a manilla editorial spread. */

.teaser { display: grid; gap: 2rem; align-items: center; padding: clamp(1.75rem, 1.2rem + 2.5vw, 3.5rem); border-radius: var(--radius-card); background: var(--manilla); }
.teaser h2 { margin-bottom: 1rem; }
.teaser p { max-width: 34rem; color: var(--text-2); }
.teaser svg { justify-self: center; width: 100%; max-width: 20rem; height: auto; }

@media (min-width: 56rem) {
  .teaser { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); }
}

/* Footer: slate, with slate-medium dividers. */

.site-footer { padding-block: 4rem 3rem; background: var(--slate); color: var(--cloud-medium); font: 400 .9375rem/1.5 var(--sans); letter-spacing: -.005em; }
.site-footer a { color: var(--ivory); }
.site-footer .brand { color: var(--ivory); }
.site-footer p { margin: 0 0 .6rem; }
.footer-grid { display: grid; gap: 2.5rem; }
.footer-grid h2 { margin-bottom: 1rem; color: var(--cloud-medium); font: 500 .75rem/1.4 var(--sans); letter-spacing: .04em; text-transform: uppercase; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: .5rem; }
.footer-grid li::marker { color: transparent; }
.footer-fine { margin-top: 3rem; padding-top: 1.75rem; border-top: 1px solid var(--slate-medium); font-size: .875rem; }
.footer-fine p { max-width: 62rem; }

@media (min-width: 56rem) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}

/* Not found page. */

.notfound { display: grid; align-items: center; min-height: 100vh; padding-block: 4rem; }
.notfound-art { display: block; width: min(18rem, 70%); height: auto; margin-bottom: 2rem; }

/* Documentation pages: an article beside a sticky list of contents. */

.nav a[aria-current="page"] { color: var(--text); text-decoration: underline; text-decoration-thickness: 1px; }

.doc-page { padding-block: clamp(2.5rem, 2rem + 2vw, 4rem) clamp(4rem, 3rem + 3vw, 6rem); }
.doc-layout { display: grid; gap: 3rem; align-items: start; }
.doc { min-width: 0; max-width: 60rem; }
.doc h1 { font-size: clamp(2.5rem, 1.9rem + 2.4vw, 3.5rem); }

.doc-source { max-width: 46rem; margin: 1.5rem 0 2rem; padding: 1rem 1.25rem; border: var(--hairline); border-radius: var(--radius-card); background: var(--ivory); color: var(--text-2); font: 400 .9375rem/1.5 var(--sans); letter-spacing: -.005em; }
.doc-source strong { color: var(--text); }

.doc-toc { margin: 0 0 2.5rem; border: var(--hairline); border-radius: var(--radius-outline); background: var(--ivory); }
.doc-toc summary { padding: .8rem 1.1rem; color: var(--text); font: 500 .9375rem/1.4 var(--sans); cursor: pointer; }
.doc-toc nav { padding: .25rem 1.1rem 1.1rem; }

.doc-side { display: none; }
.doc-nav-title { margin: 0 0 .5rem; color: var(--text-2); font: 500 .75rem/1.4 var(--sans); letter-spacing: .04em; text-transform: uppercase; }
.doc-nav-list { list-style: none; margin: 0 0 1.75rem; padding: 0; font: 400 .9375rem/1.4 var(--sans); letter-spacing: -.005em; }
.doc-nav-list:last-child { margin-bottom: 0; }
.doc-nav-list li { margin: 0; }
.doc-nav-list a { display: block; padding: .3rem 0 .3rem .85rem; border-left: 1px solid var(--stone); color: var(--text-2); text-decoration: none; }
.doc-nav-list a:hover { color: var(--text); text-decoration: underline; }
.doc-nav-list a[aria-current="page"] { padding-left: calc(.85rem - 1px); border-left: 2px solid var(--slate); color: var(--text); font-weight: 600; }
.doc-nav-list code { font-size: .8125rem; }

@media (min-width: 62rem) {
  .doc-layout { grid-template-columns: 15rem minmax(0, 1fr); column-gap: clamp(3rem, 1rem + 3vw, 5rem); }
  .doc { grid-column: 2; grid-row: 1; }
  .doc-side { display: block; grid-column: 1; grid-row: 1; position: sticky; top: 5.5rem; max-height: calc(100vh - 7rem); overflow-y: auto; padding-right: .5rem; }
  .doc-toc { display: none; }
}

.doc-body { line-height: 1.5; }
.doc-body > p, .doc-body > ul, .doc-body > ol { max-width: 46rem; }
.doc-body > p:first-child { color: var(--text-2); font-size: clamp(1.25rem, 1.15rem + .4vw, 1.4375rem); }
.doc-body h2 { margin: 3.5rem 0 1.25rem; padding-top: 2.5rem; border-top: var(--hairline); font-size: clamp(1.75rem, 1.45rem + 1.2vw, 2.375rem); }
.doc-body h3 { margin: 2.5rem 0 .75rem; font-size: 1.375rem; }
.doc-body h4 { margin: 2rem 0 .5rem; }
.doc-body p, .doc-body ul, .doc-body ol { margin: 0 0 1rem; }
.doc-body li > ul, .doc-body li > ol { margin: .4rem 0 .6rem; }
.doc-body li > p { margin-bottom: .6rem; }
.doc-body li > p:last-child { margin-bottom: 0; }
.doc-body > :last-child { margin-bottom: 0; }

.doc-body .table-wrap { margin: 1.25rem 0 1.75rem; }
.doc-body .table { font-size: 1rem; }
.doc-body .table td:first-child { white-space: normal; }
.doc-body .table code { white-space: nowrap; overflow-wrap: normal; }
.doc-body ol > li, .doc-body ul > li { margin-bottom: .55rem; }

.doc-code { margin: 1rem 0 1.5rem; padding: .9rem 1.1rem 1rem; overflow-x: auto; border: var(--hairline); border-radius: var(--radius-outline); background: var(--ivory); color: var(--text); font: 400 .8125rem/1.6 var(--mono); tab-size: 4; }
.doc-code:focus-visible { outline: 2px solid var(--slate); outline-offset: 2px; }

.doc-back { margin-top: 3.5rem; padding-top: 1.5rem; border-top: var(--hairline); font: 500 .9375rem/1.4 var(--sans); }

/* Helpers. */

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.narrow { max-width: 46rem; }

@media (forced-colors: active) {
  .btn, .card, .listing, .badge, .steps li, .table-wrap, .diagram, .figure, .doc-code, .doc-source, .doc-toc { border: 1px solid CanvasText; }
}

@media print {
  .site-header, .skip, .actions, .doc-side, .doc-toc { display: none; }
  body { background: var(--ivory); }
}

/* Ivory strokes on dark marks. Declared last, so it wins over .ink. */
.s-ivory { stroke: var(--ivory); }
.panel .trace-title { margin-top: 0; }
