@import url("https://fonts.googleapis.com/css2?family=Libertinus+Serif:ital,wght@0,400;0,600;1,400;1,600&family=JetBrains+Mono:wght@400;600&family=Geist:wght@400;600&display=swap");

:root {
  color-scheme: light;
  --serif: "Libertinus Serif", "Linux Libertine O", "Linux Libertine", Georgia, serif;
  --sans: Geist, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --paper: #f9f8f5; --surface: #f1efea; --rule: #dedbd3; --ink: #171716;
  --muted: #6a6861; --faint: #a09d95; --bad: #9d2b22; --warn: #7d5200;
  --hl-keyword: #a3331f; --hl-name: #1e5aa0; --hl-builtin: #6f3f9e;
  --hl-string: #3b6b2e; --hl-number: #8a5a00;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #12141a; --surface: #1b1e25; --rule: #31353e; --ink: #e6e7ea;
    --muted: #9a9ea8; --faint: #646975; --bad: #eda59c; --warn: #e7c277;
    --hl-keyword: #f0907a; --hl-name: #8cb8ee; --hl-builtin: #c6a1ec;
    --hl-string: #9ccc87; --hl-number: #e0b25c;
  }
}
@media print {
  :root {
    color-scheme: light;
    --paper: #fff; --surface: #fff; --rule: #999; --ink: #000; --muted: #333; --faint: #666;
    --bad: #000; --warn: #000; --hl-keyword: #000; --hl-name: #000; --hl-builtin: #000;
    --hl-string: #333; --hl-number: #000;
  }
}

* { box-sizing: border-box; }
html { font-size: 19.5px; }
body { margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: 1rem; line-height: 1.35;
  font-kerning: normal; font-variant-numeric: lining-nums;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
@media (max-width: 40rem) { html { font-size: 18px; } }
:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 3px; }
::selection { background: var(--surface); }
a:link, a:visited { color: inherit; text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 0.2em; text-decoration-color: var(--faint); }
a:hover, a:focus { text-decoration-color: currentColor; }

header.site, .layout { max-width: 58rem; margin: 0 auto; padding: 0 1.6rem; }
header.site { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 1.5rem;
  padding-top: 1.6rem; margin-bottom: 3rem; }
header.site a { text-decoration: none; }
header.site .home { font-size: 1.05rem; letter-spacing: -0.01em; }
header.site .links { margin-left: auto; display: flex; gap: 1.5rem;
  font-family: var(--sans); font-size: 0.7rem; }
header.site .links a { display: inline-block; color: var(--muted); }
header.site .links a::first-letter { text-transform: uppercase; }
header.site .links a:hover, header.site .links a[aria-current="page"] { color: var(--ink); }
img.logo { height: 1.05em; width: auto; vertical-align: -0.17em; margin-right: 0.4em; }
h1 img.logo { display: block; height: 1.3em; margin: 0 auto 0.5em; }
@media (prefers-color-scheme: dark) { img.logo.invert { filter: invert(1); } }

.layout { display: flex; gap: 3rem; }
nav.chapters { flex: 0 0 11rem; position: sticky; top: 1.5rem; align-self: flex-start;
  max-height: calc(100vh - 3rem); overflow-y: auto; padding-top: 0.6rem;
  font-family: var(--sans); font-size: 0.65rem; line-height: 1.45; }
nav.chapters ol { margin: 0; padding-left: 1.5em; }
nav.chapters li { margin: 0 0 0.7em; color: var(--muted); }
nav.chapters li::marker { color: var(--faint); }
nav.chapters a:link, nav.chapters a:visited { color: var(--muted); text-decoration: none; }
nav.chapters a:hover, nav.chapters li.current a { color: var(--ink); }
main { flex: 1; min-width: 0; max-width: 38rem; padding-bottom: 5rem; }
@media (max-width: 56rem) {
  .layout { display: block; }
  nav.chapters { position: static; max-height: none; margin-bottom: 2.5rem; }
}

h1, h2, h3, h4 { font-weight: 400; line-height: 1.2; text-wrap: balance; }
h1 { font-size: 2.4rem; line-height: 1.1; letter-spacing: -0.02em; text-align: center;
  margin: 0 0 1.2em; }
