/*
Theme Name: Somuga Ball Run
Theme URI: https://somuga.com/
Author: Somuga
Description: Somuga's own theme: a home-made chain reaction of corrugated cardboard shelves, dominoes and one steel ball on a cool white table.
Version: 1.0.0
Requires PHP: 8.2
License: GNU General Public License v2 or later
Text Domain: somuga-ballrun
*/

/* ---------- Faces (shipped in the theme, OFL) ---------- */

@font-face {
	font-family: "Calistoga";
	src: url("assets/fonts/calistoga-latin.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Figtree";
	src: url("assets/fonts/figtree-latin.woff2") format("woff2");
	font-weight: 300 900;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Figtree";
	src: url("assets/fonts/figtree-latin-italic.woff2") format("woff2");
	font-weight: 300 900;
	font-style: italic;
	font-display: swap;
}

/* ---------- The workshop table ---------- */

:root {
	--table: #f6f7f9;
	--card: #ffffff;
	--board: #a8885f;
	--core: #8a6d47;
	--tape: #ece4d0;
	--steel: #9aa3ad;
	--ink: #22262b;
	--muted: #5a6068;
	--link: #6b4f2a;
	--line: #d6dae0;
	--on-ink: #f2f3f5;
	--on-ink-soft: #c3c8cf;

	--display: "Calistoga", "Georgia", serif;
	--text: "Figtree", "Helvetica Neue", "Arial", sans-serif;

	--wide: 72rem;
	--measure: 66ch;
	--gutter: clamp(1.1rem, 4vw, 2.5rem);
	--edge: 14px;
	--ball: 16px;
}

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

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

body {
	margin: 0;
	background: var(--table);
	color: var(--ink);
	font: 400 1.125rem/1.65 var(--text);
	font-optical-sizing: auto;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

img,
svg {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--link);
	text-decoration-line: underline;
	text-decoration-thickness: 1.5px;
	text-underline-offset: 0.2em;
}

a:hover {
	color: var(--ink);
	text-decoration-thickness: 2.5px;
}

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

h1,
h2,
h3,
h4 {
	font-family: var(--display);
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: 0;
	margin: 0 0 0.6em;
	text-wrap: balance;
}

h1 { font-size: clamp(2.05rem, 4.6vw, 3.35rem); line-height: 1.12; }
h2 { font-size: clamp(1.55rem, 2.6vw, 1.95rem); }
h3 { font-size: 1.32rem; }
h4 { font-size: 1.12rem; }

p,
ul,
ol,
dl,
table,
figure,
blockquote,
details {
	margin: 0 0 1.25em;
}

strong { font-weight: 700; }

.hush {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.hop {
	position: absolute;
	left: 1rem;
	top: -4rem;
	z-index: 50;
	background: var(--ink);
	color: var(--on-ink);
	padding: 0.7rem 1rem;
	font-weight: 600;
	text-decoration: none;
}

.hop:focus { top: 1rem; }

/* The corrugated cut edge of a piece of cardboard: two liners and the wavy core between them. */
.edge,
.masthead-shelf,
.ledge::after,
.trackline::before {
	background: var(--board) url("assets/svg/corrugate.svg") repeat-x left center / 16px 100%;
}

/* ---------- Header ---------- */

.masthead {
	background: var(--card);
	position: relative;
}

.masthead-row {
	max-width: var(--wide);
	margin: 0 auto;
	padding: 0.85rem var(--gutter) 0;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	flex-wrap: wrap;
	column-gap: 2rem;
	row-gap: 0.1rem;
}

.brand {
	display: inline-block;
	margin-bottom: 0.7rem;
	line-height: 0;
}

.brand img {
	width: auto;
	height: 48px;
}

.masthead nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.15rem 1.6rem;
}

.masthead nav a {
	position: relative;
	display: inline-block;
	padding: 0.55rem 0.1rem 1.15rem;
	font-weight: 600;
	font-size: 1.02rem;
	color: var(--ink);
	text-decoration: none;
}

.masthead nav a:hover {
	text-decoration: underline;
	text-decoration-thickness: 2px;
}

/* The steel ball rests on the shelf under the current item. */
.masthead nav .current-menu-item > a::after,
.masthead nav .current-menu-parent > a::after,
.masthead nav .current-post-ancestor > a::after,
.masthead nav .current-category-ancestor > a::after,
.masthead nav a[aria-current="page"]::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 0;
	width: var(--ball);
	height: var(--ball);
	margin-left: calc(var(--ball) / -2);
	border-radius: 50%;
	border: 2px solid var(--ink);
	background: radial-gradient(circle at 34% 32%, #ffffff 0 2px, transparent 2.6px), var(--steel);
}

.masthead-shelf {
	height: var(--edge);
}

/* ---------- Page frame ---------- */

.bench {
	max-width: var(--wide);
	margin: 0 auto;
	padding: clamp(1.75rem, 5vw, 3.5rem) var(--gutter) clamp(3rem, 7vw, 5rem);
}

/* A white card whose top edge is a strip of corrugated cardboard, held on by two pieces of masking tape. */
.crate {
	position: relative;
	background: var(--card);
	border: 1px solid var(--line);
	border-top: 0;
	border-radius: 0 0 6px 6px;
	padding: calc(var(--edge) + clamp(1.2rem, 3vw, 2rem)) clamp(1.2rem, 3.5vw, 2.6rem) clamp(1.4rem, 3.5vw, 2.4rem);
}

.crate::before {
	content: "";
	position: absolute;
	inset: 0 -1px auto;
	height: var(--edge);
	background: var(--board) url("assets/svg/corrugate.svg") repeat-x left center / 16px 100%;
	border-radius: 3px 3px 0 0;
}

.crate::after {
	content: "";
	position: absolute;
	top: -5px;
	left: 1.4rem;
	right: 1.4rem;
	height: 24px;
	background:
		linear-gradient(var(--tape), var(--tape)) left top / 46px 100% no-repeat,
		linear-gradient(var(--tape), var(--tape)) right top / 46px 100% no-repeat;
	opacity: 0.88;
	transform: rotate(-1.2deg);
	pointer-events: none;
}

/* A small paper flag on a stick holds a label. */
.flag {
	display: inline-flex;
	align-items: center;
	gap: 0;
	margin: 0 0 1rem;
	font: 600 0.9rem/1.2 var(--text);
	color: var(--ink);
	text-decoration: none;
}

.flag::before {
	content: "";
	width: 2px;
	align-self: stretch;
	min-height: 2.15rem;
	margin-bottom: -0.6rem;
	background: var(--ink);
	border-radius: 1px;
}

.flag > span,
.flag > a {
	display: inline-block;
	background: var(--tape);
	color: var(--ink);
	padding: 0.32rem 1.35rem 0.32rem 0.6rem;
	clip-path: polygon(0 0, 100% 0, calc(100% - 0.6rem) 50%, 100% 100%, 0 100%);
	text-decoration: none;
	align-self: flex-start;
}

.flag > a:hover {
	text-decoration: underline;
}

.stamp {
	font-size: 0.95rem;
	color: var(--muted);
	margin: 0;
}

.stamp > span {
	display: inline-block;
	margin-right: 0.9rem;
}

/* ---------- Home: the tagline is the machine ---------- */

.machine {
	position: relative;
	padding: clamp(0.5rem, 2vw, 1.5rem) 0 0.5rem;
}

.machine-title {
	font-size: clamp(2.05rem, 6.4vw, 5.4rem);
	line-height: 1.04;
	margin: 0 0 clamp(1.2rem, 3vw, 2rem);
	text-wrap: initial;
}

.ledge {
	position: relative;
	display: block;
	margin-left: var(--from);
	width: calc(var(--to) - var(--from));
	padding: 0 0.12em calc(var(--edge) + 0.2em);
	margin-bottom: 0.22em;
}

.ledge::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0.1em;
	height: var(--edge);
	border-radius: 2px;
	transform: rotate(var(--tilt));
}

