/* rec.farm — built on the R.E.C. design system (v1.7.0; §14 tokens unchanged since v1.5.0).
   Tokens are the §14 block of DESIGN.md in https://github.com/rec-farm/rec-brand.
   Dark is default; Paper is data-theme="light". */

@font-face { font-family: "Archivo"; src: url("/fonts/Archivo.ttf") format("truetype"); font-weight: 700 800; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/fonts/Figtree.ttf") format("truetype"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/GeistMono.ttf") format("truetype"); font-weight: 400 600; font-display: swap; }

/* ───────── Primitives ───────── */
:root {
  --ink-950: #0A0B0C; --ink-900: #101214; --ink-850: #16191C; --ink-800: #1D2125; --ink-700: #23272B; --ink-600: #3A4046;
  --paper-50: #FFFCF5; --paper-100: #F7F1E3; --paper-200: #EFE8D8; --paper-300: #E5DDCB; --paper-400: #DDD3BF; --paper-500: #CFC4AD;
  --cream: #F4EFE3; --stone-400: #A8A396; --stone-500: #8A867E; --slate-600: #4B5B61; --slate-500: #5F6B67;
  --deep-900: #14262E; --deep-800: #1B323C;
  --purple-50: #F2EDFF; --purple-100: #E4D9FF; --purple-300: #AC8BFF; --purple-400: #8E5FFF; --purple-500: #7638FA;
  --purple-600: #6524E8; --purple-700: #521BC2; --purple-900: #2C1169; --purple-950: #1A0A40;
  --sun-100: #FBEFC4; --sun-300: #F2C641; --sun-400: #E8B931; --sun-600: #7A5A00; --sun-950: #241F10;
  --mint-100: #D6EEE3; --mint-300: #A8D8C2; --mint-400: #4CC79A; --mint-600: #1C6B53; --mint-950: #10221B;
  --rose-400: #F07A9C; --rose-600: #C42F52;
  --lilac-100: #EEEBF7; --lilac-300: #DCD7EE; --lilac-400: #B3A8EE; --lilac-600: #5B4FA8; --lilac-950: #1A1828;
  --sky-100: #E2F0FA; --sky-300: #B4DAF2; --sky-400: #5DB4EA; --sky-600: #1E5F8C; --sky-950: #0E1C25;
  /* Clay: Valtr's accent. Provisional until it lands in the design system (§2.10 step 9). */
  --clay-100: #FBE6D6; --clay-300: #F4C3A0; --clay-400: #EE9A62; --clay-600: #9A4515; --clay-950: #26160C;

  --font-display: "Archivo", "Arial Black", system-ui, sans-serif;
  --font-sans: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius-xs: 2px; --radius-sm: 4px; --radius-md: 6px;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-snap: cubic-bezier(0.3, 1.4, 0.5, 1);
  --content: 75rem;
}

/* ───────── Dark (default) ───────── */
:root, [data-theme="dark"] {
  color-scheme: dark;
  --canvas: var(--ink-950); --surface-1: var(--ink-900); --surface-2: var(--ink-850); --surface-3: var(--ink-800);
  --fg: var(--cream); --fg-muted: var(--stone-400); --fg-subtle: var(--stone-500);
  --border: var(--ink-700); --border-strong: var(--ink-600); --border-input: var(--ink-600);
  --shadow-hard-color: var(--ink-600);
  /* Source purple-400 hover fails contrast with white text; package uses purple-600 in dark. */
  --primary: var(--purple-500); --primary-hover: var(--purple-600); --primary-fg: #fff;
  --primary-soft: color-mix(in oklab, var(--purple-900) 50%, transparent);
  --link: var(--purple-300); --focus-ring: var(--purple-300); --selection: var(--purple-950);
  --success-text: var(--mint-400); --warning-text: var(--sun-400); --info-text: var(--lilac-400);
  --code-key: var(--purple-300); --code-str: var(--mint-400); --code-num: var(--sun-400); --code-lit: var(--rose-400);
  --accent: var(--purple-500); --accent-fg: #fff; --accent-tile: var(--purple-950); --accent-text: var(--purple-300);
  --dot: var(--ink-700);
}

