/* Design tokens. Same token names as the main site (public/css/main.css) so the two
   stay mentally one system, but a warmer palette: fire-service red for the accent and
   a brass gold for honors. Components reference tokens only; never hardcode colors
   below this block. Dark overrides live at the bottom under .darkmode. */
:root {
	color-scheme: light;
	--bg: #f6f2ec;
	--surface: #fffdf9;
	--text-primary: #1b1715;
	--text-secondary: #6a615b;
	--border: #e2d9cf;
	--accent: #b4231c;
	--accent-soft: rgba(180, 35, 28, 0.08);
	--gold: #a8781a;
	--gold-soft: rgba(168, 120, 26, 0.12);
	--hero-bg: #141010;
	--hero-text: #f3ece4;
	--hero-muted: #b9aea4;
	--font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
	--font-body: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
	--font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
	--radius: 10px;
	--shadow: 0 1px 2px rgba(27, 23, 21, 0.06), 0 8px 24px rgba(27, 23, 21, 0.06);
}

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

html { scroll-behavior: smooth; }

body {
	background: var(--bg);
	color: var(--text-primary);
	font-family: var(--font-body);
	font-size: 1.05rem;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #fff; }

img { display: block; max-width: 100%; height: auto; }

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

h1, h2, h3 {
	font-family: var(--font-display);
	font-weight: 600;
	letter-spacing: -0.015em;
	line-height: 1.15;
}

h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); }

.wrap {
	max-width: 1040px;
	margin: 0 auto;
	padding: 0 20px;
}

/* Small-caps label used above every section title and on cards */
.eyebrow {
	font-family: var(--font-mono);
	font-size: 0.72rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--accent);
}

.section {
	padding: 88px 0;
}

.section-head {
	max-width: 640px;
	margin-bottom: 44px;
}

.section-head p {
	color: var(--text-secondary);
	margin-top: 12px;
}

.skip-link {
	position: absolute;
	left: 12px;
	top: -60px;
	background: var(--surface);
	color: var(--text-primary);
	padding: 8px 14px;
	border: 1px solid var(--border);
	border-radius: 6px;
	z-index: 30;
}
.skip-link:focus { top: 12px; }

/* ---------- Theme toggle (same markup as the main site) ---------- */
#theme-toggle {
	position: fixed;
	top: 12px;
	right: 12px;
	z-index: 20;
	background: rgba(0, 0, 0, 0.25);
	border: 1px solid transparent;
	border-radius: 6px;
	padding: 7px;
	cursor: pointer;
	color: var(--hero-text);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
#theme-toggle.scrolled {
	background: var(--surface);
	border-color: var(--border);
	color: var(--text-secondary);
}
#theme-toggle:hover, #theme-toggle:focus-visible { color: var(--accent); border-color: var(--border); }
#theme-toggle svg { width: 20px; height: 20px; display: block; pointer-events: none; }
#theme-toggle .icon-sun { display: none; }
.darkmode #theme-toggle .icon-sun { display: block; }
.darkmode #theme-toggle .icon-moon { display: none; }

/* ---------- Hero ---------- */
.hero {
	position: relative;
	background: var(--hero-bg);
	color: var(--hero-text);
	overflow: hidden;
	min-height: 92vh;
	display: flex;
	align-items: center;
	padding: 100px 0 70px;
}

/* Deep red glow in one corner and a faint Maltese cross watermark */
.hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background:
		radial-gradient(ellipse 60% 55% at 85% 20%, rgba(180, 35, 28, 0.42), transparent 70%),
		radial-gradient(ellipse 50% 45% at 10% 95%, rgba(168, 120, 26, 0.18), transparent 70%);
	pointer-events: none;
}

.hero-cross {
	position: absolute;
	right: -6%;
	bottom: -14%;
	width: min(62vw, 620px);
	opacity: 0.06;
	pointer-events: none;
}

.hero .wrap {
	position: relative;
	display: grid;
	grid-template-columns: 1.15fr 0.85fr;
	gap: 48px;
	align-items: center;
	width: 100%;
}

