/* ==========================================================================
   endflock.org
   No JS, no inline styles — the CSP in site.py forbids both.
   All color goes through tokens. All decoration is gradient-based
   (CSP img-src is 'self', so data: URIs would be blocked).
   ========================================================================== */

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

:root {
	/* surfaces */
	--bg:         #08080a;
	--bg-glow:    #1a0407;
	--surface:    #121215;
	--surface-2:  #17171b;
	--border:     #26262b;
	--border-hot: #46181e;

	/* text — every foreground below meets WCAG AA on --bg */
	--text:     #d8d8dc;
	--text-hi:  #f2f2f4;
	--muted:    #8a8a94;   /* 5.9:1 */

	/* decorative only — never body copy */
	--dim:      #4e4e58;

	/* signal */
	--red:      #d21f2c;   /* structure: bars, borders, rules */
	--red-hot:  #ff3b3b;   /* large display numerals only */
	--red-link: #ff6b6b;   /* links + small text — 7.2:1 */
	--amber:    #f5a524;

	--sans:    'Inter', system-ui, -apple-system, sans-serif;
	--display: 'Archivo', 'Inter', system-ui, sans-serif;
	--mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

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

html {
	scroll-behavior: smooth;
}

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

body {
	background-color: var(--bg);
	color: var(--text);
	font-family: var(--sans);
	font-size: 16px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	/* red bleed behind the top of the page */
	background-image: radial-gradient(
		ellipse 90% 460px at 50% -70px,
		var(--bg-glow) 0%,
		transparent 70%
	);
	background-repeat: no-repeat;
}

/* ── hazard bar ── */

.hazard {
	height: 5px;
	background: repeating-linear-gradient(
		45deg,
		var(--red) 0px,
		var(--red) 11px,
		var(--bg)  11px,
		var(--bg)  22px
	);
}

/* ── skip link ── */

.skip {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--red);
	color: #fff;
	padding: 0.6rem 1rem;
	font-family: var(--mono);
	font-size: 0.78rem;
	z-index: 10;
}

.skip:focus {
	left: 0;
	text-decoration: none;
}

/* ── layout ── */

main {
	max-width: 720px;
	margin: 0 auto;
	padding: 3rem 1.5rem 5rem;
	display: flex;
	flex-direction: column;
	gap: 2rem;
}

/* ── hero ── */

.hero {
	padding-top: 0.5rem;
}

.hero-eyebrow {
	font-family: var(--mono);
	font-size: 0.7rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--red-link);
	margin-bottom: 1rem;
	display: flex;
	align-items: center;
	gap: 0.6rem;
}

.hero-eyebrow::before {
	content: '';
	width: 26px;
	height: 2px;
	background: var(--red);
	flex-shrink: 0;
}

.hero h1 {
	font-family: var(--display);
	font-size: clamp(2.1rem, 7vw, 3.15rem);
	font-weight: 800;
	line-height: 1.03;
	color: var(--text-hi);
	letter-spacing: -0.035em;
	margin-bottom: 0.75rem;
	text-wrap: balance;
}

.hero-sub {
	font-size: 1.05rem;
	color: var(--muted);
	margin-bottom: 1.25rem;
}

.hero-meta {
	font-size: 0.85rem;
	color: var(--muted);
	line-height: 1.65;
	border-left: 2px solid var(--border-hot);
	padding-left: 1rem;
}

/* ── nav ── */

.nav {
	position: sticky;
	top: 0;
	z-index: 5;
	background: rgba(8, 8, 10, 0.92);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--border);
	margin: 0 -1.5rem;
	padding: 0 1.5rem;
}

.nav ul {
	list-style: none;
	display: flex;
	gap: 1.35rem;
	overflow-x: auto;
	scrollbar-width: none;
	padding: 0.8rem 0;
}

.nav ul::-webkit-scrollbar {
	display: none;
}

.nav a {
	font-family: var(--mono);
	font-size: 0.73rem;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	color: var(--muted);
	text-decoration: none;
	white-space: nowrap;
	padding-bottom: 0.2rem;
	border-bottom: 2px solid transparent;
	transition: color 0.15s, border-color 0.15s;
}

.nav a:hover {
	color: var(--text-hi);
}

.nav a[aria-current="page"] {
	color: var(--red-link);
	border-bottom-color: var(--red);
}

/* ── sections ── */

section {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 4px;
	padding: 1.9rem 1.75rem;
	display: flex;
	flex-direction: column;
	gap: 0.95rem;
}

