/* The forge guide: one stylesheet, light and dark, phone first. The page
   reads like a git log, with each section a commit on one line.

   The palette, the fonts and the rules are the forge's own
   (site/assets/style.css, DESIGN.md), and lib/check-css.ts holds this file
   to them: a plain page, square corners, content between 1px rules rather
   than in boxes; Open Sans for the interface, Noto Sans Mono for what is
   copied or compared, Noto Serif for the prose; hierarchy from weight, size
   and colour, never capitals or tracking; one accent (#3148F6) for links,
   the rail, the current entry and the primary button. */

/* == tokens == Every colour, size, weight and family is here; nothing
   below this block names one. */
/* The forge's fonts, copied into fonts/ when the guide is deployed
   (.forge/sites). The sans is preloaded. */
@font-face { font-family: "Open Sans"; src: url(fonts/open-sans.woff2) format("woff2"); font-weight: 300 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Noto Sans Mono"; src: url(fonts/noto-sans-mono.woff2) format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Noto Serif"; src: url(fonts/noto-serif.woff2) format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Noto Serif"; src: url(fonts/noto-serif-italic.woff2) format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }
:root {
	/* colour: the page, panels raised over it with their tinted head strip,
	   ink in three strengths, rules, and the accent; the forge's own values */
	--bg: #e9e9e9;
	--raised: #ffffff;
	--tint: #f6f6f6;
	--hover: #f2f3f5;
	--fg: #1c2127;
	--muted: #5b6169;
	--faint: #6f757d;
	--border: #d2d4d7;
	--border-strong: #a9aeb4;
	--link: #3148f6;
	--accent: #3148f6;
	--deep: #1c4b8f;
	--accent-hover: #1c4b8f;
	--on-accent: #ffffff;
	/* meaning: CI results, diffs, a changed line */
	--pass: #0b7a1d;
	--fail: #c7162b;
	--warn: #965800;
	--add: #0b7a1d;
	--del: #c7162b;
	/* the terminal in the hero is dark in both modes */
	--term-bg: #08090b;
	--term-fg: #e2e4e7;
	--term-dim: #8f959d;
	--term-ok: #4fbf5f;
	--term-u: #8e9bff;
	--term-rule: #1f2329;

	/* type: the interface, what is copied or compared, and prose */
	--sans: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--mono: "Noto Sans Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	--serif: "Noto Serif", Georgia, Cambria, "Times New Roman", serif;
	--text-xs: 12px;
	--text-code: 12.5px;
	--text-sm: 13.5px;
	--text-md: 15px;
	--text-prose: 16px;
	--text-lg: 18px;
	--text-xl: 22px;
	--text-2xl: 28px;
	--text-3xl: clamp(2.4rem, 9vw, 4rem);
	/* mono inline in serif text runs large; this brings it level */
	--text-inline-mono: 0.88em;
	--fw-regular: 400;
	--fw-medium: 500;
	--fw-strong: 650;

	/* space: a 4px scale */
	--space-half: 2px;
	--space-1: 4px;
	--space-2: 8px;
	--space-3: 12px;
	--space-4: 16px;
	--space-5: 20px;
	--space-6: 24px;
	--space-8: 32px;
	--space-10: 40px;
	--hairline: 1px;
	--bar: 3px;
	--radius: 0;
	/* the log's rail: where it runs, and how far the sections sit from it */
	--rail-x: 7px;
	--gutter: 30px;
	color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #08090b;
		--raised: #111418;
		--tint: #15191e;
		--hover: #191d23;
		--fg: #e2e4e7;
		--muted: #8f959d;
		--faint: #7d838b;
		--border: #252a31;
		--border-strong: #3a4048;
		--link: #8e9bff;
		--deep: #b4bcff;
		--accent-hover: #2a3ee0;
		--pass: #4fbf5f;
		--fail: #f0606e;
		--warn: #e3a33b;
		--add: #4fbf5f;
		--del: #f0606e;
	}
}
/* == end tokens == */