.hero .eyebrow { color: var(--gold); }

.hero h1 {
	font-size: clamp(2.8rem, 7vw, 5.4rem);
	font-weight: 500;
	margin: 14px 0 10px;
	letter-spacing: -0.03em;
}

.hero .role {
	font-size: clamp(1.1rem, 2vw, 1.4rem);
	color: var(--hero-muted);
	font-family: var(--font-display);
	font-style: italic;
}

.hero .lede {
	margin-top: 26px;
	max-width: 520px;
	color: var(--hero-text);
	font-size: 1.1rem;
	line-height: 1.7;
}

.hero .years {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 30px;
}

.hero .years span {
	font-family: var(--font-mono);
	font-size: 0.78rem;
	letter-spacing: 0.06em;
	border: 1px solid rgba(243, 236, 228, 0.22);
	border-radius: 999px;
	padding: 6px 14px;
	color: var(--hero-muted);
}

.portrait {
	position: relative;
	aspect-ratio: 3 / 4;
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
	outline: 1px solid rgba(243, 236, 228, 0.12);
	transform: rotate(1.5deg);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	box-shadow: inset 0 0 0 1px rgba(243, 236, 228, 0.08);
	pointer-events: none;
}

/* ---------- Stats ---------- */
.stats {
	position: relative;
	z-index: 1;
	margin-top: -56px;
}

.stats .wrap {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 14px;
}

.stat {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 24px 22px 20px;
	box-shadow: var(--shadow);
}

.stat .num {
	font-family: var(--font-display);
	font-size: clamp(2.2rem, 4vw, 3rem);
	font-weight: 600;
	letter-spacing: -0.03em;
	line-height: 1;
	color: var(--accent);
	font-variant-numeric: tabular-nums;
}

.stat .num small {
	font-size: 0.5em;
	vertical-align: super;
	margin-left: 2px;
}

.stat .label {
	margin-top: 10px;
	font-size: 0.9rem;
	color: var(--text-secondary);
	line-height: 1.4;
}

/* ---------- Timeline ---------- */
.timeline {
	list-style: none;
	position: relative;
	padding-left: 36px;
}

.timeline::before {
	content: "";
	position: absolute;
	left: 9px;
	top: 6px;
	bottom: 6px;
	width: 2px;
	background: linear-gradient(var(--border), var(--accent) 30%, var(--gold) 70%, var(--border));
}

.event {
	position: relative;
	margin-bottom: 36px;
}

.event::before {
	content: "";
	position: absolute;
	left: -34px;
	top: 10px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--bg);
	border: 3px solid var(--accent);
	box-shadow: 0 0 0 4px var(--bg);
}

.event.honor::before { border-color: var(--gold); }

.event .when {
	font-family: var(--font-mono);
	font-size: 0.78rem;
	letter-spacing: 0.08em;
	color: var(--text-secondary);
	text-transform: uppercase;
}

.event h3 {
	font-size: 1.45rem;
	margin: 6px 0 10px;
}

.event p {
	color: var(--text-secondary);
	max-width: 640px;
}

.event .src {
	display: inline-block;
	margin: 10px 14px 0 0;
	font-family: var(--font-mono);
	font-size: 0.75rem;
	color: var(--text-secondary);
	text-decoration: none;
	border-bottom: 1px solid var(--border);
}
a.src:hover { color: var(--accent); border-color: var(--accent); }
.event .src.src { font-style: normal; }

.event.feature {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 28px;
	box-shadow: var(--shadow);
}
.event.feature::before { left: -62px; top: 38px; }
.event.feature p { max-width: none; }

/* ---------- Chapter: August 2011 ---------- */
.chapter {
	background: var(--hero-bg);
	color: var(--hero-text);
	position: relative;
	overflow: hidden;
}

.chapter::before {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse 55% 60% at 100% 100%, rgba(180, 35, 28, 0.35), transparent 70%);
	pointer-events: none;
}

