:root {
	--bg: #0f1012;
	--panel: #16181b;
	--fg: #e8e6e3;
	--dim: #9a9690;
	--line: #2a2d31;
	--accent: #f6821f;
	--ok: #7cc47c;
	--wip: #e3b341;
	--miss: #e5646d;
	--sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: light) {
	:root {
		--bg: #fbfaf8;
		--panel: #ffffff;
		--fg: #1b1a18;
		--dim: #6b6761;
		--line: #e3e0da;
		--accent: #c55a00;
		--ok: #2f8a3a;
		--wip: #a87a00;
		--miss: #c0303a;
	}
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.6 var(--sans); }
a { color: var(--accent); text-underline-offset: 3px; }
code { font: 0.88em var(--mono); background: color-mix(in oklab, var(--line) 60%, transparent); padding: 1px 5px; border-radius: 4px; }
pre { font: 13px/1.55 var(--mono); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; overflow-x: auto; }
pre code { background: none; padding: 0; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.prose { max-width: 72ch; }

header.top { position: sticky; top: 0; z-index: 5; background: color-mix(in oklab, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; height: 52px; }
header.top .me { font: 13px var(--mono); color: var(--fg); text-decoration: none; white-space: nowrap; }
header.top nav { display: flex; gap: 18px; overflow-x: auto; font-size: 14px; }
header.top nav a { color: var(--dim); text-decoration: none; white-space: nowrap; }
header.top nav a:hover { color: var(--fg); }

.hero { padding: 72px 0 40px; }
.eyebrow { font: 13px var(--mono); color: var(--accent); margin: 0 0 12px; }
h1 { font-size: clamp(34px, 6vw, 58px); line-height: 1.05; letter-spacing: -0.025em; margin: 0 0 20px; font-weight: 700; text-wrap: balance; }
.lede { font-size: 19px; color: var(--fg); max-width: 64ch; margin: 0 0 14px; text-wrap: pretty; }
.lede.dim { color: var(--dim); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 10px; margin: 36px 0 0; background: var(--panel); }
.stat { padding: 18px 20px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat b { display: block; font: 600 28px/1.1 var(--mono); color: var(--accent); font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 6px; font-size: 13px; color: var(--dim); }

section { padding: 56px 0 8px; scroll-margin-top: 52px; }
h2 { font-size: 28px; letter-spacing: -0.015em; margin: 0 0 6px; }
h2 + .sub { color: var(--dim); margin: 0 0 24px; max-width: 70ch; }
h3 { font-size: 19px; margin: 32px 0 8px; }
h4 { font-size: 16px; margin: 22px 0 6px; }

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 20px; min-width: 0; }
.card > * { margin: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card h3 { margin: 0; font: 600 18px var(--mono); }
.tag { color: var(--dim); font-size: 14px; margin-top: -8px !important; }
.what { font-size: 15px; }
.status { display: inline-flex; align-items: center; gap: 6px; font: 12px var(--mono); color: var(--dim); white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.status.wip::before { background: var(--wip); }
.status.miss::before { background: var(--miss); }
.proved { width: 100%; border-collapse: collapse; font-size: 13px; }
.proved td { padding: 6px 10px 6px 0; border-top: 1px solid var(--line); vertical-align: baseline; }
.proved td:first-child { color: var(--dim); }
.proved .v { font: 600 14px var(--mono); color: var(--accent); white-space: nowrap; font-variant-numeric: tabular-nums; }
.proved td:last-child { color: var(--dim); padding-right: 0; }
.label { font: 12px var(--mono); color: var(--dim); margin-bottom: -6px !important; }
.card ul { padding-left: 18px; font-size: 14px; }
.card li + li { margin-top: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto !important; }
.chip { font: 12px var(--mono); color: var(--dim); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }
.links { font: 13px var(--mono); }
.links .muted { color: var(--dim); }

ol.learned { padding-left: 22px; max-width: 72ch; }
ol.learned li { margin: 10px 0; }

.layers { list-style: none; padding: 0; margin: 24px 0 12px; display: grid; gap: 22px; }
.layer { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 15em 6.5em; gap: 16px; align-items: start; padding: 14px 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.layer + .layer::before { content: "↓"; position: absolute; top: -23px; left: 22px; color: var(--dim); font-size: 14px; line-height: 22px; }
.layer.missing { border-style: dashed; border-color: var(--dim); background: transparent; }
.layer .name { font-weight: 600; font-size: 15px; }
.layer .items, .layer .owner { color: var(--dim); font-size: 13px; }
.note { color: var(--dim); font-size: 14px; max-width: 72ch; }

.rfc { border-top: 1px solid var(--line); margin-top: 48px; }
.meta { border-collapse: collapse; font-size: 14px; margin: 8px 0 24px; }
.meta td { padding: 4px 18px 4px 0; }
.meta td:first-child { color: var(--dim); }
.tbl { width: 100%; overflow-x: auto; margin: 12px 0 20px; }
.tbl table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: 9px 12px 9px 0; border-top: 1px solid var(--line); }
.tbl th { font: 12px var(--mono); color: var(--dim); font-weight: 400; border-top: 0; }
.tbl td:last-child { color: var(--dim); white-space: nowrap; }

footer { border-top: 1px solid var(--line); margin-top: 72px; padding: 28px 0 48px; color: var(--dim); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
footer nav { display: flex; gap: 18px; flex-wrap: wrap; }

@media (max-width: 820px) {
	.cards { grid-template-columns: minmax(0, 1fr); }
	.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.stat:nth-child(3) { border-left: 0; }
	.stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
	.layer { grid-template-columns: minmax(0, 1fr) auto; }
	.layer .owner { grid-column: 1; }
	.layer .status { grid-column: 2; grid-row: 1; }
	header.top .me { display: none; }
}
@media (max-width: 480px) {
	.wrap { padding: 0 16px; }
	.hero { padding-top: 48px; }
	.lede { font-size: 17px; }
	.proved td:last-child { display: block; padding-top: 0; border-top: 0; }
	.proved tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; border-top: 1px solid var(--line); }
	.proved td { border-top: 0; }
	.proved td:last-child { grid-column: 1 / -1; }
}

/* tabs: one page per tab */
header.top nav a[aria-current="page"] { color: var(--fg); box-shadow: inset 0 -2px 0 var(--accent); }
header.top nav a { display: flex; align-items: center; height: 52px; }
.next { margin: 56px 0 0; padding: 20px 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.next span { color: var(--dim); font-size: 14px; }
.next a { font-weight: 600; text-decoration: none; }
.page-head { padding: 56px 0 0; }
.page-head h1 { font-size: clamp(30px, 5vw, 44px); }

.page-head + section { padding-top: 16px; }

/* project pages: a strip of every project under the tabs, so a shared project link shows the rest */
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
nav.projects { border-bottom: 1px solid var(--line); background: var(--panel); }
nav.projects .wrap { display: flex; align-items: center; gap: 18px; min-height: 44px; overflow-x: auto; font-size: 13px; }
nav.projects .projects-home { color: var(--dim); text-decoration: none; white-space: nowrap; }
nav.projects .projects-home:hover { color: var(--fg); }
nav.projects .projects-list { display: flex; gap: 6px; }
nav.projects .projects-list a { font: 13px var(--mono); color: var(--dim); text-decoration: none; white-space: nowrap; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; }
nav.projects .projects-list a:hover { color: var(--fg); border-color: var(--dim); }
nav.projects .projects-list a[aria-current="page"] { color: var(--accent); border-color: var(--accent); }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }
.title-row { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.title-row h1 { font-family: var(--mono); margin-bottom: 12px; }
.project-head .lede:first-of-type { font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 16px; }
.btn { font: 14px var(--mono); text-decoration: none; color: var(--fg); border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 8px 14px; }
.btn:hover { border-color: var(--dim); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.project-head pre { max-width: 72ch; }
.proved.big { font-size: 15px; max-width: 760px; }
.proved.big .v { font-size: 17px; }
.proved.big td { padding: 10px 14px 10px 0; }
ul.list { padding-left: 20px; max-width: 72ch; }
ul.list li { margin: 6px 0; }
section .chips { margin-top: 14px; }
.mini-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mini { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--dim); text-decoration: none; font-size: 14px; }
.mini b { font: 600 15px var(--mono); color: var(--fg); }
.mini:hover { border-color: var(--accent); }
.mini:hover b { color: var(--accent); }
@media (max-width: 820px) {
	.mini-cards { grid-template-columns: minmax(0, 1fr); }
	nav.projects .projects-home { display: none; }
}
