/* A reference book, not a landing page: paper and ink, serif headwords, hairline rules. */
:root {
  --paper: #ffffff; --paper-2: #f3f2ee; --ink: #1b1b1f; --ink-2: #4a4843; --muted: #76726a; --rule: #d9d4c9; --rule-2: #c8c2b4;
  --hier: #3652c7; --ident: #6e49b0; --contrast: #b3261e; --assoc: #2a7a5a;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --measure: 72ch;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #141416; --paper-2: #1c1c1f; --ink: #ece9e2; --ink-2: #c9c5bb; --muted: #8f8b82; --rule: #2d2d31; --rule-2: #3b3b40;
    --hier: #8094ff; --ident: #b08ff0; --contrast: #f08177; --assoc: #5cc39a; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16.5px/1.6 var(--sans); -webkit-font-smoothing: antialiased; font-feature-settings: "ss01"; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--ink); }
code, pre { font-family: var(--mono); }
code { font-size: 0.9em; background: var(--paper-2); padding: 0.08em 0.4em; border-radius: 3px; }
pre { background: transparent; border: 0; border-left: 2px solid var(--ink); padding: 4px 0 4px 20px; margin: 0 0 24px; overflow: auto; line-height: 1.6; }
pre code { background: none; padding: 0; font-size: 13.5px; color: var(--ink-2); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.1; letter-spacing: -0.012em; margin: 0; }
h1 { font-size: 46px; margin-bottom: 14px; }
h2 { font-size: 30px; margin: 0 0 18px; }
h2 em { font-size: 1em; }
h3 { font-size: 22px; margin: 28px 0 8px; }
p { margin: 0 0 16px; max-width: var(--measure); }
em { font-family: var(--serif); font-style: italic; font-size: 1.05em; }
blockquote { margin: 0 0 20px; padding: 0 0 0 20px; border-left: 2px solid var(--ink); font-family: var(--serif); font-size: 1.2em; line-height: 1.4; color: var(--ink); max-width: var(--measure); }
blockquote p { margin: 0; max-width: none; }
table { border-collapse: collapse; width: 100%; margin: 8px 0 28px; font-size: 15px; }
th, td { text-align: left; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-family: var(--mono); font-weight: 500; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border-bottom-color: var(--ink); }
ul, ol { padding-left: 22px; margin: 0 0 16px; max-width: var(--measure); }
li { margin: 5px 0; }
li::marker { color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--rule); margin: 36px 0; }
.muted { color: var(--muted); }

/* code colouring, applied at build time */
.k { color: var(--muted); }
.h { color: var(--ink); font-weight: 600; }
.l { color: var(--hier); }
.u { color: var(--muted); }
.c { color: var(--muted); font-style: italic; }
.o-h { color: var(--hier); font-weight: 600; } .o-i { color: var(--ident); font-weight: 600; }
.o-c { color: var(--contrast); font-weight: 600; } .o-a { color: var(--assoc); font-weight: 600; }

/* header */
.top { display: flex; align-items: baseline; justify-content: space-between; max-width: 1040px; margin: 0 auto; padding: 22px 28px 18px; border-bottom: 0; }
.brand { display: inline-flex; align-items: center; font-family: var(--serif); font-weight: 500; font-size: 22px; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.brand svg { color: var(--ink); margin-right: 10px; position: relative; top: 2px; }
.brand span { color: var(--muted); }
.top nav a { margin-left: 26px; color: var(--ink-2); font-size: 14px; text-decoration: none; font-family: var(--mono); letter-spacing: 0.02em; }
.top nav a.active { color: var(--ink); border-bottom: 1px solid var(--ink); padding-bottom: 2px; }
.top nav a:hover { color: var(--ink); }
.menu-toggle, .menu-button { display: none; }

/* page grid */
.page { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 1040px; margin: 0 auto; padding: 0 28px; }
.page:has(.toc) { grid-template-columns: 200px minmax(0, 1fr); gap: 56px; }
main { min-width: 0; padding: 0 0 80px; }
.prose { max-width: 720px; }
.prose > h1 + p { font-family: var(--serif); font-size: 21px; line-height: 1.4; color: var(--ink-2); margin-bottom: 36px; }
.prose h2 { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--rule); font-size: 26px; }
.toc { position: sticky; top: 28px; align-self: start; padding-top: 60px; font-size: 13.5px; }
.toc p { font-family: var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; margin-bottom: 10px; }
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 7px 0; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--ink); text-decoration: underline; }

