:root {
  --bg: #fbfaf7; --fg: #1f2328; --muted: #6a6f76; --rule: #e4e1da;
  --accent: #4d7a1f; --code-bg: #f1efe9;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1b26; --fg: #c0caf5; --muted: #8189ad; --rule: #2f3349;
    --accent: #9ece6a; --code-bg: #24283b;
  }
}
:root[data-theme="dark"] {
  --bg: #1a1b26; --fg: #c0caf5; --muted: #8189ad; --rule: #2f3349;
  --accent: #9ece6a; --code-bg: #24283b;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 17px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--accent); }
main { overflow-wrap: anywhere; max-width: 46rem; margin: 0 auto; padding: 2rem 16px 4rem; }
img { max-width: 100%; }

.cover { text-align: center; padding-top: 5rem; }
.cover .wordmark { width: 34rem; image-rendering: pixelated; }
.tagline { color: var(--muted); letter-spacing: .08em; text-transform: uppercase; font-size: .85rem; }
.cover > p:not(.tagline) { max-width: 34rem; margin: 1.5rem auto; }
.toc { list-style: none; padding: 0; margin: 3rem auto 0; max-width: 28rem; text-align: left; }
.toc a { display: flex; gap: 1rem; padding: .6rem .25rem; border-bottom: 1px solid var(--rule); color: var(--fg); text-decoration: none; }
.toc a:hover { color: var(--accent); }
.toc .num { color: var(--muted); width: 1.5rem; text-align: right; font-variant-numeric: tabular-nums; }

.bar { border-bottom: 1px solid var(--rule); padding: .75rem 16px; }
.bar a { display: inline-flex; align-items: center; gap: .6rem; color: var(--fg); text-decoration: none; font-weight: 600; font-size: .95rem; }
.bar img { width: 1.4rem; }
.kicker { color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; margin: 1.5rem 0 0; }
h1 { font-size: 2.3rem; line-height: 1.15; margin: .2rem 0 1.5rem; }
h2 { font-size: 1.35rem; margin-top: 2.5rem; }
h3 { font-size: 1.1rem; margin-top: 2rem; }

code { font: .88em ui-monospace, "JetBrainsMono Nerd Font", monospace; background: var(--code-bg); padding: .1em .3em; border-radius: 4px; }
pre { overflow-wrap: normal; background: var(--code-bg); padding: 1rem; border-radius: 8px; overflow-x: auto; line-height: 1.5; }
pre code { background: none; padding: 0; }
.highlight .c, .highlight .c1, .highlight .cm { color: var(--muted); }
.highlight .s, .highlight .s1, .highlight .s2 { color: var(--accent); }

table { border-collapse: collapse; width: 100%; font-size: .92rem; display: block; overflow-x: auto; }
th, td { text-align: left; vertical-align: top; padding: .45rem .6rem; border-bottom: 1px solid var(--rule); }
th { color: var(--muted); font-weight: 600; }
blockquote { margin: 1.5rem 0; padding: .25rem 1rem; border-left: 3px solid var(--accent); color: var(--muted); }

.pager { display: flex; justify-content: space-between; gap: 1rem; margin-top: 4rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.pager a { text-decoration: none; }
.pager .next { margin-left: auto; }
footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 2rem 16px 3rem; }
