/*
 * Styles for the corporate pages (/press, /privacy, /terms), the heritage-channel results
 * (/pigeon, /smoke-signal, /fax) and Catch the Stork (/stork). Loaded only on those pages,
 * after /styles.css, and built from its tokens.
 */

/* ─── Shared ────────────────────────────────────────────────────────────── */

/* Keep the page rhythm for blocks (figures, timelines) whose own rules reset their margins. */
.corp.stack-lg > * + * {
	margin-block-start: var(--stack-gap, 2rem);
}

.corp section > p,
.corp section > ul:not([class]),
.corp .legal-terms p {
	max-width: 70ch;
}
.corp li > p:last-child {
	margin-bottom: 0;
}

/* ─── /press ────────────────────────────────────────────────────────────── */

.press-boilerplate {
	margin: 0;
	padding: 1rem 1.25rem;
	border-left: 5px solid var(--accent);
	background: var(--panel);
	font-size: 1.08rem;
	max-width: 70ch;
}
.press-boilerplate p {
	margin: 0;
}
.press-snippet {
	max-width: 70ch;
}
.press-snippet .press-boilerplate {
	padding-bottom: 3.25rem;
}
.press-snippet .btn-copy {
	left: 1.25rem;
	right: auto;
	bottom: 0.85rem;
	color: var(--ink);
	background: var(--paper);
	border-color: var(--rule-2);
	box-shadow: none;
}
.press-snippet .btn-copy:hover {
	color: var(--ink);
	background: var(--paper-2);
	border-color: var(--ink);
}
.press .meta-list {
	margin-top: 0.75rem;
}

.press-logos {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
	gap: 1rem;
}
.press-logo {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 1.25rem;
	margin: 0;
	padding: 2rem 1.5rem 1.25rem;
	border: 1px solid var(--rule-2);
	border-radius: var(--radius);
	min-width: 0;
}
.press-logo-light {
	background: #f1ece1;
	color: #17140f;
}
.press-logo-light figcaption {
	color: #4c4538;
}
.press-logo-dark {
	background: #17140f;
	color: #f1ece1;
}
.press-logo-dark figcaption {
	color: #c3baa7;
}
.press-logo-eggs {
	background: var(--panel);
}
.press-lockup {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	min-height: 3.5rem;
}
.press-egg {
	flex: none;
	width: 2.6rem;
	height: 2.6rem;
}
.press-wordmark {
	font-family: var(--font-display);
	font-size: clamp(1.35rem, 2.6vw, 1.8rem);
	font-weight: 900;
	font-stretch: 122%;
	letter-spacing: -0.02em;
	line-height: 1;
}

.press-specimen {
	overflow-x: auto;
	overflow-y: hidden;
	padding: 1.25rem 1.5rem 1.5rem;
	background: var(--hero-bg);
	border: 3px solid var(--ink);
	box-shadow: var(--shadow);
	overscroll-behavior-x: contain;
}
.press-specimen:focus-visible {
	outline: 3px solid var(--focus);
	outline-offset: 3px;
}
/* Rule 1. Not a typo, not negotiable. */
.press-no {
	display: block;
	width: max-content;
	font-family: var(--font-display);
	font-size: 400px;
	font-weight: 900;
	font-stretch: 150%;
	line-height: 0.8;
	letter-spacing: -0.035em;
	color: var(--no);
	white-space: nowrap;
	padding-top: 0.04em;
}

.press-swatches,
.press-assets {
	display: grid;
	gap: 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}
.press-swatches {
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
}
.press-assets {
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 13rem), 1fr));
	margin-bottom: 1.75rem;
}
.press-swatches > li,
.press-assets > li {
	margin: 0;
}
.press-assets-group {
	margin-top: 1rem;
}
.press-swatch,
.press-asset {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	min-width: 0;
	padding: 0.75rem;
	background: var(--panel);
	border: 1px solid var(--rule-2);
	border-radius: var(--radius);
}
.press-chip {
	display: block;
	height: 5rem;
	margin-bottom: 0.45rem;
	border: 1px solid var(--rule-2);
	border-radius: var(--radius);
}
.press-swatch-name {
	font-weight: 700;
}
.press-asset img {
	width: 64px;
	height: 64px;
	object-fit: contain;
}
.press-asset-card img {
	width: 100%;
	height: auto;
	aspect-ratio: 1200 / 630;
	border: 1px solid var(--rule);
}
.press-asset code {
	overflow-wrap: anywhere;
}

.press-font-sample {
	margin: 0 0 0.9rem;
	font-size: 1.6rem;
	line-height: 1.15;
	overflow-wrap: anywhere;
}
.press-font:first-child .press-font-sample {
	font-size: 3.2rem;
	font-weight: 900;
	font-stretch: 150%;
	line-height: 0.9;
}