.chapter .wrap { position: relative; }
.chapter .eyebrow { color: var(--gold); }
.chapter .section-head p { color: var(--hero-muted); }

.chapter-grid {
	display: grid;
	grid-template-columns: 1.1fr 0.9fr;
	gap: 48px;
	align-items: start;
}

.chapter-text p {
	color: var(--hero-text);
	margin-bottom: 18px;
	font-size: 1.08rem;
	line-height: 1.75;
}

.chapter-text p:last-child { margin-bottom: 0; }

.chapter .press {
	border-color: rgba(243, 236, 228, 0.14);
	background: rgba(255, 255, 255, 0.04);
	box-shadow: none;
}
.chapter .press .meta { color: var(--hero-muted); }
.chapter .press h3 { color: var(--hero-text); }
.chapter .press p { color: var(--hero-muted); }
.chapter .press a.read { color: var(--gold); }

.pull {
	font-family: var(--font-display);
	font-size: clamp(1.6rem, 3vw, 2.2rem);
	line-height: 1.3;
	font-weight: 500;
	margin: 0 0 14px;
	color: var(--hero-text);
}

.pull::before { content: "\201C"; color: var(--gold); }
.pull::after { content: "\201D"; color: var(--gold); }

.attrib {
	font-family: var(--font-mono);
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--hero-muted);
	margin-bottom: 34px;
}

/* ---------- Honors ---------- */
.honors {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 14px;
}

.honor {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 24px 22px;
	box-shadow: var(--shadow);
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.honor .badge {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--gold-soft);
	color: var(--gold);
	display: grid;
	place-items: center;
}
.honor .badge svg { width: 22px; height: 22px; }

.honor h3 { font-size: 1.15rem; }
.honor p { font-size: 0.92rem; color: var(--text-secondary); }

.honor .count {
	font-family: var(--font-display);
	font-size: 2rem;
	color: var(--gold);
	line-height: 1;
}

/* ---------- Press cards ---------- */
.press-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 14px;
}

.press {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 22px;
	box-shadow: var(--shadow);
}

.press .meta {
	font-family: var(--font-mono);
	font-size: 0.72rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--text-secondary);
	display: flex;
	justify-content: space-between;
	gap: 8px;
	flex-wrap: wrap;
}

.press h3 { font-size: 1.15rem; margin: 10px 0 8px; }
.press p { font-size: 0.95rem; color: var(--text-secondary); }

.press a.read {
	display: inline-block;
	margin-top: 12px;
	font-family: var(--font-mono);
	font-size: 0.78rem;
	text-decoration: none;
}
.press a.read::after { content: " \2192"; }
.press a.read:hover { text-decoration: underline; }

/* ---------- Voices ---------- */
.voices {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 14px;
}

.voice {
	background: var(--surface);
	border: 1px solid var(--border);
	border-left: 4px solid var(--accent);
	border-radius: var(--radius);
	padding: 26px 24px;
	box-shadow: var(--shadow);
}

.voice blockquote {
	font-family: var(--font-display);
	font-size: 1.35rem;
	line-height: 1.4;
}

.voice figcaption {
	margin-top: 14px;
	font-family: var(--font-mono);
	font-size: 0.74rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--text-secondary);
}

.voice.wide { grid-column: 1 / -1; }

/* ---------- Gallery ---------- */
.gallery {
	columns: 3 260px;
	column-gap: 14px;
}

.gallery figure {
	break-inside: avoid;
	margin: 0 0 14px;
	border-radius: var(--radius);
	overflow: hidden;
	border: 1px solid var(--border);
	background: var(--surface);
	position: relative;
}

.gallery button {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: zoom-in;
}

.gallery img {
	width: 100%;
	transition: transform 0.4s ease;
}

.gallery button:hover img, .gallery button:focus-visible img { transform: scale(1.03); }
.gallery button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.gallery figcaption {
	padding: 10px 14px;
	font-size: 0.82rem;
	color: var(--text-secondary);
}

