/* Base — reset, type scale, layout primitives, accessibility.
 *
 * Every value here comes from 01-DESIGN-TOKENS.md §2 and §3. Serif headings are
 * always italic 500 unless a class says otherwise; `text-wrap: balance` on
 * headings and `pretty` on body copy are applied everywhere and are not optional
 * (they degrade harmlessly where unsupported).
 */

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

html {
	-webkit-text-size-adjust: 100%;
	/* `overflow-x` on body alone is not enough on iOS Safari — html must clip too. */
	overflow-x: clip;
}

html,
body {
	margin: 0;
	padding: 0;
	background: var(--bg);
}

body {
	font-family: var(--ui);
	font-size: 17px;
	line-height: 1.65;
	color: var(--ink2);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	/* A single overflowing decoration must never scroll the page sideways.
	 * `clip` rather than `hidden`: hidden makes body a scroll container that iOS
	 * Safari will still drag sideways; clip cannot scroll at all. */
	overflow-x: clip;
}

img,
svg,
video,
canvas { max-width: 100%; }

img,
video {
	height: auto;
	display: block;
}

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

a:hover {
	color: var(--moss-ink);
	text-decoration: underline;
	text-underline-offset: 3px;
}

:root[data-tg-theme="dark"] a:hover { color: var(--mint); }

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

button { cursor: pointer; }

:focus-visible {
	outline: 2px solid var(--moss);
	outline-offset: 2px;
	border-radius: 4px;
}

/* Screen-reader-only text that stays reachable by keyboard. */
.tg-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.tg-skip {
	position: absolute;
	top: -60px;
	left: 16px;
	z-index: 200;
	padding: 10px 16px;
	background: var(--ink);
	color: var(--bg);
	border-radius: 0 0 10px 10px;
	font-weight: 600;
	transition: top .18s var(--ease);
}

.tg-skip:focus {
	top: 0;
	text-decoration: none;
	color: var(--bg);
}

/* ---- type scale ---------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
	margin: 0;
	color: var(--ink);
	text-wrap: balance;
}

p { text-wrap: pretty; }

.tg-h1,
.tg-h1--hero {
	font-family: var(--ed);
	font-style: italic;
	font-weight: 500;
	letter-spacing: -.02em;
	color: var(--ink);
}

.tg-h1 {
	font-size: clamp(34px, 4.6vw, 54px);
	line-height: 1.06;
}

.tg-h1--hero {
	font-size: clamp(38px, 5.2vw, 64px);
	line-height: 1.05;
}

.tg-h2 { margin-bottom: 14px; }

.tg-h2--editorial {
	font-family: var(--ed);
	font-style: italic;
	font-weight: 500;
	font-size: clamp(26px, 3.4vw, 42px);
	line-height: 1.12;
	letter-spacing: -.02em;
}

.tg-h2--plain {
	font-family: var(--ui);
	font-weight: 700;
	font-size: clamp(26px, 3.4vw, 36px);
	line-height: 1.15;
	letter-spacing: -.015em;
}

.tg-h3 {
	font-family: var(--ui);
	font-weight: 600;
	font-size: 20px;
	line-height: 1.24;
}

.tg-overline {
	margin: 0 0 14px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--moss);
}

.tg-micro {
	font-size: 11.5px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: .07em;
	text-transform: uppercase;
}

.tg-lede {
	margin: 0;
	font-size: clamp(18px, 1.4vw, 21px);
	line-height: 1.6;
	color: var(--ink2);
	max-width: 36em;
}

.tg-small {
	font-size: 14px;
	line-height: 1.55;
	color: var(--ink3);
}

.tg-accent { color: var(--moss); }

/* ---- layout -------------------------------------------------------------- */

.tg-main { display: block; }

.tg-wrap {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 24px;
}

.tg-wrap--wide { max-width: 1240px; }
.tg-wrap--narrow { max-width: 840px; }
.tg-wrap--article { max-width: 680px; }

/* Vertical rhythm: 112px major, 96px minor, 64–80px band. */
.tg-section { padding: 112px 0; }
.tg-section--minor { padding: 96px 0; }
.tg-section--band { padding: 72px 0; }
.tg-section--soft { background: var(--moss-soft); }
.tg-section--card { background: var(--card); }

.tg-intro { max-width: 840px; margin-bottom: 36px; }
.tg-intro--center { margin-left: auto; margin-right: auto; text-align: center; }
.tg-intro--center .tg-lede { margin-left: auto; margin-right: auto; }

@media (max-width: 700px) {
	.tg-section { padding: 72px 0; }
	.tg-section--minor { padding: 64px 0; }
	.tg-section--band { padding: 48px 0; }
}

/* ---- utility ------------------------------------------------------------- */

.tg-stack > * + * { margin-top: 16px; }
.tg-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tg-center { text-align: center; }

/* Everything decorative is aria-hidden in the markup; this stops a stray one
 * from ever intercepting a click. */
[aria-hidden="true"] { pointer-events: none; }
[aria-hidden="true"] a,
[aria-hidden="true"] button { pointer-events: auto; }