.press-dos {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
	gap: 1rem;
}
.press-do {
	border-top: 6px solid var(--ok);
}
.press-dont {
	border-top: 6px solid var(--error);
}
.press-dos ul {
	margin: 0;
	padding-left: 1.4rem;
}
.press-dos li + li {
	margin-top: 0.35rem;
}
.press-do li::marker {
	content: '✓  ';
	color: var(--ok);
	font-weight: 700;
}
.press-dont li::marker {
	content: '✕  ';
	color: var(--error);
	font-weight: 700;
}

/* ─── /privacy, /terms ──────────────────────────────────────────────────── */

.legal-table th,
.legal-table td {
	vertical-align: top;
}
.legal-table tbody th {
	min-width: 9rem;
	font-weight: 700;
}
@media (max-width: 50rem) {
	/* Four columns of prose don't fit a phone: one card per row instead. */
	.legal-table thead {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
	}
	.legal-table,
	.legal-table tbody,
	.legal-table tr,
	.legal-table th,
	.legal-table td {
		display: block;
		width: 100%;
	}
	.legal-table tr {
		padding: 0.9rem 0;
		border-bottom: 2px solid var(--ink);
	}
	.legal-table tr:last-child {
		border-bottom: 0;
	}
	.legal-table tbody th,
	.legal-table td {
		padding: 0.2rem 1rem;
		border: 0;
	}
	.legal-table tbody th {
		font-family: var(--font-display);
		font-size: 1.15rem;
		font-stretch: 110%;
	}
	.legal-table td::before {
		content: attr(data-label);
		display: block;
		margin-top: 0.4rem;
		font-family: var(--font-mono);
		font-size: 0.68rem;
		letter-spacing: 0.1em;
		text-transform: uppercase;
		color: var(--ink-2);
	}
}

.legal-terms {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: term;
}
.legal-terms > li {
	position: relative;
	padding: 0 0 1.25rem 3.4rem;
	border-bottom: 1px solid var(--rule);
	counter-increment: term;
}
.legal-terms > li::before {
	content: '§' counter(term, decimal-leading-zero);
	position: absolute;
	top: 0.3rem;
	left: 0;
	font: 600 0.78rem / 1 var(--font-mono);
	color: var(--accent-text);
}
.legal-terms h2 {
	font-size: clamp(1.2rem, 2.4vw, 1.5rem);
}
@media (max-width: 36rem) {
	.legal-terms > li {
		padding-left: 0;
	}
	.legal-terms > li::before {
		position: static;
		display: block;
		margin-bottom: 0.4rem;
	}
}

/* ─── Heritage channels: smoke signal and fax ───────────────────────────── */

.smoke-scene {
	margin: 0;
	max-width: 40rem;
}
.smoke-stage {
	position: relative;
	display: block;
	height: clamp(16rem, 50vw, 22rem);
	overflow: hidden;
	background: linear-gradient(to bottom, var(--paper-2), var(--paper));
	border: 3px solid var(--ink);
	box-shadow: var(--shadow);
}
.smoke-hill {
	position: absolute;
	left: -15%;
	right: -15%;
	bottom: -7rem;
	height: 10rem;
	background: var(--mc-bg);
	border-top: 3px solid var(--ink);
	border-radius: 50%;
}
.smoke-fire {
	position: absolute;
	left: 50%;
	bottom: 1.7rem;
	width: 5rem;
	height: 3.5rem;
	transform: translateX(-50%);
}
.smoke-log {
	position: absolute;
	left: 0;
	bottom: 0;
	width: 5rem;
	height: 0.75rem;
	background: #6b4a2b;
	border: 2px solid #17140f;
	border-radius: 0.4rem;
}
.smoke-log-a {
	transform: rotate(13deg);
}
.smoke-log-b {
	transform: rotate(-13deg);
}
.smoke-flame {
	position: absolute;
	left: 50%;
	bottom: 0.45rem;
	width: 2.2rem;
	height: 3rem;
	margin-left: -1.1rem;
	background: radial-gradient(ellipse at 50% 78%, #ffe27a 0 22%, #f2a300 42%, #e2491f 70%, transparent 72%);
	border-radius: 50% 50% 45% 45% / 62% 62% 38% 38%;
	transform-origin: 50% 100%;
	animation: smoke-flicker 0.22s ease-in-out infinite alternate;
}
.smoke-puff {
	position: absolute;
	left: 50%;
	bottom: 4.6rem;
	width: 4.5rem;
	height: 3rem;
	margin-left: -2.25rem;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 40%, rgb(120 111 93 / 0.75), rgb(120 111 93 / 0.35) 60%, transparent 72%);
	opacity: 0;
	animation: smoke-rise 6s ease-out infinite;
	animation-delay: calc(var(--i) * -1s);
}
@keyframes smoke-rise {
	0% {
		transform: translate(0, 0) scale(0.35);
		opacity: 0;
	}
	12% {
		opacity: 0.95;
	}
	70% {
		opacity: 0.55;
	}
	100% {
		transform: translate(2.5rem, -15rem) scale(2.3);
		opacity: 0;
	}
}
@keyframes smoke-flicker {
	from {
		transform: scale(1, 1);
	}
	to {
		transform: scale(0.9, 1.1) rotate(2deg);
	}
}
@media (prefers-reduced-motion: reduce) {
	/* A still life: the puffs stacked up the sky, the fire not flickering. */
	.smoke-puff {
		animation: none;
		opacity: calc(0.85 - var(--i) * 0.12);
		transform: translate(calc(var(--i) * 0.45rem), calc(var(--i) * -2.3rem)) scale(calc(0.55 + var(--i) * 0.28));
	}
	.smoke-flame {
		animation: none;
	}
}
.smoke-scene figcaption {
	margin-top: 0.6rem;
}

