/*
Theme Name: Protect Our Power SA
Theme URI: https://protectourpowersa.org/
Author: Protect Our Power SA
Description: Campaign theme for protectourpowersa.org. Poster-derived identity — oxblood, brass, ink — built around the CPS Energy comparison tool and the City of San Antonio budget analysis.
Version: 1.6.1
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: protect-our-power
*/

/* ==========================================================================
   Tokens
   Palette sampled from the campaign poster so the site and the printed
   material read as one thing.
   ========================================================================== */

:root {
	--ink: #14120f;
	--ink-soft: #433c33;
	--ink-mute: #6f6558;
	--paper: #f7f2e8;
	--paper-2: #ece2cf;
	--card: #fffdf8;
	--red: #b3221f;
	--red-dark: #8b1a17;
	--red-wash: #f6e3e0;
	--gold: #e8c25a;
	--gold-dark: #b98f22;
	--rule: #d9cdb6;

	--display: "Anton", "Haettenschweiler", "Arial Narrow", system-ui, sans-serif;
	--body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;

	/*
	 * --wrap is for multi-column furniture: stat cards, the card grid, the
	 * header. --narrow is the reading column, and it is also the width of every
	 * interior page's hero, body copy, tables and the comparison tool, so a page
	 * has one left edge from the headline to the footer. Body copy fills it
	 * rather than sitting in a still-narrower measure inside it — a text column
	 * markedly narrower than the box drawn around it reads as a mistake.
	 */
	--wrap: 1320px;
	--narrow: 1080px;
	--radius: 4px;
}

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

/*
 * The canvas outside the body box is painted from <html>, not <body>. Without
 * this, a browser in dark mode paints it near-black and the page appears
 * letterboxed on anything taller or wider than the content. color-scheme is
 * declared because this design is light-only — it stops the UA from
 * dark-ifying form controls and scrollbars against a cream page.
 */
html {
	background: var(--paper);
	color-scheme: light;
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	min-height: 100%;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--body);
	font-size: 18px;
	line-height: 1.65;
	overflow-x: hidden;
	-webkit-font-smoothing: antialiased;
}

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

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

a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible {
	outline: 3px solid var(--red);
	outline-offset: 2px;
}

.wrap {
	width: 100%;
	max-width: var(--wrap);
	margin: 0 auto;
	padding: 0 24px;
}

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

.skip-link,
.screen-reader-text {
	position: absolute;
	left: -9999px;
}

/*
 * The header is sticky, so an anchor jump lands the target heading underneath
 * it — a reader following a "Source" link arrives at the paragraph after the
 * one they wanted, with no heading visible to tell them they are in the right
 * place. Clear the header, plus a little air.
 */
:target {
	scroll-margin-top: 96px;
}

@media (max-width: 640px) {
	:target {
		scroll-margin-top: 76px;
	}
}

.skip-link:focus {
	left: 12px;
	top: 12px;
	z-index: 100;
	padding: 10px 16px;
	background: var(--ink);
	color: var(--paper);
}

/* ==========================================================================
   Display type
   ========================================================================== */

h1,
h2,
h3,
.display {
	font-family: var(--display);
	font-weight: 400;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	line-height: 0.95;
	margin: 0 0 0.5em;
}

h1 {
	font-size: clamp(2.6rem, 7vw, 5rem);
}

h2 {
	font-size: clamp(1.9rem, 4.2vw, 3rem);
}

h3 {
	font-size: clamp(1.25rem, 2.4vw, 1.6rem);
}

p {
	margin: 0 0 1.1em;
}

.lede {
	font-size: clamp(1.1rem, 2.1vw, 1.35rem);
	line-height: 1.55;
	color: var(--ink-soft);
}

.eyebrow {
	display: inline-block;
	margin-bottom: 0.9rem;
	padding: 0.3rem 0.7rem;
	font-family: var(--body);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--paper);
	background: var(--red);
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--ink);
	color: var(--paper);
	border-bottom: 4px solid var(--gold);
}

.site-header__inner {
	display: flex;
	align-items: center;
	gap: 20px;
	min-height: 76px;
}

.brand {
	display: flex;
	align-items: center;
	gap: 12px;
	color: inherit;
	text-decoration: none;
	margin-right: auto;
}

.brand img,
.brand svg {
	width: 46px;
	height: 46px;
	flex: 0 0 auto;
}

