/* Self-hosted webfonts. Files under `static/fonts/` are copied verbatim
   to /fonts/ at build time. No CDN, no third-party network calls.
   Sources (downloaded once from upstream GitHub repositories):
     - Inter (variable, latin) — github.com/rsms/inter (SIL OFL 1.1)
     - JetBrains Mono — github.com/JetBrains/JetBrainsMono (SIL OFL 1.1) */

@font-face {
  font-family: "Inter";
  src: local("Inter"), url("/fonts/Inter-Variable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  src: local("Inter Italic"), url("/fonts/Inter-Variable-Italic.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  src: local("JetBrains Mono"), url("/fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2122, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  src: local("JetBrains Mono Medium"), url("/fonts/JetBrainsMono-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+2122, U+FEFF, U+FFFD;
}
/* ===========================================================================
   vernedocs — editorial documentation theme.
   Amber accent · self-hosted Inter · spacious density · collapsible
   sidebar · badge callouts. The whole theme is a single fixed
   configuration; no runtime variants ship.
   =========================================================================== */

:root {
  color-scheme: light dark;

  /* Accent — amber. Two tones: a brighter `--accent` for decorative
     surfaces (dots, borders, dark-mode text) and a darker `--accent-text`
     for text on light backgrounds (where 4.5:1 vs linen requires it). */
  --accent: #e0a82e;
  --accent-text: #e0a82e;
  --accent-soft: rgba(224, 168, 46, 0.14);
  --accent-fg: #1a1305;

  /* Type stacks — self-hosted fonts (see fonts.css), system fallbacks below.
     `--font-italic` keeps an editorial serif feel for the hero <em>; we
     ship no italic serif webfont, so the system stack carries it. */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --font-display: var(--font-sans);
  --font-italic: ui-serif, "Iowan Old Style", "Hoefler Text", "Apple Garamond", Georgia, serif;

  /* Density. "Spacious" baked in. */
  --density: 1.1;
  --line-height: 1.65;
  --reading-measure: 70ch;

  /* Layout. */
  --sidebar-w: 18rem;
  --toc-w: 15rem;
  --header-h: 60px;
  --gutter: clamp(1.25rem, 2.5vw, 2.25rem);
}

/* Light. */
html[data-theme="light"] {
  color-scheme: light;
  --accent-text: #8a5a00;
  --bg:        #f6f3ec;
  --bg-elev:   #fbf9f4;
  --bg-deep:   #ece7da;
  --fg:        #1c1d1a;
  --fg-soft:   #3a3a36;
  /* `--muted` is darker than the visual sketch suggested so body-level text
     that uses it (ledes, summaries, meta rows) clears WCAG AA 4.5:1
     against `--bg`. `--muted-2` stays decorative-only (rule colour, kbd
     shadow, separator dots — never load-bearing prose). */
  --muted:     #5e5c52;
  --muted-2:   #87826f;
  --rule:      #d8d2c1;
  --rule-soft: #e3ddcb;
  --code-bg:   #ece7d6;
  --code-fg:   #2a2a26;
  --kbd-bg:    #fbf9f4;
  --kbd-shadow: 0 1px 0 #c8c2b0, inset 0 -1px 0 #e9e3d2;
  --shadow-sm: 0 1px 2px rgba(45, 35, 10, 0.05);
  --shadow-md: 0 6px 24px -8px rgba(45, 35, 10, 0.18);
}

/* Dark. */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg:        #0e1014;
  --bg-elev:   #15181f;
  --bg-deep:   #090b10;
  --fg:        #e9e6dd;
  --fg-soft:   #c5c2b9;
  --muted:     #88857c;
  --muted-2:   #5a5851;
  --rule:      #25282f;
  --rule-soft: #1c1f25;
  --code-bg:   #14171d;
  --code-fg:   #d8d4c7;
  --kbd-bg:    #1d2027;
  --kbd-shadow: 0 1px 0 #000, inset 0 -1px 0 #2a2d35;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 12px 40px -8px rgba(0, 0, 0, 0.6);
}

/* ── Base ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-block-start: calc(var(--header-h) + 1rem);
}
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: calc(16.5px * var(--density));
  line-height: var(--line-height);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100dvh;
}

a {
  color: inherit;
  text-decoration-color: var(--accent-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s;
}
a:hover { color: var(--accent-text); }

::selection { background: var(--accent); color: var(--accent-fg); }

button { font: inherit; color: inherit; cursor: pointer; }

img, svg, video { display: block; max-width: 100%; height: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

.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-link {
  position: absolute; inset-block-start: 0.5rem; inset-inline-start: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: 6px;
  color: var(--fg);
  font-weight: 500;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 120ms ease;
  z-index: 100;
}
.skip-link:focus-visible { transform: translateY(0); }

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

/* ── Header ──────────────────────────────────────────────────────────── */
.vd-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule-soft);
}
.vd-header-inner {
  height: 100%;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr auto;
  align-items: center;
  padding: 0 var(--gutter);
  gap: 1rem;
  max-width: 1480px;
  margin: 0 auto;
}

