/* Every literal colour is a token; changes land in one place. */
:root { color-scheme: light dark;
  --font-body: ui-serif, Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --fg: #111;      --dim: #555;
  --bg: #fdfdfc;   --line: #e3e3e0;
  --code-bg: #f4f4f1;
  --accent: #a4432b;
}
@media (prefers-color-scheme: dark) {
  :root { --fg: #e8e8e6; --dim: #a0a09b; --bg: #16161a;
          --line: #2c2c31; --code-bg: #1e1e23; --accent: #e08a68; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg);
       font: 16px/1.65 var(--font-body); }
.wrap { max-width: 68rem; margin: 0 auto; padding: 2.5rem 1.25rem 3rem;
        display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 2.75rem;
        align-items: start; }
.wrap.solo { grid-template-columns: minmax(0, 1fr); max-width: 46rem; }
main { max-width: 46rem; }
@media (max-width: 56rem) {
  .wrap, .wrap.solo { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  nav.tree ul ul { display: none; }
}

/* The index list on the left: the whole tree, all the time, in the body
   voice. Groups are bold; where you are is underlined. */
nav.tree { position: sticky; top: 2rem; font-size: .95rem; }
nav.tree ul { list-style: none; margin: 0; padding: 0; }
nav.tree ul ul { padding-left: 1rem; }
nav.tree a { color: var(--fg); text-decoration: none; display: block;
             padding: .18rem 0; }
nav.tree a:hover { text-decoration: underline; text-underline-offset: 3px; }
nav.tree a.current { font-weight: 700; text-decoration: underline;
                     text-underline-offset: 3px; }
nav.tree li.group > a { font-weight: 700; }

.crumbs { font-size: .9rem; margin-bottom: 2rem; }

/* Previous and next, in sidebar order. */
.pager { display: flex; justify-content: space-between; gap: 1.5rem;
         margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--line);
         font-size: .95rem; }
.pager .next { margin-left: auto; text-align: right; }

h1 { font-size: 2rem; letter-spacing: -.02em; margin: 0 0 .5rem; }
h2 { font-size: 1.15rem; letter-spacing: -.01em; margin: 2.25rem 0 .6rem; }
article > p:first-child { color: var(--dim); font-size: 1.05rem; }
p, li { margin: .6rem 0; }

a { color: var(--accent); }
.dim { color: var(--dim); font-size: .9rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
blockquote { color: var(--dim); border-left: 2px solid var(--line);
             margin: 1rem 0; padding-left: 1rem; }

/* The tree of indexes: a section page is a listing of its children. */
ul.index { list-style: none; padding: 0; margin: 1.5rem 0; }
ul.index li { margin: 0 0 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
ul.index li:last-child { border-bottom: 0; }
ul.index span.dim { display: block; margin-top: .15rem; }

code, pre { font-family: var(--font-mono); font-size: .875rem; }
pre { background: var(--code-bg); border: 1px solid var(--line); border-radius: 6px;
      padding: .85rem 1rem; overflow-x: auto; line-height: 1.5; }
code:not(pre code) { background: var(--code-bg); padding: .1rem .3rem; border-radius: 3px; }

table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: .92em; }
th, td { border: 1px solid var(--line); padding: .45rem .7rem; text-align: left; vertical-align: top; }
th { background: var(--code-bg); }

footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--line);
         color: var(--dim); font-size: .9rem; }

.brand { margin: 0 0 1rem; }
.brand a { color: var(--fg); text-decoration: none;
           display: inline-flex; align-items: center; gap: .45rem; }
.tree-logo { width: 1.3rem; height: auto; display: inline-block; }
.cover { text-align: center; margin: .5rem 0 1.25rem; }
.cover img { max-width: 12rem; height: auto; border-radius: 6px;
             border: 1px solid var(--line); }