/* ───────── Paper (light) ───────── */
[data-theme="light"] {
  color-scheme: light;
  --canvas: var(--paper-100); --surface-1: var(--paper-50); --surface-2: var(--paper-200); --surface-3: var(--paper-300);
  --fg: var(--deep-900); --fg-muted: var(--slate-600); --fg-subtle: var(--slate-500);
  --border: var(--paper-400); --border-strong: var(--deep-900); --border-input: var(--paper-500);
  --shadow-hard-color: var(--deep-900);
  --primary: var(--purple-600); --primary-hover: var(--purple-700); --primary-fg: #fff;
  --primary-soft: var(--purple-50);
  --link: var(--purple-600); --focus-ring: var(--purple-600); --selection: var(--purple-100);
  --success-text: var(--mint-600); --warning-text: var(--sun-600); --info-text: var(--lilac-600);
  --code-key: var(--purple-700); --code-str: var(--mint-600); --code-num: var(--sun-600); --code-lit: var(--rose-600);
  --accent: var(--purple-600); --accent-fg: #fff; --accent-tile: var(--purple-50); --accent-text: var(--purple-600);
  --dot: var(--paper-500);
}

/* ───────── Product accents: accent = place, never action ───────── */
[data-product="stillup"]   { --accent: var(--sun-400);   --accent-fg: var(--ink-950); --accent-tile: var(--sun-950);   --accent-text: var(--sun-400); }
[data-product="paramtune"] { --accent: var(--mint-400);  --accent-fg: var(--ink-950); --accent-tile: var(--mint-950);  --accent-text: var(--mint-400); }
[data-product="handstamp"] { --accent: var(--lilac-400); --accent-fg: var(--ink-950); --accent-tile: var(--lilac-950); --accent-text: var(--lilac-400); }
[data-product="draw"]      { --accent: var(--sky-400);   --accent-fg: var(--ink-950); --accent-tile: var(--sky-950);   --accent-text: var(--sky-400); }
[data-product="valtr"]     { --accent: var(--clay-400);  --accent-fg: var(--ink-950); --accent-tile: var(--clay-950);  --accent-text: var(--clay-400); }
[data-theme="light"] [data-product="stillup"],   [data-theme="light"][data-product="stillup"]   { --accent: var(--sun-300);   --accent-fg: var(--deep-900); --accent-tile: var(--sun-100);   --accent-text: var(--sun-600); }
[data-theme="light"] [data-product="paramtune"], [data-theme="light"][data-product="paramtune"] { --accent: var(--mint-300);  --accent-fg: var(--deep-900); --accent-tile: var(--mint-100);  --accent-text: var(--mint-600); }
[data-theme="light"] [data-product="handstamp"], [data-theme="light"][data-product="handstamp"] { --accent: var(--lilac-300); --accent-fg: var(--deep-900); --accent-tile: var(--lilac-100); --accent-text: var(--lilac-600); }
[data-theme="light"] [data-product="draw"],      [data-theme="light"][data-product="draw"]      { --accent: var(--sky-300);   --accent-fg: var(--deep-900); --accent-tile: var(--sky-100);   --accent-text: var(--sky-600); }
[data-theme="light"] [data-product="valtr"],     [data-theme="light"][data-product="valtr"]     { --accent: var(--clay-300);  --accent-fg: var(--deep-900); --accent-tile: var(--clay-100);  --accent-text: var(--clay-600); }

/* ───────── Base ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { font-family: var(--font-sans); font-size: 16px; background: var(--canvas); color: var(--fg); -webkit-font-smoothing: antialiased; }
body { margin: 0; background: var(--canvas); color: var(--fg); line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
::selection { background: var(--selection); }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { display: block; max-width: 100%; }
code, kbd, pre { font-family: var(--font-mono); }
h1, h2, h3, p { margin: 0; }
.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; }
.skip { position: absolute; left: 16px; top: -48px; z-index: 20; padding: 8px 12px; background: var(--surface-1); border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--content); margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }

/* ───────── Type ───────── */
.display, .label, .eyebrow, .stat { font-family: var(--font-display); font-stretch: 125%; font-variation-settings: "wdth" 125; }
.eyebrow { font-size: 0.6875rem; line-height: 1.2; letter-spacing: 0.14em; font-weight: 700; text-transform: uppercase; color: var(--fg-muted); }
.label { font-size: 0.6875rem; line-height: 1.2; letter-spacing: 0.1em; font-weight: 700; text-transform: uppercase; }
.display-hero { font-size: clamp(2.75rem, 7vw, 4.5rem); line-height: 0.95; font-weight: 800; letter-spacing: -0.04em; }
.title-1 { font-size: clamp(2.25rem, 5vw, 3.5rem); line-height: 1; font-weight: 800; letter-spacing: -0.035em; }
.title-2 { font-size: 1.75rem; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; }
.heading { font-size: 1.25rem; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }
.subheading { font-size: 1rem; line-height: 1.35; font-weight: 700; }
.body-lg { font-size: 1.125rem; line-height: 1.55; color: var(--fg-muted); }
.body-sm { font-size: 0.875rem; line-height: 1.45; color: var(--fg-muted); }
.mono { font-family: var(--font-mono); font-size: 0.8125rem; }
.mono-sm { font-family: var(--font-mono); font-size: 0.75rem; color: var(--fg-subtle); }
.period { color: var(--primary); }  /* the purple period: H1 and hero only */
.header-trio .eyebrow { margin-bottom: 8px; }
.header-trio .lede { margin-top: 12px; max-width: 45ch; }