.vd-brand {
  display: flex; align-items: center; gap: 0.55rem;
  text-decoration: none; color: var(--fg);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 1.0625rem;
}
.vd-brand-mark { width: 24px; height: 24px; color: var(--accent-text); flex: none; }
.vd-brand .sep { color: var(--muted-2); margin: 0 0.1rem; font-weight: 400; }
.vd-brand strong { font-weight: 600; }
.vd-brand .ver {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  border: 1px solid var(--rule);
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 0.4rem;
  letter-spacing: 0.02em;
}

.vd-search-wrap { display: flex; justify-content: center; align-items: center; }
.vd-search {
  width: min(28rem, 100%);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--bg-elev);
  color: var(--muted);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.vd-search:hover { border-color: var(--muted-2); color: var(--fg-soft); }
.vd-search svg { width: 15px; height: 15px; flex: 0 0 15px; }
.vd-search-text { flex: 1; text-align: left; }
.vd-search-kbd {
  display: inline-flex; gap: 2px; align-items: center;
  font-family: var(--font-mono); font-size: 0.7rem;
}

.vd-actions { display: flex; align-items: center; gap: 0.4rem; }
.vd-icon-btn, .vd-icon-link {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--fg-soft);
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.vd-icon-btn:hover, .vd-icon-link:hover {
  background: var(--bg-elev); color: var(--fg); border-color: var(--rule);
}
.vd-icon-btn svg, .vd-icon-link svg { width: 18px; height: 18px; }
.vd-mobile-toggle { display: none; }

@media (pointer: coarse) {
  .vd-icon-btn, .vd-icon-link { width: 44px; height: 44px; }
}

/* ── Shell — three columns ───────────────────────────────────────────── */
.vd-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  gap: 0;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ── Sidebar ─────────────────────────────────────────────────────────── */
.vd-sidebar {
  position: sticky;
  top: var(--header-h);
  align-self: start;
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: calc(1.5rem * var(--density)) 1rem 2rem 0;
  font-size: 0.9375rem;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}

.vd-sidebar-mobile-close {
  display: none;
  margin-bottom: 0.75rem;
}

.vd-sidebar-group { margin-bottom: 0.4rem; }
.vd-sidebar-group--top { margin-bottom: 0.6rem; }

.vd-sidebar-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 0.4rem 0.75rem;
  margin: 1.4rem 0 0.45rem;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
}
.vd-sidebar-title:first-child,
.vd-sidebar-group:first-child .vd-sidebar-title { margin-top: 0.25rem; }
.vd-sidebar-title::before {
  content: "›";
  display: inline-block;
  font-family: var(--font-mono);
  color: var(--muted);
  transition: transform 0.18s;
  transform: rotate(90deg);
  font-size: 1rem;
  line-height: 1;
}
.vd-sidebar-group[data-collapsed="true"] .vd-sidebar-title::before {
  transform: rotate(0deg);
}
.vd-sidebar-group[data-collapsed="true"] .vd-sidebar-list { display: none; }

.vd-sidebar-list { list-style: none; padding: 0; margin: 0; }
.vd-sidebar-list li { margin: 0; }

