/* amcampbell.xyz. Production stylesheet: the design locked in the lab on 2026-11-24 (PLAN.md,
   "Design, locked"), with the lab's controls and unused options removed. lab/lab.css keeps the
   alternatives and the reasoning behind each value. */

/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  /* THREE colours, used for everything (text, rules, code, charts). */
  --bg: #fff;
  --ink: #000;
  --ink-2: #333;   /* links, secondary text, hairlines */

  --font-body: "Source Serif 4", Georgia, serif;            /* text, contents, labels, small headings */
  --font-display: "Missaali", "Source Serif 4", serif;      /* page title, sections, subsections */
  --font-num: "UnifrakturMaguntia", "Missaali", serif;      /* figures beside Missaali (its own are roman) */
  --font-ui: "Source Sans 3", system-ui, sans-serif;        /* captions, tables, byline, UI */
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  /* math: typeset at build time (build/render_math.mjs, MathJax + STIX Two), not here */

  /* 19px text on a 42.75rem measure: ~80 characters a line (Source Serif's optical sizes make it
     narrower per em at 19px than at 17px, so the measure isn't 19/17 of 39rem; measured in the lab). */
  --body-size: 19px;
  --body-leading: 1.6;
  --measure: 42.75rem;

  /* margin columns: see "page column" */
  --col: calc(var(--measure) + 40px);   /* the text column box: measure + 2 x 20px padding */
  --edge: 1.5rem;
  --gap: 4rem;
  --sn-max: 15rem;
  --sn-width: var(--sn-max);
  --left-gap: 2.5rem;
  --left-max: 36rem;
  --left-width: 24rem;

  /* Light-on-dark text looks thinner (irradiation): dark mode adds --dw to every weight. */
  --dw: 0;
  --w-body: calc(400 + var(--dw));
  --w-medium: calc(500 + var(--dw));
  --w-strong: calc(600 + var(--dw));
  --w-ui: calc(400 + var(--dw));
  --w-mono: calc(400 + var(--dw));
}
@media (prefers-color-scheme: dark) {
  :root { color-scheme: dark; --bg: #161616; --ink: #f1f1f1; --ink-2: #dcdcdc; --dw: 40; }
}
@media (max-width: 649px) { :root { --body-size: 18px; } }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: var(--body-size); font-weight: var(--w-body); line-height: var(--body-leading);
  font-optical-sizing: auto; font-kerning: normal; font-variant-ligatures: common-ligatures;
  text-rendering: optimizeLegibility; hanging-punctuation: first; overflow-x: hidden;
}
a { color: var(--ink-2); text-decoration-thickness: 0.06em; text-underline-offset: 0.18em; text-decoration-color: var(--ink-2); }
a:hover { text-decoration-thickness: 0.12em; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
strong, b { font-weight: var(--w-strong); }
hr { border: 0; border-top: 1px solid var(--ink-2); margin: 2.5em 0; }
img { max-width: 100%; height: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--bg); padding: 0.3em 0.6em; z-index: 20; }

/* ---------- corner mark (every page but home): a small Goudy "A", linking home ----------
   Wide screens: in the top-left corner, in the empty left margin. Narrower: its own row above the
   text (the margin there is the text's). */
.corner-mark { display: block; width: fit-content; margin: 1rem 0 0 var(--edge); font-family: "Goudy Initials Web"; font-size: 3.2rem; line-height: 0.8; color: var(--ink); text-decoration: none; }
.corner-mark + main { padding-top: 1.5rem; }
@media (max-width: 649px) { .corner-mark { margin-left: 16px; font-size: 2.6rem; } }
@media (min-width: 91.75rem) {
  .corner-mark { position: absolute; top: 1.25rem; left: var(--edge); margin: 0; }
  .corner-mark + main { padding-top: 2.5rem; }
}

/* ---------- page column ----------
   <main> is the text column (--col = measure + padding). Margin content hangs outside it with
   negative margins; its left edge (--x) is chosen to fit what the margins hold: the whole composition
   (left column + text + notes) is centred, and spare room goes to the left column.
     >= 91.75rem  left column (24rem+) + notes (13-15rem)
     65.25-91.75rem  notes only; left content inline
     < 65.25rem   everything inline, text centred
   Each breakpoint = measure + what the margins need (the lab derived them for 39rem; +3.75rem here). */