.gallery-note {
	margin-top: 18px;
	font-size: 0.9rem;
	color: var(--text-secondary);
}

/* ---------- Lightbox ---------- */
#lightbox {
	position: fixed;
	inset: 0;
	background: rgba(10, 8, 7, 0.92);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	z-index: 40;
}
#lightbox[hidden] { display: none; }

#lightbox figure {
	max-width: min(1200px, 100%);
	max-height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}

#lightbox img {
	max-width: 100%;
	max-height: calc(100vh - 110px);
	object-fit: contain;
	border-radius: 6px;
}

#lightbox figcaption {
	color: var(--hero-muted);
	font-size: 0.9rem;
	text-align: center;
}

#lightbox button {
	position: absolute;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.18);
	color: var(--hero-text);
	border-radius: 999px;
	width: 44px;
	height: 44px;
	cursor: pointer;
	font-size: 1.3rem;
	line-height: 1;
	display: grid;
	place-items: center;
}
#lightbox button:hover, #lightbox button:focus-visible { background: rgba(255, 255, 255, 0.18); outline: none; border-color: var(--gold); }
#lb-close { top: 16px; right: 16px; }
#lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
#lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

/* ---------- Footer ---------- */
footer {
	border-top: 1px solid var(--border);
	padding: 40px 0 48px;
	color: var(--text-secondary);
	font-size: 0.9rem;
}

footer .wrap {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 12px;
}