.brand__name {
	font-family: var(--display);
	font-size: 1.32rem;
	line-height: 1;
	text-transform: uppercase;
	letter-spacing: 0.01em;
}

.brand__name em {
	font-style: normal;
	color: var(--gold);
}

.brand__sub {
	display: block;
	margin-top: 3px;
	font-family: var(--body);
	font-size: 0.62rem;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: #b9ac97;
}

.nav {
	display: flex;
	align-items: center;
}

/*
 * wp_nav_menu emits <li> elements. They were previously dropped straight into
 * the <nav> with no list around them, which is invalid markup and — because the
 * UA still gives an <li> display:list-item — painted a bullet beside every menu
 * item. The list is now real, and the markers are turned off here rather than
 * relying on the wrapper alone, so the fallback menu renders identically.
 */
.nav__list {
	display: flex;
	align-items: center;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nav__list li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.nav a {
	display: block;
	padding: 9px 13px;
	color: var(--paper);
	font-size: 0.9rem;
	font-weight: 600;
	text-decoration: none;
	border-radius: var(--radius);
}

.nav a:hover {
	background: #2a251d;
	color: var(--gold);
}

.nav .current-menu-item > a,
.nav .current_page_item > a {
	color: var(--gold);
	box-shadow: inset 0 -3px 0 var(--gold);
}

/*
 * The one menu item that asks for something.
 *
 * Add the CSS class `menu-item-cta` to a menu item under Appearance → Menus to
 * get this. It is deliberately the only red thing in the header, so it reads as
 * the action rather than as another destination.
 */
.nav__list li.menu-item-cta {
	margin-left: 6px;
}

.nav__list li.menu-item-cta > a {
	padding: 9px 18px;
	color: var(--paper);
	background: var(--red);
	border: 2px solid var(--red-dark);
	border-radius: 999px;
	box-shadow: none;
}

.nav__list li.menu-item-cta > a:hover {
	color: var(--paper);
	background: var(--red-dark);
	border-color: var(--gold);
}

/* Current-page styling would otherwise repaint the button gold-on-ink. */
.nav .menu-item-cta.current-menu-item > a,
.nav .menu-item-cta.current_page_item > a {
	color: var(--paper);
	background: var(--red-dark);
	border-color: var(--gold);
	box-shadow: none;
}

.nav-toggle {
	display: none;
	padding: 8px 12px;
	font: inherit;
	font-weight: 700;
	color: var(--paper);
	background: transparent;
	border: 2px solid #4a4238;
	border-radius: var(--radius);
	cursor: pointer;
}

@media (max-width: 640px) {
	/* Reclaim header height on small screens; it is sticky, so every pixel
	   here is a pixel taken off every screen for the whole visit. */
	.site-header__inner {
		min-height: 60px;
		gap: 12px;
	}

	.brand img,
	.brand svg {
		width: 38px;
		height: 38px;
	}

	.brand__name {
		font-size: 1.08rem;
	}

	.brand__sub {
		font-size: 0.56rem;
		letter-spacing: 0.18em;
	}

	.section {
		padding: 40px 0;
	}

	.eyebrow {
		margin-bottom: 0.7rem;
		font-size: 0.68rem;
		letter-spacing: 0.12em;
	}
}

/*
 * The menu collapses at 1180px rather than 900px.
 *
 * Eight items plus the wordmark plus the call-to-action button no longer
 * fit on a 1024px laptop, and a nav that wraps to two lines under a sticky
 * header costs every visitor vertical space for the whole visit. Below this
 * width the hamburger is the better trade.
 */
@media (max-width: 1180px) {
	.nav-toggle {
		display: block;
	}

	.nav {
		display: none;
		position: absolute;
		left: 0;
		right: 0;
		top: 100%;
		padding: 8px 16px 16px;
		background: var(--ink);
		border-bottom: 4px solid var(--gold);
	}

	.nav.is-open {
		display: block;
	}

	.nav__list {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}

	.nav a {
		padding: 12px 6px;
		border-bottom: 1px solid #2a251d;
	}
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
	display: inline-block;
	padding: 14px 26px;
	font-family: var(--display);
	font-size: 1.05rem;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	text-decoration: none;
	border: 3px solid var(--ink);
	border-radius: var(--radius);
	cursor: pointer;
	transition: transform 0.08s ease;
}

.btn:active {
	transform: translateY(2px);
}

.btn--primary {
	color: var(--paper);
	background: var(--red);
	border-color: var(--ink);
	box-shadow: 4px 4px 0 var(--ink);
}

.btn--ghost {
	color: var(--ink);
	background: var(--gold);
	box-shadow: 4px 4px 0 var(--ink);
}

.btn--quiet {
	padding: 10px 18px;
	font-family: var(--body);
	font-weight: 700;
	font-size: 0.95rem;
	color: var(--ink);
	background: transparent;
	border-width: 2px;
	box-shadow: none;
	text-transform: none;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
	position: relative;
	overflow: hidden;
	color: var(--paper);
	background: var(--red);
	border-bottom: 6px solid var(--ink);
}

/* Sunburst echoes the poster without needing an image request. */
.hero::before {
	content: "";
	position: absolute;
	inset: -40% -10% auto -10%;
	height: 160%;
	background:
		repeating-conic-gradient(
			from 0deg at 50% 34%,
			rgba(255, 255, 255, 0.06) 0deg 7deg,
			transparent 7deg 14deg
		);
	pointer-events: none;
}

/*
 * Capped rather than proportional at the top end: on a 800px laptop the hero
 * otherwise fills the viewport exactly, leaving no hint that the page
 * continues. Trimming it lets the next section show above the fold.
 */
/*
 * Vertical padding only. This element also carries .wrap, and a padding
 * shorthand here would reset that class's horizontal gutter to zero — which
 * pinned the hero text flat against the viewport edge on every screen
 * narrower than the wrap max-width.
 */
.hero__inner {
	position: relative;
	padding-top: clamp(28px, 6vw, 68px);
	padding-bottom: clamp(26px, 4.5vw, 56px);
}

.hero h1 {
	max-width: 16ch;
	text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.32);
}

