:root {
	color-scheme: light;
	--text: #292e2b;
	--background: #fbfbf8;
	--link: #356b55;
	--link-hover: #234c3b;
	--muted: #606862;
	--border: #cbd4ca;
	--surface: #f0f1ec;
	font-family: Georgia, "Times New Roman", serif;
	color: var(--text);
	background: var(--background);
	font-synthesis: none;
	text-rendering: optimizeLegibility;
}

:root[data-theme="dark"] {
	color-scheme: dark;
	--text: #e0e5df;
	--background: #191e1b;
	--link: #9ac9ad;
	--link-hover: #c0e5ce;
	--muted: #a9b5ac;
	--border: #3b4940;
	--surface: #252e28;
}

body {
	margin: 0;
	font-size: 18px;
	line-height: 1.75;
}

main {
	width: min(100% - 40px, 960px);
	margin: 72px auto;
}

.site-nav {
	display: flex;
	align-items: center;
	position: fixed;
	top: max(12px, env(safe-area-inset-top));
	left: max(12px, env(safe-area-inset-left));
	z-index: 10;
	white-space: nowrap;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 0.85rem;
	line-height: 1.2;
}

.site-nav a { color: inherit; text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }
.site-nav .back-home { margin-right: 0.65em; }
.theme-toggle {
	margin-right: 0.65em;
	padding: 0.15em 0.35em;
	border: 1px solid var(--border);
	border-radius: 50%;
	background: var(--background);
	color: inherit;
	font: inherit;
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
}
.theme-toggle:hover { background: var(--surface); }

h1, h2, h3, h4, h5, h6 {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	line-height: 1.3;
	margin: 2em 0 0.7em;
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; }

p, ul, ol, blockquote, pre, table { margin: 0 0 1.4em; }

sup a {
	font-size: 0.85em;
	font-weight: bold;
	text-decoration: none;
}

p[id^="fn-"] { font-size: 0.85em; }
p[id^="fn-"] a { text-decoration: none; }



a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }

li { padding-left: 0.25em; }
li + li { margin-top: 0.35em; }

blockquote {
	margin-left: 0;
	padding-left: 1.2em;
	border-left: 2px solid var(--border);
	color: var(--muted);
}

code, pre { font-family: "SFMono-Regular", Consolas, monospace; }
code { padding: 0.15em 0.35em; background: var(--surface); font-size: 0.85em; }
pre { overflow-x: auto; padding: 1em; background: var(--surface); line-height: 1.5; }
pre code { padding: 0; background: none; }

hr { height: 1px; margin: 2.5em 0; border: 0; background: var(--border); }
img { max-width: 100%; height: auto; }
table { width: fit-content; max-width: 100%; margin: 0 auto 1.4em; border-collapse: collapse; text-align: left; }
th, td { padding: 0.5em 0.75em; border-bottom: 1px solid var(--border); }

@media (max-width: 600px) {
	main { margin: 40px auto; }
	body { font-size: 17px; }
	.site-nav {
		position: static;
		margin-bottom: 1.5rem;
		font-size: 0.8rem;
	}
	.site-nav + h1 { margin-top: 0; }
}
