:root {
	--paper: #ffffff;
	--ink: #1c1c1c;
	--muted: #6b6b6b;
	--rule: #dedede;
	--navy: #1d4f86;
	--navy-soft: rgba(29, 79, 134, 0.14);
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	padding: 44px clamp(20px, 5vw, 56px) 72px;
	background: var(--paper);
	color: var(--ink);
	font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia,
		serif;
	font-variant-numeric: oldstyle-nums;
	line-height: 1.68;
	font-variant-numeric: lining-nums tabular-nums;
	font-feature-settings: "lnum" 1, "tnum" 1;
}

a {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.16em;
}

a:focus-visible {
	outline: 2px solid var(--navy);
	outline-offset: 3px;
	border-radius: 1px;
}

img {
	max-width: 100%;
}

::selection {
	background: var(--navy-soft);
}

.page {
	max-width: 960px;
	margin: 0 auto;
}

/* ---------- masthead ---------- */

.masthead {
	text-align: center;
	margin-bottom: clamp(40px, 6vw, 64px);
}

.masthead .masthead-title {
	margin: 0;
	font-size: clamp(2.5rem, 7vw, 4.4rem);
	font-weight: 500;
	line-height: 1;
	letter-spacing: -0.02em;
}

.masthead-title a {
	text-decoration: none;
}

.masthead-nav {
	margin-top: 26px;
	padding: 12px 0;
	border-top: 1px solid var(--rule);
	border-bottom: 1px solid var(--rule);
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	column-gap: 8px;
	row-gap: 6px;
	font-size: 0.78rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.masthead-nav a {
	text-decoration: none;
	padding: 2px 6px;
}

.masthead-nav a:hover {
	color: var(--navy);
}

.masthead-nav a.active {
	color: var(--navy);
	text-decoration: underline;
	text-underline-offset: 0.4em;
}

.masthead-nav a.nav-lang {
	display: inline-flex;
	align-items: center;
	padding: 2px 4px 4px;
	text-decoration: none;
}

.masthead-nav a.nav-lang img {
	display: block;
	width: 18px;
	height: 12px;
	object-fit: cover;
	border: 1px solid var(--rule);
}

.masthead-nav a.nav-lang.active {
	text-decoration: none;
	border-bottom: 1px solid var(--navy);
}

.language-flag {
	width: 23px !important;
	height: 15px !important;
	object-fit: cover;
	display: block;
}

.nav-dot {
	color: var(--rule);
	user-select: none;
}

.masthead-nav .webring {
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.masthead-nav .webring a {
	display: inline-flex;
	align-items: center;
	padding: 0 2px;
	font-size: 1.1rem;
	line-height: 1;
	letter-spacing: 0;
	text-decoration: none;
}

.masthead-nav .webring img {
	display: block;
	width: 19px;
	height: 19px;
}

/* hamburger — only ever shown at mobile widths (see media query below) */
.nav-toggle {
	display: none;
	align-items: center;
	padding: 4px 6px;
	border: 0;
	background: none;
	color: inherit;
	cursor: pointer;
}

.nav-toggle:focus-visible {
	outline: 2px solid var(--navy);
	outline-offset: 2px;
}

.nav-toggle-bars {
	display: block;
	width: 24px;
}

.nav-toggle-bars span {
	display: block;
	height: 1.5px;
	background: currentColor;
	transition: transform 180ms ease, opacity 140ms ease;
}

.nav-toggle-bars span+span {
	margin-top: 6px;
}

/* ---------- shared type ---------- */

.body-copy p,
.body-copy li,
.body-copy summary,
.body-copy dd {
	font-size: 1.12rem;
}

.body-copy p {
	margin: 0 0 26px;
}

.section-label {
	margin: 0 0 26px;
	font-size: 0.76rem;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--muted);
}

.page-title {
	margin: 0 0 10px;
	font-size: clamp(1.7rem, 3.4vw, 2.3rem);
	font-weight: 500;
	line-height: 1.1;
	letter-spacing: -0.01em;
}

.lead {
	color: var(--muted);
	font-style: italic;
	margin: 0 0 40px;
	font-variant-numeric: lining-nums;
	font-feature-settings: "lnum" 1, "tnum" 1;
}

.accent-link,
.accent-text {
	color: var(--navy);
	box-shadow: inset 0 -0.42em 0 var(--navy-soft);
	border-radius: 0.14em;
	padding: 0 0.08em;
}

.accent-link {
	text-decoration-color: rgba(29, 79, 134, 0.3);
	transition: color 140ms ease, box-shadow 140ms ease;
}

.accent-link:visited {
	color: var(--navy);
}

.accent-link:hover,
.accent-link:focus-visible {
	color: #163d67;
	box-shadow: inset 0 -0.6em 0 rgba(29, 79, 134, 0.24);
}

/* ---------- home ---------- */

.intro-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 48px;
	align-items: start;
}