*, ::before, ::after { box-sizing: border-box; border-radius: var(--radius); }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--space-4); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--bg); color: var(--fg); font: var(--fw-regular) var(--text-prose)/1.65 var(--serif); font-kerning: normal; text-rendering: optimizeLegibility; }
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--deep); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code, kbd, pre { font-family: var(--mono); }
code { font-size: var(--text-inline-mono); white-space: nowrap; }
pre code, .plain code { font-size: inherit; white-space: inherit; }
kbd { font-size: var(--text-inline-mono); color: var(--muted); background: var(--raised); border: var(--hairline) solid var(--border-strong); padding: 0 var(--space-1); }
h1, h2, h3 { font-family: var(--sans); font-weight: var(--fw-strong); line-height: 1.2; }
h3 { font-size: var(--text-lg); margin: var(--space-8) 0 var(--space-2); }
p, ul, ol, dl { margin: 0 0 var(--space-4); }
b, strong { font-weight: var(--fw-strong); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 var(--space-4); }
.skip { position: absolute; left: -999px; top: var(--space-2); z-index: 5; background: var(--raised); padding: var(--space-1) var(--space-3); border: var(--hairline) solid var(--border-strong); font-family: var(--sans); font-size: var(--text-sm); }
.skip:focus { left: var(--space-2); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
/* the logo: the ring in ink, the A in the accent */
.mark { display: block; width: 26px; height: 26px; flex: none; }
.mark circle { stroke: currentColor; }
.mark path { stroke: var(--accent); }

/* top bar: the name, and the two pages as tabs on the rule */
.bar { border-bottom: var(--hairline) solid var(--border); font-family: var(--sans); }
.bar .wrap { display: flex; align-items: center; gap: var(--space-3); height: 52px; }
.brand { display: flex; align-items: center; gap: var(--space-2); color: var(--fg); text-decoration: none; font-size: var(--text-lg); font-weight: var(--fw-strong); }
.brand:hover { color: var(--fg); text-decoration: none; }
.brand span { color: var(--muted); font-weight: var(--fw-regular); }
.bar nav { margin-left: auto; display: flex; gap: var(--space-6); align-self: stretch; }
.bar nav a { display: flex; align-items: center; color: var(--muted); text-decoration: none; font-size: var(--text-md); font-weight: var(--fw-medium); }
.bar nav a:hover { color: var(--fg); }
.bar nav a[aria-current="page"] { color: var(--fg); box-shadow: inset 0 calc(-1 * var(--bar)) 0 var(--accent); }

/* hero */
.hero { padding: var(--space-10) 0 var(--space-8); border-bottom: var(--hairline) solid var(--border); }
.hero .wrap { display: grid; gap: var(--space-8); }
.eyebrow { font-family: var(--sans); font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--muted); margin: 0 0 var(--space-2); }
.hero h1 { display: flex; align-items: center; gap: 0.2em; margin: 0 0 var(--space-4); font-size: var(--text-3xl); line-height: 1; }
.hero h1 .mark { width: 0.9em; height: 0.9em; }
.lede { font-size: var(--text-lg); line-height: 1.5; max-width: 34rem; margin: 0 0 var(--space-6); }
@media (min-width: 720px) { .lede { font-size: var(--text-xl); } }
.lede em { font-style: italic; }
.cta { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; }
/* buttons, as the forge's: secondary is a raised surface, primary is
   filled with the accent */
.btn { display: inline-flex; align-items: center; min-height: 36px; padding: var(--space-1) var(--space-4); font: var(--fw-medium) var(--text-sm)/1.2 var(--sans); color: var(--fg); background: var(--raised); border: var(--hairline) solid var(--border-strong); text-decoration: none; }
.btn:hover { color: var(--fg); border-color: var(--muted); text-decoration: none; }
.btn.go { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.btn.go:hover { color: var(--on-accent); background: var(--accent-hover); border-color: var(--accent-hover); }
@media (min-width: 900px) {
	.hero { padding: 72px 0 64px; }
	.hero .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; gap: 48px; }
}

