/* ==========================================================================
   LITTERMATE
   Warm archival editorial. Hairlines, no shadows, no radius, one cold accent.
   ========================================================================== */

/* --- Tokens --------------------------------------------------------------- */

:root {
	--ink: #14161A;
	--paper: #FAF8F4;
	--vellum: #F0EBE1;
	--rule: #D8D1C4;
	--graphite: #5A6067;
	--cobalt: #1F4B8F;
	--cobalt-deep: #17376A;

	--font-display: "Fraunces", Georgia, "Times New Roman", serif;
	--font-body: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

	--fs-hero: clamp(2.75rem, 1.4rem + 5.4vw, 5rem);
	--fs-page: clamp(2.1rem, 1.2rem + 3.6vw, 3.5rem);
	--fs-lead: clamp(1.85rem, 1.15rem + 2.7vw, 2.9rem);
	--fs-h2: clamp(1.5rem, 1.1rem + 1.5vw, 2.05rem);
	--fs-h3: clamp(1.18rem, 1rem + 0.6vw, 1.4rem);
	--fs-body: 1.0625rem;
	--fs-prose: 1.125rem;
	--fs-small: 0.9375rem;
	--fs-mono: 0.72rem;
	--fs-mono-sm: 0.66rem;

	--lh-display: 1.06;
	--lh-prose: 1.72;

	--measure: 68ch;
	--frame: 1180px;
	--frame-wide: 1440px;

	--sp-1: 6px;
	--sp-2: 12px;
	--sp-3: 24px;
	--sp-4: 48px;
	--sp-5: 96px;
	--gutter: 20px;
}

@media (min-width: 640px) {
	:root { --gutter: 32px; }
}

@media (min-width: 900px) {
	:root { --gutter: 48px; }
}

/* --- Reset ---------------------------------------------------------------- */

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

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

:where(body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ol, ul) {
	margin: 0;
	padding: 0;
}

:where(ul, ol) { list-style: none; }

:where(img, svg, video) { display: block; max-width: 100%; height: auto; }

:where(button, input, select, textarea) { font: inherit; color: inherit; }

:where(blockquote, figure) { border: 0; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
	}
}

body {
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: var(--fs-body);
	font-weight: 400;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/* --- Layout --------------------------------------------------------------- */

.wrap {
	width: 100%;
	max-width: var(--frame);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.wrap--wide { max-width: var(--frame-wide); }

.wrap--prose { max-width: calc(var(--measure) + (var(--gutter) * 2)); }

.section { padding-block: clamp(48px, 7vw, 96px); }

.section--tight { padding-block: clamp(36px, 4.5vw, 60px); }

.band { background: var(--vellum); }

.band--ruled {
	border-block: 1px solid var(--rule);
}

.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }

.rule--heavy { border-top-color: var(--ink); }

/* --- Type ----------------------------------------------------------------- */

.h-hero, .h-page, .h-lead, .h2, .h3 {
	font-family: var(--font-display);
	font-variation-settings: "SOFT" 28, "WONK" 0, "opsz" 96;
	font-weight: 600;
	line-height: var(--lh-display);
	letter-spacing: -0.015em;
	text-wrap: balance;
}

.h-hero { font-size: var(--fs-hero); letter-spacing: -0.028em; }
.h-page { font-size: var(--fs-page); letter-spacing: -0.022em; }
.h-lead { font-size: var(--fs-lead); letter-spacing: -0.02em; line-height: 1.08; }
.h2 { font-size: var(--fs-h2); line-height: 1.14; }
.h3 { font-size: var(--fs-h3); line-height: 1.2; letter-spacing: -0.01em; }

.h-entry {
	font-family: var(--font-display);
	font-variation-settings: "SOFT" 28, "opsz" 40;
	font-weight: 600;
	font-size: 1.28rem;
	line-height: 1.22;
	letter-spacing: -0.014em;
	text-wrap: balance;
}

.kicker {
	font-family: var(--font-mono);
	font-size: var(--fs-mono);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.16em;
	color: var(--graphite);
	margin: 0 0 var(--sp-2);
}

.kicker--cobalt { color: var(--cobalt); }

.mono {
	font-family: var(--font-mono);
	font-size: var(--fs-mono);
	color: var(--graphite);
	letter-spacing: 0.01em;
}

.standfirst {
	font-family: var(--font-display);
	font-variation-settings: "SOFT" 40, "opsz" 30;
	font-style: italic;
	font-weight: 400;
	font-size: clamp(1.125rem, 0.95rem + 0.75vw, 1.45rem);
	line-height: 1.42;
	color: var(--ink);
	max-width: 56ch;
	padding-bottom: 0.12em;
}

.standfirst--muted { color: var(--graphite); }

.prose {
	font-size: var(--fs-prose);
	line-height: var(--lh-prose);
	max-width: var(--measure);
}

.prose p + p { margin-top: 1.35em; }
.prose > * + .h2 { margin-top: 2.2em; }
.prose .h2 + p { margin-top: 0.85em; }
.prose > * + .h3 { margin-top: 1.9em; }
.prose .h3 + p { margin-top: 0.7em; }

.prose ul, .prose ol { margin-top: 1.2em; }
.prose li { position: relative; padding-left: 1.4em; margin-bottom: 0.7em; }
.prose ul > li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.82em;
	width: 8px;
	height: 1px;
	background: var(--cobalt);
}
.prose ol { counter-reset: lm; }
.prose ol > li { counter-increment: lm; }
.prose ol > li::before {
	content: counter(lm, decimal-leading-zero);
	position: absolute;
	left: 0;
	top: 0.28em;
	font-family: var(--font-mono);
	font-size: var(--fs-mono-sm);
	color: var(--cobalt);
}

