/* Same tokens as the home page: light by default, Monokai when the OS prefers dark. */
:root {
	color-scheme: light;
	--bg: #ffffff; --surface: #fafafa; --border: #d2d2f2; --rule: #e4e4ee;
	--fg: #222222; --muted: #555555; --heading-muted: #777777; --accent-2: #555555; --focus: #6666aa;
	--c1: #222222; --c2: #6666aa; --c3: #b0602a; --grid: #ececf4; --heat: 102, 102, 170;
	--mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
	:root {
		color-scheme: dark;
		--bg: #272822; --surface: #3e3d32; --border: #49483e; --rule: #3e3d32;
		--fg: #f8f8f2; --muted: #a6a28c; --heading-muted: #66d9ef; --accent-2: #66d9ef; --focus: #66d9ef;
		--c1: #a6e22e; --c2: #66d9ef; --c3: #fd971f; --grid: #34352c; --heat: 166, 226, 46;
	}
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font-family: Georgia, "Times New Roman", serif; line-height: 1.6; color: var(--fg); background: var(--bg); }
.wrap { max-width: 70rem; margin: 0 auto; padding: 0 1.25rem; }
a { color: var(--accent-2); }
a:hover { color: var(--fg); }
a:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }

.intro { padding: 3rem 0 2.5rem; }
.back { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; text-decoration: none; }
h1 { font-size: clamp(2.2rem, 1.6rem + 2.6vw, 3.4rem); letter-spacing: -.025em; line-height: 1.05; margin: .5rem 0 1rem; }
.lead { max-width: 34rem; margin: 0; font-size: 1.1rem; color: var(--muted); }

section { margin: 0 0 4rem; }
.section-head { display: flex; align-items: center; gap: 1rem; margin: 0 0 1.5rem; }
.section-head::after { content: ""; flex: 1; order: 1; border-top: 1px solid var(--rule); }
.section-head > :not(h2) { order: 2; }
h2 { margin: 0; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--heading-muted); }
.count, .legend { font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.legend i { display: inline-block; width: .9rem; height: 2px; margin: 0 .4rem .2rem .9rem; vertical-align: middle; }
.legend i:first-child { margin-left: 0; }
.k-views { background: var(--c1); }
.k-vis { background: var(--c2); }

/* ---- Headline numbers ---- */
.stats { display: flex; flex-wrap: wrap; gap: 2rem 3rem; margin-bottom: 4rem; }
.stat { display: flex; flex-direction: column; min-width: 9rem; }
.stat .label { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stat strong { font-size: 2.6rem; line-height: 1.15; font-weight: 400; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .sub { font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.up { color: var(--c1); }

/* ---- Charts ---- */
.chart { margin: 0; position: relative; }
svg { display: block; width: 100%; overflow: visible; }
svg text { font-family: var(--mono); font-size: 11px; fill: var(--muted); }
.gridline { stroke: var(--grid); stroke-width: 1; }
.line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.l1 { stroke: var(--c1); }
.l2 { stroke: var(--c2); stroke-width: 1.5; }
.today { stroke-dasharray: 3 4; }
.a1 { fill: var(--c1); opacity: .07; }
.cursor { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; }
.dot1 { fill: var(--c1); } .dot2 { fill: var(--c2); }
.tip { position: absolute; top: 0; pointer-events: none; padding: .45rem .7rem; background: var(--bg); border: 1px solid var(--border);
	font-family: var(--mono); font-size: .75rem; line-height: 1.5; white-space: nowrap; transform: translateX(-50%); }
.tip b { font-weight: 400; color: var(--muted); display: block; }

/* ---- Projects: small multiples ---- */
.projects { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 2rem 2.5rem; }
.projects li { min-width: 0; display: flex; flex-direction: column; gap: .25rem; padding-top: .9rem; border-top: 1px solid var(--rule); }
.projects .name { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.projects .name a, .projects .name span { font-weight: 700; text-decoration: none; color: var(--fg); }
.projects .name a:hover { text-decoration: underline; }
.projects .num { font-size: 1.6rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.projects .sub { font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.projects svg { height: 2.6rem; margin-top: .35rem; }

/* ---- Countries and hours, side by side when there is room ---- */
.pair { display: flex; flex-wrap: wrap; gap: 0 4rem; }
.pair > section { flex: 1 1 22rem; min-width: 0; }
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.bars li { display: flex; align-items: center; gap: .75rem; font-size: .95rem; }
.bars .cn { flex: 0 0 9.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .bar { flex: 1; height: .5rem; background: var(--grid); }
.bars .bar span { display: block; height: 100%; background: var(--c1); }
.bars .n { flex: 0 0 3rem; text-align: right; font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.heat { margin: 0; }
.heat rect { shape-rendering: crispEdges; }

.levels { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 2rem 2.5rem; }
.levels li { display: flex; flex-direction: column; padding-top: .9rem; border-top: 1px solid var(--rule); }
.levels .name { display: flex; align-items: center; gap: .5rem; font-weight: 700; }
.levels .num { font-size: 1.9rem; line-height: 1.2; margin-top: .3rem; font-variant-numeric: tabular-nums; }
.levels .sub { font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.levels dl { display: grid; grid-template-columns: auto 1fr; gap: .1rem 1rem; margin: .8rem 0 0; font-size: .9rem; }
.levels dt { color: var(--muted); }
.levels dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.swatch { width: .7rem; height: .7rem; border-radius: 50%; }
.swatch.lv0, .pt.lv0 { background: var(--c1); fill: var(--c1); }
.swatch.lv1, .pt.lv1 { background: var(--c2); fill: var(--c2); }
.swatch.lv2, .pt.lv2 { background: var(--c3); fill: var(--c3); }
.step.lv0 { stroke: var(--c1); } .step.lv1 { stroke: var(--c2); } .step.lv2 { stroke: var(--c3); }
.step { stroke-width: 1.5; opacity: .55; }
.note { max-width: 40rem; margin: 1rem 0 0; font-size: .9rem; color: var(--muted); }
.lead a { color: var(--accent-2); }

.projects li.feature { grid-column: 1 / -1; }
.projects li.feature .num { font-size: 2.2rem; }
.projects li.feature svg { height: 4.5rem; }
.col { fill: var(--c1); opacity: .85; }
.col:hover { opacity: 1; }
.figs { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; margin: 0 0 2.5rem; }
.figs .stat strong { font-size: 2rem; }
.onheat { fill: var(--bg); font-size: 10px; }
.offheat { fill: var(--fg); font-size: 10px; }
.bars.wide .n { flex-basis: 6.5rem; }
#extra > section, #extra > .pair { margin-bottom: 3.5rem; }
.pair section { margin-bottom: 2rem; }

footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; padding: 1rem 0 3rem; border-top: 1px solid var(--rule); font-size: .9rem; color: var(--muted); }
footer .credit { font-family: var(--mono); font-size: .65rem; color: var(--muted); opacity: .6; text-decoration: none; }
footer .credit:hover, footer .credit:focus-visible { opacity: 1; text-decoration: underline; }
.empty { color: var(--muted); }
@media (max-width: 34rem) {
	.stats { gap: 1.5rem 2rem; }
	.stat { min-width: 8rem; flex: 1 1 40%; }
	.stat strong { font-size: 2rem; }
	.bars .cn { flex-basis: 7.5rem; }
	.projects { grid-template-columns: 1fr 1fr; gap: 1.75rem 1.25rem; }
	.projects .num { font-size: 1.35rem; }
}