/* terminal */
.term { margin: 0; background: var(--term-bg); color: var(--term-fg); border: var(--hairline) solid var(--term-rule); overflow: hidden; min-width: 0; }
.term .chrome { padding: var(--space-2) var(--space-4); border-bottom: var(--hairline) solid var(--term-rule); font: var(--fw-regular) var(--text-xs) var(--mono); color: var(--term-dim); }
.term pre { margin: 0; padding: var(--space-3) var(--space-4) var(--space-4); font-size: var(--text-code); line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.term .line { display: block; }
.term .p { color: var(--term-u); user-select: none; -webkit-user-select: none; }
.term .o, .term .r { color: var(--term-dim); }
.term .ok { color: var(--term-ok); }
.term .u { color: var(--term-u); }
@media (prefers-reduced-motion: no-preference) {
	.hero-text > *, .term { animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
	.hero-text > :nth-child(2) { animation-delay: 0.06s; }
	.hero-text > :nth-child(3) { animation-delay: 0.12s; }
	.hero-text > :nth-child(4) { animation-delay: 0.18s; }
	.term { animation-delay: 0.22s; }
	.term .line { animation: rise 0.35s ease-out both; animation-delay: calc(0.35s + var(--i) * 0.07s); }
	@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
}

/* page: contents, then the log of sections */
.page { display: grid; gap: var(--space-2); padding-top: var(--space-6); padding-bottom: var(--space-10); }
.toc { font-family: var(--sans); font-size: var(--text-sm); line-height: 1.4; }
.toc h2 { font-size: var(--text-xs); font-weight: var(--fw-strong); color: var(--muted); margin: 0 0 var(--space-2); }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-half) var(--space-3); }
.toc a { display: flex; gap: var(--space-2); padding: var(--space-1) 0; color: var(--muted); text-decoration: none; }
.toc a span { color: var(--faint); font-variant-numeric: tabular-nums; }
.toc a:hover { color: var(--fg); }
.toc a[aria-current="true"] { color: var(--fg); font-weight: var(--fw-medium); }
.toc a[aria-current="true"] span { color: var(--link); }
@media (min-width: 1000px) {
	.page { grid-template-columns: 200px minmax(0, 1fr); gap: 48px; padding-top: 44px; }
	.toc > div { position: sticky; top: var(--space-6); }
	.toc ol { grid-template-columns: 1fr; gap: 0; }
	.toc a { padding: var(--space-1) 0 var(--space-1) var(--space-3); border-left: 2px solid var(--border); }
	.toc a[aria-current="true"] { border-left-color: var(--accent); }
}

.log { position: relative; padding-left: var(--gutter); min-width: 0; }
.log::before { content: ""; position: absolute; left: var(--rail-x); top: 10px; bottom: 0; width: 2px; background: linear-gradient(var(--accent), var(--accent) calc(100% - 120px), transparent); }
.commit { position: relative; padding: var(--space-4) 0 var(--space-8); }
.commit > header { position: relative; margin-bottom: var(--space-4); }
/* each section's commit: a small square on the rail, filled when it is
   the one linked to */
.commit > header::before { content: ""; position: absolute; left: calc(var(--rail-x) - var(--gutter) - 6px); top: 3px; width: 10px; height: 10px; background: var(--bg); border: 2px solid var(--accent); }
.commit:target > header::before, .commit > header:hover::before { background: var(--accent); }
.ref { margin: 0 0 var(--space-1); display: flex; gap: var(--space-2); align-items: baseline; font-family: var(--mono); font-size: var(--text-xs); color: var(--muted); }
.ref b { font-weight: var(--fw-medium); color: var(--faint); }
.commit h2 { font-size: var(--text-xl); margin: 0; max-width: 34ch; }
.commit h2 a { color: inherit; text-decoration: none; }
.commit h2 a:hover { color: var(--deep); }
.prose { max-width: 41rem; }
.prose li { margin: var(--space-1) 0; }
.prose ul { padding-left: 1.2rem; }
.aside { margin-top: var(--space-4); font-family: var(--sans); font-size: var(--text-sm); color: var(--muted); border-left: var(--bar) solid var(--border); padding: var(--space-half) 0 var(--space-half) var(--space-3); max-width: 41rem; }
@media (min-width: 720px) {
	:root { --gutter: 44px; --rail-x: 9px; }
	.commit { padding: var(--space-6) 0 44px; }
	.commit h2 { font-size: var(--text-2xl); }
}

/* panels, as the forge's (DESIGN.md): a raised surface on a hairline, an
   optional head strip on the tint naming what it holds, rows between
   hairlines with none under the last */