.prose strong { font-weight: 600; }

.dropcap::first-letter {
	font-family: var(--font-display);
	font-variation-settings: "SOFT" 20, "opsz" 144;
	font-weight: 600;
	float: left;
	font-size: 4.1em;
	line-height: 0.78;
	padding: 0.06em 0.11em 0 0;
	color: var(--ink);
}

/* --- Links ---------------------------------------------------------------- */

a { color: var(--cobalt); text-decoration: none; }

.prose a,
a.link {
	color: var(--cobalt);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
	text-decoration-color: var(--rule);
	transition: text-decoration-color 120ms linear, color 120ms linear;
}

.prose a:hover,
a.link:hover { text-decoration-color: var(--cobalt); color: var(--cobalt-deep); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
	outline: 2px solid var(--cobalt);
	outline-offset: 3px;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 200;
	background: var(--ink);
	color: var(--paper);
	padding: 12px 18px;
	font-family: var(--font-mono);
	font-size: var(--fs-mono);
	text-transform: uppercase;
	letter-spacing: 0.14em;
}

.skip-link:focus { left: 0; }

/* --- Buttons -------------------------------------------------------------- */

.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }

.btn {
	display: inline-block;
	font-family: var(--font-body);
	font-size: 0.95rem;
	font-weight: 500;
	letter-spacing: 0.01em;
	padding: 13px 22px;
	border-radius: 0;
	border: 1px solid var(--ink);
	transition: background-color 120ms linear, color 120ms linear;
}

.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: var(--cobalt); border-color: var(--cobalt); }

.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }

.textlink {
	font-size: 0.95rem;
	color: var(--cobalt);
	border-bottom: 1px solid var(--rule);
	padding-bottom: 2px;
}

.textlink:hover { border-bottom-color: var(--cobalt); }

/* --- Masthead / nav ------------------------------------------------------- */

.masthead {
	border-bottom: 1px solid var(--rule);
	background: var(--paper);
}

.masthead__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--sp-3);
	padding-block: 16px;
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); }

.brand__mark { flex: 0 0 auto; }

.brand__word {
	font-family: var(--font-display);
	font-variation-settings: "SOFT" 20, "opsz" 60;
	font-weight: 600;
	font-size: 1.06rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	line-height: 1;
}

.nav__list { display: flex; flex-wrap: wrap; gap: 4px 22px; align-items: center; }

.nav__link {
	display: inline-block;
	font-family: var(--font-mono);
	font-size: var(--fs-mono);
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var(--graphite);
	padding: 6px 0;
	border-bottom: 1px solid transparent;
}

.nav__link:hover { color: var(--ink); }