/* the one that should feel loudest */
section.alert {
	border-color: var(--border-hot);
	background: linear-gradient(180deg, #150a0c 0%, var(--surface) 100%);
}

section h2 {
	font-family: var(--mono);
	font-size: 0.7rem;
	font-weight: 500;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--red-link);
	margin-bottom: 0.35rem;
	display: flex;
	align-items: center;
	gap: 0.55rem;
}

section h2::before {
	content: '';
	width: 3px;
	height: 13px;
	background: var(--red);
	flex-shrink: 0;
}

section h3 {
	font-family: var(--display);
	font-size: 1rem;
	font-weight: 700;
	color: var(--text-hi);
	letter-spacing: -0.01em;
	margin-top: 0.5rem;
}

section p {
	font-size: 0.97rem;
	color: var(--text);
	text-wrap: pretty;
}

section strong {
	color: var(--text-hi);
	font-weight: 600;
}

section em {
	color: var(--muted);
	font-style: italic;
}

.lede {
	font-size: 1.08rem;
	line-height: 1.6;
	color: var(--text-hi);
}

/* ── links ── */

a {
	color: var(--red-link);
	text-decoration-color: var(--border-hot);
	text-underline-offset: 0.18em;
}

a:hover {
	text-decoration-color: currentColor;
}

:focus-visible {
	outline: 2px solid var(--red-hot);
	outline-offset: 2px;
}

/* ── source line ── */

.src {
	font-family: var(--mono);
	font-size: 0.72rem;
	color: var(--muted);
	line-height: 1.65;
}

.src a {
	color: var(--muted);
	text-decoration: underline;
	text-decoration-color: var(--dim);
}

.src a:hover {
	color: var(--red-link);
}

/* ── stat grid ── */

.stat-list {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 0.6rem;
	margin: 0.35rem 0;
}

.stat-list li {
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-left: 2px solid var(--red);
	border-radius: 3px;
	padding: 0.9rem 1rem;
	font-size: 0.8rem;
	color: var(--muted);
	line-height: 1.45;
}

.stat {
	display: block;
	font-family: var(--mono);
	font-size: 1.5rem;
	font-weight: 500;
	color: var(--red-hot);
	letter-spacing: -0.04em;
	line-height: 1.1;
	margin-bottom: 0.3rem;
}

/* ── claim vs reality ── */

.claim-list {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 1.15rem;
	margin-top: 0.3rem;
}

.claim-list > li {
	border-left: 2px solid var(--border-hot);
	padding-left: 1rem;
	font-size: 0.95rem;
}

.claim {
	display: block;
	color: var(--muted);
	font-weight: 400;
	font-style: italic;
	margin-bottom: 0.3rem;
}

.reality {
	display: block;
}

.reality::before {
	content: 'REALITY';
	font-family: var(--mono);
	font-size: 0.62rem;
	letter-spacing: 0.14em;
	font-style: normal;
	color: var(--red-link);
	margin-right: 0.5rem;
}

/* ── case list ── */

.case-list {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	margin-top: 0.3rem;
}

.case-list > li {
	border-left: 2px solid var(--red);
	padding-left: 1rem;
	font-size: 0.95rem;
	color: var(--text);
}

.case-tag {
	display: inline-block;
	font-family: var(--mono);
	font-size: 0.6rem;
	letter-spacing: 0.13em;
	text-transform: uppercase;
	color: var(--red-link);
	border: 1px solid var(--border-hot);
	border-radius: 2px;
	padding: 0.1rem 0.42rem;
	margin-bottom: 0.5rem;
}

.case-list h3 {
	font-family: var(--display);
	font-size: 1.02rem;
	font-weight: 700;
	color: var(--text-hi);
	line-height: 1.3;
	letter-spacing: -0.015em;
	margin: 0 0 0.35rem;
}

.case-list p {
	font-size: 0.93rem;
	margin-bottom: 0.45rem;
}

/* a hard number pulled out of a case */
.pull {
	font-family: var(--mono);
	color: var(--red-hot);
	font-size: 0.93em;
	white-space: nowrap;
}

/* ── link list ── */

.link-list {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	margin-top: 0.2rem;
}

.link-list li {
	display: flex;
	flex-direction: column;
	gap: 0.12rem;
}

.link-list li a {
	font-size: 0.96rem;
	font-weight: 500;
	text-decoration: none;
}

.link-list li a:hover {
	text-decoration: underline;
}

