/* Reader pages (read/…), generated by tools/generate-text.py.
   A single calm column, like a browser's reader view: the site's fonts and
   warm paper, no images, no motion, no scripts. Light only, to match the
   site. */

:root {
	--paper: #f2f1ee;
	--paper-2: #faf9f6;
	--ink: #171512;
	--ink-2: #413d38;
	--ink-3: #666158;
	--rule: rgba(23, 21, 18, 0.12);
	--rule-strong: rgba(23, 21, 18, 0.22);
	--accent-text: #a83214;
	--serif: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
	--sans: "Figtree", "Helvetica Neue", Helvetica, Arial, sans-serif;
	--mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	--col: 40rem;
	--pad: clamp(1.25rem, 5vw, 2rem);
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 1.125rem;
	line-height: 1.7;
	letter-spacing: -0.008em;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

::selection {
	background: var(--ink);
	color: var(--paper);
}

a {
	color: inherit;
	text-decoration-color: var(--rule-strong);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	transition:
		color 0.2s ease,
		text-decoration-color 0.2s ease;
}

a:hover {
	color: var(--accent-text);
	text-decoration-color: currentColor;
}

:focus-visible {
	outline: 2px solid var(--accent-text);
	outline-offset: 3px;
}

.rd-col {
	width: min(var(--col), calc(100% - var(--pad) * 2));
	margin: 0 auto;
}

/* ---------- the way back: a slim bar that stays at the top ---------- */

.rd-bar {
	position: sticky;
	top: 0;
	z-index: 10;
	background: color-mix(in srgb, var(--paper) 90%, transparent);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--rule);
}

.rd-bar .rd-col {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 56px;
}

.rd-name {
	font-family: var(--serif);
	font-size: 1.2rem;
	text-decoration: none;
	white-space: nowrap;
}

.rd-back {
	font-size: 0.88rem;
	text-decoration: none;
	color: var(--ink-2);
	text-align: right;
}

.rd-back:hover {
	color: var(--accent-text);
}

/* ---------- the article ---------- */

.rd {
	padding: clamp(40px, 8vw, 72px) 0 32px;
}

.rd-meta {
	margin: 0 0 18px;
	color: var(--ink-3);
	font-family: var(--mono);
	font-size: 0.72rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.rd h1,
.rd h2,
.rd h3,
.rd h4 {
	font-family: var(--serif);
	font-weight: 400;
	letter-spacing: -0.015em;
	text-wrap: balance;
}

.rd h1 {
	margin: 0 0 24px;
	font-size: clamp(2.4rem, 7vw, 3.4rem);
	line-height: 1.02;
}

.rd h2 {
	margin: 2.4em 0 0.5em;
	padding-top: 1.1em;
	border-top: 1px solid var(--rule-strong);
	font-size: clamp(1.7rem, 4.4vw, 2.1rem);
	line-height: 1.1;
}

/* a section label sits on the divider, with its heading right under it */
.rd-kicker {
	margin: 2.4em 0 0 !important;
	padding-top: 1.1em;
	border-top: 1px solid var(--rule-strong);
	color: var(--ink-3);
	font-family: var(--mono);
	font-size: 0.72rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.rd-kicker + .rd-kicker {
	margin-top: 0.3em !important;
	padding-top: 0;
	border-top: 0;
	color: var(--accent-text);
}

.rd-kicker + h2,
.rd-kicker + .rd-kicker + h2 {
	margin-top: 0.3em;
	padding-top: 0;
	border-top: 0;
}

.rd h3 {
	margin: 1.4em 0 0.3em;
	font-size: 1.35rem;
	line-height: 1.2;
}

.rd p,
.rd ul,
.rd ol,
.rd blockquote {
	margin: 0 0 1em;
}

.rd strong {
	font-weight: 500;
}

.rd ul,
.rd ol {
	padding-left: 1.3em;
}

.rd li {
	margin-bottom: 0.45em;
	padding-left: 0.2em;
}

.rd li::marker {
	color: var(--ink-3);
}

/* list items that carry a label and a short story (decisions, learnings) */
.rd li > .rd-label {
	margin: 1.2em 0 0;
	color: var(--accent-text);
	font-family: var(--mono);
	font-size: 0.74rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.rd li > h3 {
	margin-top: 0.2em;
}

.rd li > p {
	margin-bottom: 0.6em;
}

.rd blockquote {
	padding: 0.2em 0 0.2em 1.1em;
	border-left: 3px solid var(--accent-text);
	font-family: var(--serif);
	font-size: 1.3rem;
	line-height: 1.4;
	color: var(--ink);
}

.rd blockquote p {
	margin-bottom: 0.5em;
}

.rd-figure {
	color: var(--ink-3);
	font-size: 0.95rem;
}

.rd hr {
	margin: 2.4em 0;
	border: 0;
	border-top: 1px solid var(--rule-strong);
}

/* ---------- footer ---------- */

.rd-foot {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 28px 0 56px;
	border-top: 1px solid var(--rule-strong);
	color: var(--ink-3);
	font-size: 0.9rem;
}

.rd-foot .rd-back {
	text-align: left;
	font-size: 1rem;
	color: var(--ink);
}

.rd-foot p {
	margin: 0;
}

@media (max-width: 480px) {
	body {
		font-size: 1.0625rem;
	}

	.rd-back {
		font-size: 0.82rem;
	}
}

@media print {
	.rd-bar,
	.rd-foot .rd-back {
		display: none;
	}

	body {
		background: #fff;
	}
}

@media (prefers-reduced-motion: reduce) {
	a {
		transition: none;
	}
}