h2 { font-size: 1.5rem; letter-spacing: -0.01em; margin: 2.2em 0 0.4em; }
h3 { font-size: 1.15rem; font-style: italic; margin: 1.7em 0 0.2em; }
h4 { font-size: 1rem; font-style: italic; margin: 1.2em 0 0; }
@media (max-width: 40rem) { h1 { font-size: 2rem; } }
p { margin: 0.8em 0; }
strong, b { font-weight: 600; }
dfn { font-style: italic; }
li::marker { color: var(--faint); }
ol li::marker { color: var(--muted); }


code, pre { font-family: var(--mono); font-variant-numeric: normal;
  font-variant-ligatures: none; font-feature-settings: "calt" 0, "liga" 0; }
code { font-size: 0.8em; background: var(--surface); border-radius: 3px; padding: 0.1em 0.3em; }
pre code, h1 code, h2 code, h3 code, .chunk-name code { background: none; padding: 0; }
pre code { font-size: inherit; }
pre { overflow-x: auto; }
pre.code, div.code pre { margin: 0.3em 0; padding: 0.9em 1.1em; background: var(--surface);
  border-radius: 4px; font-size: 0.59rem; line-height: 1.6; }
.code :is(.k, .kd, .kn, .kr, .kp, .ow, .sa) { color: var(--hl-keyword); }
.code :is(.nf, .fm, .nc, .ne, .nt, .nn) { color: var(--hl-name); }
.code :is(.nb, .bp, .vm, .nd, .nv, .na) { color: var(--hl-builtin); }
.code :is(.s, .s1, .s2, .sb, .sc, .dl, .sd, .sh, .sx, .sr, .ss) { color: var(--hl-string); }
.code :is(.si, .se) { color: var(--hl-number); }
.code :is(.m, .mb, .mf, .mh, .mi, .mo, .il, .kc, .kt, .l, .ld) { color: var(--hl-number); }
.code :is(.c, .c1, .ch, .cm, .cp, .cpf, .cs) { color: var(--muted); font-style: italic; }
.code .err { color: inherit; border: 0; }
.code a.ref { font-family: var(--serif); font-style: italic; font-size: 1.2em; }
.undefined { color: var(--bad); font-family: var(--serif); font-style: italic; }

.chunk { margin: 1.6em 0; }
.chunk-name { font-style: italic; color: var(--muted); }
.chunk-name a:link, .chunk-name a:visited { color: var(--ink); text-decoration: none; }
.chunk-name code { font-style: normal; font-size: 0.75em; }
.chunk-notes { font-family: var(--sans); font-size: 0.65rem; line-height: 1.5;
  color: var(--muted); }
.chunk-notes a:link, .chunk-notes a:visited { color: inherit; }

table { border-collapse: collapse; margin: 1em 0; font-size: 0.9rem; line-height: 1.45; }
td { padding: 0.55em 1.2em 0.55em 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
td:last-child { padding-right: 0; }
tr:first-child td { font-family: var(--sans); font-size: 0.6rem; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); vertical-align: bottom;
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
tr:last-child td { border-bottom: 1px solid var(--ink); }

blockquote { margin: 1em 0; padding: 0 0 0 1.5em; font-style: italic; }
blockquote.alert { font-style: normal; background: var(--surface); border-radius: 4px;
  padding: 0.8em 1.1em; margin: 1.6em 0; }
blockquote.alert > p { margin: 0.4em 0; }
blockquote.alert > p:first-child::before { font-weight: 600; }
blockquote.warning > p:first-child::before { content: "Warning. "; color: var(--warn); }
blockquote.caution > p:first-child::before { content: "Caution. "; color: var(--warn); }
blockquote.important > p:first-child::before { content: "Important. "; }
blockquote.note > p:first-child::before { content: "Note. "; }
blockquote.tip > p:first-child::before { content: "Tip. "; }
ul.chunks { padding-left: 1.2em; }
ul.chunks li { margin: 0.2em 0; }

nav.turn { display: flex; justify-content: space-between; gap: 1.5em; margin-top: 4rem;
  font-family: var(--sans); font-size: 0.7rem; }
nav.turn a:link, nav.turn a:visited { color: var(--muted); text-decoration: none; }
nav.turn a:hover { color: var(--ink); }
nav.turn .next { margin-left: auto; text-align: right; }
footer.colophon { margin-top: 1.5rem; font-family: var(--sans); font-size: 0.65rem;
  color: var(--muted); }
footer.colophon a:link, footer.colophon a:visited { color: inherit; }
@media print {
  nav.chapters, nav.turn, header.site .links { display: none; }
  .layout { display: block; }
}