.panel { margin: var(--space-5) 0 var(--space-6); min-width: 0; background: var(--raised); border: var(--hairline) solid var(--border); }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); margin: 0; padding: var(--space-2) var(--space-3); background: var(--tint); border-bottom: var(--hairline) solid var(--border); font: var(--fw-regular) var(--text-sm)/1.5 var(--sans); color: var(--muted); }
.panel-head b { font-weight: var(--fw-medium); color: var(--fg); }
.panel-head .end { margin-left: auto; }
.panel-head .n { font: var(--fw-regular) var(--text-xs) var(--mono); color: var(--faint); }
.panel > .table { margin: 0; border: 0; }
.panel th:first-child, .panel td:first-child { padding-left: var(--space-3); }
.panel th:last-child, .panel td:last-child { padding-right: var(--space-3); }
/* a command or two between paragraphs */
.commit > .code { margin: var(--space-4) 0 var(--space-5); }

/* figures: a raised plate on a hairline, a caption under it */
figure { margin: var(--space-5) 0 var(--space-6); }
/* what is in a figure is labels and notes, in the sans; shas, paths and
   commands in the mono */
.plate { font-family: var(--sans); line-height: 1.5; }
.plate { border: var(--hairline) solid var(--border); background: var(--raised); padding: var(--space-4); overflow: hidden; }
figcaption { font-family: var(--sans); font-size: var(--text-sm); color: var(--muted); margin-top: var(--space-2); }
figcaption b { color: var(--fg); font-weight: var(--fw-strong); margin-right: var(--space-2); }
@media (min-width: 720px) { .plate { padding: 22px var(--space-6); } }

/* fig: the push, as a trace down one line */
.flow { list-style: none; margin: 0; padding: 0; position: relative; --x: 6px; }
.flow::before { content: ""; position: absolute; left: var(--x); top: 8px; bottom: 14px; width: 2px; background: var(--border); }
.flow > li { position: relative; padding: 0 0 var(--space-4) 26px; }
/* the marker: centred on the rail and on the first 24px line */
.flow > li::before { content: ""; position: absolute; left: calc(var(--x) - 4px); top: 7px; width: 10px; height: 10px; background: var(--raised); border: 2px solid var(--accent); }
.flow .where { display: block; font-family: var(--mono); font-size: var(--text-code); line-height: 24px; font-weight: var(--fw-strong); color: var(--fg); }
.flow p { margin: 0; font-size: var(--text-md); line-height: 24px; }
.flow p + p { margin-top: var(--space-1); }
.flow .src { font-family: var(--mono); font-size: var(--text-xs); color: var(--muted); margin-top: var(--space-1); }
.flow ul { margin: 6px 0 0; padding: 0; list-style: none; font-size: var(--text-md); }
.flow ul li { position: relative; padding-left: var(--space-4); margin: 3px 0; }
.flow ul li::before { content: ""; position: absolute; left: 0; top: 0.75em; width: 10px; border-top: 2px solid var(--accent); }
.flow .returns { padding-bottom: 18px; }
.flow .returns::before { display: none; }
.flow .returns span { display: block; border-top: var(--hairline) dashed var(--border-strong); padding-top: 6px; font-family: var(--sans); font-size: var(--text-sm); color: var(--muted); }
@media (min-width: 720px) {
	.flow { --x: 148px; }
	.flow > li { display: grid; grid-template-columns: 128px 1fr; gap: 0 40px; padding-left: 0; }
	.flow .where { text-align: right; }
	.flow .returns { grid-template-columns: 1fr; padding-left: 168px; }
}

/* fig: a stack of reviews, as a graph. Every commit is one row of the
   same height, its marker centred on the row, so the rail's segments
   between markers are equal; a layer's review is a bracket beside its
   rows, which on phones shows only its number. */