/* footer */
footer { border-top: 0; margin-top: 24px; padding: 32px 28px 56px; color: var(--muted); font-size: 14px; }
footer .cols { max-width: 984px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; }
footer a { display: block; color: var(--ink-2); margin: 6px 0; text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer .head { font-family: var(--mono); color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 10px; }
.brand-foot { font-family: var(--serif); font-size: 20px; color: var(--ink); margin: 0 0 6px; }
.brand-foot span { color: var(--muted); }
footer .muted { max-width: 34ch; }

/* home: numbered sections with the numeral in the margin */
main > section:not(.hero):not(.interlude) { padding: 40px 0 8px; counter-increment: sec; border-top: 1px solid var(--rule); margin-top: 20px; }
main > section:not(.hero):not(.interlude) > h2::before { content: counter(sec, decimal-leading-zero); display: block; font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 14px; }
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 64px; align-items: center; min-height: calc(100vh - 92px); padding: 0 0 24px; }
.eyebrow { font-family: var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; font-size: 11.5px; margin-bottom: 22px; }
.hero h1 { font-size: 60px; line-height: 1.02; margin-bottom: 22px; letter-spacing: -0.02em; }
.hero h1 em { font-size: 1em; color: var(--ink); }
.u { position: relative; display: inline-block; }
.stroke { position: absolute; left: -1%; bottom: -0.14em; width: 102%; height: 0.2em; overflow: visible; }
.stroke path { fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 420; stroke-dashoffset: 420; animation: draw 0.8s ease-out 0.5s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .stroke path { animation: none; stroke-dashoffset: 0; } }
.lead { font-size: 19px; line-height: 1.5; color: var(--ink-2); max-width: 30em; }
.install { display: inline-flex; align-items: center; gap: 18px; margin-top: 14px; padding: 0; border: 0; background: none; }
.install code { background: var(--paper-2); font-size: 15px; padding: 10px 16px; border-radius: 0; border: 1px solid var(--rule-2); }
.install .copy { font: 500 12.5px var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink); background: none; border: 0; border-bottom: 1px solid var(--ink); padding: 2px 0; cursor: pointer; }
.install .copy:hover { color: var(--muted); border-color: var(--muted); }
.graph { width: 100%; height: auto; display: block; }
.graph text { font-family: var(--mono); font-size: 11.5px; fill: var(--ink); }
.graph text.e { font-size: 10px; fill: var(--muted); letter-spacing: 0.04em; }
.graph rect { fill: var(--paper); stroke: var(--ink); stroke-width: 1; }
.graph rect.center { stroke-width: 1.8; }
.graph line, .graph path { stroke-width: 1.2; fill: none; }
.graph .eh { stroke: var(--hier); } .graph .ea { stroke: var(--assoc); } .graph .ec { stroke: var(--contrast); } .graph .ei { stroke: var(--ident); }
.graph .arrow-h { fill: var(--hier); } .graph .arrow-a { fill: var(--assoc); } .graph .arrow-c { fill: var(--contrast); }
.graph rect.sw { stroke: none; } .graph .sw-h { fill: var(--hier); } .graph .sw-a { fill: var(--assoc); } .graph .sw-c { fill: var(--contrast); }
.caption { font-family: var(--mono); color: var(--muted); font-size: 11.5px; letter-spacing: 0.03em; margin: 10px 0 0; max-width: none; }
.interlude { position: relative; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 24px 0; }
.thesis { margin: 0; padding: 0; border: 0; font-size: 38px; line-height: 1.28; max-width: 21em; font-weight: 400; letter-spacing: -0.012em; }
.thesis p { margin: 0; }
.thesis-who { font-family: var(--mono); color: var(--muted); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; margin: 28px 0 0; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; margin-bottom: 20px; }
.two > * { min-width: 0; }
.two figure { display: flex; flex-direction: column; }
.two pre { white-space: pre-wrap; word-break: break-word; margin: 0; flex: 1; }
.two pre code { font-size: 12.5px; }
figure { margin: 0 0 12px; }
figcaption { font-family: var(--mono); font-size: 11.5px; color: var(--muted); letter-spacing: 0.03em; margin-bottom: 10px; }
.cases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; margin: 8px 0 20px; }
.case { border-top: 1px solid var(--rule); padding-top: 14px; }
.case p { max-width: none; margin: 0 0 12px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.case .req { font-family: var(--serif); font-size: 21px; line-height: 1.3; color: var(--ink); margin-bottom: 16px; }
.case span { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.case .wi { color: var(--ink); }
.more { font-size: 15px; }
.try .install { margin-top: 4px; }
.entries { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 48px; margin: 8px 0 0; max-width: none; }
.entries div { padding: 16px 0; border-top: 1px solid var(--rule); }
.entries dt { font-family: var(--serif); font-size: 21px; font-weight: 500; margin: 0 0 6px; }
.entries dd { margin: 0; color: var(--ink-2); font-size: 15.5px; line-height: 1.55; }
.steps { counter-reset: s; list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 36px; max-width: none; }
.steps li { counter-increment: s; margin: 0; font-size: 15.5px; color: var(--ink-2); line-height: 1.55; }
.steps li::before { content: counter(s); display: block; font-family: var(--serif); font-size: 44px; line-height: 1; color: var(--ink); margin-bottom: 14px; }
.steps li strong { display: block; color: var(--ink); font-family: var(--serif); font-size: 20px; font-weight: 500; margin-bottom: 6px; }
.types td:first-child { font-family: var(--serif); font-size: 17px; white-space: nowrap; }
.types td:nth-child(2) { font-family: var(--mono); font-size: 13.5px; color: var(--ink-2); }
.works { display: flex; flex-wrap: wrap; font-family: var(--mono); font-size: 13.5px; color: var(--ink-2); line-height: 2; margin: 0 0 8px; max-width: none; }
.works span { white-space: nowrap; }
.works span::after { content: "  ·  "; color: var(--rule-2); white-space: pre; }
.works span:last-child::after { content: ""; }
dl.faq { margin: 0; max-width: var(--measure); }
dl.faq dt { font-family: var(--serif); font-size: 20px; font-weight: 500; margin-top: 22px; }
dl.faq dd { margin: 6px 0 0; color: var(--ink-2); }
.swatch { display: inline-block; width: 9px; height: 9px; border-radius: 1px; margin-right: 10px; vertical-align: 1px; }

@media (max-width: 880px) {
  .page:has(.toc) { grid-template-columns: 1fr; } .toc { display: none; }
  main { padding-top: 12px; }
  main > section:not(.hero):not(.interlude) { padding-top: 28px; }
  .hero { grid-template-columns: 1fr; gap: 24px; min-height: 0; padding: 8px 0 24px; }
  .interlude { min-height: 0; padding: 48px 0 32px; }
  .hero h1 { font-size: 42px; } h1 { font-size: 36px; } h2 { font-size: 26px; }
  .thesis { font-size: 24px; }
  .entries, .steps, .cases { grid-template-columns: 1fr; }
  footer .cols { grid-template-columns: 1fr; }
  .top { padding: 16px 16px 12px; flex-wrap: wrap; align-items: center; }
  .menu-button { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 38px; height: 34px; padding: 0 9px; border: 1px solid var(--ink); cursor: pointer; }
  .menu-button span { display: block; height: 1.5px; background: var(--ink); }
  .top nav { display: none; width: 100%; flex-direction: column; margin-top: 14px; padding-top: 4px; border-top: 1px solid var(--rule); }
  .menu-toggle:checked ~ nav { display: flex; }
  .top nav a { margin: 0; padding: 12px 0; font-size: 15px; border-bottom: 1px solid var(--rule); }
  .top nav a:last-child { border-bottom: 0; }
  .top nav a.active { border-bottom: 1px solid var(--rule); padding-bottom: 12px; }
  .page { padding: 0 16px; }
  .install code { white-space: nowrap; }
}
@media (max-width: 1000px) {
  .two { grid-template-columns: 1fr; }
}