.nav__link[aria-current="page"] {
	color: var(--cobalt);
	border-bottom-color: var(--cobalt);
}

@media (max-width: 639px) {
	.masthead__inner { flex-direction: column; align-items: flex-start; gap: 14px; }
	.nav__list { gap: 2px 18px; }
}

/* --- Standing note -------------------------------------------------------- */

.notebar {
	border-bottom: 1px solid var(--rule);
	background: var(--vellum);
}

.notebar__text {
	font-family: var(--font-mono);
	font-size: var(--fs-mono-sm);
	line-height: 1.7;
	letter-spacing: 0.05em;
	color: var(--graphite);
	padding-block: 11px;
	text-transform: uppercase;
}

.notebar--inline {
	border: 1px solid var(--rule);
	background: var(--vellum);
	padding: 14px 18px;
	margin-block: var(--sp-3);
}

.notebar--inline .notebar__text { padding-block: 0; }

/* --- Image plates --------------------------------------------------------- */

.plate {
	position: relative;
	display: block;
	width: 100%;
	min-width: 0;
	background: var(--vellum);
	overflow: hidden;
	border-radius: 0;
}

.plate img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: grayscale(1) sepia(0.24) contrast(1.05) brightness(1.03) saturate(0.85);
}

.plate::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--cobalt);
	mix-blend-mode: multiply;
	opacity: 0.09;
	pointer-events: none;
}

.plate::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
	background: var(--vellum);
	mix-blend-mode: screen;
	opacity: 0.16;
	pointer-events: none;
}

.plate--3x2 { aspect-ratio: 3 / 2; }
.plate--4x3 { aspect-ratio: 4 / 3; }
.plate--16x9 { aspect-ratio: 16 / 9; }
.plate--21x9 { aspect-ratio: 21 / 9; }
.plate--1x1 { aspect-ratio: 1 / 1; }

@media (max-width: 639px) {
	.plate--21x9 { aspect-ratio: 16 / 10; }
}

figure.figure { margin: 0; }

.figure__caption {
	font-family: var(--font-mono);
	font-size: var(--fs-mono-sm);
	line-height: 1.65;
	color: var(--graphite);
	margin-top: 10px;
	padding-top: 9px;
	border-top: 1px solid var(--rule);
	max-width: 62ch;
}

.figure__credit { display: block; margin-top: 4px; opacity: 0.72; }

/* --- Byline --------------------------------------------------------------- */

.byline { display: flex; align-items: flex-start; gap: 14px; }

.byline__mark {
	flex: 0 0 auto;
	width: 46px;
	height: 46px;
	border: 1px solid var(--rule);
	background: var(--vellum);
	display: grid;
	place-items: center;
	font-family: var(--font-display);
	font-variation-settings: "SOFT" 20, "opsz" 60;
	font-weight: 600;
	font-size: 0.95rem;
	letter-spacing: 0.02em;
	color: var(--ink);
}

.byline__mark--sm { width: 34px; height: 34px; font-size: 0.76rem; }

.byline__meta { min-width: 0; }

.byline__name {
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--ink);
	line-height: 1.4;
}

.byline__role,
.byline__date {
	font-family: var(--font-mono);
	font-size: var(--fs-mono-sm);
	color: var(--graphite);
	line-height: 1.7;
}

.byline__note {
	font-style: italic;
	font-size: 0.86rem;
	color: var(--graphite);
	margin-top: 6px;
	line-height: 1.5;
}

/* --- Entry lists ---------------------------------------------------------- */

.grid { display: grid; gap: var(--sp-4) var(--sp-3); }

.entry { display: flex; flex-direction: column; gap: 14px; }

.entry__tag {
	font-family: var(--font-mono);
	font-size: var(--fs-mono-sm);
	text-transform: uppercase;
	letter-spacing: 0.15em;
	color: var(--cobalt);
}

.entry__excerpt { font-size: var(--fs-small); line-height: 1.62; color: var(--graphite); }

.entry__foot {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	padding-top: 12px;
	border-top: 1px solid var(--rule);
	margin-top: auto;
}

a.entry__title-link { color: var(--ink); }
a.entry__title-link:hover { color: var(--cobalt); }

.entry--ruled { padding-top: var(--sp-3); border-top: 1px solid var(--rule); }

