/* intex.academy: the paper and ink of intex.university, with the demonstrations set on a navy board.
 *
 * Text is ink on white or mist, or white on the navy board. Sky blue is an accent and a highlighter; pale yellow
 * marks the words that carry a formula's structure, always behind ink. Headlines are STIX Two Text, the serif of the
 * mathematics itself; the interface is Inter. The colour tokens are the main site's (site/style.css), copied, not linked.
 * The pairs tools/academy/check measures (WCAG 2.1 AA, 4.5:1 for text, 3:1 for large text and focus):
 * contrast: --ink on --white >= 4.5
 * contrast: --ink-2 on --white >= 4.5
 * contrast: --muted on --white >= 4.5
 * contrast: --link on --white >= 4.5
 * contrast: --ink on --mist >= 4.5
 * contrast: --ink-2 on --mist >= 4.5
 * contrast: --muted on --mist >= 4.5
 * contrast: --link on --mist >= 4.5
 * contrast: --ink on --sky-50 >= 4.5
 * contrast: --ink on --sky-100 >= 4.5
 * contrast: --ink on --sky-200 >= 4.5
 * contrast: --ink on --sun >= 4.5
 * contrast: --white on --ink >= 4.5
 * contrast: --sky-200 on --ink >= 4.5
 * contrast: --chalk on --ink >= 4.5
 * contrast: --ink on --chalk >= 4.5
 * contrast: --focus on --white >= 3
 * contrast: --sky-400 on --ink >= 3
 * contrast: --danger on --white >= 4.5
 * contrast: --danger on --mist >= 4.5
 * contrast: --pass on --white >= 4.5
 * contrast: --pass on --mist >= 4.5
 */

@font-face { font-family: "Inter"; src: url("/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "STIX Two Text"; src: url("/fonts/stix-text.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "STIX Two Text"; src: url("/fonts/stix-text-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "STIX Two Math"; src: url("/fonts/stix-math.woff2") format("woff2"); font-display: swap; }

:root {
	--ink: #0c2340;
	--ink-2: #2c4664;
	--muted: #4f6680;
	--link: #1d5f99;
	--focus: #2b78c2;
	--danger: #9b1c1c;
	--pass: #1f6b45;
	--white: #ffffff;
	--mist: #f5f8fb;
	--sky-50: #f3f8fd;
	--sky-100: #e7f1fb;
	--sky-200: #d3e7f8;
	--sky-400: #8cc1ec;
	--sun: #fff2ad;
	--chalk: #eef4fa;
	--line: #dde5ee;
	--line-strong: #c3cfdc;
	--hairline: #e6ecf2;
	--board-line: #23406a;
	--shadow: 0 1px 2px rgba(12, 35, 64, 0.04), 0 12px 32px -24px rgba(12, 35, 64, 0.22);
	--radius: 10px;
	--serif: "STIX Two Text", "STIX Two", Georgia, "Times New Roman", serif;
	--sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
	--measure: 66ch;
	--wide: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 6rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
	margin: 0;
	color: var(--ink);
	background: var(--white);
	font: 400 1.0625rem/1.65 var(--sans);
	font-feature-settings: "cv11", "ss01";
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
img, svg { display: block; max-width: 100%; }
figure { margin: 0; }
p { margin: 0 0 1em; }
strong { font-weight: 600; }
code { font: 0.92em/1.5 var(--mono); }
mark { color: inherit; background: linear-gradient(180deg, transparent 0 60%, var(--sun) 60% 94%, transparent 94%); padding: 0 0.06em; }
math { font-family: "STIX Two Math", math; }

.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--ink); color: var(--white); padding: 0.6rem 1rem; border-radius: 6px; text-decoration: none; }
.skip:focus { top: 1rem; }
.wrap { width: min(var(--wide), calc(100% - 2.5rem)); margin-inline: auto; }
.narrow { width: min(48rem, calc(100% - 2.5rem)); margin-inline: auto; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- header and footer: the main site's bar, with the academy's name ---- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--white); border-top: 3px solid var(--ink); border-bottom: 1px solid var(--line); }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 4.6rem; }
.brand { display: inline-flex; align-items: center; gap: 0.7rem; color: var(--ink); text-decoration: none; }
.brand img { width: 32px; height: 32px; }
.brand span { font: 400 1.6rem/1 var(--serif); letter-spacing: 0.01em; }
.brand em { font-style: italic; color: var(--ink-2); }
.nav { display: flex; align-items: center; gap: 0.15rem; flex-wrap: wrap; justify-content: flex-end; }
.nav a { color: var(--ink-2); text-decoration: none; font-size: 0.94rem; font-weight: 500; padding: 0.55rem 0.85rem; border-radius: 6px; }
.nav a:hover { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.35em; }
.nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.35em; }

