:root {
  --bg: #fcfafb; --fg: #1c1620; --muted: #6d6270;
  --rule: #e6dce3; --accent: #8a3a67; --surface: #f4eef2;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15111a; --fg: #ece5ee; --muted: #9c90a2;
    --rule: #2e2636; --accent: #dd91bb; --surface: #1f1927;
  }
}
:root {
  --hl-k: #8a3a67; --hl-t: #1f6f6b; --hl-s: #3f6b2b; --hl-n: #8a5a1a;
  --hl-c: #8a8290; --hl-d: #6d6270; --hl-o: #7a7280;
}
@media (prefers-color-scheme: dark) {
  :root {
    --hl-k: #dd91bb; --hl-t: #6fc7c0; --hl-s: #9ccf7a; --hl-n: #e0b170;
    --hl-c: #7d7386; --hl-d: #9c90a2; --hl-o: #9b93a4;
  }
}
.k { color: var(--hl-k); }
.t { color: var(--hl-t); }
.s { color: var(--hl-s); }
.n { color: var(--hl-n); }
.c { color: var(--hl-c); font-style: italic; }
.d { color: var(--hl-d); font-style: italic; }
.o { color: var(--hl-o); }
.f { color: inherit; font-weight: 600; }
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: ui-serif, Georgia, 'Times New Roman', serif;
  line-height: 1.6;
  display: grid; grid-template-columns: 16rem minmax(0, 1fr);
  gap: 3rem; max-width: 72rem; margin: 0 auto; padding: 0 1.5rem;
}
nav {
  position: sticky; top: 0; align-self: start; max-height: 100vh;
  overflow-y: auto; padding: 2.5rem 0 3rem;
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 0.88rem;
}
.brand { font-weight: 600; margin: 0 0 1.25rem; }
.brand a { color: var(--accent); text-decoration: none; }
nav ul { list-style: none; margin: 0; padding: 0; }
nav ul.ns { margin: 0.15rem 0 0.5rem 0.85rem; font-size: 0.94em; }
nav li { margin: 0.1rem 0; }
nav a {
  color: var(--fg); text-decoration: none; display: block;
  padding: 0.15rem 0.4rem; border-left: 2px solid transparent; border-radius: 2px;
}
nav a:hover { background: var(--surface); border-left-color: var(--accent); }
nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
main { padding: 2.5rem 0 6rem; min-width: 0; }
h1 {
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 1.7rem; letter-spacing: -0.02em; margin: 0 0 0.75rem;
  color: var(--accent);
}
.sub { color: var(--muted); font-size: 0.9rem; margin: 0 0 2rem; }
.blurb { max-width: 66ch; }
.decl {
  border-top: 1px solid var(--rule); padding: 1.3rem 0 0.4rem;
  max-width: 66ch;
}
.decl h2 { margin: 0 0 0.65rem; font-weight: 400; font-size: 1rem; }
.decl h2 code {
  background: var(--surface); padding: 0.35rem 0.55rem; border-radius: 3px;
  border-left: 2px solid var(--accent); display: inline-block;
  overflow-wrap: anywhere;
}
p { margin: 0 0 0.8rem; }
code {
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.87em;
}
p code { background: var(--surface); padding: 0.08em 0.3em; border-radius: 2px; }
a { color: var(--accent); }
nav .home { margin: 0 0 0.75rem; font-size: 0.85rem; }
nav .home a { color: var(--muted); text-decoration: none; }
nav .home a:hover { color: var(--accent); }
.search { position: relative; margin: 0 0 1.25rem; }
#q {
  width: 100%; padding: 0.4rem 0.55rem; border-radius: 3px;
  border: 1px solid var(--rule); background: var(--bg); color: var(--fg);
  font: inherit;
}
#q:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
#results {
  list-style: none; margin: 0.3rem 0 0; padding: 0.25rem;
  position: absolute; z-index: 5; left: 0; right: 0; max-height: 60vh; overflow-y: auto;
  background: var(--bg); border: 1px solid var(--rule); border-radius: 3px;
}
#results li { margin: 0; }
#results a { display: flex; justify-content: space-between; gap: 0.5rem; align-items: baseline; }
#results a span { color: var(--muted); font-size: 0.85em; }
#results .none { color: var(--muted); padding: 0.2rem 0.4rem; }
@media (max-width: 800px) {
  body { grid-template-columns: 1fr; gap: 0; }
  nav { position: static; max-height: none; border-bottom: 1px solid var(--rule); }
}