.ledge-1 { --from: 0%; --to: 82%; --tilt: 0.9deg; }
.ledge-2 { --from: 26%; --to: 82%; --tilt: -1.1deg; text-align: right; }
.ledge-3 { --from: 26%; --to: 94%; --tilt: 1deg; }
.ledge-4 { --from: 50%; --to: 94%; --tilt: -1.3deg; text-align: right; }

@media (max-width: 40rem) {
	.ledge-1 { --from: 0%; --to: 100%; --tilt: 1.6deg; }
	.ledge-2 { --from: 14%; --to: 100%; --tilt: -2deg; }
	.ledge-3 { --from: 14%; --to: 100%; --tilt: 2deg; }
	.ledge-4 { --from: 34%; --to: 100%; --tilt: -2.4deg; }
}

/* The ball's resting place and the domino it tipped, at the low end of the last ledge. */
.ledge-stop {
	position: absolute;
	left: 0;
	bottom: calc(0.1em + var(--edge) - 5px);
	width: 0;
	height: 0;
	pointer-events: none;
}

.steel-ball,
.runner {
	position: absolute;
	width: calc(var(--ball) * 1.6);
	height: calc(var(--ball) * 1.6);
	border-radius: 50%;
	border: 2.5px solid var(--ink);
	background: radial-gradient(circle at 34% 32%, #ffffff 0 3px, transparent 3.6px), var(--steel);
}

.ledge-stop .steel-ball {
	left: 22px;
	bottom: 0;
}

.domino {
	position: absolute;
	width: 16px;
	height: 40px;
	background: #ffffff;
	border: 2px solid var(--ink);
	border-radius: 3px;
}

.domino::before {
	content: "";
	position: absolute;
	left: 2px;
	right: 2px;
	top: 50%;
	border-top: 1.6px solid var(--ink);
}

.domino::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 6px;
	width: 4px;
	height: 4px;
	margin-left: -2px;
	border-radius: 50%;
	background: var(--ink);
	box-shadow: -3px 20px 0 var(--ink), 3px 25px 0 var(--ink);
}