.vd-sidebar a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.75rem;
  border-radius: 5px;
  color: var(--fg-soft);
  text-decoration: none;
  font-weight: 450;
  position: relative;
  transition: background 0.12s, color 0.12s;
}
.vd-sidebar a:hover { background: var(--bg-elev); color: var(--fg); }
.vd-sidebar a[aria-current="page"] {
  color: var(--accent-text);
  background: var(--accent-soft);
  font-weight: 500;
}
.vd-sidebar a[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 18%;
  bottom: 18%;
  width: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* Nested children (when summary uses children:) */
.vd-sidebar-list ul {
  list-style: none;
  padding-left: 1rem;
  margin: 0;
}

/* ── Main ────────────────────────────────────────────────────────────── */
.vd-main {
  min-width: 0;
  padding: calc(2.5rem * var(--density)) calc(2rem * var(--density)) 6rem;
  position: relative;
}

.vd-breadcrumb {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.25rem;
}
.vd-breadcrumb a { text-decoration: none; }
.vd-breadcrumb a:hover { color: var(--accent-text); }
.vd-breadcrumb .sep { color: var(--muted-2); }
.vd-breadcrumb .vd-breadcrumb-current { color: var(--fg-soft); }

.vd-page-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.85rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 600;
  margin: 0 0 0.85rem;
  text-wrap: balance;
}

.vd-page-lede {
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.45;
  color: var(--muted);
  font-weight: 400;
  margin: 0 0 2.5rem;
  max-width: 60ch;
  text-wrap: pretty;
}

/* ── 404 ─────────────────────────────────────────────────────────────── */
.vd-404 { padding-top: clamp(2.5rem, 8vh, 5rem); }
.vd-404-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin: 0 0 0.75rem;
}

/* ── Prose ───────────────────────────────────────────────────────────── */
.vd-prose {
  max-width: var(--reading-measure);
  font-size: 1rem;
}
.vd-prose > * + * { margin-top: 1.4em; }
.vd-prose p { margin: 0; line-height: var(--line-height); text-wrap: pretty; }
.vd-prose p + p { margin-top: 1.4em; }

.vd-prose h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 3rem 0 0.6rem;
  scroll-margin-top: calc(var(--header-h) + 1rem);
  position: relative;
  text-wrap: balance;
}

.vd-prose h2 .anchor {
  margin-left: 0.5rem;
  color: var(--muted-2);
  text-decoration: none;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.85em;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.vd-prose h2:hover .anchor { opacity: 1; }
.vd-prose h2 .anchor:hover { color: var(--accent-text); }

.vd-prose h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  margin: 2rem 0 0.5rem;
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

.vd-prose code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--code-bg);
  border: 1px solid var(--rule-soft);
  padding: 0.05em 0.35em;
  border-radius: 4px;
  color: var(--fg);
  word-break: break-word;
}
.vd-prose strong { font-weight: 600; color: var(--fg); }
.vd-prose em { font-style: italic; color: var(--fg); }

.vd-prose ul, .vd-prose ol { margin: 0; padding-left: 1.5rem; }
.vd-prose ul li, .vd-prose ol li {
  padding-left: 0.25rem;
  margin: 0.4em 0;
  line-height: var(--line-height);
}
.vd-prose ul li::marker { color: var(--muted-2); }
.vd-prose ol { counter-reset: ol; padding-left: 0; list-style: none; }
.vd-prose ol li {
  counter-increment: ol;
  position: relative;
  padding-left: 2.5rem;
}
.vd-prose ol li::before {
  content: counter(ol, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.05em;
  font-family: var(--font-mono);
  font-size: 0.78em;
  color: var(--accent-text);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.vd-prose blockquote {
  margin: 1.5rem 0;
  padding: 0.5rem 1rem;
  border-left: 3px solid var(--rule);
  color: var(--fg-soft);
  font-style: italic;
}

.vd-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  display: block;
  overflow-x: auto;
}
.vd-prose thead { background: var(--code-bg); }
.vd-prose th, .vd-prose td {
  text-align: left;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}
.vd-prose th {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--fg);
  border-bottom: 1px solid var(--rule);
}
.vd-prose tbody tr:last-child td { border-bottom: none; }

/* ── Code blocks (chroma-emitted markup) ─────────────────────────────── */
/* The renderer wraps highlighted code in:
     <div class="code-wrap" data-lang="…">
       <div class="highlight"><pre tabindex="0" class="chroma">…</pre></div>
       <span class="code-lang">…</span>
       <button class="code-copy mono">copy</button>
     </div>                                                                */