/* ───────── Buttons ───────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: var(--radius-sm); font: 600 0.9375rem/1 var(--font-sans); cursor: pointer;
  text-decoration: none; transition: transform 80ms var(--ease-snap), box-shadow 80ms var(--ease-snap), background-color 120ms;
}
.btn:hover { text-decoration: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--primary); color: var(--primary-fg); border: 1.5px solid var(--border-strong); box-shadow: 3px 3px 0 0 var(--shadow-hard-color); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: translate(2px, 2px); box-shadow: 0 0 0 0 var(--shadow-hard-color); }
.btn-secondary { background: var(--surface-1); color: var(--fg); border: 1px solid var(--border-input); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-outline { background: transparent; color: var(--fg); border: 1px solid var(--border-strong); font-family: var(--font-display); font-stretch: 125%; font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; min-height: 36px; padding: 0 12px; }
.btn-outline:hover { background: var(--surface-2); }
.link-tertiary { display: inline-flex; align-items: center; gap: 6px; color: var(--fg); min-height: 44px; }
.link-tertiary .arrow { transition: transform 120ms var(--ease-out); }
.link-tertiary:hover .arrow { transform: translateX(2px); }
.ext::after { content: "↗"; margin-left: 4px; font-family: var(--font-sans); }

/* ───────── Top bar ───────── */
.topbar { height: 64px; border-bottom: 1px solid var(--border); background: var(--canvas); position: sticky; top: 0; z-index: 10; }
.topbar .wrap { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--fg); min-height: 44px; }
.brand:hover { text-decoration: none; }
.brand img { height: 22px; width: auto; }
.brand .domain { font-family: var(--font-mono); font-size: 0.875rem; color: var(--fg-muted); padding-left: 12px; border-left: 1px solid var(--border); }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--fg-muted); min-height: 44px; display: inline-flex; align-items: center; padding: 0 10px; }
.nav a:hover { color: var(--fg); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--fg); }
.theme-toggle { width: 44px; height: 44px; display: inline-grid; place-items: center; background: transparent; color: var(--fg-muted); border: 0; border-radius: var(--radius-sm); cursor: pointer; }
.theme-toggle:hover { color: var(--fg); background: var(--surface-2); }
.theme-toggle svg { width: 18px; height: 18px; }
[data-theme="light"] .icon-sun, :root:not([data-theme="light"]) .icon-moon { display: none; }
@media (max-width: 720px) { .nav .hide-sm, .brand .domain { display: none; } }

/* Logo swaps: cream on dark, ink on Paper. Never recolor. */
[data-theme="light"] .on-dark { display: none; }
:root:not([data-theme="light"]) .on-light { display: none; }

/* ───────── Hero ───────── */
.hero { position: relative; padding: 96px 0 72px; border-bottom: 1px solid var(--border); overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; mask-image: linear-gradient(to bottom, #000 0%, transparent 85%); -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 85%); pointer-events: none; }
.hero.dots { background: none; }
.hero.dots::before { background-image: radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 0); background-size: 8px 8px; }
.hero .wrap { position: relative; }
.hero .lede { margin-top: 20px; max-width: 52ch; }
.hero .actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-meta { margin-top: 40px; }

/* ───────── Sections ───────── */
.section { padding: 72px 0; }
.section + .section { border-top: 1px solid var(--border); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; flex-wrap: wrap; }
.section-head .title-2 { display: flex; align-items: center; gap: 12px; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--radius-xs); background: var(--surface-3); color: var(--fg-muted); font: 600 0.75rem/1 var(--font-mono); letter-spacing: 0; }