.fax-sheet {
	max-width: 34rem;
	padding: clamp(1.25rem, 4vw, 2.25rem);
	color: #17140f;
	font-family: var(--font-mono);
	background-color: #fbfaf4;
	background-image: repeating-linear-gradient(to bottom, transparent 0 3px, rgb(23 20 15 / 0.03) 3px 4px);
	border: 1px solid var(--rule-2);
	box-shadow: var(--shadow);
	transform: rotate(-0.8deg);
}
.fax-banner {
	margin: 0 0 1rem;
	padding-bottom: 0.5rem;
	font: 900 clamp(1.1rem, 4vw, 1.6rem) / 1 var(--font-display);
	font-stretch: 130%;
	letter-spacing: 0.08em;
	border-bottom: 4px double #17140f;
}
.fax-fields {
	margin: 0;
}
.fax-fields div {
	display: grid;
	grid-template-columns: 5.5rem 1fr;
	gap: 0.5rem;
	padding: 0.3rem 0;
	border-bottom: 1px dashed rgb(23 20 15 / 0.3);
}
.fax-fields dt {
	font-size: 0.72rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}
.fax-fields dd {
	margin: 0;
}
.fax-message {
	margin: 1.25rem 0 0.5rem;
	font: 900 clamp(3rem, 14vw, 6rem) / 0.9 var(--font-display);
	font-stretch: 150%;
	letter-spacing: -0.03em;
	filter: blur(0.5px);
}
.fax-noise {
	margin: 0;
	font-size: 0.72rem;
	color: #786f5d;
	overflow-wrap: anywhere;
}

/* ─── /stork ────────────────────────────────────────────────────────────── */

.stork-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(17rem, 23rem);
	gap: clamp(1rem, 3vw, 2rem);
	align-items: start;
}
@media (max-width: 60rem) {
	.stork-layout {
		grid-template-columns: minmax(0, 1fr);
	}
}
.stork-stage {
	position: relative;
	width: 100%;
	/* As wide as fits, but short enough that the whole field is on screen at once. */
	max-width: min(540px, calc((100svh - 8rem) * 480 / 560));
	margin-inline: auto;
	background: var(--paper);
	border: 3px solid var(--ink);
	box-shadow: var(--shadow);
	user-select: none;
	-webkit-user-select: none;
}
.stork-canvas {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 480 / 560;
}
.stork-stage.is-playing .stork-canvas {
	touch-action: none;
	cursor: none;
}
.stork-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.2rem;
	padding: 1.5rem;
	text-align: center;
	background: color-mix(in srgb, var(--paper) 84%, transparent);
}
.stork-overlay p {
	max-width: 30ch;
	margin: 0 0 0.6rem;
}
.stork-overlay-title {
	font-family: var(--font-display);
	font-size: clamp(1.6rem, 5vw, 2.4rem);
	font-weight: 900;
	font-stretch: 122%;
	line-height: 1.02;
	letter-spacing: -0.02em;
	text-wrap: balance;
}
.stork-main > p[data-stork-bar] {
	max-width: 540px;
	margin-inline: auto;
	text-align: center;
}
.stork-bar {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem;
	max-width: 540px;
	margin-inline: auto;
}
.stork-move {
	min-width: 4.5rem;
	font-size: 1.15rem;
	touch-action: manipulation;
	user-select: none;
	-webkit-user-select: none;
}
/* Phones: one row, the arrows taking whatever is left at either end (thumb-sized). */
@media (max-width: 30rem) {
	.stork-bar {
		display: grid;
		grid-template-columns: minmax(3rem, 1fr) auto auto minmax(3rem, 1fr);
	}
	.stork-bar .btn {
		padding-inline: 0.75rem;
	}
	.stork-move {
		min-width: 0;
	}
}
.stork-initials-input {
	width: 7.5ch;
	font-size: 1.5rem;
	letter-spacing: 0.3em;
	text-align: center;
	text-transform: uppercase;
}
.stork-side fieldset {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}
.stork-side fieldset:disabled .field,
.stork-side fieldset:disabled button {
	opacity: 0.6;
}
.stork-side legend {
	padding: 0;
}
.stork-initials {
	letter-spacing: 0.15em;
}
.stork-board td:first-child {
	width: 2.5rem;
}
.stork-legend {
	display: grid;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}
.stork-legend-icon {
	display: inline-block;
	width: 1.7rem;
	text-align: center;
}
