:root {
	--base: #1e1e2e;
	--text: #cdd6f4;
	--crust: #191724;
	--surface0: #313244;
	--subtext0: #a6adc8;
	--subtext1: #bac2de;
	--pink: #f5c2e7;
	--rosewater: #f5e0dc;
	--blue: #89b4fa;
	--mauve: #cba6f7;
	color-scheme: dark;
}

:root,
code {
	font-family: "Hack", "Hack Nerd Font", "JetBrains Mono", "JetBrainsMono Nerd Font", monospace, sans-serif;
}

:root {
	scrollbar-width: none;

	background-color: var(--base);
	color: var(--text);
	accent-color: var(--pink);
}

a {
	color: var(--pink);
}

a:hover {
	color: var(--rosewater);
}

a:active {
	color: var(--blue);
}

a:visited {
	color: var(--mauve);
}

progress {
	width: 100%;
	border: 2px solid;

	background-color: var(--base);
	color: var(--pink);
	accent-color: var(--pink);
	border-color: var(--text);
}
::-moz-progress-bar,
::-webkit-progress-value {
	background-color: var(--pink) !important;
}
::-webkit-progress-bar {
	background-color: var(--base);
	width: 100%;
}

fieldset {
	margin-bottom: 1em;

	border-color: var(--text);
}

fieldset#motd {
	padding: 0px 1.5em 1.5em;
}

fieldset#motd > p:first-of-type {
	margin-top: 1.5em;
}

footer {
	text-align: end;
	font-size: small;
	opacity: 50%;
}
code {
	padding: 0.15em 0.3em;
	overflow-wrap: break-word;
	word-break: break-all;
	white-space: pre-wrap;

	background-color: var(--surface0);
	color: var(--subtext1);
}

pre > code {
	border: 2px solid var(--surface0);
	padding: 1.25em 1.5em;
	display: block;

	background-color: var(--base);
	color: var(--text);
}

legend {
	font-weight: 900;
}

.projects-list li details[open] {
	margin: 1em auto;
}

summary:hover,
summary:active,
details[open] > summary {
	font-weight: bold;
}

summary::after {
	content: " (click to expand)";
	opacity: 50%;
	font-size: smaller;
	font-weight: lighter;
}

details[open] > summary::after {
	content: " (click to collapse)";
}

div.buttons a {
	font-size: 0;
}
div.buttons img,
div.buttons a > img {
	image-rendering: crisp-edges;
	image-rendering: pixelated;
	object-fit: contain;
	width: 88px;
	height: 31px;
}

table {
	word-break: break-word;
}

td:first-child {
	font-weight: bold;
	word-break: keep-all;
	vertical-align: top;
}

td:nth-child(2) {
	padding-left: 1em;
	word-break: break-all;
}

.webring a {
	text-decoration: none;
}

blockquote {
	margin-left: 1em;
	padding-left: 1.5em;
	border-left: 0.5em solid;
	border-color: var(--rosewater);
}

body {
	margin: 0;
	box-sizing: border-box;
	min-height: 100dvh;

	background-color: var(--base);
}

main {
	padding: 2em;

	background-color: var(--base);
}

.divider::before {
	content: " 〜 ";
	user-select: none;
}

body > main > h1:first-child {
	margin-top: 0;
}

@media (min-width: 900px) {
	:root {
		--target-ratio: 0.7;
		--largest-possible: min(
			100% * var(--target-ratio),  
			1600px * var(--target-ratio) 
		);
		--width: max(
			var(--largest-possible),
			1200px * var(--target-ratio)     
		);
	}

	body {
		padding: 4em 0;

		background: var(--crust);
		background: linear-gradient(
			90deg,
			var(--base) 0%,
			var(--crust) calc((100% - var(--width)) / 2),
			var(--crust) calc(50% + var(--width) / 2),
			var(--base) 100%
		);
	}

	main {
		padding: 4em;
	}

	body > * {
		margin: auto;
		box-sizing: border-box;
		width: var(--width);
	}
}