/* ───────── Product grid: joined tiles, one outline, one hard shadow ───────── */
.grid { display: grid; grid-template-columns: 1fr; border: 1.5px solid var(--border-strong); box-shadow: 5px 5px 0 0 var(--shadow-hard-color); background: var(--border); gap: 1px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1200px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.tile { position: relative; background: var(--surface-1); padding: 28px; display: flex; flex-direction: column; gap: 16px; min-height: 320px; color: var(--fg); }
.tile::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--accent); }
.tile:hover { text-decoration: none; }
a.tile:hover { outline: 1.5px solid var(--border-strong); outline-offset: -1.5px; background: var(--surface-2); }
a.tile:hover .corner { transform: translate(2px, -2px); color: var(--fg); }
.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tile .mark { width: 48px; height: 48px; }
.mark-pending { width: 48px; height: 48px; display: grid; place-items: center; border: 1.5px dashed var(--accent-text); border-radius: var(--radius-sm); color: var(--accent-text); }
.mark-pending svg { width: 24px; height: 24px; }
.corner { width: 20px; height: 20px; color: var(--fg-muted); transition: transform 120ms var(--ease-out); }
.tile h3 { font-size: 1.5rem; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; }
.tile .verb { color: var(--accent-text); }
.tile p { color: var(--fg-muted); font-size: 0.9375rem; }
.tile .tile-foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--radius-xs); font: 500 0.75rem/1 var(--font-mono); background: var(--surface-3); color: var(--fg-muted); }
.tag.accent { background: var(--accent-tile); color: var(--accent-text); }

.pill { display: inline-flex; align-items: center; gap: 8px; height: 26px; padding: 0 10px; border-radius: 9999px; background: var(--surface-1); border: 1px solid var(--border); font-size: 0.8125rem; font-weight: 500; color: var(--fg); white-space: nowrap; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-subtle); }
.pill.live .dot { background: var(--mint-400); animation: pulse-dot 2s ease-in-out infinite; }
.pill.soon .dot { background: var(--lilac-400); }
.pill.beta .dot { background: var(--sun-400); }
@keyframes pulse-dot { 0%, 100% { opacity: 1 } 50% { opacity: 0.4 } }

.tile.more { grid-column: 1 / -1; min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding: 20px 28px; background: var(--surface-2); }
.tile.more::before { display: none; }
.tile.more .prompt { font-family: var(--font-mono); color: var(--fg); font-size: 0.9375rem; }
.tile.more p { flex: 1 1 280px; }

/* ───────── Principles (callouts) ───────── */
.principles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.callout { background: var(--surface-2); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius-sm); padding: 20px; display: grid; gap: 8px; align-content: start; }
.medallion { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-1); color: var(--accent-text); margin-bottom: 4px; }
[data-theme="light"] .medallion { background: var(--paper-50); }
.medallion svg { width: 20px; height: 20px; }

/* ───────── Product page ───────── */
.p-hero { padding: 64px 0 40px; border-bottom: 1px solid var(--border); }
.p-hero .hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px; align-items: center; }
.p-hero .lockup { height: 40px; width: auto; margin-bottom: 32px; }
.p-hero .art { width: 360px; max-width: 100%; }
@media (max-width: 860px) { .p-hero .hero-grid { grid-template-columns: 1fr; } .p-hero .art { display: none; } }
.p-hero .actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }
.crumb { font-size: 0.875rem; color: var(--fg-muted); margin-bottom: 32px; display: flex; gap: 8px; align-items: center; }
.crumb .sep { color: var(--fg-subtle); }
.crumb [aria-current] { color: var(--fg); }

.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); border: 1px solid var(--border); background: var(--border); gap: 1px; margin-top: 40px; }
.kv > div { background: var(--surface-1); padding: 16px 20px; display: grid; gap: 6px; }
.kv dt { color: var(--fg-subtle); }
.kv dd { margin: 0; font-family: var(--font-mono); font-size: 0.875rem; color: var(--fg); overflow-wrap: anywhere; }

.two-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 48px; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: minmax(0, 1fr); } }

.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); }
.features li { background: var(--surface-1); padding: 18px 20px; display: grid; grid-template-columns: 24px 1fr; gap: 14px; }
.features li svg { width: 20px; height: 20px; color: var(--accent-text); margin-top: 2px; }
.features strong { display: block; font-weight: 700; margin-bottom: 2px; }
.features span { color: var(--fg-muted); font-size: 0.9375rem; }

.card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 24px; }
.card + .card { margin-top: 16px; }
.card .label { display: block; margin-bottom: 4px; }
.card .desc { margin-bottom: 16px; }