.snapshot {
	margin: 0;
	background: #ffffff;
	border: 1px solid var(--rule);
	padding: 8px;
}

.snapshot img {
	display: block;
	width: 100%;
	object-fit: cover;
}

.snapshot figcaption {
	margin-top: 10px;
	font-size: 0.92rem;
	font-style: italic;
	text-align: center;
	color: var(--muted);
}

.side-col {
	position: sticky;
	top: 32px;
	display: flex;
	flex-direction: column;
	gap: 36px;
}

.portrait-figure img {
	aspect-ratio: 1 / 1;
	object-position: center 18%;
}

.potd .section-label {
	margin-bottom: 12px;
}

.potd a {
	display: block;
}

/* click-to-expand trigger for the picture of the day */
.potd-button {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	cursor: zoom-in;
}

.potd-button:focus-visible {
	outline: 2px solid var(--navy);
	outline-offset: 3px;
}

/* show the whole photo, uncropped, at its natural proportions */
.potd img {
	aspect-ratio: auto;
	object-fit: contain;
}

.potd-note {
	margin: 8px 0 0;
	font-size: 0.92rem;
	font-style: italic;
	color: var(--muted);
}

.potd-note a {
	display: inline;
}

/* the long-run manifesto */
.manifesto {
	list-style: none;
	padding: 0;
	margin: 14px 0 0;
}

.manifesto li {
	padding: 9px 0;
	border-bottom: 1px solid var(--rule);
}

.manifesto li:first-child {
	border-top: 1px solid var(--rule);
}

/* ---------- photo album ---------- */

.photo-grid {
	columns: 3;
	column-gap: 24px;
}

.photo-grid button {
	margin: 0 0 24px;
	padding: 8px;
	display: block;
	width: 100%;
	break-inside: avoid;
	background: #ffffff;
	border: 1px solid var(--rule);
	cursor: zoom-in;
	font: inherit;
}

.photo-grid button:focus-visible {
	outline: 2px solid var(--navy);
	outline-offset: 3px;
}

.photo-grid img {
	display: block;
	width: 100%;
	height: auto;
}

.lightbox {
	max-width: none;
	max-height: none;
	width: 100vw;
	height: 100vh;
	margin: 0;
	padding: 24px;
	border: 0;
	background: transparent;
	display: none;
	align-items: center;
	justify-content: center;
}

.lightbox[open] {
	display: flex;
}

.lightbox::backdrop {
	background: rgba(255, 255, 255, 0.96);
}

.lightbox img {
	max-width: min(92vw, 1400px);
	max-height: 86vh;
	display: block;
	border: 1px solid var(--rule);
	background: #ffffff;
	padding: 8px;
}

.lightbox-button {
	position: fixed;
	border: 0;
	background: none;
	color: var(--ink);
	font-family: inherit;
	font-size: 2rem;
	line-height: 1;
	padding: 12px 16px;
	cursor: pointer;
}

.lightbox-button:hover {
	color: var(--navy);
}

.lightbox-button:focus-visible {
	outline: 2px solid var(--navy);
	outline-offset: 2px;
}

.lightbox-close {
	top: 14px;
	right: 14px;
}

.lightbox-prev {
	left: 10px;
	top: 50%;
	transform: translateY(-50%);
}

.lightbox-next {
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
}

/* ---------- builds ledger ---------- */

.ledger {
	list-style: none;
	counter-reset: build;
	padding: 0;
	margin: 0;
}

.ledger li {
	counter-increment: build;
	display: grid;
	grid-template-columns: 44px minmax(0, 1fr);
	gap: 20px;
	padding: 30px 0;
	border-bottom: 1px solid var(--rule);
}

.ledger li:first-child {
	padding-top: 6px;
}

.ledger li:last-child {
	border-bottom: 0;
}

.ledger-index {
	color: var(--muted);
	padding-top: 5px;
	font-size: 0.98rem;
}

.ledger-index::before {
	content: counter(build, decimal-leading-zero);
}