.hero h1 em {
	font-style: normal;
	color: var(--gold);
}

.hero .lede {
	max-width: 56ch;
	color: #fbeee4;
}

.hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 24px;
}

/*
 * On a phone the hero used to run 686px with the header — taller than an
 * iPhone SE viewport, so the calls to action sat below the fold on the one
 * screen guaranteed to be seen. Everything here buys that height back.
 */
@media (max-width: 640px) {
	.hero h1 {
		max-width: 100%;
		font-size: clamp(2.1rem, 9.5vw, 2.75rem);
		text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.32);
	}

	.hero .lede {
		font-size: 1.02rem;
		line-height: 1.5;
	}

	.hero__actions {
		gap: 10px;
	}

	/* Equal, full-width targets read as a pair rather than as scraps. */
	.hero__actions .btn {
		flex: 1 1 100%;
		text-align: center;
		padding: 13px 18px;
		box-shadow: 3px 3px 0 var(--ink);
	}
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
	padding: clamp(48px, 7vw, 84px) 0;
}

.section--paper2 {
	background: var(--paper-2);
	border-top: 3px solid var(--rule);
	border-bottom: 3px solid var(--rule);
}

.section--ink {
	background: var(--ink);
	color: var(--paper);
}

.section--ink .lede {
	color: #c9bda8;
}

.section--ink h2 em {
	font-style: normal;
	color: var(--gold);
}

.section__head {
	max-width: 62ch;
	margin-bottom: 2.2rem;
}

/* ==========================================================================
   Stat cards
   ========================================================================== */

.stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	gap: 18px;
}

.stat {
	padding: 24px 22px;
	background: var(--card);
	border: 3px solid var(--ink);
	border-radius: var(--radius);
	box-shadow: 6px 6px 0 rgba(20, 18, 15, 0.14);
}

.section--ink .stat {
	background: #1e1a15;
	border-color: var(--gold);
	box-shadow: none;
}

.stat__num {
	display: block;
	font-family: var(--display);
	font-size: clamp(2.2rem, 5vw, 3.1rem);
	line-height: 1;
	color: var(--red);
}

.section--ink .stat__num {
	color: var(--gold);
}

.stat__label {
	display: block;
	margin-top: 0.5rem;
	font-weight: 700;
	font-size: 1rem;
	line-height: 1.3;
}

.stat__note {
	display: block;
	margin-top: 0.4rem;
	font-size: 0.86rem;
	color: var(--ink-mute);
}

.section--ink .stat__note {
	color: #a1957f;
}

