@layer reset.fix {
	* {
		box-sizing: border-box;
	}

	b,
	strong {
		font-weight: 700;
	}

	code,
	pre {
		font-family: monospace, m;
	}

	button,
	label,
	summary,
	[type="button"],
	[type="submit"] {
		cursor: pointer;
	}

	button,
	input,
	select {
		font: inherit;
		color: currentColor;
	}
}

@layer reset.normalize {
	html {
		-webkit-text-size-adjust: none;
		line-height: 1.5;
		tab-size: 4;
		scrollbar-gutter: stable;
	}

	body {
		margin: 0;
		padding: 0;
	}

	img,
	svg {
		display: block;
		max-inline-size: 100%;
		max-block-size: 100%;
		block-size: auto;
	}

	table {
		inline-size: 100%;
		border-collapse: collapse;
	}

	td,
	th {
		padding: 0.2em 0.5em;
	}

	th {
		vertical-align: bottom;
	}

	td {
		vertical-align: top;
	}
}

@layer reset.prose {
	html {
		font-optical-sizing: auto;
		text-rendering: optimizeLegibility;
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
	}

	body {
		font-kerning: normal;
		font-variant-ligatures: common-ligatures;
		/*font-size-adjust: ex-height 0.527;*/
	}

	h1,
	h2,
	h3,
	h4,
	h5,
	h6 {
		margin-block: 2rem 1rem;
		line-height: 1.2;
		text-wrap: balance;
		break-after: avoid;
	}

	:not(h1):first-child {
		margin-block-start: 0;
	}

	:last-child {
		margin-block-end: 0;
	}

	[id] {
		scroll-margin-block: 1em;
	}

	a,
	abbr[title] {
		text-underline-position: from-font;
		text-decoration-thickness: from-font;
	}

	blockquote,
	li,
	p {
		text-wrap: pretty;
		hanging-punctuation: first;
	}

	blockquote,
	li {
		line-height: normal;
	}

	li {
		padding-block: 0.25em;
	}

	figcaption {
		font-style: italic;
		text-align: center;
	}
}

:root {
	--accent: light-dark(red, yellow);
	--back: light-dark(oklch(0.9832 0.003 311.22), oklch(0.2129 0.002 106.58));
	--soft: light-dark(white, black);
	--edge: light-dark(oklch(0.8536 0.014 300.59), oklch(0.4007 0.007 96.1));
	--mute: light-dark(oklch(0.5048 0.016 296.08), oklch(0.7666 0.009 97.38));
	--text: light-dark(oklch(0.2446 0.013 298.05), oklch(0.9483 0.003 106.45));
	--bold: light-dark(black, white);
}

:focus-visible {
	border-color: currentColor;
	outline: 4px solid #da0;
}

body {
	font-family: system-ui, sans-serif;
	font-synthesis: none;
	color: var(--text);
	background-color: var(--back);
	scrollbar-gutter: unset;
	accent-color: var(--bold);
}

.container {
	display: flex;
	height: 100vh;
	overflow-block: hidden;
}

.sidebar {
	flex: none;
	display: flex;
	flex-direction: column;
	width: 300px;
	overflow: hidden;

	h1 {
		margin-block: 0;
		padding: 1rem;
		font-weight: 700;
		font-size: 1.4rem;
		border-inline-end: 1px solid var(--edge);
		border-block-end: 1px solid var(--edge);
	}
}

.controls {
	flex: 1 1 0%;
	border-inline-end: 1px solid var(--edge);
	overflow-block: auto;
	scrollbar-gutter: stable;

	label {
		display: block;
		padding: 1em;
		font-weight: 700;
		border-block-end: 1px solid var(--edge);
	}
	[type="number"] {
		display: block;
		width: 100%;
		padding-inline: 0.75em;
		padding-block: 0.25em;
		font-weight: 400;
		background-color: var(--soft);
		border: 1px solid var(--edge);

		&:hover,
		&:focus {
			border-color: currentColor;
		}
	}
}

.family-btn {
	display: block;
	width: 100%;
	padding-inline: 1em;
	padding-block: 0.5em;
	font-family: monospace, m;
	font-size-adjust: 0.523;
	line-height: 1.2;
	text-align: start;
	text-wrap: balance;
	color: var(--mute);
	border: 0;
	border-block-start: 1px solid var(--edge);
	background-color: transparent;

	&:hover,
	&:focus {
		background-color: var(--soft);
	}

	&.is-loaded {
		color: var(--text);
	}

	&.is-active {
		color: var(--soft);
		background-color: var(--bold);
		border-color: var(--bold);
	}
}

.proofs-container {
	--width: 75ch;
	--font-family: system-ui, sans-serif;
	--font-size: 16px;
	--line-height: 1.5;

	display: flex;
	flex-direction: column;
	border-inline-end: 1px solid var(--edge);
	overflow: hidden;
}
.proofs-nav {
	display: flex;
	border-block-end: 1px solid var(--edge);
}
.proofs-tab {
	width: fit-content;
	padding-inline: 1em;
	padding-block: 0.5em;
	line-height: 1.2;
	background-color: var(--soft);
	border: 0;

	& + & {
		border-inline-start: 1px solid var(--edge);
	}

	&:hover,
	&:focus {
		color: var(--accent);
	}

	&.is-open {
		color: var(--soft);
		background-color: var(--text);
	}
}
.proofs-content {
	display: none;
	width: 100%;
	max-width: calc(var(--width) + 3rem + 1px);
	padding: 1rem;
	font-family: var(--font-family);
	font-size: var(--font-size);
	line-height: var(--line-height);
	background-color: var(--soft);
	overflow-block: auto;

	&.is-open {
		display: block;
	}
}

@layer prose {
	:is(h1, h2, h3, em, strong) {
		color: var(--bold);
	}

	h2 {
		margin-block: 1rem;
		font-size: 2.5em;
	}

	h3 {
		font-size: 2em;
	}

	h4 {
		font-size: 1.75em;
	}

	a {
		&:hover,
		&:focus {
			color: MarkText;
			background-color: Mark;
		}
	}

	details {
		border-block-end: 1px solid var(--edge);
	}
	summary {
		padding-inline: 1em;
		padding-block: 0.5em;
		font-family: monospace, m;
		font-weight: 700;
		background-color: var(--soft);

		&:hover,
		&:focus {
			color: var(--accent);
		}
	}

	blockquote {
		margin-inline: 0;
		padding: 1em;
		font-style: italic;
		background-color: var(--back);
		border: 1px solid var(--edge);
		border-inline-start-width: 0.5em;
	}

	hr {
		margin-block: 2em;
		border: 0;
		border-block-start: 1px solid var(--edge);
	}

	figure img {
		margin-inline: auto;
	}
}

.flex {
	display: flex;
}
.flex-1 {
	flex: 1 1 0%;
	margin: 0;
}
.is-italic {
	font-style: italic;
}