main { max-width: var(--col); margin: 0 auto; padding: 2.5rem 20px 6rem; }
@media (max-width: 649px) { main { padding-left: 16px; padding-right: 16px; } }
:root {
  --x-right: max(var(--edge), (100vw - (var(--col) + var(--gap) + var(--sn-max))) / 2);
  --x-both: max(24rem + var(--left-gap) + var(--edge),
    min(100vw - var(--col) - (var(--sn-max) + var(--gap) + var(--edge)),
        (100vw - (var(--left-max) + var(--left-gap) + var(--col) + var(--gap) + var(--sn-max))) / 2 + var(--left-max) + var(--left-gap)));
}
@media (min-width: 65.25rem) {
  :root { --x: var(--x-right); --sn-width: min(var(--sn-max), 100vw - var(--col) - var(--x) - var(--gap) - var(--edge)); }
  .note main { margin-left: var(--x); margin-right: 0; }
}
@media (min-width: 91.75rem) {
  :root { --x: var(--x-both); --left-width: calc(var(--x) + 20px - var(--left-gap) - var(--edge)); }
}

/* ---------- post header ---------- */
.post-header { margin: 0 0 2.25em; }
.status-banner { font-family: var(--font-ui); font-weight: var(--w-ui); font-size: 0.85em; line-height: 1.45; border: 1px solid var(--ink); padding: 0.55em 0.9em; margin: 0 0 2em; }
.kicker { margin: 0 0 0.45em; line-height: 1.3; }
.chapter { font-size: 0.95em; color: var(--ink-2); font-variant-caps: small-caps; letter-spacing: 0.06em; }
h1 {
  font-family: var(--font-display); font-weight: 400; font-synthesis: none; font-size: 2.6em; line-height: 1.1;
  margin: 0 0 0.3em; text-wrap: balance;
}
.subtitle { font-size: 1.25em; font-style: italic; line-height: 1.3; margin: 0 0 0.5em; }
.dek { font-size: 1.08em; font-style: italic; line-height: 1.45; color: var(--ink-2); margin: 0 0 1em; text-wrap: pretty; }
/* byline, as a book sets it: names in small caps (italic ampersand), the date in italic below */
.byline { margin: 0.2em 0 0; }
.byline p { margin: 0; }
.byline-names { font-variant-caps: small-caps; letter-spacing: 0.03em; font-size: 1em; color: var(--ink); }   /* body size, 19px */
.byline .amp { font-style: italic; font-variant-caps: normal; letter-spacing: 0; }
.byline-date { font-style: italic; color: var(--ink-2); font-size: 1em; margin-top: 0.05em !important; }
.keywords { font-family: var(--font-ui); font-weight: var(--w-ui); font-size: 0.82em; line-height: 1.5; color: var(--ink-2); margin: 0; }
.keywords { font-family: var(--font-mono); font-weight: var(--w-mono); font-size: 0.72em; margin-top: 0.3em; }
.keywords-label { font-family: var(--font-ui); font-size: calc(0.82em / 0.72); font-variant-caps: small-caps; letter-spacing: 0.06em; font-weight: var(--w-strong); margin-right: 0.5em; }

/* sequence navigation: right margin, above the contents (>= 65.25rem); top of the header below that */
.seqnav { text-align: center; line-height: 1.3; margin: 0 0 1.4em; }
.seq-title { display: block; font-size: 1.1em; font-weight: var(--w-medium); font-variant-caps: small-caps; letter-spacing: 0.04em; color: var(--ink); text-decoration: none; text-wrap: balance; }
.seq-title:hover { text-decoration: underline; text-decoration-thickness: 0.06em; }
.seq-step { display: flex; justify-content: center; align-items: baseline; gap: 0.7em; margin: 0.3em 0 0; }
.seq-pos { font-variant-numeric: lining-nums tabular-nums; color: var(--ink-2); }
.seq-prev, .seq-next { font-family: var(--font-ui); font-size: 1.15em; line-height: 1; color: var(--ink); text-decoration: none; padding: 0.1em 0; }
:is(.seq-prev, .seq-next):not(.seq-end):hover { color: var(--ink-2); }
.seq-end { color: var(--ink-2); opacity: 0.35; }
.seqnav-inline .seqnav { text-align: left; margin: 0 0 0.6em; }
.seqnav-inline .seq-step { justify-content: flex-start; }
@media (max-width: 65.24rem) { .seqnav-inline + .kicker { display: none; } }

/* ---------- abstract ---------- */
.abstract { margin: 0 calc(2.5em / 0.94) 2.75em; padding: 0.9em 1.4em 1em; border: 1px solid var(--ink); font-size: 0.94em; line-height: 1.5; }
.abstract p { margin: 0; text-align: justify; hyphens: auto; }
.abstract p + p { text-indent: 1.5em; }
@media (max-width: 649px) { .abstract { margin-left: 0.75em; margin-right: 0.75em; padding: 0.75em 1em 0.85em; } .abstract p { text-align: left; } }