/* --- Pull quote ----------------------------------------------------------- */

.pullquote {
	background: var(--vellum);
	border-block: 1px solid var(--rule);
	padding-block: clamp(48px, 6vw, 84px);
}

.pullquote__text {
	font-family: var(--font-display);
	font-variation-settings: "SOFT" 46, "opsz" 120;
	font-style: italic;
	font-weight: 400;
	font-size: clamp(1.55rem, 0.95rem + 2.4vw, 2.65rem);
	line-height: 1.28;
	letter-spacing: -0.012em;
	max-width: 22ch;
	padding-bottom: 0.1em;
}

.pullquote__text--wide { max-width: 26ch; }

.pullquote__attr {
	font-family: var(--font-mono);
	font-size: var(--fs-mono);
	text-transform: uppercase;
	letter-spacing: 0.15em;
	color: var(--graphite);
	margin-top: var(--sp-3);
	padding-top: var(--sp-2);
	border-top: 1px solid var(--rule);
	display: inline-block;
}

/* --- Evidence snapshot ---------------------------------------------------- */

.snapshot {
	border: 1px solid var(--rule);
	background: var(--paper);
	margin-top: var(--sp-3);
}

.snapshot__head {
	font-family: var(--font-mono);
	font-size: var(--fs-mono-sm);
	text-transform: uppercase;
	letter-spacing: 0.16em;
	color: var(--ink);
	padding: 11px 16px;
	border-bottom: 1px solid var(--rule);
	background: var(--vellum);
}

.snapshot__row {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2px;
	padding: 11px 16px;
	border-bottom: 1px solid var(--rule);
	font-family: var(--font-mono);
	font-size: var(--fs-mono-sm);
	line-height: 1.6;
}

.snapshot__row:last-child { border-bottom: 0; }

.snapshot__label { color: var(--graphite); text-transform: uppercase; letter-spacing: 0.13em; }
.snapshot__value { color: var(--ink); }

@media (min-width: 640px) {
	.snapshot__row { grid-template-columns: 190px minmax(0, 1fr); gap: 16px; align-items: baseline; }
}

/* --- Marginal notes ------------------------------------------------------- */

.marginal {
	font-family: var(--font-mono);
	font-size: var(--fs-mono-sm);
	line-height: 1.72;
	color: var(--graphite);
	border-top: 1px solid var(--rule);
	padding-top: 10px;
	margin-block: var(--sp-3);
	max-width: 46ch;
}

/* --- Footnote markers ----------------------------------------------------- */

.fnref {
	font-family: var(--font-mono);
	font-size: 0.62em;
	vertical-align: super;
	line-height: 0;
	color: var(--cobalt);
	text-decoration: none;
	padding-inline: 1px;
}

.fnref:hover { text-decoration: underline; }

.refs { counter-reset: ref; }
.refs li {
	position: relative;
	padding-left: 2.4em;
	margin-bottom: 1em;
	font-size: var(--fs-small);
	line-height: 1.62;
	color: var(--graphite);
}
.refs li::before {
	counter-increment: ref;
	content: counter(ref);
	position: absolute;
	left: 0;
	top: 0.28em;
	font-family: var(--font-mono);
	font-size: var(--fs-mono-sm);
	color: var(--cobalt);
}

:target { scroll-margin-top: 90px; }

/* --- Progress bar --------------------------------------------------------- */

.progress {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 2px;
	z-index: 150;
	background: transparent;
	pointer-events: none;
}

.progress__fill {
	height: 100%;
	width: 0;
	background: var(--cobalt);
	transform-origin: 0 50%;
}

/* --- Forms ---------------------------------------------------------------- */

.signup { display: grid; gap: 12px; max-width: 460px; }

.signup__label {
	font-family: var(--font-mono);
	font-size: var(--fs-mono-sm);
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var(--graphite);
}

.signup__controls { display: flex; flex-wrap: wrap; gap: 10px; }

.signup__input {
	flex: 1 1 220px;
	min-width: 0;
	background: var(--paper);
	border: 1px solid var(--rule);
	border-radius: 0;
	padding: 12px 14px;
	font-size: 0.98rem;
	color: var(--ink);
}