/* ==========================================================================
   Prose
   ========================================================================== */

/*
 * Body copy fills its column.
 *
 * It used to be capped at 76ch inside a much wider wrapper, which on a desktop
 * put a ~680px ribbon of text against the left edge of a ~1270px content box
 * and left the right third of every interior page empty. The measure is now set
 * by --narrow, which is also what the page's headline, tables and tool use, so
 * the text ends where the page ends.
 *
 * The cap that remains is a backstop for the one place prose sits inside the
 * full --wrap container (the homepage), where filling the width really would be
 * unreadable. Type is a shade larger and more leaded than before to carry the
 * longer line.
 */
.prose {
	max-width: min(100%, 68rem);
	font-size: clamp(1.03rem, 0.98rem + 0.28vw, 1.1875rem);
	line-height: 1.72;
}

.prose h2 {
	margin-top: 2em;
}

.prose h3 {
	margin-top: 1.8em;
}

.prose ul,
.prose ol {
	padding-left: 1.3em;
	margin: 0 0 1.2em;
}

.prose li {
	margin-bottom: 0.45em;
}

.prose blockquote {
	margin: 1.6em 0;
	padding: 0.6em 0 0.6em 1.2em;
	border-left: 5px solid var(--gold);
	font-size: 1.12rem;
	color: var(--ink-soft);
}

.prose table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.4em 0;
	font-size: 0.95rem;
}

.prose th,
.prose td {
	padding: 9px 12px;
	text-align: left;
	border-bottom: 1px solid var(--rule);
}

.prose thead th {
	font-size: 0.76rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ink-mute);
	border-bottom: 2px solid var(--ink);
}

.prose td:nth-child(n + 2),
.prose th:nth-child(n + 2) {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.table-scroll {
	overflow-x: auto;
	margin: 1.4em 0;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	background: var(--card);
}

.table-scroll table {
	margin: 0;
}

/* ==========================================================================
   Callouts
   ========================================================================== */

.callout {
	padding: 22px 24px;
	margin: 1.8em 0;
	background: var(--card);
	border-left: 6px solid var(--red);
	border-radius: var(--radius);
}

.callout--gold {
	border-left-color: var(--gold-dark);
}

.callout__title {
	margin: 0 0 0.4rem;
	font-family: var(--display);
	font-size: 1.15rem;
	text-transform: uppercase;
}

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

/* ==========================================================================
   Cards / grid
   ========================================================================== */

.cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
	gap: 20px;
}

.card {
	display: flex;
	flex-direction: column;
	padding: 26px 24px;
	background: var(--card);
	border: 2px solid var(--rule);
	border-radius: var(--radius);
}

.card h3 {
	margin-bottom: 0.5rem;
}

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

.card__num {
	font-family: var(--display);
	font-size: 2rem;
	color: var(--gold-dark);
	line-height: 1;
	margin-bottom: 0.4rem;
}

/* ==========================================================================
   Reality check — what people actually paid
   Two figures side by side, because the whole argument is the distance between
   them. Deliberately louder than the cards below it: this is the finding, and
   the advertised comparison is the follow-up.
   ========================================================================== */

.realitycheck {
	margin-bottom: 28px;
	padding: 26px 28px;
	background: var(--card);
	border: 3px solid var(--ink);
	border-radius: var(--radius);
	box-shadow: 8px 8px 0 rgba(20, 18, 15, 0.14);
}

.realitycheck__pair {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 18px 32px;
}

.realitycheck__side {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.realitycheck__label {
	font-size: 0.76rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--ink-mute);
}

.realitycheck__num {
	font-family: var(--display);
	font-size: clamp(2.8rem, 8vw, 4.4rem);
	line-height: 1;
}

.realitycheck__num--bad {
	color: var(--red);
}

.realitycheck__num--good {
	color: var(--gold-dark);
}

.realitycheck__note {
	font-size: 0.9rem;
	color: var(--ink-mute);
}

.realitycheck__punch {
	margin: 1.1rem 0 0;
	padding-top: 1.1rem;
	border-top: 2px solid var(--rule);
	font-size: 1.02rem;
	line-height: 1.6;
	font-weight: 600;
}

/* ==========================================================================
   Comparison tool host
   ========================================================================== */

