:root {
	--space-xs: 0.25rem;
	--space-sm: 0.5rem;
	--space-md: 1rem;
	--space-lg: 1.5rem;
	--space-xl: 2rem;

	--color-fg: #000;
	--color-bg: #fff;

	--color-gray1: #555;
	--color-gray2: #999;

	--color-green: oklch(61% 30% 125deg);
	--color-tag: oklch(58% 50% 25deg);

	--font-size-default: 1rem;
	--line-height: 1.5;
	--list-indent: 2ch;

	--wrapper-width: 700px;
	--wrap-inner-pad: calc(7 * var(--space-lg));

	/* where the wrap's left edge lands. the % resolves at each use site, and
	   both of them measure against the body, so one definition serves */
	--wrap-gutter: max(
		var(--wrap-inner-pad),
		(100% - var(--wrapper-width)) / 2
	);

	@media (width < 640px) {
		--wrap-inner-pad: calc(1 * var(--space-sm));
	}
}

#wrap {
	display: flex;
	flex-direction: column;

	box-sizing: border-box;

	color: var(--color-fg);

	max-width: var(--wrapper-width);
	min-height: 100vh;

	margin: 0 var(--wrap-gutter);

	font-size: var(--font-size-default);
	font-family: Arial, sans-serif;

	line-height: var(--line-height);
}

body {
	margin: 0;
	padding: 0;

	overflow-x: clip;

	-webkit-font-smoothing: antialiased;

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

h1,
h2,
h3,
h4,
h5,
h6 {
	line-height: 1.1em;
}

ol,
ul {
	padding-left: var(--list-indent);
}

li {
	margin-bottom: var(--space-xs);
}

table {
	border-collapse: collapse;
	width: auto;

	margin-block: var(--space-md);

	@media (width < 640px) {
		margin-block: var(--space-xl);
	}
}

th,
td {
	text-align: left;
	vertical-align: top;

	padding-block: 0;
	padding-right: var(--space-md);

	@media (width < 640px) {
		padding-right: var(--space-sm);
	}
}

th {
	font-weight: bold;

	@media (width < 640px) {
		padding-bottom: var(--space-xs);
	}
}

@media (width < 640px) {
	tr:last-child > :is(th, td) {
		padding-bottom: var(--space-sm);
	}
}

blockquote {
	color: var(--color-gray1);
	font-size: calc(0.9 * var(--font-size-default));
}

pre * {
	margin: 0;
	padding: 0;
}

header ul,
footer ul {
	/* used in calc() later so plain "0" doesn't work */
	--list-indent: 0px;

	margin: 0;
}

header ul li,
footer ul li {
	display: inline-block;

	padding: 0;
	margin: 0 var(--space-xl) 0 0;

	@media (width < 640px) {
		margin-right: var(--space-md);
	}
}

main {
	flex: 1;
}

hr {
	border: none;
	overflow: visible;
	margin-block: calc(var(--tag-offset) - var(--space-md));
}

time {
	word-break: keep-all;
	white-space: nowrap;
}

.comment {
	display: block;

	color: var(--color-green);

	font-family: "Gaegu", sans-serif;
	font-size: 16px;
}

.comment a {
	color: inherit !important;

	text-decoration: underline;
	text-decoration-color: inherit !important;
	text-decoration-thickness: 0.07em;
}

/* posts */

.post article {
	font-family: serif !important;
}

article h1 {
	font-size: 180%;
	line-height: 1.7;
}

article h2 {
	font-size: 130%;
	line-height: 1.4;
}

#date-created {
	color: var(--color-gray2);
}

#date-updated {
	display: none;
}

/* footnotes */
#f {
	margin-top: var(--space-md);
}

#f ol li:not(:last-child) {
	margin-bottom: var(--space-lg);
}

.fr {
	font-family: monospace;
	font-weight: bolder;

	color: var(--color-green);
}
