:root {
	color-scheme: light dark;
	--bg: #f1f6f5;
	--surface: #e0ebea;
	--border: #b9cdcb;
	--text: #11262a;
	--muted: #4a625f;
	--accent: #a8203b;
	--empty: #6b8785;
	--level-1: #34908f;
	--level-2: #2b8487;
	--level-3: #17666a;
	--level-4: #0a4a4e;
	--author-l: 0.5;
	--author-c: 0.13;
	--shadow: rgb(17 38 42 / 0.25);
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0d1a1d;
		--surface: #16272b;
		--border: #2b4247;
		--text: #e9f0ec;
		--muted: #9fb4b0;
		--accent: #f0768b;
		--empty: #52706f;
		--level-1: #24787c;
		--level-2: #2b9a9d;
		--level-3: #6cc7c2;
		--level-4: #c6eeea;
		--author-l: 0.78;
		--author-c: 0.11;
		--shadow: rgb(0 0 0 / 0.5);
	}
}

:root {
	--serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
	--sans: system-ui, sans-serif;
	--cell: 0.625rem;
}

@media (pointer: coarse) {
	:root {
		--cell: 0.75rem;
	}
}

* {
	box-sizing: border-box;
}

html {
	scroll-padding-top: 1rem;
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

body {
	display: grid;
	grid-template-columns: 11rem minmax(0, 56rem);
	justify-content: center;
	column-gap: 3rem;
	padding: 0 1rem;
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--sans);
	line-height: 1.5;
}

::selection {
	background: var(--accent);
	color: var(--bg);
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.skip-link {
	position: absolute;
	top: 0.5rem;
	left: 0.5rem;
	padding: 0.25rem 0.5rem;
	border-radius: 0.25rem;
	background: var(--surface);
	color: var(--text);
	transform: translateY(-200%);
}

.skip-link:focus {
	transform: none;
}

main {
	min-width: 0;
	padding: 2rem 0 1rem;
}

footer {
	grid-column: 2;
	padding-bottom: 2rem;
	color: var(--muted);
	font-size: 0.8rem;
}

footer hr {
	margin: 0 0 1rem;
	border: 0;
	border-top: 1px solid var(--border);
}

footer p {
	margin: 0;
}

main > section + section {
	margin-top: 2rem;
	padding-top: 0.5rem;
	border-top: 1px solid var(--border);
}

.toc {
	position: sticky;
	top: 0;
	align-self: start;
	max-height: 100vh;
	padding: 2rem 0;
	overflow-y: auto;
	font-size: 0.875rem;
}

.toc h2 {
	margin: 1.5rem 0 0.5rem;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.toc h2:first-child {
	margin-top: 0;
}

.toc ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.toc a {
	display: block;
	padding: 0.25rem 0 0.25rem 0.75rem;
	border-left: 2px solid var(--border);
	color: var(--muted);
	text-decoration: none;
}

.toc a:hover,
.toc a[aria-current] {
	color: var(--text);
}

.toc a[aria-current] {
	border-left-color: var(--accent);
}

@media (max-width: 62rem) {
	body {
		grid-template-columns: minmax(0, 56rem);
	}

	footer {
		grid-column: 1;
	}

	.toc {
		position: static;
		max-height: none;
		padding: 1rem 0 0;
		display: flex;
		flex-wrap: wrap;
		gap: 0 1.5rem;
		align-items: baseline;
	}

	.toc h2,
	.toc h2:first-child {
		margin: 0;
	}

	.toc ul {
		display: flex;
		flex-wrap: wrap;
		gap: 0 0.5rem;
	}

	.toc a {
		padding: 0.25rem 0.25rem;
		border-left: 0;
	}

	.menu-ready .toc {
		display: none;
	}

	.menu-ready .toc[data-open] {
		position: absolute;
		top: var(--menu-top, 0);
		right: 0;
		left: 0;
		z-index: 1;
		display: block;
		padding: 1rem;
		background: var(--surface);
		border-bottom: 1px solid var(--border);
	}

	.menu-ready .toc h2 {
		margin: 1rem 0 0.25rem;
	}

	.menu-ready .toc h2:first-child {
		margin-top: 0;
	}

	.menu-ready .toc ul {
		display: block;
	}

	.menu-ready .toc a {
		padding: 0.5rem 0.75rem;
	}

	header .menu-toggle {
		display: flex;
		margin-left: auto;
	}
}

header {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding-bottom: 1rem;
	margin-bottom: 2rem;
	border-bottom: 1px solid var(--border);
}

.menu-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 0.3rem;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0 0.7rem;
	color: var(--text);
	background: none;
	border: 1px solid var(--border);
	border-radius: 0.25rem;
	cursor: pointer;
}

.menu-toggle[hidden] {
	display: none;
}

.menu-toggle span {
	height: 2px;
	background: currentColor;
}

.menu-toggle:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

h1 {
	margin: 0;
	font-family: var(--serif);
	font-size: 2rem;
	line-height: 1.2;
}

h2 {
	margin: 1.5rem 0 1rem;
	font-size: 1rem;
	font-weight: 600;
	color: var(--muted);
}

h3,
h4 {
	margin: 1.5rem 0 0.5rem;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--muted);
}