pre.code { margin: 0; padding-top: 44px !important; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; overflow-x: auto; font-size: 0.8125rem; line-height: 1.6; color: var(--fg); }
pre.code .c { color: var(--fg-subtle); }
pre.code .p { color: var(--code-key); user-select: none; }
.code-wrap { position: relative; }
.copy { position: absolute; top: 8px; right: 8px; height: 32px; padding: 0 10px; background: var(--surface-1); color: var(--fg-muted); border: 1px solid var(--border-input); border-radius: var(--radius-sm); font: 500 0.75rem var(--font-sans); cursor: pointer; }
.copy:hover { color: var(--fg); }

.links { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.links li { border-bottom: 1px solid var(--border); }
.links a { display: flex; align-items: center; gap: 12px; min-height: 52px; color: var(--fg); padding: 0 4px; }
.links a:hover { text-decoration: none; background: var(--surface-2); }
.links a svg { width: 16px; height: 16px; color: var(--fg-muted); flex: none; }
.links a .hint { margin-left: auto; font-family: var(--font-mono); font-size: 0.75rem; color: var(--fg-subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%; }

.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.doc { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; display: grid; gap: 6px; color: var(--fg); min-height: 96px; align-content: start; position: relative; }
.doc:hover { border-color: var(--border-strong); text-decoration: none; }
.doc:hover .chev { transform: translateX(2px); }
.doc .chev { position: absolute; top: 16px; right: 16px; width: 16px; height: 16px; color: var(--fg-subtle); transition: transform 120ms var(--ease-out); }
.doc strong { font-weight: 700; padding-right: 24px; }
.doc .mono-sm { overflow-wrap: anywhere; }

/* ───────── Docs ───────── */
.docs-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr) 208px; gap: 48px; align-items: start; padding-top: 40px; padding-bottom: 80px; }
@media (max-width: 1180px) { .docs-layout { grid-template-columns: 232px minmax(0, 1fr); } .docs-toc { display: none; } }
@media (max-width: 860px) { .docs-layout { grid-template-columns: minmax(0, 1fr); padding-top: 24px; } .docs-side { display: none; } }

.docs-side, .docs-toc { position: sticky; top: 88px; max-height: calc(100vh - 112px); overflow-y: auto; }
.docs-product { display: flex; align-items: center; gap: 12px; color: var(--fg); font-weight: 700; font-size: 1.0625rem; margin-bottom: 28px; min-height: 44px; }
.docs-product:hover { text-decoration: none; }
.docs-product .mark, .docs-product .mark-pending { width: 32px; height: 32px; }
.docs-product .mark-pending svg { width: 18px; height: 18px; }
.docs-side .eyebrow { margin-bottom: 8px; }
.docs-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.docs-list a { display: flex; align-items: center; min-height: 40px; padding: 0 12px; border-radius: var(--radius-sm); color: color-mix(in oklab, var(--fg) 85%, transparent); font-size: 0.9375rem; font-weight: 500; border: 1.5px solid transparent; }
.docs-list a:hover { background: var(--surface-2); color: var(--fg); text-decoration: none; }
.docs-list a[aria-current="page"] { background: var(--accent); color: var(--accent-fg); font-weight: 600; border-color: var(--border-strong); box-shadow: 3px 3px 0 0 var(--shadow-hard-color); }
.docs-side-foot { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--border); display: grid; gap: 4px; font-size: 0.875rem; }
.docs-side-foot a { color: var(--fg-muted); min-height: 32px; display: inline-flex; align-items: center; }
.docs-side-foot a:hover { color: var(--fg); }

.docs-menu { display: none; margin-bottom: 24px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-1); }
@media (max-width: 860px) { .docs-menu { display: block; } }
.docs-menu summary { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px; cursor: pointer; font-weight: 600; list-style: none; }
.docs-menu summary::-webkit-details-marker { display: none; }
.docs-menu summary svg { width: 16px; height: 16px; color: var(--accent-text); }
.docs-menu summary .mono-sm { margin-left: auto; }
.docs-menu .docs-list { padding: 0 8px 8px; }

.docs-main { min-width: 0; max-width: 46rem; }
.docs-main .crumb { margin-bottom: 24px; flex-wrap: wrap; }
.docs-head { padding-bottom: 24px; margin-bottom: 32px; border-bottom: 1px solid var(--border); }
.doc-title { font-size: clamp(2rem, 4.5vw, 2.75rem); line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; }