.tool {
	padding: 26px;
	background: var(--card);
	border: 3px solid var(--ink);
	border-radius: var(--radius);
	box-shadow: 8px 8px 0 rgba(20, 18, 15, 0.12);
}

@media (max-width: 620px) {
	.tool {
		padding: 16px;
		box-shadow: none;
	}
}

/* The calculator ships its own tokens; only its width is managed here. */
.tool .tpc,
.tool .tpc-app {
	max-width: none;
	padding: 0;
	background: transparent;
}

/* ==========================================================================
   Generation chart
   Emphasis form: the subject is drawn in the accent, everything else recedes
   to a neutral. Pure CSS bars so it renders inside post content with no
   scripting and degrades to a readable list if the styles never arrive.
   ========================================================================== */

.genchart {
	margin: 1.6em 0;
	font-size: 0.95rem;
}

.genchart__row {
	display: grid;
	grid-template-columns: minmax(9rem, 15rem) 1fr auto;
	align-items: center;
	gap: 12px;
	padding: 5px 0;
}

.genchart__name {
	font-weight: 600;
	line-height: 1.25;
}

.genchart__track {
	position: relative;
	height: 20px;
	background: rgba(20, 18, 15, 0.06);
	border-radius: 2px;
	overflow: hidden;
}

.genchart__bar {
	display: block;
	height: 100%;
	background: var(--ink-mute);
	border-radius: 2px;
}

.genchart__row--focus .genchart__name {
	color: var(--red);
}

.genchart__row--focus .genchart__bar {
	background: var(--red);
}

.genchart__val {
	min-width: 4.2rem;
	text-align: right;
	font-variant-numeric: tabular-nums;
	color: var(--ink-soft);
}

.genchart__note {
	margin-top: 0.7rem;
	font-size: 0.8rem;
	color: var(--ink-mute);
}

@media (max-width: 620px) {
	.genchart__row {
		grid-template-columns: 1fr auto;
		grid-template-areas: "name val" "track track";
		gap: 4px 10px;
	}

	.genchart__name { grid-area: name; }
	.genchart__val  { grid-area: val; }
	.genchart__track { grid-area: track; }
}

/* ==========================================================================
   Explainer diagrams
   Markup and CSS, not SVG, so the labels stay real text — they reflow on a
   phone, they can be read aloud, and without the stylesheet the whole thing is
   still a numbered list that explains the process.
   ========================================================================== */

.flowfig {
	margin: 2em 0;
	padding: 0;
}

.flowfig__cap {
	margin-bottom: 1rem;
	font-family: var(--display);
	font-size: clamp(1.15rem, 2.4vw, 1.5rem);
	text-transform: uppercase;
	letter-spacing: 0.01em;
	line-height: 1.05;
}

.flowfig__track {
	padding: 20px 22px;
	margin-bottom: 18px;
	background: var(--card);
	border: 3px solid var(--ink);
	border-radius: var(--radius);
	box-shadow: 6px 6px 0 rgba(20, 18, 15, 0.12);
}

.flowfig__title {
	margin: 0 0 1rem;
	font-family: var(--display);
	font-size: 1.05rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.flowfig__track--gold .flowfig__title {
	color: var(--gold-dark);
}

.flowfig__track--red .flowfig__title {
	color: var(--red);
}

/* The flow itself. A row of boxes on a wide screen, a column on a phone, with
   the connector rotating to match — the arrow has to point along the reading
   direction or the diagram fights the layout. */
.flow {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: flow;
}

.flow__step {
	position: relative;
	flex: 1 1 190px;
	min-width: 0;
	padding: 14px 16px;
	background: var(--paper);
	border: 2px solid var(--rule);
	border-radius: var(--radius);
}

.flowfig__track--gold .flow__step {
	border-color: #e0cf9f;
}

.flowfig__track--red .flow__step {
	border-color: #e7c4c1;
}

/* The connector between steps. Drawn on the box rather than between them, so
   there is no empty grid cell to keep in step when the flow wraps. */
.flow__step + .flow__step::before {
	content: "";
	position: absolute;
	top: 50%;
	left: -11px;
	width: 0;
	height: 0;
	margin-top: -6px;
	border-left: 7px solid var(--ink-mute);
	border-top: 6px solid transparent;
	border-bottom: 6px solid transparent;
}

.flow__tag {
	display: block;
	margin-bottom: 0.3rem;
	font-size: 0.66rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ink-mute);
}