.build-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 16px;
	margin-bottom: 8px;
	flex-wrap: wrap;
}

.build-header .build-title {
	margin-bottom: 0;
}

.build-header p.lead {
	margin-bottom: 0;
	white-space: nowrap;
}

.build-title {
	margin: 0 0 8px;
	font-size: 1.42rem;
	font-weight: 500;
	line-height: 1.15;
}

.build-description {
	margin: 0 0 12px;
	color: var(--muted);
}

.inline-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	font-size: 0.78rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.inline-links a {
	color: var(--navy);
	text-decoration-color: rgba(29, 79, 134, 0.3);
}

.inline-links span {
	color: var(--rule);
}

/* ---------- empty page ---------- */

.empty-note {
	margin: 80px auto;
	text-align: center;
	font-style: italic;
	color: var(--muted);
}

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

.page-footer {
	margin-top: 72px;
	padding-top: 18px;
	border-top: 1px solid var(--rule);
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
	font-size: 0.76rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--muted);
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
	.intro-grid {
		grid-template-columns: 1fr;
		gap: 40px;
	}

	.intro-grid>.side-col {
		order: -1;
		position: static;
		justify-self: center;
		width: min(100%, 320px);
	}

	.ledger li {
		grid-template-columns: 1fr;
		gap: 8px;
	}

	.photo-grid {
		columns: 2;
	}
}

/* ---------- mobile nav ---------- */

/* the full-screen menu only ever exists at mobile widths */
.nav-overlay {
	display: none;
}

@media (max-width: 640px) {
	.has-js .nav-toggle {
		display: inline-flex;
	}

	/* inline row keeps only Home / Builds / Photos plus the hamburger */
	.has-js .masthead-nav>*:not(.nav-primary):not(.nav-lang):not(.nav-toggle) {
		display: none;
	}

	.has-js .masthead-nav {
		column-gap: 20px;
	}

	.has-js .nav-toggle-bars {
		width: 20px;
	}

	.has-js .nav-toggle-bars span+span {
		margin-top: 5px;
	}

	.has-js .nav-overlay {
		position: fixed;
		inset: 0;
		z-index: 50;
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 72px 24px 40px;
		overflow-y: auto;
		background: var(--paper);
		opacity: 0;
		visibility: hidden;
		transition: opacity 180ms ease, visibility 180ms;
	}

	body.nav-open .nav-overlay {
		opacity: 1;
		visibility: visible;
	}

	.has-js body.nav-open {
		overflow: hidden;
	}

	.nav-menu {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 26px;
		border: 0;
		padding: 0;
		margin: 0;
		font-size: 0.95rem;
		letter-spacing: 0.16em;
		text-transform: uppercase;
	}

	.nav-menu a {
		padding: 4px 8px;
		text-decoration: none;
	}

	.nav-menu a.nav-lang {
		display: inline-flex;
		align-items: center;
		padding: 4px 6px 6px;
	}

	.nav-menu a.nav-lang img {
		display: block;
		width: 20px;
		height: 14px;
		object-fit: cover;
		border: 1px solid var(--rule);
	}

	.nav-menu a.nav-lang.active {
		border-bottom: 1px solid var(--navy);
	}

	.nav-menu a.active {
		color: var(--navy);
		text-decoration: underline;
		text-underline-offset: 0.4em;
	}

	.nav-menu .webring {
		display: inline-flex;
		align-items: center;
		gap: 10px;
	}

	.nav-menu .webring a {
		font-size: 1.35rem;
		line-height: 1;
		letter-spacing: 0;
	}

	.nav-menu .webring img {
		display: block;
		width: 22px;
		height: 22px;
	}

	/* keep the close control above the open menu, morphed into an X */
	body.nav-open .nav-toggle {
		position: fixed;
		top: 18px;
		right: clamp(12px, 4vw, 28px);
		z-index: 60;
	}

	body.nav-open .nav-toggle-bars span:first-child {
		transform: translateY(6.5px) rotate(45deg);
	}

	body.nav-open .nav-toggle-bars span:nth-child(2) {
		opacity: 0;
	}

	body.nav-open .nav-toggle-bars span:last-child {
		transform: translateY(-6.5px) rotate(-45deg);
	}
}

@media (max-width: 480px) {
	.accordion-content {
		padding-left: 0;
	}

	.photo-grid {
		columns: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	.nav-overlay,
	.nav-toggle-bars span {
		transition: none;
	}
}