.updated {
	margin: 0;
	font-size: 0.875rem;
	color: var(--muted);
}

.prose {
	font-family: var(--serif);
	font-size: 1.1875rem;
	line-height: 1.65;
	hyphens: auto;
	hyphenate-limit-chars: 7 3 3;
	overflow-wrap: break-word;
	text-wrap: pretty;
}

.prose p {
	margin: 0 0 1.25em;
}

.prose .empty {
	color: var(--muted);
}

.word,
.participant,
.profile {
	--author: oklch(var(--author-l) var(--author-c) var(--hue, 200));
}

.word {
	max-width: 100%;
	padding: 0;
	border: 0;
	border-radius: 0.125em;
	background: none;
	color: inherit;
	font: inherit;
	hyphens: inherit;
	overflow-wrap: inherit;
	text-align: left;
	text-decoration: underline;
	text-decoration-color: color-mix(in oklch, var(--author) 55%, transparent);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.25em;
	cursor: pointer;
}

.word:hover,
.word:focus-visible {
	background: var(--surface);
	text-decoration-color: var(--author);
}

.word:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 1px;
}

.word.latest {
	background: color-mix(in srgb, var(--accent) 22%, transparent);
	text-decoration-color: var(--accent);
	text-decoration-thickness: 2px;
}

.word:has(+ :popover-open) {
	background: var(--accent);
	color: var(--bg);
}

.word.dim {
	opacity: 0.35;
}

.word.match {
	background: color-mix(in oklch, var(--author) 30%, transparent);
	text-decoration-color: var(--author);
	text-decoration-thickness: 2px;
}

.tooltip {
	margin: auto;
	padding: 0.5rem;
	border: 1px solid var(--border);
	border-radius: 0.25rem;
	background: var(--surface);
	color: var(--text);
	font-family: var(--sans);
	font-size: 0.8125rem;
	line-height: 1.4;
	hyphens: manual;
	box-shadow: 0 4px 12px var(--shadow);
}

.tooltip:popover-open {
	display: flex;
	gap: 0.5rem;
}

.tooltip > span {
	display: flex;
	flex-direction: column;
}

@supports (position-area: bottom) {
	.tooltip {
		margin: 0.25rem 0 0;
		position-area: bottom span-right;
		position-try-fallbacks: flip-block, flip-inline;
	}
}

.participants {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
	gap: 0.5rem 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.9375rem;
}

.participant {
	display: flex;
	width: 100%;
	gap: 0.625rem;
	padding: 0.25rem;
	border: 0;
	border-radius: 0.375rem;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
}

.participant:enabled {
	cursor: pointer;
}

.participant:enabled:hover,
.participant[aria-pressed="true"] {
	background: var(--surface);
}

.participant:focus-visible {
	outline: 2px solid var(--accent);
}

.participant img {
	flex: none;
	border-radius: 50%;
}

.participant .who {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
}

.participant strong {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.participant .who > span:not(.bar) {
	font-size: 0.8125rem;
	color: var(--muted);
}

.participant .bar {
	width: calc(var(--share) * 1%);
	min-width: 0.25rem;
	height: 0.25rem;
	margin-top: 0.25rem;
	border-radius: 0.125rem;
	background: var(--author);
}

.participants li:has(> .profile:not([hidden])) {
	grid-column: 1 / -1;
}

.profile {
	position: relative;
	margin-top: 0.5rem;
	padding: 0.25rem 2.5rem 0.5rem 1rem;
	border-left: 0.25rem solid var(--author);
}

.profile h4 {
	margin: 1rem 0 0.25rem;
	font-size: 0.9375rem;
}

.profile .close {
	position: absolute;
	top: 0;
	right: 0;
	width: 2rem;
	height: 2rem;
	padding: 0;
	border: 0;
	border-radius: 0.375rem;
	background: none;
	color: inherit;
	font: inherit;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.profile .close:hover {
	background: var(--surface);
}

.profile .close:focus-visible {
	outline: 2px solid var(--accent);
}

.note {
	margin: 0 0 0.75rem;
	font-size: 0.8125rem;
	color: var(--muted);
}

.barlist {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(14rem, 100%), 1fr));
	gap: 0.35rem 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.9375rem;
}

