/* ==========================================================================
   Reset + element defaults
   ========================================================================== */

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

body {
	margin: 0;
	background: var(--c-surface);
	color: var(--c-body);
	font-family: var(--f-body);
	font-size: var(--fs-body);
	line-height: var(--lh-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 var(--s-4);
	color: var(--c-ink);
	font-family: var(--f-display);
	font-weight: var(--fw-semibold);
	line-height: var(--lh-heading);
	letter-spacing: var(--ls-tight);
	/* No `text-wrap: balance`: the original breaks headings greedily, and
	   balancing moves every wrap point away from it. */
}

h1 { font-size: var(--fs-h1); line-height: 1.06; }
h2 { font-size: var(--fs-h2); line-height: 1.1; }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
h5 { font-size: var(--fs-h5); }
h6 { font-size: var(--fs-h6); }

p {
	margin: 0 0 var(--s-4);
}

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

a {
	color: var(--c-accent);
	text-decoration: none;
	transition: color var(--t-base), opacity var(--t-base);
}

a:hover,
a:focus-visible {
	color: var(--c-ink);
}

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

svg {
	fill: none;
}

ul,
ol {
	margin: 0 0 var(--s-4);
	padding-left: 1.25em;
}

li {
	margin-bottom: var(--s-2);
}

blockquote {
	margin: var(--s-6) 0;
	padding-left: var(--s-5);
	border-left: 3px solid var(--c-line);
	color: var(--c-muted-2);
	font-size: var(--fs-lead);
}

hr {
	height: 1px;
	margin: var(--s-8) 0;
	border: 0;
	background: var(--c-line);
}

table {
	width: 100%;
	border-collapse: collapse;
}

th,
td {
	padding: var(--s-3) var(--s-4);
	border-bottom: 1px solid var(--c-line);
	text-align: left;
}

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

button {
	cursor: pointer;
}

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

/* --- Accessibility helpers ---------------------------------------------- */

.screen-reader-text {
	position: absolute !important;
	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;
}

.skip-link {
	position: absolute;
	top: -100px;
	left: var(--s-4);
	z-index: 999;
	padding: var(--s-3) var(--s-5);
	background: var(--c-ink);
	color: var(--c-white);
	border-radius: 0 0 var(--r-sm) var(--r-sm);
	transition: top var(--t-fast);
}

.skip-link:focus {
	top: 0;
	color: var(--c-white);
}

/* --- Motion ---------------------------------------------------------------
   In-page links glide instead of jumping, and every moving thing on the site
   stops moving for a visitor who has asked for less motion.
   ---------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

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

/* --- Reveal-on-scroll ----------------------------------------------------
   Content is visible by default. The hidden state applies only when the
   inline head script has marked the document as JS-capable, so a script
   failure can never leave a section permanently blank.
   ---------------------------------------------------------------------- */

.reveal {
	transition: opacity var(--t-slow), transform var(--t-slow);
}

html.js .reveal:not(.is-in) {
	opacity: 0;
	transform: translateY(18px);
}

@media (prefers-reduced-motion: reduce) {
	html.js .reveal:not(.is-in) {
		opacity: 1;
		transform: none;
	}
}