.site-footer { margin-top: 3rem; background: var(--mist); border-top: 1px solid var(--line); padding: 2.6rem 0 2.8rem; }
.site-footer .bar { display: grid; grid-template-columns: 1.1fr 2fr; gap: 1.5rem 3rem; align-items: start; }
.site-footer p { color: var(--ink-2); font-size: 0.94rem; margin: 1rem 0 0; max-width: 26rem; }
.site-footer nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem 1.5rem; }
.site-footer nav h2 { font: 600 0.72rem/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.6rem; }
.site-footer nav ul { list-style: none; margin: 0; padding: 0; }
.site-footer nav li { margin: 0 0 0.35rem; }
.site-footer a { color: var(--ink-2); text-decoration: none; font-size: 0.94rem; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.site-footer small { display: block; color: var(--muted); font-size: 0.86rem; margin-top: 1.4rem; }

/* ---- type ---- */
.eyebrow { display: inline-flex; align-items: center; gap: 0.8rem; font: 600 0.76rem/1 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2); margin: 0; }
.eyebrow::before { content: ""; width: 2rem; height: 1px; background: var(--ink); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; color: var(--ink); margin: 0; }
h1 { font-size: clamp(2.5rem, 5.4vw, 4.2rem); line-height: 1.05; letter-spacing: -0.015em; }
h1 em, h2 em { font-style: italic; }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.5rem); line-height: 1.12; letter-spacing: -0.01em; }
h3 { font-size: 1.35rem; line-height: 1.25; }
.lede { font-size: clamp(1.1rem, 1.5vw, 1.24rem); line-height: 1.6; color: var(--ink-2); max-width: 42rem; }
.kicker { font: 600 0.74rem/1.2 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.8rem; }
section { padding: clamp(3rem, 6vw, 5rem) 0; }
.section-head { max-width: 46rem; margin: 0 0 2.4rem; }
.section-head p { color: var(--ink-2); font-size: 1.1rem; margin: 1rem 0 0; }
.band { background: var(--mist); border-block: 1px solid var(--hairline); }