.link-list li span {
	font-size: 0.85rem;
	color: var(--muted);
	line-height: 1.55;
}

/* ── action list ── */

.action-list {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 0.95rem;
	margin-top: 0.2rem;
	counter-reset: step;
}

.action-list li {
	font-size: 0.95rem;
	padding-left: 2rem;
	position: relative;
	counter-increment: step;
}

.action-list li::before {
	content: counter(step, decimal-leading-zero);
	position: absolute;
	left: 0;
	top: 0.1em;
	font-family: var(--mono);
	font-size: 0.72rem;
	color: var(--red);
}

/* ── blockquote ── */

blockquote {
	border-left: 3px solid var(--red);
	padding: 0.9rem 1.1rem;
	margin: 0.3rem 0;
	background: var(--surface-2);
	border-radius: 0 3px 3px 0;
	font-size: 0.98rem;
	color: var(--text-hi);
	line-height: 1.6;
}

blockquote p + p {
	margin-top: 0.7rem;
}

blockquote cite {
	display: block;
	margin-top: 0.7rem;
	font-family: var(--mono);
	font-size: 0.72rem;
	font-style: normal;
	color: var(--muted);
	letter-spacing: 0.04em;
}

/* ── teaser cards ── */

.teaser-grid {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-top: 0.4rem;
}

.teaser-card {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 0.15rem 0.75rem;
	background: var(--surface-2);
	border: 1px solid var(--border);
	border-radius: 3px;
	padding: 0.9rem 1rem;
	text-decoration: none;
	transition: border-color 0.15s, background 0.15s;
}

.teaser-card:hover {
	border-color: var(--border-hot);
	background: #1b1113;
}

.teaser-label {
	font-family: var(--display);
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--red-link);
	letter-spacing: -0.01em;
}

.teaser-desc {
	grid-column: 1;
	font-size: 0.85rem;
	color: var(--muted);
	line-height: 1.45;
}

.teaser-arrow {
	grid-row: 1 / 3;
	grid-column: 2;
	align-self: center;
	color: var(--dim);
	font-family: var(--mono);
}

.teaser-card:hover .teaser-arrow {
	color: var(--red-link);
}

/* ── figure ── */

figure {
	margin: 0.5rem 0 0;
}

figure img {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 3px;
	border: 1px solid var(--border);
}

figcaption {
	font-family: var(--mono);
	font-size: 0.7rem;
	color: var(--muted);
	margin-top: 0.5rem;
	line-height: 1.5;
}

/* ── back nav ── */

.back-nav {
	font-family: var(--mono);
	font-size: 0.73rem;
	letter-spacing: 0.06em;
}

.back-nav a {
	color: var(--muted);
	text-decoration: none;
}

.back-nav a:hover {
	color: var(--red-link);
}

/* ── footer ── */

footer {
	font-size: 0.82rem;
	color: var(--muted);
	text-align: center;
	padding-top: 1.5rem;
	border-top: 1px solid var(--border);
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
}

footer nav {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.4rem 1rem;
	font-family: var(--mono);
	font-size: 0.72rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	margin-bottom: 0.4rem;
}

footer a {
	color: var(--muted);
}

footer a:hover {
	color: var(--red-link);
}

footer em {
	font-style: italic;
}

/* ── 404 ── */

.err-code {
	font-family: var(--mono);
	font-size: 3.5rem;
	color: var(--red);
	line-height: 1;
	letter-spacing: -0.05em;
}

/* ── responsive ── */

@media (max-width: 560px) {
	body {
		font-size: 15px;
	}

	main {
		padding: 2rem 1.1rem 3.5rem;
		gap: 1.5rem;
	}

	.nav {
		margin: 0 -1.1rem;
		padding: 0 1.1rem;
	}

	section {
		padding: 1.4rem 1.2rem;
		border-radius: 3px;
	}

	.stat-list {
		grid-template-columns: 1fr;
	}

	.teaser-card {
		grid-template-columns: 1fr;
	}

	.teaser-arrow {
		display: none;
	}
}

/* ── print ── */

@media print {
	body {
		background: #fff;
		color: #000;
		background-image: none;
	}

	.nav, .hazard, .skip {
		display: none;
	}

	section {
		background: none;
		border: 1px solid #ccc;
		break-inside: avoid;
	}

	a::after {
		content: ' (' attr(href) ')';
		font-size: 0.75em;
		word-break: break-all;
	}
}
