/* Reset and typography. */

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

* {
	margin: 0;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--header-h) + var(--space-m));
	overflow-x: clip;
}

body {
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: var(--step-0);
	line-height: 1.62;
	font-weight: 400;
	font-variation-settings: 'opsz' var(--opsz-text);
	letter-spacing: -0.008em;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: clip;
}

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

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

h1,
h2,
h3,
h4 {
	font-weight: 600;
	letter-spacing: var(--track-tight);
	line-height: 1.14;
	text-wrap: balance;
	color: var(--text);
	overflow-wrap: break-word;
	font-variation-settings: 'opsz' var(--opsz-display);
}

h1 {
	font-size: var(--step-5);
	font-weight: 700;
	letter-spacing: var(--track-display);
	line-height: 1;
}

h2 {
	font-size: var(--step-4);
	font-weight: 700;
	letter-spacing: var(--track-display);
	line-height: 1.04;
}

h3 {
	font-size: var(--step-2);
	font-weight: 600;
	letter-spacing: var(--track-tighter);
	line-height: 1.22;
}

h4 {
	font-size: var(--step-1);
	font-weight: 600;
	line-height: 1.34;
}

/* Emphasis in a headline is carried by colour alone, never by a second face. */
h1 em,
h2 em {
	font-style: normal;
	font-weight: inherit;
	color: var(--accent);
}

p {
	text-wrap: pretty;
}

a {
	color: var(--accent);
	text-decoration-color: var(--accent-line);
	text-underline-offset: 3px;
	transition: color var(--dur-fast) var(--ease);
}

a:hover {
	color: var(--accent-ink);
}

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

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

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

.skip-link {
	position: absolute;
	top: -100px;
	left: var(--space-s);
	z-index: 200;
	padding: var(--space-xs) var(--space-s);
	background: var(--accent);
	color: #fff;
	border-radius: var(--radius-pill);
	text-decoration: none;
}

.skip-link:focus {
	top: var(--space-s);
	color: #fff;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* Long-form copy coming out of the editor or meta fields. */
.prose > * + * {
	margin-top: 1em;
}

.prose {
	color: var(--text-muted);
	max-width: 65ch;
}

.prose strong {
	color: var(--text);
}

.prose h2,
.prose h3,
.prose h4 {
	color: var(--text);
	margin-top: 1.6em;
}

/* Long documents read better with a flatter heading scale than a landing page. */
.prose--long {
	max-width: 65ch;
}

.prose--long h2 {
	font-size: var(--step-2);
	margin-top: 2em;
	padding-top: 1.2em;
	border-top: 1px solid var(--line);
}

.prose--long h3 {
	font-size: var(--step-1);
}

.prose--long h2:first-child {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

.prose ul,
.prose ol {
	padding-left: 1.25em;
	display: grid;
	gap: 0.45em;
}

.prose li::marker {
	color: var(--accent);
}

.prose img {
	border-radius: var(--radius);
}

/*
 * Visible by default so above-the-fold content never pops.
 * JS adds .will-reveal only to items still below the fold, then .is-visible on entry.
 * animation-fill-mode: both is avoided — it snaps visible items to opacity 0 first.
 */
[data-reveal].will-reveal {
	opacity: 0;
}

[data-reveal].will-reveal.is-visible {
	animation: reveal-fade 500ms ease forwards;
}

@keyframes reveal-fade {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@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;
	}

	[data-reveal],
	[data-reveal].will-reveal,
	[data-reveal].will-reveal.is-visible {
		opacity: 1;
		transform: none;
		animation: none;
	}
}