/* ---- the home page's head: graph paper under the ink ---- */
.hero { padding: clamp(3rem, 6vw, 5rem) 0 clamp(3rem, 6vw, 4.5rem); border-bottom: 1px solid var(--hairline);
	background-image: linear-gradient(var(--hairline) 1px, transparent 1px), linear-gradient(90deg, var(--hairline) 1px, transparent 1px);
	background-size: 28px 28px; background-position: -1px -1px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { margin: 1.4rem 0 1.4rem; }
.hero .lede { background: var(--white); box-shadow: 0 0 0 0.6rem var(--white); }
.hero .try { margin: 1.6rem 0 0; max-width: 42rem; color: var(--ink); font-weight: 500; background: var(--white); box-shadow: 0 0 0 0.6rem var(--white); }

/* ---- the board: one formula, read three ways, on navy ---- */
.board { background: var(--ink); color: var(--chalk); border-radius: var(--radius); padding: clamp(1.3rem, 3vw, 2rem); box-shadow: 0 30px 60px -40px rgba(12, 35, 64, 0.55); position: relative; overflow: hidden; }
.board .row { display: grid; grid-template-columns: 5.6rem minmax(0, 1fr); gap: 1rem; align-items: baseline; padding: 0.95rem 0; border-top: 1px solid var(--board-line); }
.board .row:first-of-type { border-top: 0; padding-top: 0.2rem; }
.board .lab { font: 600 0.7rem/1.4 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--sky-200); }
.board code { font: 0.92rem/1.55 var(--mono); color: var(--white); overflow-wrap: anywhere; }
.board .seen { min-height: 4.2rem; display: flex; align-items: center; overflow-x: auto; overflow-y: hidden; padding: 0.35rem 0; }
.board .seen math { color: var(--white); font-size: 1.45rem; }
.board .heard { font: italic 400 1.1rem/1.55 var(--serif); color: var(--chalk); margin: 0; }
.board .copied { font: 1rem/1.5 var(--mono); color: var(--white); margin: 0; overflow-wrap: anywhere; }
.board .foot { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: center; justify-content: space-between; margin-top: 0.6rem; padding-top: 0.9rem; border-top: 1px solid var(--board-line); }
.board .foot p { margin: 0; font-size: 0.86rem; color: var(--sky-200); }
.board .sg { color: var(--ink); background: var(--sun); border-radius: 3px; padding: 0.05em 0.2em; font-style: normal; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* ---- buttons: quiet, and only where they do something on this page ---- */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; font: 600 0.9rem/1 var(--sans); padding: 0.7rem 1rem; border-radius: 7px; cursor: pointer; border: 1px solid var(--line-strong); background: var(--white); color: var(--ink); text-decoration: none; }
.btn:hover { border-color: var(--ink); }
.btn svg { width: 16px; height: 16px; }
.btn-ink { background: var(--ink); color: var(--white); border-color: var(--ink); }
.btn-ink:hover { background: #17365e; }
.board .btn { background: transparent; color: var(--white); border-color: var(--sky-400); }
.board .btn:hover { border-color: var(--white); }
[hidden] { display: none !important; }

/* ---- the demonstrations, listed ---- */
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.card { position: relative; display: flex; flex-direction: column; gap: 0.7rem; padding: 1.5rem 1.5rem 1.4rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card:hover { border-color: var(--line-strong); }
.card svg { width: 44px; height: 44px; color: var(--ink); }
.card h3 { font-size: 1.3rem; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card h3 a:hover { text-decoration: underline; }
.card p { margin: 0; color: var(--ink-2); font-size: 0.97rem; }
.card .sample { font: italic 400 1rem/1.45 var(--serif); color: var(--ink); margin-top: auto; padding-top: 0.6rem; border-top: 1px solid var(--hairline); }

/* ---- prose ---- */
.prose p, .prose li { max-width: var(--measure); color: var(--ink-2); }
.prose h2 { font-size: clamp(1.55rem, 2.6vw, 2rem); margin: 0 0 1rem; }
.prose h3 { font: 600 1.05rem/1.4 var(--sans); margin: 1.6rem 0 0.5rem; color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin: 0.4rem 0; }
.prose .callout { padding: 1rem 1.2rem; border-left: 3px solid var(--ink); background: var(--mist); margin: 1.4rem 0; max-width: var(--measure); }
.prose .callout p:last-child { margin: 0; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }

/* ---- a demonstration's page head ---- */
.page-head { padding: clamp(2.6rem, 5vw, 4rem) 0 clamp(1.6rem, 3vw, 2.2rem); border-bottom: 1px solid var(--line); }
.crumbs { font-size: 0.88rem; color: var(--muted); margin: 0 0 1.3rem; }
.crumbs a { color: var(--muted); }
.crumbs span { margin: 0 0.45rem; }
.page-head h1 { font-size: clamp(2.3rem, 4.6vw, 3.5rem); margin: 0 0 1rem; max-width: 22ch; }
.page-head .lede { margin: 0; }
.page-head .meta { margin: 1.2rem 0 0; font-size: 0.9rem; color: var(--muted); }

/* ---- side by side: two formulas, two documents, two pastes ---- */
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; margin: 0 0 1rem; }
.side { padding: 1.3rem 1.4rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.side h3, .side .kicker { margin: 0 0 0.8rem; }
.side .shown { display: flex; justify-content: center; align-items: center; min-height: 4.4rem; overflow-x: auto; overflow-y: hidden; padding: 0.4rem 0; }
.side .shown math { font-size: 1.45rem; }
.side .said { font: italic 400 1.08rem/1.5 var(--serif); color: var(--ink); margin: 0.8rem 0 0; }
.side .src { font: 0.86rem/1.5 var(--mono); color: var(--ink-2); margin: 0.7rem 0 0; overflow-wrap: anywhere; }
.sg { background: var(--sun); border-radius: 3px; padding: 0.05em 0.2em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.figure-note { font-size: 0.92rem; color: var(--muted); margin: 0.8rem 0 0; max-width: 60rem; }

/* ---- structure: the boxes the reading walks through ---- */
.struct { display: flex; justify-content: center; padding: 1.2rem 0 0.6rem; overflow-x: auto; overflow-y: hidden; }
.sx { display: inline-flex; align-items: center; gap: 0.35rem; font: 1.3rem/1.2 var(--serif); color: var(--ink); }
.sx.box { flex-direction: column; align-items: stretch; gap: 0.35rem; padding: 0.4rem 0.5rem 0.5rem; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--white); }
.sx.box > .tag { align-self: flex-start; font: 600 0.62rem/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); background: var(--sun); padding: 0.22rem 0.4rem; border-radius: 3px; }
.sx.box > .parts { display: flex; align-items: center; justify-content: center; gap: 0.35rem; }
.sx.box.frac > .parts, .sx.box.lim > .parts { flex-direction: column; }
.sx.box.frac > .parts > .sx + .sx { border-top: 2px solid var(--ink); }
.sx.slot { flex-direction: column; gap: 0.2rem; padding: 0.3rem 0.5rem 0.4rem; border: 1px dashed var(--line-strong); border-radius: 5px; background: var(--sky-50); }
.sx.slot > .stag { font: 600 0.56rem/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.sx.slot > .sv { display: inline-flex; align-items: center; gap: 0.35rem; }
.sx .tok { padding: 0 0.04em; }

/* ---- the clipboard: what a paste brings back ---- */
.clip { padding: 1.2rem 1.3rem; background: var(--mist); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.clip .kicker { margin-bottom: 0.7rem; }
.clip pre { margin: 0; font: 0.98rem/1.5 var(--mono); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.clip.good { background: var(--white); border-color: var(--ink); border-width: 1px 1px 1px 4px; }
.clip .verdict { margin: 0.9rem 0 0; font-size: 0.9rem; color: var(--ink-2); }
.clip .verdict.ok { color: var(--pass); font-weight: 600; }
.selecting { position: relative; display: inline-block; padding: 0.2rem 0.4rem; }
.selecting::after { content: ""; position: absolute; inset: 0; background: var(--sky-200); mix-blend-mode: multiply; border-radius: 3px; }
.copy-table { width: 100%; border-collapse: collapse; font-size: 0.96rem; }
.copy-table th, .copy-table td { text-align: left; vertical-align: top; padding: 0.95rem 1rem 0.95rem 0; border-bottom: 1px solid var(--line); }
.copy-table thead th { font: 600 0.72rem/1.3 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line-strong); }
.copy-table td.m { min-width: 12rem; }
.copy-table td.m math { font-size: 1.15rem; }
.copy-table pre { margin: 0; font: 0.9rem/1.45 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.copy-table td.bad pre { color: var(--ink-2); }
.table-wrap { overflow-x: auto; }

/* ---- a document as the engine made it: the page beside the PDF ---- */
.docs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.docs figure { margin: 0; min-width: 0; }
.docs figcaption { font: 600 0.72rem/1.3 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.7rem; }
.pdfview { background: var(--mist); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.pdfview img { width: 100%; height: auto; background: var(--white); box-shadow: var(--shadow); border-radius: 2px; }
.docview { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.2rem, 3vw, 2rem); font: 1.04rem/1.6 var(--serif); color: var(--ink); overflow-x: auto; }
/* set as the engine's own page sets it: a centred title block, bold headings, no section padding of ours */
.docview section { padding: 0; }
.docview .doc-header { text-align: center; margin-bottom: 1.4rem; }
.docview .doc-header h3 { font: 700 1.45rem/1.2 var(--serif); margin: 0 0 0.4rem; }
.docview .doc-header p { margin: 0.2rem 0; }
.docview h3, .docview h4, .docview h5 { font: 700 1.2rem/1.3 var(--serif); margin: 1.4rem 0 0.5rem; }
.docview h4 { font-size: 1.12rem; }
.docview h5 { font-size: 1.02rem; }
.docview .slide > h4 { margin-top: 0; }
.docview .slide .doc-header { margin-bottom: 0; }
.docview .num { margin-right: 0.6em; }
.docview p { margin: 0.5rem 0; }
.docview .display { margin: 0.9rem 0; overflow-x: auto; overflow-y: hidden; padding: 0.3rem 0; }
.docview .equation { display: flex; align-items: center; justify-content: center; gap: 1rem; position: relative; min-height: 2em; }
.docview .eqno { position: absolute; right: 0; }
.docview .theorem, .docview .proof { margin: 0.9rem 0; }
.docview .thead { font-weight: 700; }
.docview .theorem.plain p { font-style: italic; }
.docview .theorem.plain .thead { font-style: normal; }
.docview .qed { float: right; }
.docview .references ol, .docview ol[style] { list-style: none; padding: 0; }
.docview .references li { padding-left: 2.5rem; text-indent: -2.5rem; margin: 0.3rem 0; }
.docview .lbl { display: inline-block; min-width: 2.2rem; text-indent: 0; }
.docview .slide { margin: 1.4rem 0; padding-top: 0.8rem; border-top: 1px solid var(--line); }
.docview .slide:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.docview ul, .docview ol { padding-left: 1.4rem; }
.docview li { margin: 0.35rem 0; }
.docview math[display="block"] { font-size: 1.15rem; }
.hl { background: var(--sun); border-radius: 3px; box-shadow: 0 0 0 2px var(--sun); }

/* ---- numbers: what LaTeX printed, what the page says ---- */
.ledger { width: 100%; border-collapse: collapse; font-size: 0.97rem; font-variant-numeric: tabular-nums; }
.ledger th, .ledger td { text-align: left; padding: 0.8rem 1rem 0.8rem 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.ledger thead th { font: 600 0.72rem/1.3 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line-strong); }
.ledger td.n { font: 400 1.2rem/1 var(--serif); }
.ledger td.ok { color: var(--pass); font-weight: 600; }
.ledger code { color: var(--ink-2); }

/* ---- what the document carries: the checks, in plain words ---- */
.checks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.checks li { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto; gap: 0.8rem; align-items: baseline; padding: 0.85rem 0; border-bottom: 1px solid var(--line); }
.checks li::before { content: "\2713"; color: var(--pass); font-weight: 700; }
.checks li.open::before { content: "\2013"; color: var(--muted); }
.checks b { font-weight: 600; color: var(--ink); }
.checks span { color: var(--ink-2); }
.checks em { font-style: normal; font: 600 0.72rem/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--pass); white-space: nowrap; }
.checks li.open em { color: var(--muted); }
.hashes { display: grid; gap: 0.6rem; margin: 1.2rem 0 0; }
.hashes p { margin: 0; display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 1rem; align-items: baseline; }
.hashes b { font: 600 0.8rem/1.3 var(--sans); color: var(--ink-2); }
.hashes code { font: 0.86rem/1.4 var(--mono); color: var(--ink); overflow-wrap: anywhere; background: var(--mist); border: 1px solid var(--line); border-radius: 4px; padding: 0.35rem 0.5rem; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.facts li { padding: 1.2rem 1.3rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.facts b { display: block; font: 400 2rem/1.1 var(--serif); color: var(--ink); margin-bottom: 0.4rem; }
.facts span { color: var(--ink-2); font-size: 0.95rem; }

/* ---- notes ---- */
.notes-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.notes-list li { padding: 1.3rem 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: 0.3rem 1.5rem; }
.notes-list time { font-size: 0.88rem; color: var(--muted); padding-top: 0.35rem; }
.notes-list h3 { font-size: 1.35rem; }
.notes-list h3 a { color: var(--ink); text-decoration: none; }
.notes-list h3 a:hover { text-decoration: underline; }
.notes-list p { grid-column: 2; margin: 0.35rem 0 0; color: var(--ink-2); max-width: var(--measure); }
.note { padding: clamp(2rem, 4vw, 3rem) 0 1rem; }
.note p, .note li { font-size: 1.08rem; line-height: 1.7; color: var(--ink-2); max-width: var(--measure); }
.note h2 { font-size: 1.5rem; margin: 2rem 0 0.8rem; }
.note .example { margin: 1.4rem 0; padding: 1.1rem 1.3rem; background: var(--mist); border: 1px solid var(--line); border-radius: var(--radius); max-width: var(--measure); }
.note .example .shown { display: flex; justify-content: center; padding: 0.3rem 0 0.6rem; overflow-x: auto; overflow-y: hidden; }
.note .example .shown math { font-size: 1.35rem; }
.note .example p { margin: 0.35rem 0 0; font-size: 1rem; }
.note .example b { font: 600 0.72rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-right: 0.6rem; }
.note .example .said { font: italic 400 1.06rem/1.5 var(--serif); color: var(--ink); }
.note .example code { color: var(--ink); overflow-wrap: anywhere; }
.note .example pre { margin: 0.5rem 0 0; font: 0.95rem/1.45 var(--mono); white-space: pre-wrap; color: var(--ink); }
.note-foot { margin: 2.4rem 0 0; padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: 0.95rem; color: var(--muted); }

/* ---- the formula tool ---- */
.tool { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.tool form { padding: clamp(1.4rem, 3vw, 2rem); background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.tool label { display: block; font-weight: 600; margin: 0 0 0.5rem; }
.tool textarea { width: 100%; min-height: 6.5rem; resize: vertical; font: 1rem/1.5 var(--mono); color: var(--ink); padding: 0.8rem 0.9rem; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--white); }
.tool textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(43, 120, 194, 0.2); }
.tool .hint { font-size: 0.9rem; color: var(--muted); margin: 0.6rem 0 1rem; }
.tool .examples { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.tool .examples button { font: 0.84rem/1.3 var(--mono); color: var(--ink); background: var(--mist); border: 1px solid var(--line); border-radius: 5px; padding: 0.4rem 0.55rem; cursor: pointer; }
.tool .examples button:hover { border-color: var(--ink); }
.tool .status { margin: 1rem 0 0; font-size: 0.95rem; color: var(--ink-2); }
.tool .status.err { color: var(--danger); font-weight: 600; }
.answer { display: grid; gap: 0.8rem; }
.answer .part { padding: 1.1rem 1.2rem; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.answer .part h2 { font: 600 0.72rem/1.2 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.7rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.answer .part h2 .btn { font-size: 0.78rem; padding: 0.4rem 0.6rem; letter-spacing: 0; text-transform: none; }
.answer .shown { display: flex; justify-content: center; align-items: center; min-height: 4rem; overflow-x: auto; overflow-y: hidden; padding: 0.4rem 0; }
.answer .shown math { font-size: 1.5rem; }
.answer .said { font: italic 400 1.1rem/1.5 var(--serif); margin: 0; }
.answer pre { margin: 0; font: 0.9rem/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.answer pre.mml { max-height: 9rem; overflow: auto; font-size: 0.78rem; color: var(--ink-2); }
.answer .from { font-size: 0.88rem; color: var(--muted); margin: 0; }

/* ---- closing: where to go next, in words ---- */
.onward { padding: clamp(2rem, 4vw, 2.8rem); background: var(--mist); border: 1px solid var(--line); border-radius: var(--radius); }
.onward h2 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); margin: 0 0 0.9rem; }
.onward p { color: var(--ink-2); max-width: var(--measure); margin: 0 0 0.8rem; }
.onward p:last-child { margin: 0; }

/* ---- motion: the finished picture is the default. With script, and only when the reader has not asked for reduced
 * motion, the page arms each figure (html.motion-on) and plays it once when it is seen: under five seconds, never in
 * a loop, so nothing keeps moving beside the text. Replay buttons appear only with script. ---- */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lit { 0% { opacity: 0.28; } 40% { opacity: 1; box-shadow: 0 0 0 2px var(--sky-400); } 100% { opacity: 1; } }
@keyframes sweep { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes draw { from { stroke-dashoffset: var(--len, 300); } to { stroke-dashoffset: 0; } }
@keyframes pop { 0% { opacity: 0; transform: scale(0.6); } 70% { opacity: 1; transform: scale(1.12); } 100% { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
.motion-on .motion:not(.play) .m, .motion-on .motion:not(.play) .w, .motion-on .motion:not(.play) .sx { opacity: 0; }
.motion-on .motion:not(.play) .w { opacity: 0.28; }
.motion-on .motion.play .m { animation: rise 0.55s ease both; animation-delay: calc(var(--d, 0) * 1ms); }
.motion-on .motion.play .m.f { animation-name: fade; }
.motion-on .motion.play .m.r { animation: reveal 0.9s steps(28, end) both; animation-delay: calc(var(--d, 0) * 1ms); }
.motion-on .motion.play .m.p { animation: pop 0.45s ease both; animation-delay: calc(var(--d, 0) * 1ms); }
.motion-on .motion.play .w { animation: lit 0.5s ease both; animation-delay: calc(var(--o, 0) * 1ms + var(--i, 0) * 110ms); }
@keyframes hl { from { background-color: transparent; } to { background-color: var(--sun); } }
.motion-on .motion:not(.play) .sg { background-color: transparent; }
.motion-on .motion.play .sg { animation: hl 0.35s ease both; animation-delay: calc(var(--o, 0) * 1ms + var(--i, 0) * 110ms); }
.motion-on .motion.play .sx { animation: rise 0.45s ease both; animation-delay: calc(var(--o, 0) * 1ms + var(--k, 0) * 90ms); }
.motion-on .motion:not(.play) .selecting::after { transform: scaleX(0); }
.motion-on .motion.play .selecting::after { transform-origin: left; animation: sweep 0.8s ease both; animation-delay: calc(var(--d, 0) * 1ms); }
.motion-on .motion:not(.play) svg .ln { stroke-dashoffset: var(--len, 300); }
.motion-on .motion.play svg .ln { stroke-dasharray: var(--len, 300); animation: draw 0.9s ease both; animation-delay: calc(var(--d, 0) * 1ms); }
.motion-on .motion.play svg .beat { animation: pulse 1.2s ease 3 both; animation-delay: calc(var(--d, 0) * 1ms); }
.replay { margin-left: auto; }
svg .ln { stroke-dasharray: var(--len, 300); }

/* ---- the 404 ---- */
.lost { padding: clamp(4rem, 8vw, 6rem) 0; }

/* ---- narrow screens ---- */
@media (max-width: 960px) {
	.hero-grid, .two, .docs, .tool, .site-footer .bar { grid-template-columns: minmax(0, 1fr); }
	.cards, .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
	.cards, .facts, .pair { grid-template-columns: minmax(0, 1fr); }
	.site-footer nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.notes-list li { grid-template-columns: minmax(0, 1fr); }
	.notes-list p { grid-column: 1; }
	.board .row { grid-template-columns: minmax(0, 1fr); gap: 0.35rem; }
	/* on a phone the bar is two lines, the name above the links, and scrolls away with the page */
	.site-header { position: static; }
	.site-header .bar { flex-wrap: wrap; gap: 0.1rem 1rem; min-height: 0; padding: 0.8rem 0 0.4rem; }
	.nav { justify-content: flex-start; margin-left: -0.55rem; }
	.nav a { padding: 0.5rem 0.55rem; font-size: 0.92rem; }
	.brand span { font-size: 1.4rem; white-space: nowrap; }
	.hashes p { grid-template-columns: minmax(0, 1fr); gap: 0.3rem; }
	.board { padding: 1.1rem 1rem; }
	.board .seen math { font-size: 1.2rem; }
	.page-head h1 { font-size: 2.2rem; }
	html { scroll-padding-top: 1rem; }
}
