/* Fonts, reset and base elements. */

/*
 * Self-hosted variable fonts, Latin subset (see assets/fonts/README.md).
 * Fraunces has opsz 9–144 and wght 300–700, with SOFT fixed at 100: the
 * design only uses the soft cut, and pinning it halves the file.
 */
@font-face {
	font-family: "Fraunces";
	src: url("../fonts/fraunces-var.woff2") format("woff2");
	font-weight: 300 700;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Figtree";
	src: url("../fonts/figtree-var.woff2") format("woff2");
	font-weight: 400 700;
	font-style: normal;
	font-display: swap;
}

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

html {
	-webkit-text-size-adjust: 100%;
	font-size: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--header-height) + 8px);
}

/* Text size control in the header (assets/js/main.js) */
html[data-size="1"] { font-size: 112.5%; }
html[data-size="2"] { font-size: 125%; }

body {
	margin: 0;
	overflow-x: clip;
	font-family: var(--sans);
	font-size: var(--t4);
	line-height: 1.65;
	color: var(--ink);
	background: var(--paper);
	-webkit-font-smoothing: antialiased;
}

/*
 * Fraunces with its SOFT axis up: rounded terminals, closer to the logo's
 * bookish italic than a sharp modern serif would be.
 */
h1, h2, h3, h4,
.serif {
	margin: 0;
	font-family: var(--serif);
	font-weight: 400;
	font-variation-settings: "SOFT" 100, "opsz" 144;
	letter-spacing: -0.02em;
	color: var(--forest);
	text-wrap: balance;
}

h1 { font-size: var(--t1); line-height: 1.02; font-weight: 350; }
h2 { font-size: var(--t2); line-height: 1.06; }
h3 { font-size: var(--t3); line-height: 1.2; font-variation-settings: "SOFT" 100, "opsz" 48; }

/* Emphasis is carried by colour alone: no italics anywhere. */
em { font-style: normal; }
h1 em, h2 em, h3 em { color: var(--leaf); }

p, ul, ol, dl, figure, address {
	margin: 0 0 1em;
}

address { font-style: normal; }

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

img, video { height: auto; }

a { color: inherit; }

:focus-visible {
	outline: 3px solid var(--coral);
	outline-offset: 3px;
}

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

.skip-link:focus {
	position: fixed !important;
	top: 0;
	left: 0;
	z-index: 200;
	width: auto;
	height: auto;
	margin: 0;
	padding: 14px 22px;
	clip: auto;
	background: var(--forest);
	color: #fff;
	font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation: none !important;
		transition: none !important;
		scroll-behavior: auto !important;
	}
}