.flow__label {
	display: block;
	font-family: var(--display);
	font-size: 1.1rem;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	line-height: 1.05;
}

.flow__desc {
	display: block;
	margin-top: 0.35rem;
	font-size: 0.85rem;
	line-height: 1.45;
	color: var(--ink-soft);
}

.flowfig__note {
	margin: 1rem 0 0;
	padding-top: 0.9rem;
	border-top: 2px solid var(--rule);
	font-size: 0.88rem;
	line-height: 1.55;
	color: var(--ink-soft);
}

.flowfig__punch {
	margin: 1.1rem 0 0;
	padding: 16px 18px;
	background: var(--paper-2);
	border-left: 5px solid var(--red);
	border-radius: var(--radius);
	font-size: 0.95rem;
	line-height: 1.6;
	font-weight: 600;
}

@media (max-width: 720px) {
	/*
	 * Stack by giving each step a full-width basis, NOT by switching the flex
	 * direction. flex-basis follows the main axis, so `flex-direction: column`
	 * reads the step's `flex: 1 1 190px` as a 190px *height* and every box
	 * inflates to the same tall rectangle whatever is in it. Wrapping keeps the
	 * axis horizontal and stacks with content-sized heights.
	 */
	.flow {
		gap: 18px;
	}

	.flow__step {
		flex: 1 1 100%;
	}

	/* Stacked layout: the arrow moves to the top edge and points down. */
	.flow__step + .flow__step::before {
		top: -15px;
		left: 50%;
		margin: 0 0 0 -6px;
		border-left: 6px solid transparent;
		border-right: 6px solid transparent;
		border-top: 8px solid var(--ink-mute);
		border-bottom: 0;
	}
}

/* --- the contract timeline ------------------------------------------------ */

.tline {
	margin: 0;
	padding: 0;
	list-style: none;
	border-left: 3px solid var(--rule);
}

.tline__step {
	position: relative;
	padding: 0 0 1.4rem 1.6rem;
}

.tline__step:last-child {
	padding-bottom: 0;
}

.tline__step::before {
	content: "";
	position: absolute;
	left: -0.66rem;
	top: 0.28rem;
	width: 1.05rem;
	height: 1.05rem;
	border: 3px solid var(--ink);
	border-radius: 50%;
	background: var(--gold);
}

.tline__step--warn::before {
	background: var(--gold-dark);
}

.tline__step--bad::before {
	background: var(--red);
}

.tline__when {
	display: block;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ink-mute);
}

.tline__what {
	display: block;
	margin-top: 0.1rem;
	font-family: var(--display);
	font-size: 1.15rem;
	text-transform: uppercase;
	line-height: 1.05;
}

.tline__step--bad .tline__what {
	color: var(--red);
}

.tline__desc {
	display: block;
	margin-top: 0.3rem;
	font-size: 0.9rem;
	line-height: 1.5;
	color: var(--ink-soft);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
	padding: 48px 0 36px;
	background: var(--ink);
	color: #b9ac97;
	border-top: 5px solid var(--gold);
	font-size: 0.92rem;
}

.site-footer a {
	color: var(--gold);
}

.footer-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: 28px;
	margin-bottom: 28px;
}

.site-footer h4 {
	margin: 0 0 0.6rem;
	font-family: var(--display);
	font-size: 1rem;
	text-transform: uppercase;
	color: var(--paper);
}

.site-footer ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.site-footer li {
	margin-bottom: 0.35rem;
}

.colophon {
	padding-top: 20px;
	border-top: 1px solid #332d25;
	font-size: 0.82rem;
	color: #8d8271;
}

.colophon a {
	color: var(--gold);
}

.colophon--legal {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1.4rem;
	margin-top: 0.8rem;
	padding-top: 0.9rem;
}

.colophon--legal a {
	font-weight: 600;
}

/* ==========================================================================
   Forms — the mailing list and the contact form
   ========================================================================== */

.pop-form {
	margin: 0;
}

.pop-form__row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.pop-form input[type="email"],
.pop-form input[type="text"],
.pop-form textarea {
	flex: 1 1 12rem;
	min-width: 0;
	padding: 12px 14px;
	font: inherit;
	font-size: 1rem;
	color: var(--ink);
	background: var(--card);
	border: 2px solid var(--rule);
	border-radius: var(--radius);
}