/* ---------- headings ----------
   authored  element  role            style                                         numbered
   (title)   h1       post            Missaali, large                               -
   #         h2       section         Missaali as written (Title Cased), rule below 1 / N.1
   ##        h3       subsection      Missaali (Title Cased)                        1.1 / N.1.1
   ###       h4       subsubsection   Source Serif as written, medium               no
   ####      (run-in) paragraph       Source Serif small caps, starts the para      no
   #####     (run-in) paragraph       Source Serif bold (theorems, defs, ...)       no
   Missaali: one weight (no faux bold), no tracking, its medieval round r and long s (calt) on.
   Section numbers are UnifrakturMaguntia: Missaali's own "digits" are roman numerals (2 -> ij). */
h2, h3, h4 { color: var(--ink); text-wrap: balance; }
h2, h3 { font-family: var(--font-display); font-weight: 400; font-synthesis: none; }
h2 { font-size: 1.55em; line-height: 1.2; margin: 2.2em 0 0.9em; padding-bottom: 0.3em; border-bottom: 1px solid var(--ink); }
h3 { font-size: 1.3em; line-height: 1.3; margin: 1.8em 0 0.5em; }
h4 { font-family: var(--font-body); font-size: 1em; font-weight: var(--w-medium); line-height: 1.3; margin: 1.6em 0 0.35em; }
.secnum { font-variant-numeric: lining-nums tabular-nums; margin-right: 0.6em; }
:is(h2, h3) .secnum { font-family: var(--font-num); font-weight: 400; font-variant-numeric: normal; }
.runin { font-style: normal; }
.runin-sc { font-variant-caps: small-caps; letter-spacing: 0.03em; }
.runin-b { font-weight: var(--w-strong); }

/* ---------- paragraphs ---------- */
p { margin: 0 0 1em; text-wrap: pretty; hyphens: auto; }
main > p { margin: 0; text-align: justify; }
main > p + p, main > p + .aux + p { text-indent: 2.5em; }
/* a paragraph that starts with a run-in heading: no indent, a little space above */
main > p:has(.runin) { text-indent: 0 !important; margin-top: 0.9em; }
/* text continuing after a display equation is not indented */
main > p:has(> .math.display), main > p:has(> .math.display) + p, main > p:has(> .math.display) + .aux + p,
main > .equation + p, main > .equation + .aux + p { text-indent: 0; }
main > :is(p, ul, ol, blockquote, .table-block, div.sourceCode, .aux) + :is(ul, ol, blockquote, .table-block, div.sourceCode, figure:not(.left), .box),
main > :is(ul, ol, blockquote, .table-block:not(.left), div.sourceCode, figure:not(.left), .box) + :is(p, .aux) { margin-top: 1em; }
@media (max-width: 649px) {
  main > p { text-align: left; }
  main > p + p, main > p + .aux + p { text-indent: 1.75em; }
}
ul, ol { padding-left: 1.3em; }
li { margin: 0.25em 0; }
main ul > li::marker { content: "⸫\2002"; font-family: var(--font-display); color: var(--ink); }   /* Missaali's tricolon */
.lead-in { font-variant-caps: small-caps; letter-spacing: 0.03em; }   /* the opening words (blocks.lua) */
span.smallcaps { font-variant-caps: small-caps; }

/* Initial: Goudy Initialen, a floated ::first-letter three lines deep (Justif sets the lines around a
   floated initial; it can't with CSS initial-letter). Every glyph is a square 0.8em tall on the
   baseline, sized from the cap height of line 1 to the baseline of line 3 (2 lines + 1 cap) and
   lowered to meet line 1's cap height. Lengths are registered properties so they compute on the
   paragraph, in its font. 0.35em = (ascent - descent) / 2 of Source Serif 4. Line 1 continues the
   initial's word, so it sits tight against it (negative first-line indent); lines 2-3 keep the gap. */
@property --dc-size { syntax: "<length>"; inherits: true; initial-value: 0px; }
@property --dc-top { syntax: "<length>"; inherits: true; initial-value: 0px; }
@property --dc-gap { syntax: "<length>"; inherits: true; initial-value: 0px; }
.note main > p:first-of-type {
  text-indent: calc(-1 * var(--dc-gap));
  --dc-size: calc(2lh + 1cap); --dc-top: calc(0.5lh + 0.35em - 1cap); --dc-gap: 0.4em;
}
.note main > p:first-of-type::first-letter {
  float: left; font-family: "Goudy Initials Web"; font-weight: 400; font-variant-caps: normal; letter-spacing: 0; color: var(--ink);
  font-size: calc(var(--dc-size) / 0.8); line-height: 0.8; margin: var(--dc-top) var(--dc-gap) 0 0; padding: 0;
}