.ledge-stop .domino {
	left: 2px;
	bottom: 0;
	transform-origin: 0% 100%;
	transform: rotate(-62deg);
}

.ledge-stop .domino {
	transition: transform 520ms cubic-bezier(0.5, 0, 0.9, 0.55);
}

.roll-ready .ledge-stop .steel-ball { opacity: 0; }
.roll-ready .ledge-stop .domino { transform: rotate(0deg); }

.runner {
	left: 0;
	top: 0;
	z-index: 3;
	pointer-events: none;
}

.machine-lede {
	max-width: 34rem;
	font-size: 1.2rem;
	color: var(--muted);
	margin: 0 0 clamp(2rem, 5vw, 3rem);
}

@media (min-width: 64rem) {
	.machine {
		display: grid;
		grid-template-columns: minmax(0, 23%) minmax(0, 1fr);
	}

	.machine-title {
		grid-column: 1 / -1;
		grid-row: 1;
	}

	.machine-lede {
		grid-column: 1;
		grid-row: 1;
		align-self: end;
		margin: 0 0 1.2rem;
		font-size: 1.12rem;
		line-height: 1.55;
	}
}

/* The guide the last domino falls toward. */
.lead-guide {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
	gap: clamp(1.2rem, 3vw, 2.6rem);
	align-items: center;
	margin-bottom: clamp(2.5rem, 6vw, 4rem);
}

.lead-guide h2 {
	font-size: clamp(1.6rem, 3vw, 2.3rem);
	margin-bottom: 0.45em;
}

.lead-guide h2 a {
	color: var(--ink);
	text-decoration: none;
}

.lead-guide h2 a:hover {
	text-decoration: underline;
	text-decoration-thickness: 2px;
}

.lead-guide p.excerpt {
	color: var(--muted);
	margin-bottom: 1rem;
}

.figure-board {
	margin: 0;
	background: var(--card);
	position: relative;
	padding-bottom: var(--edge);
}

.figure-board::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: var(--edge);
	background: var(--board) url("assets/svg/corrugate.svg") repeat-x left center / 16px 100%;
}

.figure-board img {
	display: block;
	width: 100%;
}

@media (max-width: 48rem) {
	.lead-guide { grid-template-columns: 1fr; }
}

/* What sets off what: the website's own text beside a small chain. */
.workings {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
	gap: clamp(1.5rem, 4vw, 3rem);
	align-items: start;
	margin-bottom: 2.5rem;
}

.workings .crate > :last-child { margin-bottom: 0; }

.chain-card {
	padding-top: 0.6rem;
}

.chain-title {
	font-size: 1.45rem;
	margin-bottom: 1.1rem;
}

.chain {
	list-style: none;
	margin: 0;
	padding: 0.5rem 0 0;
	counter-reset: none;
}

.chain li {
	position: relative;
	padding: 0 0 2.4rem 4.2rem;
	min-height: 3.6rem;
}

.chain li::before {
	content: "";
	position: absolute;
	left: 0.4rem;
	top: 0.1rem;
	width: 2.6rem;
	height: 2.6rem;
	border: 2px solid var(--ink);
	border-radius: 4px;
	background: var(--board) url("assets/svg/corrugate.svg") repeat-x left bottom / 16px 12px;
	background-color: var(--board);
}