.pop-form textarea {
	width: 100%;
	resize: vertical;
	line-height: 1.55;
}

.pop-form input:focus,
.pop-form textarea:focus {
	border-color: var(--red);
	outline: none;
	box-shadow: 0 0 0 3px rgba(179, 34, 31, 0.18);
}

.pop-form .btn {
	flex: 0 0 auto;
	padding: 12px 22px;
	font-size: 0.98rem;
}

.pop-form button[disabled] {
	opacity: 0.6;
	cursor: progress;
}

.pop-field {
	margin-bottom: 1.1rem;
}

.pop-field label {
	display: block;
	margin-bottom: 0.35rem;
	font-weight: 700;
	font-size: 0.95rem;
}

.pop-optional {
	font-weight: 400;
	font-size: 0.85rem;
	color: var(--ink-mute);
}

.pop-form__status {
	margin: 0.6rem 0 0;
	font-size: 0.9rem;
	min-height: 1.2em;
}

.pop-form__status.is-ok {
	color: #1d6b3f;
	font-weight: 600;
}

.pop-form__status.is-error {
	color: var(--red-dark);
	font-weight: 600;
}

/* The honeypot. Off-screen rather than display:none, because some form fillers
   skip hidden fields but not positioned ones. */
.pop-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.pop-subscribe-inline {
	padding: 22px 24px;
	margin: 1.8em 0;
	background: var(--card);
	border: 3px solid var(--ink);
	border-radius: var(--radius);
	box-shadow: 6px 6px 0 rgba(20, 18, 15, 0.14);
}

/* --- the footer signup, on the dark ground -------------------------------- */

.footer-signup p {
	margin-bottom: 0.8rem;
}

.footer-signup .pop-form input[type="email"] {
	flex: 1 1 9rem;
	padding: 10px 12px;
	font-size: 0.95rem;
	background: #1e1a15;
	border-color: #453d32;
	color: var(--paper);
}

.footer-signup .pop-form input::placeholder {
	color: #8d8271;
}

.footer-signup .pop-form .btn {
	padding: 10px 18px;
	font-size: 0.92rem;
	box-shadow: none;
	border-color: var(--gold);
}

.footer-signup .pop-form__status.is-ok {
	color: #8fd3a8;
}

.footer-signup .pop-form__status.is-error {
	color: #f0a99a;
}

/* ==========================================================================
   Support / Ko-fi
   ========================================================================== */

.footer-support {
	display: grid;
	grid-template-columns: minmax(200px, auto) 1fr;
	align-items: start;
	gap: 20px 28px;
	padding: 24px 0;
	margin-bottom: 8px;
	border-top: 1px solid #332d25;
}

@media (max-width: 720px) {
	.footer-support {
		grid-template-columns: 1fr;
	}
}

/* Ko-fi's own button colours, so it reads as the thing it links to. */
.pop-kofi {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 12px 20px;
	font-family: var(--display);
	font-size: 1.02rem;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	text-decoration: none;
	color: #fff;
	background: #ff5e5b;
	border: 3px solid var(--ink);
	border-radius: 999px;
	box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.45);
	transition: transform 0.08s ease;
}

.pop-kofi:hover {
	background: #ff726f;
}

.pop-kofi:active {
	transform: translateY(2px);
}

.pop-kofi__mark {
	width: 26px;
	height: auto;
	flex: 0 0 auto;
}

.footer-support__note p {
	margin-bottom: 0.6rem;
	font-size: 0.82rem;
	line-height: 1.55;
	color: #a1957f;
}

.footer-support__note p:last-child {
	margin-bottom: 0;
}

.footer-support__note strong {
	color: var(--paper);
}

/* ==========================================================================
   Mailing-list modal
   ========================================================================== */

body.pop-modal-open {
	overflow: hidden;
}

.pop-modal {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.pop-modal[hidden] {
	display: none;
}

.pop-modal__scrim {
	position: absolute;
	inset: 0;
	background: rgba(20, 18, 15, 0.66);
	backdrop-filter: blur(3px);
}

/*
 * The panel keeps the poster idiom — heavy border, hard offset shadow — but at
 * a softer radius and with room to breathe, so it reads as an invitation rather
 * than as the site shouting at somebody who is halfway through reading.
 */
.pop-modal__panel {
	position: relative;
	width: 100%;
	max-width: 33rem;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	padding: 34px 34px 28px;
	background: var(--paper);
	border: 3px solid var(--ink);
	border-radius: 10px;
	box-shadow: 10px 10px 0 rgba(20, 18, 15, 0.35);
	animation: pop-modal-in 0.22s ease-out;
}

@keyframes pop-modal-in {
	from {
		opacity: 0;
		transform: translateY(14px) scale(0.985);
	}
}

.pop-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	color: var(--ink-soft);
	background: transparent;
	border: 2px solid transparent;
	border-radius: 50%;
	cursor: pointer;
}