.graph { list-style: none; margin: 0; padding: 0; --row: 32px; }
.graph ol { list-style: none; margin: 0; padding: 0; min-width: 0; }
.graph .layer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--space-3); }
/* sha, subject and branch share one baseline, centred in the row */
.graph .c { position: relative; display: flex; align-items: baseline; gap: var(--space-2); height: var(--row); padding-left: 28px; font-size: var(--text-md); line-height: var(--row); white-space: nowrap; }
/* the rail through the row, and the marker on it */
.graph .c::before { content: ""; position: absolute; left: 6px; top: 0; bottom: 0; width: 2px; background: var(--accent); }
.graph > .layer:first-child > ol > .c:first-child::before { top: 50%; }
.graph .base .c::before { bottom: 50%; background: var(--faint); }
.graph .c::after { content: ""; position: absolute; left: 2px; top: 50%; width: 10px; height: 10px; margin-top: -5px; background: var(--raised); border: 2px solid var(--accent); }
.graph .base .c::after { border-color: var(--faint); }
.graph code { flex: none; font-size: var(--text-xs); color: var(--muted); }
.graph .s { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.graph .pill { flex: none; line-height: 1.5; }
/* a branch name on a commit: a square label on a hairline */
.pill { font-family: var(--mono); font-size: var(--text-xs); padding: 0 6px; border: var(--hairline) solid var(--accent); color: var(--link); white-space: nowrap; }
.pill.main { border-color: var(--border-strong); color: var(--muted); }
.graph .tag { display: flex; flex-direction: column; justify-content: center; margin: var(--space-1) 0; padding: 0 0 0 10px; border-left: 2px solid var(--accent); font-size: var(--text-sm); line-height: 1.4; color: var(--muted); }
.graph .tag b { color: var(--fg); }
.graph .tag .t, .graph .tag small { display: none; }
.graph .tag small { font-size: var(--text-sm); }
@media (min-width: 720px) {
	.graph .layer { grid-template-columns: minmax(0, 1fr) 210px; }
	.graph .tag .t { display: inline; }
	.graph .tag small { display: block; }
}

/* code-ish figures: range-diff, statements */
.code { margin: 0; font-size: var(--text-code); line-height: 1.55; white-space: pre; overflow-x: auto; background: var(--raised); border: var(--hairline) solid var(--border); padding: var(--space-3) 14px; tab-size: 4; }
.code .same, .code .dim { color: var(--muted); }
.code .chg { color: var(--warn); font-weight: var(--fw-strong); }
.code .add { color: var(--add); }
.code .del { color: var(--del); }
.code .key { color: var(--link); }
/* numbered markers, square, white on the accent in both modes */
.code .n { display: inline-block; min-width: 1.6em; margin-left: var(--space-2); padding: 0 var(--space-1); background: var(--accent); color: var(--on-accent); font-size: var(--text-xs); font-weight: var(--fw-strong); text-align: center; line-height: 1.5; }

.annotated { display: grid; gap: var(--space-4); }
.annotated ol { margin: 0; padding: 0; list-style: none; counter-reset: n; font-size: var(--text-md); }
.annotated ol li { counter-increment: n; position: relative; padding-left: 30px; margin: 0 0 var(--space-2); line-height: 24px; }
.annotated ol li::before { content: counter(n); position: absolute; left: 0; top: 3px; min-width: 1.6em; padding: 0 var(--space-1); background: var(--accent); color: var(--on-accent); font: var(--fw-strong) var(--text-xs)/1.5 var(--mono); text-align: center; }
.annotated figcaption { grid-column: 1 / -1; margin: 0; }
@media (min-width: 900px) { .annotated { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; } }

/* proves / doesn't: two columns under a bar in pass and fail */
.verdict { display: grid; gap: var(--space-4) var(--space-8); margin: 18px 0 var(--space-6); }
.verdict > div { padding: var(--space-3) 0 0; border-top: var(--bar) solid var(--pass); }
.verdict > div.no { border-top-color: var(--fail); }
.verdict h3 { margin: 0 0 var(--space-2); font-size: var(--text-md); }
.verdict ul { list-style: none; padding: 0; font-size: var(--text-md); }
.verdict li { position: relative; padding-left: var(--space-6); margin: 0 0 var(--space-2); }
.verdict li::before { position: absolute; left: 0; font: var(--fw-strong) var(--text-md) var(--sans); }
.verdict .yes li::before { content: "✓"; color: var(--pass); }
.verdict .no li::before { content: "✗"; color: var(--fail); }
@media (min-width: 720px) { .verdict { grid-template-columns: 1fr 1fr; } }

/* fig: from ref to hostname */
.chain { list-style: none; margin: 0; padding: 0; }
.chain li { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-half) var(--space-3); align-items: baseline; }
.chain .k { font-family: var(--sans); font-size: var(--text-xs); font-weight: var(--fw-medium); color: var(--muted); }
/* values break only where they have <wbr>, never at a hyphen */
.chain .v { font-family: var(--mono); font-size: var(--text-code); background: var(--raised); border: var(--hairline) solid var(--border-strong); padding: 6px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chain .v small { display: block; white-space: normal; font-family: var(--sans); font-size: var(--text-sm); color: var(--muted); margin-top: var(--space-half); }
.chain .hop { min-height: 34px; }
.chain .hop span { grid-column: -2; position: relative; padding: 6px 0 6px 26px; font-family: var(--sans); font-size: var(--text-xs); color: var(--muted); }
.chain .hop span::before { content: ""; position: absolute; left: 11px; top: 0; bottom: 0; border-left: 2px solid var(--accent); }
.chain .hop span::after { content: ""; position: absolute; left: 7px; bottom: 0; border: 5px solid transparent; border-top: 6px solid var(--accent); border-bottom: 0; }
.chain .hop.up span::after { bottom: auto; top: 0; border-top: 0; border-bottom: 6px solid var(--accent); }
@media (min-width: 480px) {
	.chain li { grid-template-columns: 76px minmax(0, 1fr); }
	.chain .k { text-align: right; }
}
.split { display: grid; gap: 18px; }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 28px; } }
.split > .prose { font-size: var(--text-md); }