/* ---------- boxes ---------- */
.box { margin: 1.5em 0; padding: 0.85em 1.25em 0.95em; border: 1px solid var(--ink); font-size: 0.92em; line-height: 1.5; }
.box p { margin: 0 0 0.5em; }
.box p:last-child { margin-bottom: 0; }
/* label: Source Serif, Title Cased by the build, in small caps (capitals stay full height) */
.box-label { font-family: var(--font-body); font-weight: var(--w-medium); font-size: 1.02em; color: var(--ink); font-variant-caps: small-caps; letter-spacing: 0.05em; margin-bottom: 0.4em !important; }

/* ---------- blockquotes: a blackletter opening quote hanging in the indent ---------- */
blockquote { position: relative; margin: 2em 2.5em 2em calc(2.5em / 0.95); padding: 0; font-size: 0.95em; line-height: var(--body-leading); color: var(--ink); }
blockquote p { margin: 0; text-align: left; hyphens: auto; }
blockquote p + p { margin-top: 0.6em; }
blockquote::before { content: "\201C"; position: absolute; left: -0.62em; top: -0.12em; font-family: var(--font-num); font-size: 3.1em; line-height: 1; color: var(--ink-2); }
blockquote .attribution p { margin-top: 0.55em; font-variant-caps: small-caps; letter-spacing: 0.04em; color: var(--ink-2); }
blockquote .attribution em { font-variant-caps: normal; letter-spacing: 0; }
@media (max-width: 649px) { blockquote { margin-right: 0.5em; } }

