/* The palette lives here and nowhere else. Go emits structure plus a class
   name per source; nothing about colour crosses the boundary, so a hue can be
   retuned without a recompile and dark mode costs nothing. */
:root {
	color-scheme: light dark;
	font-size: 100%;

	--bg: #fbfaf8;
	--fg: #1c1c1a;
	--muted: #6b6862;
	--rule: #dedbd4;
	--track: #ecebe6;

	--wind-offshore: #2f6f8f;
	--wind-onshore: #4f9ac0;
	--pv: #c99700;
	--hydro: #264882;
	--biomass: #4e7d3a;
	--lignite: #8a5a33;
	--hardcoal: #4a4038;
	--gas: #b5651d;
	--other: #7d7a74;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #14151a;
		--fg: #e6e4e0;
		--muted: #9a978f;
		--rule: #2c2e36;
		--track: #22242b;

		--wind-offshore: #3d86ab;
		--wind-onshore: #63b3d6;
		--pv: #dcb33a;
		--hydro: #537dc6;
		--biomass: #68ab57;
		--lignite: #b07a4e;
		--hardcoal: #8b7a6d;
		--gas: #d3873f;
		--other: #8e8b84;
	}
}

* { box-sizing: border-box; }

body {
	margin: 0;
	padding: 1.5rem 1rem 3rem;
	background: var(--bg);
	color: var(--fg);
	font: 400 1rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

main {
	max-width: 46rem;
	margin: 0 auto;
}

h1 {
	margin: 0 0 .25rem;
	font-size: 1.375rem;
	font-weight: 600;
	letter-spacing: -0.01em;
}

.stand {
	margin: 0 0 1.5rem;
	color: var(--muted);
	font-size: .875rem;
}

.stand .hint { color: var(--muted); }

.error {
	padding: 1rem;
	border: 1px solid var(--rule);
	border-radius: .375rem;
	background: var(--track);
}

/* Headline figures. */
.headline {
	display: flex;
	gap: 2.5rem;
	margin: 0 0 2rem;
	padding: 0;
}

.headline dt {
	color: var(--muted);
	font-size: .8125rem;
	text-transform: uppercase;
	letter-spacing: .04em;
}

.headline dd {
	margin: 0;
	font-size: 1.75rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

/* The breakdown: a table, so the numbers are text, selectable, and readable by
   anything that never runs a script. The bar is decoration on top. */
.mix {
	width: 100%;
	border-collapse: collapse;
}

.mix thead th {
	padding: 0 .5rem .375rem;
	border-bottom: 1px solid var(--rule);
	color: var(--muted);
	font-size: .75rem;
	font-weight: 500;
	text-align: left;
	text-transform: uppercase;
	letter-spacing: .04em;
}

.mix thead th:last-child { text-align: right; }

.mix tbody th,
.mix tbody td {
	padding: .4375rem .5rem;
	border-bottom: 1px solid var(--rule);
	font-size: .9375rem;
}

.mix tbody tr:last-child th,
.mix tbody tr:last-child td { border-bottom: 0; }

.mix tbody th {
	font-weight: 400;
	text-align: left;
	white-space: nowrap;
}

.emoji {
	display: inline-block;
	width: 1.4em;
	font-size: .875rem;
}

.mix .track { width: 55%; }

.track {
	margin: 0;
	background: linear-gradient(to right, var(--rule) 1px, transparent 1px);
}

.bar {
	display: block;
	height: .875rem;
	border-radius: 2px;
	/* Go hands over a bare number; the stylesheet decides what it means. */
	width: calc(var(--v, 0) * 1%);
	min-width: 0;
	background: var(--series, var(--other));
}

.mix .num {
	text-align: right;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	width: 6.5rem;
}

.nodata {
	color: var(--muted);
	font-size: .8125rem;
}

.g-wind-offshore { --series: var(--wind-offshore); }
.g-wind-onshore  { --series: var(--wind-onshore); }
.g-pv            { --series: var(--pv); }
.g-hydro         { --series: var(--hydro); }
.g-biomass       { --series: var(--biomass); }
.g-lignite       { --series: var(--lignite); }
.g-hardcoal      { --series: var(--hardcoal); }
.g-gas           { --series: var(--gas); }
.g-other         { --series: var(--other); }

footer {
	max-width: 46rem;
	margin: 3rem auto 0;
	color: var(--muted);
	font-size: .75rem;
	line-height: 1.45;
}

footer p { margin: 0 0 .25rem; }
footer a { color: inherit; }

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

@media print {
	:root { --bg: #fff; --fg: #000; --track: #eee; --rule: #ccc; }
	main { max-width: none; }
}