/* tables: no outer box, rows between hairlines, headers small and muted */
.table { overflow-x: auto; margin: 18px 0 var(--space-6); border-top: var(--hairline) solid var(--border); border-bottom: var(--hairline) solid var(--border); }
table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: var(--text-sm); line-height: 1.5; }
th, td { text-align: left; vertical-align: top; padding: var(--space-2) var(--space-3); border-bottom: var(--hairline) solid var(--border); }
th:first-child, td:first-child { padding-left: 0; }
tr:last-child > * { border-bottom: 0; }
thead th { font-size: var(--text-xs); font-weight: var(--fw-medium); color: var(--muted); padding-top: var(--space-3); padding-bottom: var(--space-1); }
tbody th { font-weight: var(--fw-medium); }
td.y::before { content: "✓ "; font-weight: var(--fw-strong); color: var(--pass); }
td.n::before { content: "✗ "; font-weight: var(--fw-strong); color: var(--fail); }
td.n { color: var(--muted); }
td code, th code { font-size: var(--text-code); white-space: normal; }
/* code that never breaks at its hyphens, only where it has <wbr> */
table.whole code { white-space: nowrap; }
@media (max-width: 719px) { th, td { padding: var(--space-2) var(--space-2); } }
/* tables marked .rows restack on phones: the first cell on its own line,
   then the rest, labelled from data-l when there is more than one */
@media (max-width: 719px) {
	table.rows thead { display: none; }
	table.rows tr { display: grid; grid-template-columns: 1fr 1fr; border-bottom: var(--hairline) solid var(--border); }
	table.rows tr:last-child { border-bottom: 0; }
	table.rows th, table.rows td { border: 0; padding-left: 0; }
	table.rows tr > :first-child { grid-column: 1 / -1; padding-bottom: 0; }
	table.rows td:not([data-l]):not(:first-child) { grid-column: 1 / -1; padding-top: 3px; }
	table.rows td[data-l] { position: relative; padding-top: var(--space-6); }
	table.rows td[data-l]::after { content: attr(data-l); position: absolute; left: 0; top: 6px; font-size: var(--text-xs); font-weight: var(--fw-medium); color: var(--muted); }
	.panel table.rows tr { padding: 0 var(--space-3); }
	table.rows.three tr { grid-template-columns: 1fr 1fr 1fr; }
	.panel table.rows :is(th, td) { padding-left: 0; padding-right: 0; }
}