footer a { color: var(--text-primary); text-decoration: none; border-bottom: 1px solid var(--border); }
footer a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Motion ---------- */
.reveal {
	opacity: 0;
	transform: translateY(18px);
	transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.reveal { opacity: 1; transform: none; transition: none; }
	.gallery img { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
	.stats .wrap { grid-template-columns: repeat(2, 1fr); }
	.honors { grid-template-columns: repeat(2, 1fr); }
	.chapter-grid { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 720px) {
	.section { padding: 64px 0; }
	.hero { min-height: auto; padding: 90px 0 60px; }
	.hero .wrap { grid-template-columns: 1fr; gap: 36px; }
	.portrait { max-width: 320px; margin: 0 auto; transform: none; }
	.hero-cross { width: 80vw; right: -20%; bottom: -8%; }
	.stats { margin-top: -30px; }
	.press-grid, .voices { grid-template-columns: 1fr; }
	.event.feature { padding: 20px; }
	.event.feature::before { left: -54px; top: 30px; }
}

@media (max-width: 480px) {
	.stats .wrap { grid-template-columns: 1fr 1fr; gap: 10px; }
	.stat { padding: 18px 16px 16px; }
	.honors { grid-template-columns: 1fr; }
	.timeline { padding-left: 28px; }
	.event::before { left: -26px; }
	.event.feature::before { left: -46px; }
}

/* ---------- Dark theme ---------- */
.darkmode {
	color-scheme: dark;
	--bg: #0e0c0b;
	--surface: #181412;
	--text-primary: #efe9e2;
	--text-secondary: #a39a91;
	--border: #2b2521;
	--accent: #ff6b5f;
	--accent-soft: rgba(255, 107, 95, 0.1);
	--gold: #e2b64a;
	--gold-soft: rgba(226, 182, 74, 0.12);
	--hero-bg: #0a0807;
	--shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
}

.darkmode ::selection { background: var(--gold); color: #0e0c0b; }

/* ---------- Lesson page (digital-intubation.html) ---------- */
.lesson { padding: 90px 0 60px; }
.lesson .wrap { max-width: 900px; }
.lesson .crumbs { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 28px; }
.lesson .crumbs a { color: var(--text-secondary); text-decoration: none; }
.lesson .crumbs a:hover { color: var(--accent); }
.lesson .crumbs span { padding: 0 8px; }
.lesson h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin: 10px 0 18px; }
.lesson .lede { font-size: 1.12rem; line-height: 1.75; max-width: 680px; }
.lesson .note {
	margin-top: 22px;
	padding: 12px 16px;
	border-left: 3px solid var(--gold);
	background: var(--gold-soft);
	font-size: 0.9rem;
	color: var(--text-secondary);
	border-radius: 0 6px 6px 0;
}
.lesson-section { margin-top: 64px; }
.lesson-section h2 { margin-bottom: 14px; }
.lesson-section > p { color: var(--text-secondary); max-width: 680px; }
.lesson-page #theme-toggle { color: var(--text-secondary); background: var(--surface); border-color: var(--border); }

.diagram {
	margin: 24px 0 0;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 16px;
	box-shadow: var(--shadow);
}
.diagram svg { width: 100%; height: auto; display: block; }
.diagram figcaption { margin-top: 12px; font-size: 0.88rem; color: var(--text-secondary); }

/* Anatomy fills. Muted, printable, tokens only. No .diagram prefix: these elements are
   cloned through <use> from the hidden defs svg and keep that context for selectors. */
.skin { fill: var(--anat-skin); stroke: var(--anat-line); stroke-width: 1.5; }
.cavity { fill: var(--anat-cavity); stroke: var(--anat-line); stroke-width: 1; }
.bone { fill: var(--anat-bone); stroke: var(--anat-line); stroke-width: 1; }
.tissue { fill: var(--anat-tissue); stroke: var(--anat-line); stroke-width: 1; }
.tongue { fill: var(--anat-tongue); stroke: var(--anat-line); stroke-width: 1.5; }
.epiglottis { fill: var(--anat-cartilage); stroke: var(--anat-line); stroke-width: 1.5; }
.airway { fill: var(--anat-cavity); stroke: var(--anat-line); stroke-width: 1.5; }
.cords { fill: none; stroke: var(--anat-line); stroke-width: 2; stroke-linecap: round; }
.rings { fill: none; stroke: var(--anat-line); stroke-width: 1; opacity: 0.6; }
.glove { fill: var(--anat-glove); stroke: var(--anat-glove-line); stroke-width: 1.5; }
.tube { fill: none; stroke: var(--anat-tube); stroke-width: 11; stroke-linecap: round; opacity: 0.92; }
.tube-stylet { fill: none; stroke: var(--text-primary); stroke-width: 1.5; stroke-dasharray: 4 4; opacity: 0.6; }
.tube-cuff { fill: var(--anat-tube); opacity: 0.45; }
.bite-block { fill: var(--anat-bone); stroke: var(--anat-line); }
.diagram .labels text { font-family: var(--font-mono); font-size: 13px; fill: var(--text-primary); }
.diagram .labels line, .diagram .labels .arrow { stroke: var(--accent); stroke-width: 1.5; fill: none; }
.diagram .labels .arrow { marker-end: none; stroke-width: 2.5; }
.diagram .capno rect { fill: var(--hero-bg); stroke: var(--border); }
.diagram .capno path { fill: none; stroke: #4ade80; stroke-width: 2.5; stroke-linejoin: round; }
.diagram .capno text { font-family: var(--font-mono); font-size: 12px; fill: #b9aea4; }

:root {
	--anat-skin: #f3dccb;
	--anat-cavity: #faf3ea;
	--anat-bone: #ece2cf;
	--anat-tissue: #e2a596;
	--anat-tongue: #d97f7a;
	--anat-cartilage: #c9b88a;
	--anat-line: #5b4a42;
	--anat-glove: #8fb7d9;
	--anat-glove-line: #3f6a8e;
	--anat-tube: #2f6f9f;
}
.darkmode {
	--anat-skin: #4a3a33;
	--anat-cavity: #1e1816;
	--anat-bone: #5a5043;
	--anat-tissue: #9a5a50;
	--anat-tongue: #a85a56;
	--anat-cartilage: #8a7a52;
	--anat-line: #d8c9bd;
	--anat-glove: #5d8fb8;
	--anat-glove-line: #a9d0ee;
	--anat-tube: #7fb6e0;
}

.lesson-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 14px;
	margin-top: 20px;
}
.lesson-card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 20px;
	box-shadow: var(--shadow);
}
.lesson-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.lesson-card p { font-size: 0.95rem; color: var(--text-secondary); }

.steps { list-style: none; margin-top: 10px; }
.step {
	display: grid;
	grid-template-columns: 1.1fr 0.9fr;
	gap: 24px;
	align-items: center;
	padding: 28px 0;
	border-bottom: 1px solid var(--border);
}
.step:last-child { border-bottom: 0; }
.step .diagram { margin: 0; }
.step-num {
	font-family: var(--font-display);
	font-size: 2.6rem;
	line-height: 1;
	color: var(--accent);
}
.step-text h3 { font-size: 1.4rem; margin: 6px 0 10px; }
.step-text p { color: var(--text-secondary); }
.lesson-foot { margin-top: 22px; font-size: 0.9rem; color: var(--text-secondary); }
.back { margin-top: 48px; font-family: var(--font-mono); font-size: 0.85rem; }
.back a { text-decoration: none; }
.back a::before { content: "\2190 "; }

@media (max-width: 720px) {
	.step { grid-template-columns: 1fr; gap: 14px; }
	.lesson-grid { grid-template-columns: 1fr; }
	.lesson { padding-top: 70px; }
}
.defs-only { position: absolute; }

/* ---------- Clippings page ---------- */
.clips { columns: 2 320px; }
.clips .clip figcaption { padding: 14px 16px 16px; }
.clips .clip .when { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.clips .clip h3 { font-size: 1.35rem; margin: 4px 0 6px; }
.clips .clip .sub { font-family: var(--font-display); font-style: italic; color: var(--text-primary); font-size: 0.98rem; }
.clips .clip .note { margin-top: 8px; font-size: 0.88rem; }
.clips .clip .byline { margin-top: 8px; font-size: 0.78rem; font-family: var(--font-mono); }
.clips .clip .byline a { color: var(--accent); text-decoration: none; }
.clips .clip .byline a:hover { text-decoration: underline; }
.clips img { background: #fff; }
.page-index { list-style: none; margin-top: 20px; columns: 3 220px; column-gap: 24px; }
.page-index .year { break-inside: avoid; margin-bottom: 18px; }
.page-index .y { font-family: var(--font-display); font-size: 1.3rem; color: var(--accent); display: block; margin-bottom: 4px; }
.page-index ul { list-style: none; }
.page-index li li { font-size: 0.86rem; line-height: 1.7; padding-left: 14px; position: relative; }
.page-index li li a { color: var(--text-secondary); text-decoration: none; border-bottom: 1px solid var(--border); }
.page-index li li a:hover { color: var(--accent); border-color: var(--accent); }
.page-index li.has-clip::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.page-index li.has-clip a { color: var(--text-primary); }

/* ---------- Page grid on the clippings page ---------- */
.page-grid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 18px; }
.page-grid li { min-width: 0; }
.page-grid button { display: block; width: 100%; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: #fff; cursor: zoom-in; overflow: hidden; box-shadow: var(--shadow); }
.page-grid button img { width: 100%; display: block; transition: transform 0.3s ease; }
.page-grid button:hover img, .page-grid button:focus-visible img { transform: scale(1.03); }
.page-grid button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.page-grid .cap { margin-top: 6px; font-size: 0.78rem; line-height: 1.4; color: var(--text-secondary); }
.page-grid .cap b { display: block; color: var(--text-primary); font-weight: 600; }
.page-grid .cap a { color: var(--text-secondary); text-decoration: none; border-bottom: 1px solid var(--border); }
.page-grid .cap a:hover { color: var(--accent); border-color: var(--accent); }
.page-grid li.pending .ph { aspect-ratio: 11 / 17; border: 1px dashed var(--border); border-radius: 6px; display: grid; place-items: center; font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-secondary); text-align: center; padding: 10px; }
.page-grid li.has-clip .cap b::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); margin-right: 6px; vertical-align: middle; }
.year-head { font-family: var(--font-display); font-size: 1.6rem; color: var(--accent); margin: 36px 0 0; }
#lightbox figcaption a { color: var(--gold); text-decoration: none; margin: 0 8px; }
#lightbox figcaption a:hover { text-decoration: underline; }

/* ---------- Scroll story: a sticky desk with the real pages ---------- */
.story { position: relative; }
.story .wrap { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: start; }
.story-stage {
	position: sticky;
	top: 0;
	z-index: 2;
	height: 100vh;
	display: block;
	overflow: hidden;
	background: var(--desk);
	border-radius: 0 0 var(--radius) var(--radius);
	perspective: 1600px;
}
/* a warm pool of light on the desk and the grain of old newsprint */
.story-stage::before {
	content: "";
	position: absolute;
	inset: 0;
	background:
		radial-gradient(ellipse 70% 60% at 50% 40%, rgba(255, 236, 200, 0.18), transparent 70%),
		radial-gradient(ellipse 50% 40% at 85% 95%, rgba(180, 35, 28, 0.16), transparent 70%);
	pointer-events: none;
	z-index: 0;
}
.sheet {
	position: absolute;
	inset: 0;
	transform-origin: left center;
	transform-style: preserve-3d;
	z-index: 1;
	opacity: 0;
	transition: opacity 0.5s ease;
}
.sheet.front { opacity: 1; z-index: 2; }
.sheet.behind { opacity: 0; z-index: 1; }
.sheet img {
	position: absolute;
	left: 0;
	top: 0;
	transform-origin: 0 0;
	will-change: transform;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.4);
	background: #f4efe6;
	max-width: none;
}
@keyframes page-turn {
	0% { transform: rotateY(-75deg); opacity: 0; }
	40% { opacity: 1; }
	100% { transform: rotateY(0deg); opacity: 1; }
}
.sheet.turn { animation: page-turn 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.stage-card {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: grid;
	place-items: center;
	text-align: center;
	padding: 40px;
	color: var(--hero-text);
	opacity: 0;
	transition: opacity 0.5s ease;
	pointer-events: none;
}
.stage-card.on { opacity: 1; }
.stage-card-text {
	font-family: var(--font-display);
	font-size: clamp(4rem, 14vw, 11rem);
	line-height: 0.95;
	letter-spacing: -0.04em;
	color: var(--hero-text);
}
.stage-card-sub {
	margin-top: 18px;
	font-family: var(--font-mono);
	font-size: 0.8rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--gold);
}
.beats { list-style: none; padding: 20vh 0 30vh; position: relative; z-index: 1; }
.beat {
	min-height: 90vh;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 24px 0;
	opacity: 0.35;
	transition: opacity 0.4s ease;
}
.beat.active { opacity: 1; }
.beat .when {
	font-family: var(--font-mono);
	font-size: 0.78rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--accent);
}
.beat h3 { font-size: clamp(1.7rem, 3vw, 2.4rem); margin: 8px 0 14px; }
.beat p { color: var(--text-secondary); font-size: 1.05rem; line-height: 1.75; }
.beat .src { display: inline-block; margin: 12px 14px 0 0; font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-secondary); text-decoration: none; border-bottom: 1px solid var(--border); }
.beat a.src:hover { color: var(--accent); border-color: var(--accent); }
.beat.honor .when { color: var(--gold); }
.story-note { font-size: 0.85rem; color: var(--text-secondary); font-family: var(--font-mono); margin-top: -10vh; padding-bottom: 40px; }

:root { --desk: #1a1411; }
.darkmode { --desk: #0d0a09; }

@media (max-width: 900px) {
	.story .wrap { grid-template-columns: 1fr; gap: 0; }
	.story-stage { height: 52vh; border-radius: 0 0 var(--radius) var(--radius); }
	.beats { padding: 6vh 0 20vh; }
	.beat { min-height: 60vh; padding: 20px 0; }
	.beat p { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
	.sheet.turn { animation: none; }
	.beat { opacity: 1; }
}