.pop-modal__close:hover {
	color: var(--red);
	background: var(--paper-2);
}

.pop-modal__eyebrow {
	display: inline-block;
	margin-bottom: 0.9rem;
	padding: 0.3rem 0.7rem;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--paper);
	background: var(--red);
	border-radius: 3px;
}

.pop-modal__title {
	margin: 0 0 0.6rem;
	font-family: var(--display);
	font-size: clamp(1.9rem, 5vw, 2.5rem);
	line-height: 0.98;
	text-transform: uppercase;
}

.pop-modal__title em {
	font-style: normal;
	color: var(--gold-dark);
}

.pop-modal__lede {
	margin-bottom: 1.3rem;
	font-size: 1rem;
	line-height: 1.6;
	color: var(--ink-soft);
}

.pop-modal__promise {
	margin: 1.2rem 0 0;
	padding: 0;
	list-style: none;
	font-size: 0.86rem;
	color: var(--ink-mute);
}

.pop-modal__promise li {
	position: relative;
	margin-bottom: 0.35rem;
	padding-left: 1.5rem;
}

.pop-modal__promise li::before {
	content: "";
	position: absolute;
	left: 0.15rem;
	top: 0.42em;
	width: 0.55rem;
	height: 0.3rem;
	border-left: 2.5px solid var(--gold-dark);
	border-bottom: 2.5px solid var(--gold-dark);
	transform: rotate(-45deg);
}

.pop-modal__dismiss {
	margin-top: 1.2rem;
	padding: 0;
	font: inherit;
	font-size: 0.86rem;
	color: var(--ink-mute);
	background: none;
	border: 0;
	text-decoration: underline;
	cursor: pointer;
}

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

@media (max-width: 480px) {
	.pop-modal__panel {
		padding: 26px 20px 22px;
		box-shadow: 6px 6px 0 rgba(20, 18, 15, 0.35);
	}

	/*
	 * Stack by forcing a full-width basis, not by switching to a column.
	 * flex-basis follows the main axis, so `flex-direction: column` reads the
	 * input's `flex: 1 1 12rem` as a 12rem *height* and inflates the field to a
	 * 192px box. Wrapping keeps the axis horizontal and gets the same stack.
	 */
	.pop-modal .pop-form__row > * {
		flex: 1 1 100%;
	}

	.pop-modal .pop-form .btn {
		text-align: center;
	}
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.stack > * + * {
	margin-top: 1.1em;
}

.center {
	text-align: center;
}

.mt-0 {
	margin-top: 0;
}

.source-note {
	font-size: 0.82rem;
	color: var(--ink-mute);
}

/* ==========================================================================
   Source links
   Small enough not to interrupt the sentence, present enough that a reader
   never has to wonder which document a number came from.
   ========================================================================== */

.src {
	display: inline-block;
	margin-left: 0.4em;
	font-family: var(--body);
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	white-space: nowrap;
	color: var(--ink-mute);
	text-decoration: none;
	border-bottom: 1px dotted currentColor;
	vertical-align: 0.08em;
}

.src::after {
	content: " \2197";
	font-weight: 400;
}

.src:hover,
.src:focus-visible {
	color: var(--red);
}

.src--block {
	display: block;
	margin: 0.7rem 0 0;
	margin-left: 0;
}

/* On the ink sections and in the footer the muted ink is unreadable. */
.section--ink .src,
.site-footer .src {
	color: #a1957f;
}

.section--ink .src:hover,
.section--ink .src:focus-visible,
.site-footer .src:hover,
.site-footer .src:focus-visible {
	color: var(--gold);
}

/* Inside prose the link should not inherit the body link colour, which would
   make it compete with the sentence it is attached to. */
.prose .src {
	color: var(--ink-mute);
}

.prose .src:hover,
.prose .src:focus-visible {
	color: var(--red);
}

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