/* ---------- math (SVG from MathJax at build time; screen readers read the hidden MathML) ---------- */
.math { position: relative; }
.math-sr { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
mjx-container[jax="SVG"] { direction: ltr; }
mjx-container[jax="SVG"] > svg { overflow: visible; }
.math.inline { display: inline-block; white-space: nowrap; text-indent: 0; }   /* one unbreakable box for Justif */
.math.display { display: block; margin: 1.2em 0; padding: 0.2em 0; text-align: center; overflow-x: auto; overflow-y: hidden; }
.math.display mjx-container { display: block; margin: 0; }
/* a display equation wider than its column is scaled down to fit (MathJax's SVG has a viewBox), but
   not below 80% of its natural width (--w, written by render_math.mjs): past that it scrolls. So a
   few pixels over never shows a scrollbar, and phones get smaller but still readable equations.
   (min-width beats max-width.) Break very long equations by hand with aligned. */
.math.display mjx-container > svg { max-width: 100%; min-width: calc(var(--w) * 0.8); height: auto; }
figcaption .math, table .math, .table-caption .math, .sidenote .math, .note-inline .math { font-size: 1.08em; }
.equation { display: grid; grid-template-columns: 4em minmax(0, 1fr) 4em; align-items: center; margin: 1.2em 0; }
.equation .math.display { grid-column: 2; margin: 0; }
.eq-num { grid-column: 3; justify-self: end; font-variant-numeric: lining-nums; color: var(--ink-2); }
@media (max-width: 649px) {
  .equation { grid-template-columns: minmax(0, 1fr) auto; column-gap: 0.5em; }
  .equation .math.display { grid-column: 1; }
  .eq-num { grid-column: 2; }
}
.equation:target .eq-num { color: var(--ink); font-weight: var(--w-strong); }
a.xref { white-space: nowrap; }

/* ---------- code: monochrome, framed ---------- */
code, pre, kbd { font-family: var(--font-mono); font-weight: var(--w-mono); font-size: 0.84em; font-variant-ligatures: none; }
div.sourceCode, pre { margin: 1.4em 0; overflow-x: auto; }
pre { padding: 0.7em 1em; border: 1px solid var(--ink-2); line-height: 1.5; }
pre code { font-size: 0.8em; }
div.sourceCode pre { margin: 0; }
pre > code.sourceCode > span { display: inline; }
code span.kw, code span.cf, code span.im { font-weight: calc(500 + var(--dw)); }
code span.co, code span.do, code span.an, code span.cv { color: var(--ink-2); font-style: italic; }

/* ---------- tables: rules, double rule under the header, frozen header + first column ---------- */
.table-block { margin: 1.5em 0; }
.table-caption { font-family: var(--font-ui); font-weight: var(--w-ui); font-size: 0.84em; line-height: 1.45; margin: 0 0 0.6em; }
.table-caption p { margin: 0; }
.table-wrap:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
.table-wrap { overflow: auto; max-height: min(75vh, 42rem); overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--ink-2) var(--bg); }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-family: var(--font-ui); font-weight: var(--w-ui); font-size: 0.8em; line-height: 1.4; font-variant-numeric: tabular-nums lining-nums; }
th, td { padding: 0.4em 0.7em; text-align: left; vertical-align: top; background: var(--bg); min-width: 4.5em; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
thead th { font-weight: var(--w-strong); border-top: 1px solid var(--ink); border-bottom: 3px double var(--ink); }
tbody tr + tr > * { border-top: 0.5px solid var(--ink-2); }
tbody tr:last-child > * { border-bottom: 1px solid var(--ink); }
th[align="right"], td[align="right"], th[style*="right"], td[style*="right"] { text-align: right; }
.table-wrap thead th { position: sticky; top: 0; z-index: 2; }
.table-wrap :is(th, td):first-child { position: sticky; left: 0; z-index: 1; padding-right: 1em; }
.table-wrap thead th:first-child { z-index: 3; }
.cap-label { font-weight: var(--w-strong); margin-right: 0.15em; }
.table-button { float: right; margin: 0 0 0.3em 1em; padding: 0.1em 0.6em; font-family: var(--font-ui); font-weight: var(--w-ui); font-size: 0.95em; line-height: 1.4; color: var(--ink); background: var(--bg); border: 1px solid var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 0.45em; }
.table-button:hover { border-color: var(--ink); }
.table-button[hidden] { display: none; }
.icon { display: inline-block; width: 1em; height: 1em; background: currentColor; mask: var(--icon) center / contain no-repeat; -webkit-mask: var(--icon) center / contain no-repeat; }
.icon-expand { --icon: url(icons/expand.svg); }
.icon-close { --icon: url(icons/close.svg); }
html.dialog-open { overflow: hidden; }
.table-dialog { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 1.25rem 1.5rem 1rem; border: 0; background: var(--bg); color: var(--ink); font-size: var(--body-size); }
.table-dialog[open] { display: flex; flex-direction: column; }
.table-dialog::backdrop { background: var(--bg); }
.table-dialog-bar { display: flex; align-items: flex-start; gap: 2rem; margin-bottom: 1rem; }
.table-dialog-bar .table-caption { flex: 1; max-width: 48rem; margin: 0; }
.table-dialog-bar .table-button { float: none; margin: 0 0 0 auto; flex: none; }
.table-dialog .table-wrap { flex: 1; min-height: 0; max-height: none; }

/* ---------- figures ---------- */
figure { margin: 2em 0; }
figure img { display: block; margin: 0 auto; }
figcaption { font-family: var(--font-ui); font-weight: var(--w-ui); font-size: 0.8em; line-height: 1.45; color: var(--ink); margin-top: 0.6em; }
figcaption p { margin: 0; }
figcaption strong { font-weight: inherit; font-style: italic; }

/* ---------- margins: notes, citations, sequence nav + contents, left column ---------- */
.sidenote, .sidecite { display: none; }
.aux { margin: 0; }
.note-inline { position: relative; margin: 0.6em 0 0.9em; padding-left: calc(2.5em / 0.85); font-size: 0.85em; line-height: 1.45; color: var(--ink-2); text-indent: 0; text-align: left; hyphens: auto; }
.note-inline > .note-num { position: absolute; left: 0; width: calc(2.5em / 0.85 - 0.6em); text-align: right; margin: 0; }
.cite-note-inline .cite-short { font-variant-caps: small-caps; letter-spacing: 0.04em; color: var(--ink); font-size: 1.05em; }
@media (max-width: 649px) { .note-inline { padding-left: calc(1.75em / 0.85); } .note-inline > .note-num { width: calc(1.75em / 0.85 - 0.5em); } }
.note-inline p { margin: 0; }
.note-num { font-family: var(--font-ui); font-weight: var(--w-strong); font-variant-numeric: lining-nums; margin-right: 0.15em; }
a.note-ref { text-decoration: none; }
a.note-ref sup { font-family: var(--font-ui); font-size: 0.7em; font-weight: var(--w-strong); color: var(--ink-2); line-height: 0; padding-left: 0.05em; }
a.note-back { text-decoration: none; font-family: var(--font-ui); }
.cite-short { font-family: var(--font-ui); font-size: 0.92em; }
.sidenote, .sidecite, .note-inline { overflow-wrap: break-word; }
.side-top { display: none; }
@media (min-width: 65.25rem) {
  .sidenote, .sidecite {
    display: block; float: right; clear: right; position: relative; width: var(--sn-width);
    margin: 0.25em calc(-1 * (var(--sn-width) + var(--gap))) 0.9em 0;
    text-indent: 0; text-align: left; hyphens: auto;
  }
  .sidenote { font-size: 0.82em; line-height: 1.4; color: var(--ink-2); }
  .sidecite { font-family: var(--font-ui); font-weight: var(--w-ui); font-size: 0.74em; line-height: 1.4; color: var(--ink-2); }
  .sidecite p { margin: 0; }
  .sidecite > p + p { margin-top: 0.3em; }
  .sidecite .cite-note { font-family: var(--font-body); font-weight: var(--w-body); font-size: calc(0.82em / 0.74); margin-top: 0.3em; color: var(--ink-2); }
  .sidecite .cite-short { font-size: 1em; font-style: italic; }
  .note-inline { height: 0; overflow: hidden; margin: 0; }
  /* sequence nav + contents: top of the right margin, level with the top of the title (emitted
     between the chapter line and the h1; -0.15em meets Missaali's tall capitals) */
  .side-top { display: block; float: right; clear: right; width: var(--sn-width); margin: calc(0.2em - 0.15em) calc(-1 * (var(--sn-width) + var(--gap))) 2em 0; }
  .toc-inline, .seqnav-inline { display: none; }
}
@media (min-width: 91.75rem) {
  figure.left, .table-block.left { float: left; clear: left; width: var(--left-width); margin: 0.3em 0 1em calc(-1 * (var(--left-width) + var(--left-gap))); }
  main > p + :is(figure.left, .table-block.left) + p, main > p + .aux + :is(figure.left, .table-block.left) + p { text-indent: 2.5em; margin-top: 0; }
}

/* ---------- contents: sections in small caps, subsections title case ---------- */
.toc { font-family: var(--font-body); }
.toc-list, .toc-sub { list-style: none; margin: 0; padding: 0; }
.toc a { display: grid; grid-template-columns: 2.4em minmax(0, 1fr); column-gap: 0.5em; text-decoration: none; color: var(--ink); line-height: 1.3; }
.toc a:hover .toc-text { text-decoration: underline; text-decoration-thickness: 0.06em; text-underline-offset: 0.18em; }
.toc-num { font-variant-numeric: lining-nums tabular-nums; color: var(--ink-2); font-weight: var(--w-body); }
.toc-1 { margin: 0.5em 0 0; font-size: 0.86em; font-weight: var(--w-medium); }
.toc-1:first-child { margin-top: 0; }
.toc-1 > a .toc-text { font-variant-caps: small-caps; letter-spacing: 0.05em; font-size: 1.12em; }
.toc-2 { margin: 0.25em 0 0; font-size: 0.92em; font-weight: var(--w-body); }
.toc-2 .toc-text { color: var(--ink-2); }
.toc-sub { margin: 0.1em 0 0.2em; padding-left: 2.9em; }
.toc-2 a { grid-template-columns: 2.9em minmax(0, 1fr); }
.toc-label { font-family: var(--font-ui); font-weight: var(--w-medium); font-size: 0.72em; text-transform: uppercase; letter-spacing: 0.16em; color: var(--ink-2); margin: 0; }
.toc-inline { margin: 0 0 2.5em; border: 1px solid var(--ink); padding: 0.5em 0.9em; }
.toc-inline summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 0.6em; }
.toc-inline summary::-webkit-details-marker { display: none; }
.toc-inline summary::after { content: "+"; font-family: var(--font-ui); color: var(--ink-2); margin-left: auto; }
.toc-inline[open] summary::after { content: "−"; }
.toc-inline .toc-list { padding: 0.2em 0 0.4em; }