.chain li:first-child::before {
	border-radius: 50%;
	background: radial-gradient(circle at 34% 32%, #ffffff 0 3px, transparent 3.6px), var(--steel);
}

.chain li:last-child::before {
	width: 1.1rem;
	left: 1.15rem;
	background: #ffffff;
}

.chain li:not(:last-child)::after {
	content: "";
	position: absolute;
	left: 1.7rem;
	top: 3rem;
	bottom: 0.25rem;
	border-left: 2px dashed var(--ink);
}

.chain strong {
	display: block;
	font-family: var(--display);
	font-weight: 400;
	font-size: 1.15rem;
	line-height: 1.25;
}

.chain span {
	display: block;
	color: var(--muted);
	font-size: 1rem;
	line-height: 1.5;
}

@media (max-width: 48rem) {
	.workings { grid-template-columns: 1fr; }
}

/* ---------- Ad slots: plain labelled cards, apart from the machine ---------- */

.chute {
	display: block;
	clear: both;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 6px;
	padding: 0.6rem 0.8rem 0.9rem;
	margin: 2.4rem 0;
	max-width: 100%;
	overflow: hidden;
}

.counterweight {
	display: block;
	margin: 0 0 0.5rem;
	font: 600 0.8rem/1.3 var(--text);
	letter-spacing: 0.01em;
	color: var(--muted);
}

.chute iframe {
	display: block;
	max-width: 100%;
	margin-inline: auto;
	border: 0;
}

.slot-bay {
	margin: 3rem 0 0;
}

/* ---------- Article ---------- */

.title-run {
	display: grid;
	grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
	gap: clamp(1.25rem, 3vw, 2.5rem);
	align-items: center;
	margin-bottom: clamp(2rem, 5vw, 3.25rem);
}

.title-run h1 {
	font-size: clamp(2rem, 3.4vw, 2.85rem);
}

.title-run .excerpt {
	font-size: 1.2rem;
	color: var(--muted);
	margin-bottom: 1.4rem;
}

.byline {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	padding-top: 1.1rem;
	border-top: 2px dashed var(--line);
}

.byline img {
	width: 46px;
	height: 46px;
	flex: none;
	border-radius: 8px;
	border: 1px solid var(--line);
}

.byline p {
	margin: 0;
	font-size: 0.98rem;
	line-height: 1.45;
}

.byline .who {
	font-weight: 700;
}

.byline .stamp {
	font-size: 0.92rem;
}

@media (max-width: 52rem) {
	.title-run { grid-template-columns: 1fr; }
	.title-run .figure-board { order: -1; }
}

.reading {
	max-width: var(--wide);
	margin: 0 auto;
}

.prose {
	max-width: var(--measure);
	margin-left: clamp(0rem, 7%, 6rem);
}

.prose > :first-child { margin-top: 0; }

.crate .prose {
	margin-left: 0;
}

.prose h2 {
	margin-top: 2.6rem;
	scroll-margin-top: 1.5rem;
}

.prose h3 {
	margin-top: 1.9rem;
}

.prose ul {
	padding-left: 1.3rem;
}

.prose ul li::marker {
	content: "● ";
	color: var(--steel);
	font-size: 0.8em;
}

.prose li + li {
	margin-top: 0.35rem;
}

/* Ordered steps stand on domino tiles. */
.prose ol {
	list-style: none;
	padding: 0;
	counter-reset: tile;
}

.prose ol > li {
	position: relative;
	counter-increment: tile;
	padding-left: 3.4rem;
	min-height: 3.1rem;
	margin-top: 0.9rem;
}

.prose ol > li::before {
	content: counter(tile);
	position: absolute;
	left: 0;
	top: -0.1rem;
	width: 2.1rem;
	height: 3rem;
	display: grid;
	place-items: center;
	padding-bottom: 1rem;
	border: 2px solid var(--ink);
	border-radius: 4px;
	background: linear-gradient(transparent calc(50% - 1px), var(--ink) calc(50% - 1px) calc(50% + 0.5px), transparent calc(50% + 0.5px)), #ffffff;
	font: 400 0.95rem/1 var(--display);
	color: var(--ink);
}

.prose ol > li::after {
	content: "";
	position: absolute;
	left: 0.92rem;
	top: 2.05rem;
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: var(--ink);
}

/* Figures sit on white with a cardboard baseline. */
.prose figure {
	margin: 2rem 0;
	background: var(--card);
	border: 1px solid var(--line);
	border-bottom: 0;
	position: relative;
	padding: clamp(0.8rem, 2.5vw, 1.4rem) clamp(0.8rem, 2.5vw, 1.4rem) calc(var(--edge) + 0.9rem);
}

.prose figure::after {
	content: "";
	position: absolute;
	left: -1px;
	right: -1px;
	bottom: 0;
	height: var(--edge);
	background: var(--board) url("assets/svg/corrugate.svg") repeat-x left center / 16px 100%;
}

.prose figure img {
	display: block;
	margin: 0 auto;
}

.prose figcaption {
	margin-top: 0.85rem;
	font-size: 0.93rem;
	line-height: 1.5;
	color: var(--muted);
}

/* Tables: a cardboard head row; they scroll sideways on phones. */
.table-run {
	margin: 2rem 0;
	overflow-x: auto;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 0 0 6px 6px;
	-webkit-overflow-scrolling: touch;
}

.table-run:focus-visible {
	outline-offset: 2px;
}

.prose table {
	width: 100%;
	min-width: 36rem;
	border-collapse: collapse;
	margin: 0;
	font-size: 0.92rem;
	line-height: 1.45;
}

.prose caption {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.prose .table-head {
	position: sticky;
	left: 0;
	max-width: min(100%, calc(100vw - 2 * var(--gutter) - 2px));
	margin: 0;
	padding: 0.8rem 1rem 0.65rem;
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.4;
	color: var(--ink);
}

.prose thead th {
	background: var(--board);
	color: var(--ink);
	font-weight: 700;
	border-bottom: 3px solid var(--core);
}

.prose th,
.prose td {
	text-align: left;
	vertical-align: top;
	padding: 0.6rem 0.75rem;
	border-bottom: 1px solid var(--line);
}

.prose tbody th {
	font-weight: 700;
}

.prose tbody tr:last-child > * {
	border-bottom: 0;
}

/* Asides are side tracks that branch off the main column. */
.prose aside {
	position: relative;
	background: var(--card);
	border: 2px solid var(--ink);
	border-radius: 6px;
	padding: 1rem 1.15rem 0.9rem;
	margin: 1.9rem 0 1.9rem 1.6rem;
	font-size: 1rem;
	line-height: 1.55;
}

.prose aside::before {
	content: "";
	position: absolute;
	left: -1.7rem;
	top: -1.6rem;
	width: 1.6rem;
	height: 2.9rem;
	border-left: 2px dashed var(--ink);
	border-bottom: 2px dashed var(--ink);
	border-bottom-left-radius: 10px;
}

.prose aside::after {
	content: "";
	position: absolute;
	left: -0.55rem;
	top: 0.95rem;
	width: 0.9rem;
	height: 0.9rem;
	border-radius: 50%;
	border: 2px solid var(--ink);
	background: var(--steel);
}

.prose aside > :last-child { margin-bottom: 0; }

@media (min-width: 76rem) {
	.prose .table-run {
		clear: right;
		width: min(calc(100% + 19.5rem), calc(100vw - 2 * var(--gutter)));
	}

	.prose aside {
		float: right;
		clear: right;
		width: 16.5rem;
		margin: 0.35rem -20rem 1.4rem 1.5rem;
	}

	.prose aside::before {
		left: -2.6rem;
		top: 1.35rem;
		width: 2.5rem;
		height: 0;
		border-left: 0;
		border-bottom: 0;
		border-top: 2px dashed var(--ink);
		border-radius: 0;
	}

	.prose aside::after {
		top: 0.95rem;
		left: -0.55rem;
	}
}

/* Questions flip open like a lever. */
.prose details {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 6px;
	padding: 0;
	margin: 0.8rem 0;
}

.prose details + :not(details) {
	margin-top: 1.6rem;
}

.prose summary {
	position: relative;
	cursor: pointer;
	list-style: none;
	padding: 0.85rem 1rem 0.85rem 3.1rem;
	font-weight: 700;
	line-height: 1.4;
}

.prose summary::-webkit-details-marker { display: none; }

.prose summary::before {
	content: "";
	position: absolute;
	left: 1rem;
	top: 1.25rem;
	width: 1.4rem;
	height: 0.35rem;
	background: var(--ink);
	border-radius: 2px;
	transform: rotate(-24deg);
	transform-origin: 50% 50%;
	transition: transform 160ms ease-out;
}

.prose summary::after {
	content: "";
	position: absolute;
	left: 1.42rem;
	top: 1.55rem;
	border-left: 0.3rem solid transparent;
	border-right: 0.3rem solid transparent;
	border-bottom: 0.55rem solid var(--board);
}

.prose details[open] summary::before {
	transform: rotate(24deg);
}

.prose details > :not(summary) {
	padding: 0 1rem 0 3.1rem;
}

.prose details > :last-child {
	padding-bottom: 0.9rem;
	margin-bottom: 0;
}

/* Terms: each term set off what follows by a short dashed path. */
.prose dl {
	margin: 1.6rem 0;
}

.prose dt {
	font-family: var(--display);
	font-size: 1.12rem;
	line-height: 1.3;
	margin-top: 1rem;
}

.prose dd {
	margin: 0.3rem 0 0;
	padding: 0 0 0 1.3rem;
	border-left: 2px dashed var(--board);
}

.prose blockquote {
	margin: 2rem 0;
	padding: 0.4rem 0 0.4rem 1.6rem;
	border-left: var(--edge) solid var(--board);
	font-family: var(--display);
	font-size: 1.3rem;
	line-height: 1.4;
}

.prose blockquote > :last-child { margin-bottom: 0; }

.prose hr {
	border: 0;
	border-top: 2px dashed var(--line);
	margin: 2.4rem 0;
}

.prose code {
	font-size: 0.92em;
	background: var(--tape);
	padding: 0.05em 0.3em;
	border-radius: 3px;
}

/* The guide's run: its sections as a chain of dominoes, in order. */
.run-list {
	margin: 2.2rem 0 2.6rem;
	padding: 1.1rem 1.2rem 0.4rem;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 6px;
}

.run-list .run-title {
	font: 400 1.15rem/1.3 var(--display);
	margin: 0 0 0.8rem;
}

.prose .run-list ol {
	margin: 0;
	padding: 0;
	counter-reset: tile;
}

.prose .run-list ol > li {
	padding-left: 2.6rem;
	min-height: 2.3rem;
	margin: 0 0 0.75rem;
	font-size: 1rem;
	line-height: 1.4;
}

.prose .run-list ol > li::before {
	width: 1.55rem;
	height: 2.2rem;
	padding-bottom: 1.05rem;
	font-size: 0.78rem;
}

.prose .run-list ol > li::after {
	left: 0.68rem;
	top: 1.5rem;
	width: 3px;
	height: 3px;
}

/* A domino tipping toward the next section. */
.bridge {
	display: flex;
	align-items: flex-end;
	gap: 0.4rem;
	margin: 2.4rem 0 0;
}

.bridge::before {
	content: "";
	flex: 1 1 auto;
	margin-bottom: 0.1rem;
	border-top: 2px dashed var(--line);
}

.bridge-tile {
	position: relative;
	flex: none;
	width: 3.1rem;
	height: 2.2rem;
}

.bridge-tile::before,
.bridge-tile::after {
	content: "";
	position: absolute;
	bottom: 0;
	width: 0.65rem;
	height: 1.75rem;
	background: #ffffff;
	border: 2px solid var(--ink);
	border-radius: 2px;
	transform-origin: 100% 100%;
}

.bridge-tile::before {
	left: 0.2rem;
	background: var(--board);
}

.bridge-tile::after {
	left: 1.35rem;
	transform: rotate(28deg);
}

.bridge a {
	font-weight: 700;
}

.bridge + h2 {
	margin-top: 1.2rem;
}

/* The team's note and more guides. */
.after-run {
	clear: both;
	max-width: var(--measure);
	margin: 3.5rem 0 0 clamp(0rem, 7%, 6rem);
}

.team-note {
	display: flex;
	gap: 1.1rem;
	align-items: flex-start;
}

.team-note img {
	width: 60px;
	height: 60px;
	flex: none;
	border-radius: 10px;
	border: 1px solid var(--line);
}

.team-note h2 {
	font-size: 1.3rem;
	margin-bottom: 0.3rem;
}

.team-note p {
	margin: 0 0 0.6rem;
	font-size: 1rem;
	color: var(--muted);
}

.team-note p:last-child { margin-bottom: 0; }

.more-run {
	margin-top: 2.5rem;
}

.more-run h2 {
	font-size: 1.4rem;
}

.more-run ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.more-run li {
	position: relative;
	padding: 0 0 1rem 2rem;
}

.more-run li::before {
	content: "";
	position: absolute;
	left: 0.25rem;
	top: 0.35rem;
	width: 0.85rem;
	height: 0.85rem;
	border-radius: 50%;
	border: 2px solid var(--ink);
	background: var(--steel);
}

.more-run a {
	font-weight: 700;
}

.more-run span {
	display: block;
	font-size: 0.97rem;
	color: var(--muted);
}

/* ---------- Archive and search: a marble run of guides ---------- */

.archive-head {
	max-width: 50rem;
	margin-bottom: clamp(2rem, 5vw, 3rem);
}

.archive-head h1 {
	margin-bottom: 0.4em;
}

.archive-head p {
	color: var(--muted);
	margin: 0;
}

.marble-run {
	list-style: none;
	margin: 0;
	padding: 0;
}

.marble-run > li {
	position: relative;
	width: min(100%, 44rem);
	padding-bottom: 4.2rem;
}

.marble-run > li:nth-child(even) {
	margin-left: auto;
}

.marble-run > li:last-child {
	padding-bottom: 0;
}

.trackline {
	position: relative;
	height: 2.2rem;
}

.trackline::before {
	content: "";
	position: absolute;
	left: 8%;
	right: 8%;
	top: 0.6rem;
	height: var(--edge);
	border-radius: 2px;
	transform: rotate(1.4deg);
}

.marble-run > li:nth-child(even) .trackline::before {
	transform: rotate(-1.4deg);
}

.marble-run > li:not(:last-child)::after {
	content: "";
	position: absolute;
	right: 9%;
	bottom: 0.4rem;
	height: 3rem;
	border-left: 2px dashed var(--ink);
}

.marble-run > li:nth-child(even):not(:last-child)::after {
	right: auto;
	left: 9%;
}

.guide-card {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
	gap: 1.3rem;
	align-items: center;
}

.guide-card h2 {
	font-size: 1.45rem;
	margin-bottom: 0.4rem;
}

.guide-card h2 a {
	color: var(--ink);
	text-decoration: none;
}

.guide-card h2 a:hover {
	text-decoration: underline;
}

.guide-card p {
	margin: 0 0 0.6rem;
	font-size: 1rem;
	color: var(--muted);
}

.guide-card .thumb {
	display: block;
	line-height: 0;
	border: 1px solid var(--line);
	background: var(--card);
}

.guide-card.no-thumb {
	grid-template-columns: 1fr;
}

@media (max-width: 40rem) {
	.guide-card { grid-template-columns: 1fr; }
}

.paging {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 2.5rem;
	font-weight: 700;
}

/* Search form */
.lookup {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin: 0 0 2rem;
	max-width: 36rem;
}

.lookup input[type="search"] {
	flex: 1 1 14rem;
	min-height: 48px;
	padding: 0.5rem 0.85rem;
	font: inherit;
	color: var(--ink);
	background: var(--card);
	border: 2px solid var(--ink);
	border-radius: 6px;
}

.lookup button,
.knob {
	min-height: 48px;
	padding: 0.5rem 1.2rem;
	font: 700 1rem/1 var(--text);
	color: var(--on-ink);
	background: var(--ink);
	border: 2px solid var(--ink);
	border-radius: 6px;
	cursor: pointer;
}

.lookup button:hover,
.knob:hover {
	background: #3a4048;
}

/* ---------- Institutional and policy pages ---------- */

.sheet {
	max-width: 52rem;
}

.sheet .crate {
	padding-left: clamp(1.2rem, 5vw, 3.5rem);
	padding-right: clamp(1.2rem, 5vw, 3.5rem);
}

.sheet .prose {
	margin-left: 0;
}

.sheet .lede {
	font-size: 1.18rem;
	color: var(--muted);
}

.sheet .stamp {
	margin-bottom: 1.6rem;
}

.team-card {
	display: flex;
	gap: 1rem;
	align-items: flex-start;
	margin: 2rem 0 0;
	padding-top: 1.4rem;
	border-top: 2px dashed var(--line);
}

.team-card img {
	width: 64px;
	height: 64px;
	flex: none;
	border-radius: 10px;
	border: 1px solid var(--line);
}

.team-card p {
	margin: 0 0 0.4rem;
	font-size: 1rem;
}

/* The missing page: the ball has left the track. */
.off-track {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 2rem;
	align-items: center;
}

.off-track-figure {
	position: relative;
	height: 12rem;
}

.off-track-figure .rail {
	position: absolute;
	left: 0;
	width: 62%;
	top: 3rem;
	height: var(--edge);
	background: var(--board) url("assets/svg/corrugate.svg") repeat-x left center / 16px 100%;
	transform: rotate(8deg);
	transform-origin: 0 0;
	border-radius: 2px;
}

.off-track-figure .steel-ball {
	left: 76%;
	bottom: 0.4rem;
}

.off-track-figure .gap {
	position: absolute;
	left: 62%;
	top: 4.6rem;
	width: 15%;
	height: 6.2rem;
	border-top: 2px dashed var(--ink);
	border-right: 2px dashed var(--ink);
	border-top-right-radius: 3rem;
}

@media (max-width: 44rem) {
	.off-track { grid-template-columns: 1fr; }
	.off-track-figure { height: 9rem; }
}

/* ---------- Footer: an ink band under a row of standing dominoes ---------- */

.underside {
	position: relative;
	overflow-x: clip;
	margin-top: 3.5rem;
	background: var(--ink);
	color: var(--on-ink);
}

.underside::before {
	content: "";
	position: absolute;
	left: 0;
	right: 4.5rem;
	bottom: 100%;
	height: 40px;
	background: url("assets/svg/domino.svg") repeat-x left bottom / 44px 40px;
	pointer-events: none;
}

.underside::after {
	content: "";
	position: absolute;
	right: 2.6rem;
	bottom: 100%;
	width: 14px;
	height: 36px;
	background: #ffffff;
	border: 2px solid var(--ink);
	border-radius: 2px;
	transform-origin: 0 100%;
	transform: rotate(52deg);
	pointer-events: none;
}

.underside-row {
	max-width: var(--wide);
	margin: 0 auto;
	padding: 2.6rem var(--gutter) 3.2rem;
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
	gap: 2rem 3rem;
}

.underside a {
	color: var(--on-ink);
}

.underside a:hover {
	color: #ffffff;
}

.underside :focus-visible {
	outline-color: var(--tape);
}

.underside-brand {
	display: flex;
	gap: 1rem;
	align-items: flex-start;
}

.underside-brand img {
	width: 56px;
	height: 56px;
	flex: none;
	border-radius: 10px;
}

.underside-brand p {
	margin: 0 0 0.45rem;
	font-size: 1rem;
	color: var(--on-ink-soft);
}

.underside-brand .name {
	font: 400 1.5rem/1.2 var(--display);
	color: var(--on-ink);
}

.underside nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	columns: 2;
	column-gap: 2rem;
}

.underside nav li {
	break-inside: avoid;
	padding: 0.15rem 0;
}

.underside nav a {
	position: relative;
	display: inline-block;
	padding: 0.4rem 0 0.4rem 1.5rem;
	font-size: 0.98rem;
	text-decoration: none;
}

.underside nav a::before {
	content: "";
	position: absolute;
	left: 0.2rem;
	top: 0.62rem;
	width: 0.55rem;
	height: 1rem;
	background: linear-gradient(transparent calc(50% - 0.5px), var(--ink) calc(50% - 0.5px) calc(50% + 0.5px), transparent calc(50% + 0.5px)), var(--board);
	border-radius: 2px;
	transform-origin: 100% 100%;
	transition: transform 160ms ease-out;
}

.underside nav a:hover,
.underside nav a:focus-visible {
	text-decoration: underline;
}

.underside nav a:hover::before,
.underside nav a:focus-visible::before {
	transform: rotate(24deg);
}

.underside small {
	display: block;
	grid-column: 1 / -1;
	padding-top: 1.4rem;
	border-top: 1px solid #3c4249;
	font-size: 0.88rem;
	color: var(--on-ink-soft);
}

@media (max-width: 48rem) {
	.underside-row { grid-template-columns: 1fr; }
}

@media (max-width: 22rem) {
	.underside nav ul { columns: 1; }
}

/* ---------- Measurement notice and choice (runtime markup, this website's look) ---------- */

.ramp {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 40;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.45rem 1rem;
	padding: 0.6rem var(--gutter) 0.7rem;
	background: var(--card);
	border-top: 2px solid var(--ink);
	font-size: 0.9rem;
	line-height: 1.45;
	color: var(--ink);
}

.ramp p {
	flex: 1 1 26rem;
	margin: 0;
}

.ramp a {
	color: var(--link);
	font-weight: 600;
}

.ramp button,
.pulley button {
	flex: 0 0 auto;
	min-height: 44px;
	min-width: 6.5rem;
	padding: 0.4rem 1rem;
	font: 700 0.95rem/1 var(--text);
	color: var(--ink);
	background: var(--card);
	border: 2px solid var(--ink);
	border-radius: 6px;
	cursor: pointer;
}

.ramp button:hover,
.pulley button:hover {
	background: var(--table);
}

.ramp button:focus-visible,
.pulley button:focus-visible {
	outline: 3px solid var(--link);
	outline-offset: 2px;
}

@media (max-width: 34rem) {
	.ramp {
		font-size: 0.84rem;
		padding-top: 0.5rem;
		padding-bottom: 0.55rem;
		gap: 0.4rem 0.6rem;
	}

	.ramp p { flex-basis: 100%; }

	.ramp button {
		flex: 1 1 0;
		min-width: 0;
	}
}

.pulley {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.7rem;
	margin: 1.4rem 0;
	padding: 1rem 1.1rem;
	background: var(--table);
	border: 1px solid var(--line);
	border-radius: 6px;
}

.trigger {
	flex: 1 1 100%;
	margin: 0;
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--ink);
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition: none !important;
		animation: none !important;
	}

	.runner { display: none; }
}