.docs-toc .eyebrow { margin-bottom: 12px; }
.docs-toc ul { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 1px solid var(--border); display: grid; gap: 2px; }
.docs-toc a { display: block; padding: 4px 0; font-size: 0.8125rem; line-height: 1.4; color: var(--fg-muted); }
.docs-toc a:hover { color: var(--fg); text-decoration: none; }
.docs-toc a.active { color: var(--accent-text); font-weight: 600; }
.docs-toc .d3 a { padding-left: 12px; }

/* Prose */
.prose { font-size: 1rem; line-height: 1.7; color: var(--fg); overflow-wrap: break-word; }
.prose > * + * { margin-top: 1.1em; }
.prose h2, .prose h3, .prose h4 { position: relative; scroll-margin-top: 88px; }
.prose h2 { font-size: 1.5rem; line-height: 1.2; font-weight: 800; letter-spacing: -0.02em; margin-top: 2.2em; padding-top: 0.2em; }
.prose h3 { font-size: 1.1875rem; line-height: 1.3; font-weight: 700; margin-top: 1.8em; }
.prose h4 { font-size: 1rem; font-weight: 700; margin-top: 1.5em; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: 0.6em; }
.prose .anchor { position: absolute; left: -1.1em; width: 1em; color: var(--fg-subtle); opacity: 0; font-weight: 500; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose h4:hover .anchor { opacity: 1; text-decoration: none; }
.prose p, .prose li { color: color-mix(in oklab, var(--fg) 88%, var(--fg-muted)); }
.prose strong { color: var(--fg); font-weight: 700; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.35em; }
.prose li > ul, .prose li > ol { margin-top: 0.35em; }
.prose li::marker { color: var(--fg-subtle); }
.prose a { text-decoration: underline; text-decoration-color: color-mix(in oklab, var(--link) 45%, transparent); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--link); }
.prose :not(pre) > code { font-size: 0.875em; padding: 0.12em 0.36em; border-radius: var(--radius-xs); background: var(--surface-2); border: 1px solid var(--border); color: var(--fg); overflow-wrap: anywhere; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.5em 0; }
.prose blockquote { margin-left: 0; margin-right: 0; padding: 14px 20px; background: var(--surface-2); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius-sm); }
.prose blockquote > * + * { margin-top: 0.6em; }
.prose .code-wrap { margin-top: 1.2em; }
.prose pre.code { padding-top: 16px !important; padding-right: 72px; }
.prose .table-wrap { overflow-x: auto; border: 1px solid var(--border); background: var(--surface-1); }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.875rem; line-height: 1.5; }
.prose th { font-family: var(--font-display); font-stretch: 125%; font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; color: var(--fg-subtle); text-align: left; background: var(--surface-2); padding: 12px 14px; white-space: nowrap; }
.prose td { padding: 12px 14px; border-top: 1px solid var(--border); vertical-align: top; }
.prose td { min-width: 7rem; }
.prose td code { overflow-wrap: anywhere; word-break: break-word; }

/* Code tokens (§10.18) */
.tk-key { color: var(--code-key); }
.tk-str { color: var(--code-str); }
.tk-num { color: var(--code-num); }
.tk-lit { color: var(--code-lit); }
.tk-com, .tk-punct { color: var(--fg-subtle); }
pre.code[data-lang]::before { content: attr(data-lang); position: absolute; top: 12px; right: 76px; font: 500 0.6875rem var(--font-mono); color: var(--fg-subtle); }
.code-wrap pre.code[data-lang] { position: static; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--border); }
.pager .doc { min-height: 0; gap: 4px; }
.pager .doc .label { color: var(--fg-subtle); }
.pager .next { text-align: right; grid-column: 2; }
.docs-meta { margin-top: 24px; }
.docs-meta a { color: var(--fg-muted); }

/* ───────── Footer ───────── */
.footer { border-top: 1px solid var(--border); padding: 40px 0; margin-top: 0; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.footer .left { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.footer .chain { height: 16px; width: auto; }
.footer nav { display: flex; gap: 4px; flex-wrap: wrap; }
.footer nav a { color: var(--fg-muted); font-size: 0.875rem; min-height: 44px; display: inline-flex; align-items: center; padding: 0 8px; }
.footer nav a:hover { color: var(--fg); }

/* ───────── 404 ───────── */
.empty { text-align: center; padding: 120px 0; }
.empty .title-2 { margin-bottom: 12px; }
.empty p { color: var(--fg-muted); max-width: 420px; margin: 0 auto 28px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-property: color, background-color, border-color, opacity !important; }
}