/* ---------- references (citeproc) ---------- */
#refs { font-size: 0.9em; line-height: 1.45; overflow-wrap: break-word; }
#refs .csl-entry { padding-left: 1.5em; text-indent: -1.5em; margin: 0 0 0.9em; text-align: left; }
#refs .csl-entry p { margin: 0; }
#refs .annote { text-indent: 0; margin-top: 0.25em; font-size: 0.95em; color: var(--ink-2); }
#refs .annote p { font-style: italic; }
.csl-entry a { word-break: break-word; }

/* ---------- figures drawn with D3: ink, ink-2, bg only ---------- */
.viz { position: relative; }
.viz .viz-mount svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font-ui); font-weight: var(--w-ui); }
.viz .axis text { fill: var(--ink-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz .axis line, .viz .axis path { stroke: var(--ink-2); stroke-width: 0.75; }
.viz .grid line { stroke: var(--ink-2); stroke-width: 0.5; stroke-dasharray: 1 3; }
.viz .axis-title { fill: var(--ink-2); font-size: 11px; }
.viz .ref-line { stroke: var(--ink-2); stroke-width: 0.75; }
.viz .series { fill: none; stroke: var(--ink); }
.viz .mark { fill: var(--ink); stroke: var(--bg); stroke-width: 1.5; }
.viz .series-label { font-size: 11px; font-weight: var(--w-medium); fill: var(--ink); }
.viz .hover-hit { fill: transparent; cursor: crosshair; }
.viz .hover-hit:focus { outline: none; }
.viz .hover-hit:focus-visible + g.crosshair line { stroke: var(--ink); }
.viz .crosshair line { stroke: var(--ink-2); stroke-width: 0.75; }
.viz .tooltip { position: absolute; pointer-events: none; z-index: 2; background: var(--bg); color: var(--ink); border: 1px solid var(--ink-2); padding: 0.4rem 0.55rem; font-family: var(--font-ui); font-size: 0.72rem; line-height: 1.45; font-variant-numeric: tabular-nums; white-space: nowrap; }
.viz .tooltip .t-head { color: var(--ink-2); margin-bottom: 0.15rem; }
.viz .tooltip .t-row { display: flex; align-items: center; gap: 0.45em; }
.viz .tooltip .t-row b { font-weight: var(--w-strong); margin-left: auto; padding-left: 1em; }
.viz details { font-family: var(--font-ui); font-size: 0.78em; color: var(--ink-2); margin-top: 0.6rem; }
.viz details summary { cursor: pointer; }
.viz details table { font-size: 1em; margin: 0.5em 0 0; }

/* ---------- home page (after gwern.net's): monogram + boxed nav + intro at text width; then a
   wide grid of short lists (Newest, the sequences, Essays) ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.home-main { max-width: 84rem; padding: 2.5rem 1.5rem 6rem; }
/* the intro is centred on the page; the monogram hangs in the margin to its left (above it, when
   the margin is too narrow) */
.home-head { position: relative; max-width: var(--measure); margin: 0 auto; }
.monogram { position: absolute; right: calc(100% + 1.75rem); top: 0; font-family: "Goudy Initials Web"; font-size: 7.6rem; line-height: 0.8; color: var(--ink); text-decoration: none; padding-top: 0.05em; }
@media (max-width: 64rem) { .monogram { position: static; display: block; font-size: 4.5rem; margin-bottom: 0.3em; } }
.home-intro > p { margin: 0; text-align: justify; hyphens: auto; }
.home-intro > p + p { text-indent: 2.5em; }
.home-intro > p:has(.runin) { text-indent: 2.5em !important; margin-top: 0; }
@media (max-width: 649px) {
  .home-main { padding: 1.5rem 16px 4rem; }

  .home-intro > p { text-align: left; }
}
.home-lists { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 0 2.5rem; margin-top: 3.5em; }
.home-lists section h2 { font-size: 1.45em; margin: 0 0 0.7em; }
.home-lists ul, .home-lists ol { margin: 0 0 2.5em; padding-left: 1.3em; }
.home-lists li { margin: 0.25em 0; }   /* the posts' list spacing (body leading), not gwern's looser lists */
.home-lists ul > li::marker { content: "⸫\2002"; font-family: var(--font-display); color: var(--ink); }
.home-lists ol > li::marker { font-family: var(--font-num); color: var(--ink-2); }
.home-lists a { color: var(--ink); }
.home-main .site-footer { max-width: var(--measure); margin-left: auto; margin-right: auto; }
.sequence .writing { list-style: none; padding: 0; margin: 2em 0 0; }
.sequence .writing li { margin: 0 0 0.9em; }
.entry-title { font-size: 1.1em; }
.entry-meta { font-family: var(--font-ui); font-size: 0.78em; color: var(--ink-2); margin-left: 0.4em; }
.entry-desc { display: block; font-size: 0.92em; color: var(--ink-2); font-style: italic; }
.seq-chapters li { display: grid; grid-template-columns: 1.6em 1fr; }
.seq-chapters .n { font-variant-numeric: lining-nums; color: var(--ink-2); }
.site-footer { font-family: var(--font-ui); font-size: 0.8rem; color: var(--ink-2); margin-top: 4em; padding-top: 1em; border-top: 1px solid var(--ink-2); display: flex; gap: 1.2em; flex-wrap: wrap; }
.site-footer a { color: var(--ink-2); }

/* a heading that is a link (home: the sequence title), as gwern.net does it: no underline; on hover
   or focus it turns ink-2 and a link icon appears to its right (always there, invisible: no shift) */
h2 a { color: inherit; text-decoration: none; }
h2 a::after { content: ""; display: inline-block; width: 0.5em; height: 0.5em; margin-left: 0.3em; vertical-align: 0.1em;
  background: currentColor; mask: url(icons/link.svg) center / contain no-repeat; -webkit-mask: url(icons/link.svg) center / contain no-repeat; opacity: 0; }
h2 a:hover, h2 a:focus-visible { color: var(--ink-2); outline: none; }
h2 a:hover::after, h2 a:focus-visible::after { opacity: 1; }
.site-footer .site-name { font-family: var(--font-mono); font-weight: var(--w-mono); font-size: 0.95em; color: var(--ink); }
.site-footer a { font-family: var(--font-body); font-weight: var(--w-body); font-size: 1.12em; }   /* footer links in the serif */

/* end of a post in a sequence: previous and next chapter */
.seq-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 2em; margin: 4em 0 0; padding-top: 1.2em; border-top: 1px solid var(--ink); }
.seq-foot a { text-decoration: none; color: var(--ink); display: block; }
.seq-foot-next { text-align: right; }
.seq-foot-dir { display: block; font-size: 0.82em; color: var(--ink-2); font-variant-caps: small-caps; letter-spacing: 0.06em; }
.seq-foot-title { display: block; font-size: 1.05em; line-height: 1.35; margin-top: 0.15em; text-decoration: underline; text-decoration-thickness: 0.06em; text-underline-offset: 0.18em; text-decoration-color: var(--ink-2); }
.seq-foot a:hover .seq-foot-title { text-decoration-thickness: 0.12em; }
.seq-foot + .site-footer { margin-top: 2.5em; }
@media (max-width: 649px) { .seq-foot { grid-template-columns: 1fr; gap: 1.2em; } .seq-foot-next { text-align: left; } }
.missaali { font-family: var(--font-display); }
.dek + p { text-indent: 0 !important; }   /* the first paragraph after a page's description */
.site-footer a { font-variant-caps: small-caps; letter-spacing: 0.04em; text-decoration: none; }   /* small caps, underlined only on hover */
.site-footer a:hover { text-decoration: underline; text-decoration-thickness: 0.06em; text-underline-offset: 0.18em; }

/* ---------- aphorisms (::: aphorisms + an ordered list): each centred under its number; the number
   (Source Sans) centred between two short rules, as numbered aphorisms are printed ---------- */
.aphorisms { clear: left; margin: 2em 0; }
.aphorism + .aphorism { margin-top: 1.6em; }
.aph-num { display: flex; align-items: center; justify-content: center; gap: 0.8em; margin: 0 0 0.45em !important;
  font-family: var(--font-ui); font-weight: var(--w-ui); font-size: 0.82em; font-variant-numeric: lining-nums tabular-nums; }
.aph-num::before, .aph-num::after { content: ""; width: 3em; border-top: 1px solid var(--ink-2); }
.aph-num a { color: var(--ink-2); text-decoration: none; }
.aph-num a:hover, .aphorism:target .aph-num a { color: var(--ink); }
.aphorism p { margin: 0; text-align: center; text-wrap: balance; hyphens: manual; }
.aphorism p + p { margin-top: 0.6em; }

/* ---------- image viewer (js/images.js): click an image to see it full screen ---------- */
img.zoomable { cursor: zoom-in; }
.img-dialog { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 1rem 1.5rem; border: 0;
  background: var(--bg); color: var(--ink); font-size: var(--body-size); }
.img-dialog[open] { display: flex; flex-direction: column; }
.img-dialog::backdrop { background: var(--bg); }
.img-dialog-bar { display: flex; justify-content: flex-end; margin-bottom: 0.75rem; }
.img-dialog-bar .table-button { float: none; margin: 0; }
.img-dialog-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: auto; }
.img-dialog-stage img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; }
.img-dialog-stage.actual { display: block; }
.img-dialog-stage.actual img { max-width: none; max-height: none; cursor: zoom-out; }
.img-dialog-caption { font-family: var(--font-ui); font-size: 0.84em; text-align: center; margin: 0.75rem auto 0; max-width: 48rem; color: var(--ink-2); }
.img-dialog-caption:empty { display: none; }

/* ---------- publications (/publications, from content/publications.yaml) ---------- */
.pubs h2 { margin-top: 1.6em; }
.pub { display: grid; grid-template-columns: 3.2em minmax(0, 1fr); column-gap: 0.8em; margin: 0 0 1em; }
.pub p { margin: 0; text-align: left; hyphens: auto; }
.pub-year { color: var(--ink-2); font-variant-numeric: lining-nums tabular-nums; }
.pub .me { font-variant-caps: small-caps; letter-spacing: 0.03em; font-weight: var(--w-medium); }
.pub a { overflow-wrap: anywhere; }
@media (max-width: 649px) { .pub { grid-template-columns: 1fr; } .pub-year:empty { display: none; } }