.vd-prose .code-wrap {
  position: relative;
  margin: 1.5rem 0;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--code-bg);
  overflow: hidden;
}
.vd-prose .code-wrap .highlight,
.vd-prose pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--code-fg);
  background: var(--code-bg);
  overflow-x: auto;
  scrollbar-width: thin;
}
.vd-prose pre {
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0.95rem 1rem;
  position: relative;
}
.vd-prose .code-wrap pre,
.vd-prose .code-wrap .highlight pre.chroma {
  border: 0;
  border-radius: 0;
  padding: 0.95rem 1rem;
  background: transparent;
  margin: 0;
}
.vd-prose pre code,
.vd-prose .code-wrap pre code { background: none; border: none; padding: 0; font-size: inherit; color: inherit; }

/* Code-block header — a flex row above the highlighted code, so it never
   overlays long lines and stays in normal flow (no z-index race with the
   chroma <pre>). */
.vd-prose .code-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: color-mix(in oklab, var(--code-bg) 80%, var(--bg));
  border-bottom: 1px solid var(--rule-soft);
}
.vd-prose .code-filename {
  flex: 1; min-width: 0;
  margin-right: auto;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vd-prose .code-lang {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 2px 6px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--bg);
  pointer-events: none;
}
.vd-prose .code-copy {
  background: var(--bg);
  border: 1px solid var(--rule);
  color: var(--muted-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.vd-prose .code-copy:hover { color: var(--accent-text); border-color: var(--accent-text); background: var(--bg-elev); }
.vd-prose .code-copy.is-copied { color: var(--accent-text); border-color: var(--accent-text); }

/* Chroma token classes shipped by the renderer. */
.vd-prose .chroma .k,  .vd-prose .chroma .kd, .vd-prose .chroma .kn { color: var(--accent-text); font-weight: 500; }
.vd-prose .chroma .s,  .vd-prose .chroma .s1, .vd-prose .chroma .s2 { color: #6fa775; }
.vd-prose .chroma .c,  .vd-prose .chroma .c1, .vd-prose .chroma .cm { color: var(--muted); font-style: italic; }
.vd-prose .chroma .nb, .vd-prose .chroma .nf { color: var(--accent-text); }
.vd-prose .chroma .nt { color: #5b9dd9; }
.vd-prose .chroma .mi, .vd-prose .chroma .mf { color: #d59f4a; }
.vd-prose .chroma .p,  .vd-prose .chroma .o  { color: var(--muted-2); }

html[data-theme="light"] .vd-prose .chroma .s,
html[data-theme="light"] .vd-prose .chroma .s1,
html[data-theme="light"] .vd-prose .chroma .s2 { color: #4d7d52; }
html[data-theme="light"] .vd-prose .chroma .nt { color: #2c66a0; }
html[data-theme="light"] .vd-prose .chroma .mi { color: #a37223; }

/* ── Callouts (GitHub alert syntax) ──────────────────────────────────── */
/* Author writes `> [!NOTE] Optional title` then body lines; the engine
   emits <blockquote data-callout="…">
            <p class="callout-badge">{kind}</p>
            <p class="callout-title">{user title}</p>   (only when set)
            …body…
         </blockquote>
   The five GitHub kinds are note/tip/important/warning/caution. */
.vd-prose blockquote[data-callout] {
  margin: 1.6rem 0;
  padding: 1rem 1.1rem;
  font-style: normal;
  border-left: 0;
  border: 1px solid var(--cal-border, var(--rule));
  background: var(--cal-bg-soft, var(--bg-elev));
  border-radius: 8px;
  --cal-bg-soft: color-mix(in oklab, var(--cal-accent, var(--accent)) 6%, var(--bg-elev));
  --cal-border: color-mix(in oklab, var(--cal-accent, var(--accent)) 35%, var(--rule));
  color: var(--fg-soft);
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.7rem;
  row-gap: 0.45rem;
  align-items: baseline;
}
.vd-prose blockquote[data-callout] > .callout-badge {
  grid-column: 1;
  align-self: start;
  display: inline-flex;
  align-items: center;
  background: var(--cal-accent, var(--accent));
  color: var(--bg);
  padding: 3px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  margin: 0;
}
html[data-theme="dark"] .vd-prose blockquote[data-callout] > .callout-badge { color: var(--bg-deep); }
.vd-prose blockquote[data-callout] > .callout-title {
  grid-column: 2;
  margin: 0;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.35;
  text-wrap: balance;
}
/* Body paragraphs (anything that isn't badge/title) span both columns
   so they wrap under the badge instead of getting pinched into the
   title's narrow track. */
.vd-prose blockquote[data-callout] > *:not(.callout-badge):not(.callout-title) {
  grid-column: 1 / -1;
  margin: 0;
}
/* Reset the prose-wide adjacent-sibling margin rule inside the callout —
   the grid handles spacing. */
.vd-prose blockquote[data-callout] > * + * { margin-top: 0; }
/* Untitled callouts: badge stays in column 1, body in column 2 on the
   same row so short notes read as a single line. */
.vd-prose blockquote[data-callout][data-callout-untitled] > *:not(.callout-badge) {
  grid-column: 2;
}
.vd-prose blockquote[data-callout="note"]      { --cal-accent: #5b8def; }
.vd-prose blockquote[data-callout="tip"]       { --cal-accent: #5eb88a; }
.vd-prose blockquote[data-callout="important"] { --cal-accent: #b07cf0; }
.vd-prose blockquote[data-callout="warning"]   { --cal-accent: #d68a3e; }
.vd-prose blockquote[data-callout="caution"]   { --cal-accent: #d96280; }

/* ── KBD chips ───────────────────────────────────────────────────────── */
kbd {
  font-family: var(--font-mono);
  font-size: 0.72em;
  background: var(--kbd-bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1px 5px;
  box-shadow: var(--kbd-shadow);
  color: var(--fg-soft);
  vertical-align: 1px;
}

/* ── Page footer — prev/next + meta row ──────────────────────────────── */
.vd-page-foot {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule-soft);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: var(--reading-measure);
}
.vd-pn {
  display: flex; flex-direction: column; gap: 0.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  text-decoration: none;
  background: var(--bg);
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.vd-pn:hover { border-color: var(--accent-text); background: var(--bg-elev); }
.vd-pn .lbl {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.vd-pn .ttl { font-weight: 500; color: var(--fg); }
.vd-pn--next { text-align: right; }
.vd-pn--placeholder { visibility: hidden; }

.vd-meta-row {
  margin-top: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.vd-meta-edit {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dotted var(--muted-2);
}
.vd-meta-edit:hover { color: var(--accent-text); border-color: var(--accent-text); }
.vd-meta-updated {
  margin-left: auto;
  text-align: right;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
}
.vd-meta-updated b { color: var(--fg-soft); font-weight: 500; text-transform: none; letter-spacing: 0.02em; }
@media (max-width: 600px) {
  .vd-meta-row { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
  .vd-meta-updated { margin-left: 0; }
}

/* ── On-this-page TOC ────────────────────────────────────────────────── */
.vd-toc {
  position: sticky;
  top: var(--header-h);
  align-self: start;
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: calc(2.5rem * var(--density)) 0 2rem 1.5rem;
  font-size: 0.85rem;
  border-left: 1px solid var(--rule-soft);
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}
.vd-toc-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 0 0 0.6rem;
}
.vd-toc nav, .vd-toc div { display: contents; }
.vd-toc ul { list-style: none; padding: 0; margin: 0; }
.vd-toc li { margin: 0; }
.vd-toc a {
  display: block;
  padding: 0.3rem 0.6rem;
  margin-left: -0.6rem;
  color: var(--muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  font-weight: 450;
  transition: color 0.12s, border-color 0.12s;
  line-height: 1.35;
}
.vd-toc a:hover { color: var(--fg); }
.vd-toc a.active {
  color: var(--accent-text);
  border-left-color: var(--accent-text);
}

/* ── Home ─────────────────────────────────────────────────────────────── */
.vd-home { max-width: 70rem; margin: 0 auto; padding: 0 var(--gutter); }

.vd-hero {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--rule-soft);
  position: relative;
}
.vd-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--rule-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--rule-soft) 1px, transparent 1px);
  background-size: 96px 96px;
  background-position: -1px -1px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 30%, transparent 80%);
  opacity: 0.4;
  pointer-events: none;
}
.vd-hero > * { position: relative; }

.vd-hero-kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.25rem;
  display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap;
}
.vd-hero-kicker .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; }
.vd-hero-kicker .sep { color: var(--muted-2); }

.vd-hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  line-height: 1.0;
  letter-spacing: -0.025em;
  margin: 0 0 1.25rem;
  max-width: 18ch;
  text-wrap: balance;
}
.vd-hero-title em {
  font-style: italic;
  color: var(--accent-text);
  font-family: var(--font-italic);
  font-weight: 400;
}

.vd-hero-tagline {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--muted);
  margin: 0 0 1.5rem;
  max-width: 50ch;
  font-weight: 400;
  text-wrap: pretty;
}
.vd-hero-summary {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--fg-soft);
  margin: 0 0 2.25rem;
  max-width: 56ch;
}

.vd-cta-row { display: flex; flex-wrap: wrap; gap: 0.8rem; align-items: center; }
.vd-btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.7rem 1.15rem;
  border-radius: 6px;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--fg);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.vd-btn:hover { border-color: var(--accent-text); }
.vd-btn--primary {
  background: var(--accent);
  color: var(--accent-fg);
  border-color: var(--accent-text);
}
.vd-btn--primary:hover { background: var(--fg); border-color: var(--fg); color: var(--bg); transform: translateY(-1px); }
.vd-btn .arrow { font-family: var(--font-mono); }

.vd-keypoints {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--rule-soft);
}
.vd-kp {
  padding: 2rem 1.75rem 2rem 0;
  border-right: 1px solid var(--rule-soft);
}
.vd-kp:last-child { border-right: none; padding-right: 0; }
.vd-kp:nth-child(n+2) { padding-left: 1.75rem; }
@media (max-width: 1000px) {
  .vd-kp { border-right: none; border-bottom: 1px solid var(--rule-soft); padding: 1.5rem 0; }
  .vd-kp:nth-child(n+2) { padding-left: 0; }
  .vd-kp:last-child { border-bottom: none; }
}
.vd-kp-kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-text);
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}
.vd-kp-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.005em;
}
.vd-kp-body { color: var(--muted); font-size: 0.95rem; line-height: 1.55; margin: 0; }

.vd-section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--rule-soft);
}
.vd-section:last-of-type { border-bottom: none; }
.vd-section-head {
  display: flex; align-items: baseline; gap: 1rem;
  margin-bottom: 1.5rem;
}
.vd-section-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted-2);
  letter-spacing: 0.15em;
}
.vd-section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