/* fig: one key, two generated files */
.fan { display: grid; gap: var(--space-3); }
.fan .file { display: block; font-family: var(--mono); font-size: var(--text-xs); font-weight: var(--fw-strong); color: var(--fg); margin-bottom: var(--space-1); }
.fan .box { background: var(--raised); border: var(--hairline) solid var(--border-strong); padding: 10px var(--space-3); }
.fan .box > code { display: block; font-size: var(--text-code); line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.fan .box p { margin: 6px 0 0; font-size: var(--text-sm); color: var(--muted); }
.fan .by { font-family: var(--mono); font-size: var(--text-xs); color: var(--muted); display: flex; align-items: center; gap: 10px; }
.fan .by::before, .fan .by::after { content: ""; flex: 1; border-top: 2px solid var(--accent); }
.fan .outs { display: grid; gap: var(--space-3); }
@media (min-width: 900px) { .fan .outs { grid-template-columns: 1fr 1fr; } }

/* fig: hosting */
.hosts { display: grid; gap: 18px; margin: var(--space-5) 0 var(--space-6); }
@media (min-width: 900px) { .hosts { grid-template-columns: 1.25fr 1fr; } }
.hosts figure { margin: 0; }
.hops { list-style: none; margin: 0; padding: 0; }
.hops .node { background: var(--raised); border: var(--hairline) solid var(--border-strong); padding: 10px var(--space-3); }
.hops .node b { display: block; font-family: var(--sans); font-size: var(--text-md); font-weight: var(--fw-strong); }
.hops .node span { display: block; font-size: var(--text-md); color: var(--muted); line-height: 1.5; margin-top: var(--space-half); }
.hops .node.home { border-color: var(--accent); border-left-width: var(--bar); }
.hops .node ul { margin: var(--space-2) 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.hops .node ul li { font-family: var(--mono); font-size: var(--text-xs); border: var(--hairline) solid var(--border-strong); padding: 0 6px; color: var(--fg); }
.hops .wire { position: relative; padding: var(--space-2) 0 var(--space-2) 34px; font-family: var(--sans); font-size: var(--text-xs); color: var(--muted); }
.hops .wire::before { content: ""; position: absolute; left: 18px; top: 0; bottom: 0; border-left: 2px solid var(--accent); }
.hops .wire.tunnel::before { border-left: 6px double var(--accent); left: 16px; }

/* cheat sheet: groups under a strong rule, entries between hairlines; in
   panels, each group's name is its head strip */
.cheat { display: grid; gap: var(--space-6) var(--space-8); }
@media (min-width: 900px) { .cheat { grid-template-columns: 1fr 1fr; } }
.cheat section { border-top: var(--hairline) solid var(--border-strong); }
.cheat h3 { margin: 0; padding: var(--space-2) 0 var(--space-1); font-size: var(--text-sm); font-weight: var(--fw-strong); color: var(--muted); }
.cheat dl { margin: 0; }
.cheat dl > div { padding: var(--space-2) 0; border-bottom: var(--hairline) solid var(--border); }
.cheat.panels { gap: var(--space-4); align-items: start; }
.cheat section.panel { margin: 0; border-top: var(--hairline) solid var(--border); }
.cheat h3.panel-head { padding: var(--space-2) var(--space-3); font-size: var(--text-sm); font-weight: var(--fw-medium); color: var(--fg); }
.cheat .panel dl > div { padding: var(--space-2) var(--space-3); }
.cheat dl > div:last-child { border-bottom: 0; }
.cheat dt { font-family: var(--mono); font-size: var(--text-code); line-height: 1.5; overflow-wrap: anywhere; }
.cheat dt::before { content: "$ "; color: var(--link); }
.cheat dt.nop::before { content: ""; }
.cheat dd { margin: var(--space-half) 0 0; font-size: var(--text-md); color: var(--muted); line-height: 1.5; }

/* not yet: a list between hairlines */
.gaps { list-style: none; padding: 0; max-width: 41rem; border-bottom: var(--hairline) solid var(--border); }
.gaps li { border-top: var(--hairline) solid var(--border); padding: 10px 0; }

/* files and trees */
.tree { margin: 0; font-size: var(--text-code); line-height: 1.6; white-space: pre; overflow-x: auto; background: var(--raised); border: var(--hairline) solid var(--border); padding: var(--space-3) 14px; }
.tree .c { color: var(--muted); }
@media (max-width: 719px) { .tree .c { display: block; white-space: pre-wrap; padding-left: 3.2em; } }
.tree .d { color: var(--fg); font-weight: var(--fw-strong); }

footer.end { border-top: var(--hairline) solid var(--border); padding: var(--space-6) 0 var(--space-10); font-family: var(--sans); font-size: var(--text-sm); color: var(--muted); }
footer.end .wrap { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); align-items: center; }
footer.end .mark { width: 20px; height: 20px; color: var(--fg); }
footer.end p { margin: 0; }

/* the internals page: a shorter hero */
.hero.short { padding: var(--space-8) 0 var(--space-8); }
.hero.short .lede { max-width: 40rem; }
@media (min-width: 900px) { .hero.short { padding: 56px 0 48px; } .hero.short .wrap { grid-template-columns: 1fr; } }

/* settings: groups of names and what they do */
.cheat.keys dt::before { content: none; }