.barlist li {
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: 0.25rem;
}

.barlist span:not(.bar) {
	font-size: 0.8125rem;
	color: var(--muted);
}

.barlist .bar {
	width: calc(var(--share) * 1%);
	min-width: 0.25rem;
	height: 0.25rem;
	margin-top: 0.25rem;
	border-radius: 0.125rem;
	background: var(--accent);
}

.barlist li[style*="--hue"] .bar {
	background: hsl(var(--hue) 55% 50%);
}

.tiles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
	gap: 0.5rem 1rem;
	margin: 0 0 0.5rem;
}

.tiles div {
	display: flex;
	flex-direction: column;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--border);
	border-radius: 0.5rem;
	background: var(--surface);
}

.tiles .wide {
	grid-column: span 2;
}

.tiles dt {
	order: 1;
	font-size: 0.8125rem;
	color: var(--muted);
}

.tiles dd {
	margin: 0;
}

.tiles .value {
	order: 0;
	font-size: 1.5rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.tiles .hint {
	order: 2;
	font-size: 0.75rem;
	color: var(--accent);
}

.tiles .hint::before {
	content: "(";
}

.tiles .hint::after {
	content: ")";
}

.toplist {
	columns: 12rem;
	column-gap: 2rem;
	margin: 0 0 0.5rem;
	padding: 0;
	list-style: none;
	counter-reset: rank;
	font-size: 0.9375rem;
}

.toplist:has(li:only-child),
.toplist:has(.note) {
	columns: auto;
}

.toplist li {
	position: relative;
	padding: 0.125rem 0 0.125rem 2rem;
	counter-increment: rank;
	break-inside: avoid;
	overflow-wrap: anywhere;
}

.groups {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
	gap: 0 1.5rem;
}

.groups .toplist {
	columns: auto;
}

.toplist li::before {
	content: counter(rank) ".";
	position: absolute;
	left: 0;
	font-variant-numeric: tabular-nums;
}

.toplist .meta {
	display: inline-block;
	margin-left: 0.5rem;
	white-space: nowrap;
}

.toplist .count,
.toplist .note {
	display: inline-block;
	padding: 0 0.5rem;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface);
	font-size: 0.75rem;
	line-height: 1.375;
	color: var(--muted);
}

.toplist .count:has(+ .note) {
	padding-right: 0.25rem;
	border-right: 0;
	border-radius: 999px 0 0 999px;
}

.toplist .count + .note {
	padding-left: 0.25rem;
	border-left: 0;
	border-radius: 0 999px 999px 0;
}

.activity {
	font-size: 0.8125rem;
	color: var(--muted);
}

.graphs {
	container-type: inline-size;
	--cell: max(0.625rem, calc((100cqw - 2.25rem) / 53 - 3px));
}

.graph {
	gap: 3px;
	padding-bottom: 0.25rem;
}

.cell {
	border-radius: 2px;
	background: var(--surface);
}

.cell[data-level="0"] { box-shadow: inset 0 0 0 1px var(--empty); }
.cell[data-level="1"] { background: var(--level-1); }
.cell[data-level="2"] { background: var(--level-2); }
.cell[data-level="3"] { background: var(--level-3); }
.cell[data-level="4"] { background: var(--level-4); }

.cell.future {
	visibility: hidden;
}

.graph .cell:hover {
	outline: 1px solid var(--muted);
}

.graph .label,
.weekday {
	white-space: nowrap;
}

.weekday {
	line-height: var(--cell);
}

.days {
	display: flex;
	flex-direction: row-reverse;
	overflow-x: auto;
}

.days .grid {
	display: grid;
	grid-auto-flow: column;
	grid-template-rows: auto repeat(7, var(--cell));
	grid-template-columns: auto;
	grid-auto-columns: var(--cell);
	gap: 3px;
	margin-right: auto;
	padding-right: 0.5rem;
}

.days .weekday {
	padding-right: 0.25rem;
}

.legend {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 3px;
	margin-top: 0.25rem;
}

.legend .cell {
	width: 0.75rem;
	height: 0.75rem;
}

@media (forced-colors: active) {
	.cell {
		forced-color-adjust: none;
	}

	.word:has(+ :popover-open),
	.word.match {
		outline: 2px solid Highlight;
	}

	.word.latest {
		outline: 1px dotted CanvasText;
	}
}