.signup__input::placeholder { color: var(--graphite); opacity: 0.75; }
.signup__input:focus { border-color: var(--cobalt); }

.signup__hint { font-size: 0.86rem; color: var(--graphite); line-height: 1.55; }

.signup--compact { max-width: 420px; }
.signup--compact .signup__hint { display: none; }

.signup__status {
	font-family: var(--font-mono);
	font-size: var(--fs-mono-sm);
	color: var(--cobalt);
	line-height: 1.7;
}

/* --- Table of contents ---------------------------------------------------- */

.toc__title {
	font-family: var(--font-mono);
	font-size: var(--fs-mono-sm);
	text-transform: uppercase;
	letter-spacing: 0.16em;
	color: var(--graphite);
	padding-bottom: 10px;
	border-bottom: 1px solid var(--ink);
	margin-bottom: 12px;
}

.toc__list li { border-bottom: 1px solid var(--rule); }

.toc__link {
	display: flex;
	gap: 10px;
	align-items: baseline;
	padding: 9px 0;
	color: var(--ink);
	font-size: 0.92rem;
	line-height: 1.4;
}

.toc__link:hover { color: var(--cobalt); }

.toc__num {
	font-family: var(--font-mono);
	font-size: var(--fs-mono-sm);
	color: var(--cobalt);
	flex: 0 0 auto;
}

/* --- Section marker ------------------------------------------------------- */

.marker {
	font-family: var(--font-mono);
	font-size: var(--fs-mono-sm);
	color: var(--cobalt);
	letter-spacing: 0.1em;
}

/* --- Footer --------------------------------------------------------------- */

.footer {
	border-top: 1px solid var(--ink);
	background: var(--paper);
	padding-block: clamp(44px, 5vw, 72px) 36px;
}

.footer__top {
	display: grid;
	gap: var(--sp-4);
	padding-bottom: var(--sp-4);
	border-bottom: 1px solid var(--rule);
}

.footer__cols { display: grid; gap: var(--sp-4) var(--sp-3); }

.footer__heading {
	font-family: var(--font-mono);
	font-size: var(--fs-mono-sm);
	text-transform: uppercase;
	letter-spacing: 0.16em;
	color: var(--ink);
	padding-bottom: 10px;
	border-bottom: 1px solid var(--rule);
	margin-bottom: 12px;
}

.footer__list li { margin-bottom: 7px; }

.footer__list a,
.footer__list span {
	font-size: 0.9rem;
	line-height: 1.55;
	color: var(--graphite);
}

.footer__list a:hover { color: var(--cobalt); }

.footer__tagline {
	font-family: var(--font-display);
	font-variation-settings: "SOFT" 40, "opsz" 40;
	font-style: italic;
	font-size: 1.05rem;
	color: var(--graphite);
	margin-top: 12px;
	padding-bottom: 0.1em;
}

.footer__social { display: flex; gap: 14px; margin-top: 18px; }

.footer__social a {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border: 1px solid var(--rule);
	color: var(--graphite);
}

.footer__social a:hover { border-color: var(--ink); color: var(--ink); }

.footer__disclaimer {
	font-size: 0.86rem;
	line-height: 1.7;
	color: var(--graphite);
	max-width: 88ch;
	padding-block: var(--sp-3);
	border-bottom: 1px solid var(--rule);
}

.footer__legal {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 24px;
	justify-content: space-between;
	padding-top: 18px;
	font-family: var(--font-mono);
	font-size: var(--fs-mono-sm);
	color: var(--graphite);
	line-height: 1.7;
}

@media (min-width: 640px) {
	.footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
	.footer__cols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.footer__top { grid-template-columns: minmax(0, 1fr) minmax(0, 2.1fr); gap: var(--sp-5); }
}

/* --- Utilities ------------------------------------------------------------ */

.stack-1 > * + * { margin-top: var(--sp-1); }
.stack-2 > * + * { margin-top: var(--sp-2); }
.stack-3 > * + * { margin-top: var(--sp-3); }
.stack-4 > * + * { margin-top: var(--sp-4); }

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.muted { color: var(--graphite); }

.lede { font-size: 1.05rem; line-height: 1.68; color: var(--graphite); max-width: 60ch; }