.vd-section-list { display: grid; gap: 0; }
.vd-section-item {
  display: grid;
  grid-template-columns: 12rem 1fr auto;
  gap: 1.5rem;
  align-items: baseline;
  padding: 1rem 0;
  border-top: 1px solid var(--rule-soft);
  text-decoration: none;
  color: inherit;
  transition: padding-left 0.18s, color 0.18s;
}
.vd-section-item:last-child { border-bottom: 1px solid var(--rule-soft); }
.vd-section-item:hover { color: var(--accent-text); padding-left: 0.5rem; }
.vd-section-item .ttl { font-family: var(--font-display); font-weight: 500; font-size: 1.05rem; }
.vd-section-item .lede { font-size: 0.9375rem; color: var(--muted); text-wrap: pretty; }
.vd-section-item .arr { font-family: var(--font-mono); color: var(--muted-2); transition: transform 0.18s, color 0.18s; }
.vd-section-item:hover .arr { transform: translateX(4px); color: var(--accent-text); }
@media (max-width: 700px) {
  .vd-section-item { grid-template-columns: 1fr; gap: 0.25rem; }
  .vd-section-item .arr { display: none; }
}

.vd-home-foot {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 1rem;
  padding: 2.5rem 0 4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.vd-home-foot a { color: var(--muted); text-decoration: none; border-bottom: 1px dotted var(--muted-2); }
.vd-home-foot a:hover { color: var(--accent-text); border-color: var(--accent-text); }
@media (max-width: 700px) {
  .vd-home-foot { grid-template-columns: 1fr; }
}

/* ── Section index list (used on /reference/, /guides/) ──────────────── */
.vd-section-index { list-style: none; padding: 0; margin: 1.5rem 0 0; border-top: 1px solid var(--rule-soft); }
.vd-section-index li { border-bottom: 1px solid var(--rule-soft); }
.vd-section-index a {
  display: grid;
  grid-template-columns: 14rem 1fr auto;
  gap: 1.5rem;
  align-items: baseline;
  padding: 1rem 0;
  text-decoration: none;
  color: inherit;
  transition: padding-left 0.18s, color 0.18s;
}
.vd-section-index a:hover { color: var(--accent-text); padding-left: 0.5rem; }
.vd-section-index a .ttl { font-family: var(--font-display); font-weight: 500; font-size: 1.05rem; }
.vd-section-index a .desc { color: var(--muted); font-size: 0.9375rem; }
.vd-section-index a .arr { color: var(--muted-2); font-family: var(--font-mono); transition: transform 0.18s, color 0.18s; }
.vd-section-index a:hover .arr { color: var(--accent-text); transform: translateX(4px); }
@media (max-width: 700px) {
  .vd-section-index a { grid-template-columns: 1fr; gap: 0.25rem; }
  .vd-section-index a .arr { display: none; }
}

/* ── Command palette (kbar) ──────────────────────────────────────────── */
.kbar-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: color-mix(in oklab, var(--bg-deep) 60%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: grid;
  place-items: start center;
  padding-top: 12vh;
  animation: vd-fade 0.15s ease-out;
}
.kbar-overlay[hidden] { display: none; }
@keyframes vd-fade { from { opacity: 0; } to { opacity: 1; } }

.kbar {
  width: min(36rem, 92vw);
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  animation: vd-pop 0.18s ease-out;
}
@keyframes vd-pop { from { transform: translateY(-8px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }

.kbar-search {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--rule-soft);
}
.kbar-search svg { width: 1rem; height: 1rem; color: var(--muted); flex-shrink: 0; }
.kbar-search input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 1rem;
  outline: none;
}
.kbar-search input::placeholder { color: var(--muted); }

.kbar-list { max-height: 22rem; overflow-y: auto; padding: 0.4rem 0; }
.kbar-empty {
  padding: 2rem 1.25rem;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}
.kbar-empty[hidden] { display: none; }

.kbar-section-h {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 0.7rem 1.25rem 0.3rem;
}
.kbar-section-h[hidden] { display: none; }

.kbar-item {
  display: grid;
  grid-template-columns: 1.5rem 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.55rem 1.25rem;
  cursor: pointer;
  border-left: 2px solid transparent;
  color: var(--fg-soft);
  text-decoration: none;
}
.kbar-item[hidden] { display: none; }
.kbar-item:hover, .kbar-item.is-active {
  background: var(--bg-deep);
  border-left-color: var(--accent-text);
  color: var(--fg);
}
.kbar-item .kbar-icn {
  font-family: var(--font-mono);
  color: var(--muted);
  text-align: center;
}
.kbar-item.is-active .kbar-icn { color: var(--accent-text); }
.kbar-item .kbar-lbl {
  display: flex; flex-direction: column; gap: 0.05rem;
  font-weight: 500;
}
.kbar-item .kbar-lbl .kbar-sub {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  font-weight: 400;
}

.kbar-foot {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.55rem 1rem;
  border-top: 1px solid var(--rule-soft);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  flex-wrap: wrap;
}
.kbar-foot kbd { font-size: 0.7em; }

/* ── Mobile drawer ───────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .vd-shell { grid-template-columns: var(--sidebar-w) 1fr; }
  .vd-toc { display: none; }
  .vd-header-inner { grid-template-columns: var(--sidebar-w) 1fr auto; }
}
@media (max-width: 800px) {
  :root { --sidebar-w: 14rem; }
  .vd-shell { grid-template-columns: 1fr; padding: 0 1rem; }
  .vd-sidebar {
    display: none;
    position: fixed;
    inset: var(--header-h) 0 0 0;
    z-index: 25;
    background: var(--bg);
    height: calc(100dvh - var(--header-h));
    padding: 1.25rem 1rem 2rem;
  }
  .vd-sidebar.is-open { display: block; }
  .vd-sidebar-mobile-close { display: inline-flex; }
  .vd-mobile-toggle { display: inline-flex; }
  .vd-header-inner { grid-template-columns: auto 1fr auto; padding: 0 1rem; }
  .vd-search-wrap { display: none; }
  .vd-page-foot { grid-template-columns: 1fr; }
  .vd-main { padding: 1.5rem 1rem 4rem; }
  .vd-prose { max-width: 100%; }
}

/* ── Print ───────────────────────────────────────────────────────────── */
@media print {
  .vd-header, .vd-sidebar, .vd-toc, .vd-page-foot, .vd-meta-row, .skip-link, .kbar-overlay { display: none !important; }
  .vd-shell { grid-template-columns: 1fr !important; padding: 0 !important; }
  .vd-main { padding: 0; }
  .vd-prose a::after { content: " (" attr(href) ")"; font-size: 0.85em; color: var(--muted); }
  .vd-prose pre, .vd-prose blockquote { break-inside: avoid; }
  @page { margin: 1.5cm; }
}
