@font-face { font-family: 'Iosevka'; src: url('/fonts/iosevka-latin-200-normal.woff2') format('woff2'); font-weight: 200; font-style: normal; font-display: swap; }
@font-face { font-family: 'Iosevka'; src: url('/fonts/iosevka-latin-200-italic.woff2') format('woff2'); font-weight: 200; font-style: italic; font-display: swap; }
@font-face { font-family: 'Iosevka'; src: url('/fonts/iosevka-latin-300-normal.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Iosevka'; src: url('/fonts/iosevka-latin-300-italic.woff2') format('woff2'); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: 'Iosevka'; src: url('/fonts/iosevka-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Iosevka'; src: url('/fonts/iosevka-latin-700-italic.woff2') format('woff2'); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Podkova'; src: url('/fonts/podkova-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Podkova'; src: url('/fonts/podkova-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --bg-page: #f7f6f2;
  --bg-surface: #ffffff;
  --bg-secondary: #efede6;
  --text-primary: #1a1a18;
  --text-secondary: #6b6a64;
  --border: rgba(0,0,0,0.12);
  --border-strong: rgba(0,0,0,0.25);
  --radius-md: 8px;
  --font-sans: 'Iosevka', monospace;
  --font-mono: 'Iosevka', "SF Mono", "Fira Code", monospace;
  --font-heading: 'Podkova', Georgia, "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-page: #1a1a18;
    --bg-surface: #232220;
    --bg-secondary: #2a2926;
    --text-primary: #f0eee8;
    --text-secondary: #a0a09a;
    --border: rgba(255,255,255,0.12);
    --border-strong: rgba(255,255,255,0.25);
  }
}

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

body {
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.7;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 24px 60px;
}

h1 { font-size: 22px; font-weight: 700; margin: 8px 0 10px; letter-spacing: -0.01em; }
h2 { font-size: 18px; font-weight: 600; margin: 28px 0 8px; letter-spacing: -0.01em; }
h3 { font-size: 15px; font-weight: 600; margin: 22px 0 6px; }
h1, h2, h3, h4 { font-family: var(--font-heading); }

p { margin: 0 0 14px; }
ul, ol { margin: 6px 0 14px 20px; padding: 0; }
li { margin: 4px 0; }
.chevron-list { list-style: none; margin: 6px 0 14px 20px; padding: 0; }
strong { font-weight: 600; }
em { font-style: italic; }

code {
  background: var(--bg-secondary);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 13px;
  font-family: var(--font-mono);
  border: 1px solid var(--border);
}

pre {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 8px 0 14px;
  border: 1px solid var(--border);
}

pre code {
  background: none; border: none; padding: 0;
  font-size: 12px; line-height: 1.55;
  font-family: var(--font-mono);
  white-space: pre;
}

blockquote {
  margin: 8px 0 14px;
  padding: 10px 14px;
  border-left: 3px solid var(--border-strong);
  color: var(--text-secondary);
  font-style: italic;
}
blockquote p { margin: 2px 0; }

hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

table { border-collapse: collapse; font-size: 13px; width: 100%; margin: 8px 0 14px; }
th, td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
th { background: var(--bg-secondary); font-weight: 600; }

a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
a:hover { opacity: 0.75; }

img { max-width: 100%; height: auto; border-radius: var(--radius-md); margin: 4px 0; }

/* ── Footnote (entry "kb:footnote" section) ──────────────────────────────── */
/* Provenance, credits, corrections — worth keeping on the page, not worth reading
   at body size. Headings inside are pulled down so an authored "## Source Note"
   doesn't announce itself like a real section. */
.entry-footnote {
  margin: 32px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.entry-footnote > :first-child { margin-top: 0; }
.entry-footnote h2 { font-size: 13.5px; font-weight: 600; margin: 0 0 6px; letter-spacing: 0; }
.entry-footnote h3 { font-size: 12.5px; margin: 14px 0 4px; }
.entry-footnote p { margin: 0 0 8px; }
.entry-footnote blockquote { font-size: 12.5px; }
/* Attribution following a citation list needs air, or it reads as one more entry in it. */
.entry-footnote ol + p, .entry-footnote ul + p { margin-top: 16px; }

/* ── Nav / hamburger (pure CSS — no <script>, checkbox-hack toggle) ───────── */

.nav-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

#nav-btn {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 30;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}
#nav-btn:hover { background: var(--bg-secondary); }

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 20;
}

#render-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  overflow-y: auto;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  padding: 68px 18px 40px;
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  will-change: transform;
  z-index: 25;
}

.nav-toggle:checked ~ .nav-overlay { opacity: 1; pointer-events: auto; }
.nav-toggle:checked ~ #render-nav { transform: translateX(0); }

.nav-brand {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 14px;
  text-decoration: none;
}

.nav-site-links, .nav-namespaces { list-style: none; margin: 0 0 16px; padding: 0; }
.nav-site-links { border-bottom: 1px solid var(--border); padding-bottom: 14px; }
.nav-site-links li a {
  display: block;
  padding: 4px 2px;
  font-size: 13px;
  text-decoration: none;
}
.nav-site-links li a:hover { color: var(--text-secondary); opacity: 1; }

.nav-group summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  text-transform: capitalize;
  padding: 5px 2px;
  list-style: none;
}
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::before { content: "▸ "; }
.nav-group[open] summary::before { content: "▾ "; }

.nav-group ul {
  list-style: none;
  margin: 2px 0 8px 8px;
  padding: 0 0 0 10px;
  border-left: 1px solid var(--border);
}
.nav-group li a {
  display: block;
  padding: 3px 2px;
  font-size: 12.5px;
  color: var(--text-secondary);
  text-decoration: none;
}
.nav-group li a:hover { color: var(--text-primary); opacity: 1; }

/* ── Print ──────────────────────────────────────────────────────────────── */

@media print {
  @page { size: letter; margin: 0.55in; }

  #nav-btn, .nav-overlay, #render-nav, .nav-toggle { display: none !important; }

  body { background: #fff; color: #000; font-size: 11.5px; line-height: 1.4; }

  main { max-width: 100%; padding: 0; margin: 0; }

  h1 { font-size: 20px; margin: 0 0 7px; }
  h2 { font-size: 14.5px; margin: 15px 0 5px; break-after: avoid; }
  h3 { font-size: 13px; margin: 11px 0 4px; break-after: avoid; }

  p { margin: 0 0 9px; }
  h3 + p { break-after: avoid; }
  ul, ol { margin: 4px 0 9px 18px; break-inside: avoid; }
  li { margin: 2.5px 0; break-inside: avoid; }

  hr { margin: 9px 0; }

  a { color: #000; text-decoration: underline; }

  .entry-footnote {
    margin-top: 16px; padding-top: 8px;
    font-size: 9.5px; line-height: 1.35; color: #000;
    break-inside: avoid;
  }
  .entry-footnote h2 { font-size: 11px; margin: 0 0 4px; }
  .entry-footnote p { margin: 0 0 5px; }
}
