/* Base elements: reset, typography, links, focus, layout container. */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	margin: 0;
	font-family: var(--font-family);
	font-size: var(--text-body);
	font-weight: var(--font-weight-regular);
	line-height: 1.5;
	color: var(--color-text-primary);
	background: var(--color-background);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img,
svg,
video {
	max-width: 100%;
	height: auto;
}

/* Headings: app scale; the largest sizes shrink on small screens. */
h1,
h2,
h3,
h4,
h5,
h6 {
	margin: 0 0 var(--space-sm);
	font-weight: var(--font-weight-bold);
	line-height: 1.2;
	color: var(--color-text-primary);
}

h1 {
	font-size: clamp(var(--text-title1), 4vw, var(--text-large-title));
}

h2 {
	font-size: clamp(var(--text-title2), 3vw, var(--text-title1));
}

h3 {
	font-size: var(--text-title3);
	font-weight: var(--font-weight-semibold);
}

h4,
h5,
h6 {
	font-size: var(--text-headline);
	font-weight: var(--font-weight-semibold);
}

/* Two-tone headings: the accented part in brand red (large text, 4.26:1 passes AA for ≥24px). */
.title-accent {
	color: var(--color-primary);
}

/* Section heading used across the site: large, tight, with an optional red part. */
.section-title {
	margin: 0;
	/* 22–28px, normal letter spacing so it breathes. */
	font-size: clamp(1.375rem, 1.1rem + 0.9vw, 1.75rem);
	font-weight: var(--font-weight-bold);
	line-height: 1.2;
	letter-spacing: -0.005em;
}

p,
ul,
ol {
	margin: 0 0 var(--space-md);
}

small {
	font-size: var(--text-footnote);
}

strong,
b {
	font-weight: var(--font-weight-semibold);
}

hr {
	height: 1px;
	margin: var(--space-xl) 0;
	border: 0;
	background: var(--color-border);
}

/* Links: darker brand red (#D20A00 on white is 5.55:1, AA for small text). */
a {
	color: var(--color-primary-pressed);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
	transition: color var(--transition-fast);
}

a:hover {
	color: var(--color-button-primary-pressed);
}

/* Visible keyboard focus everywhere. */
:focus-visible {
	outline: 2px solid var(--color-primary-pressed);
	outline-offset: 2px;
}

::selection {
	background: var(--color-primary-subtle);
}

/* Layout container */
.container {
	width: 100%;
	max-width: var(--container-max);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

/* Accessibility helpers */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	white-space: nowrap;
}

.skip-link {
	position: absolute;
	left: -9999px;
	z-index: 1000;
}

.skip-link:focus {
	left: var(--space-md);
	top: var(--space-md);
	padding: var(--space-xs) var(--space-md);
	border-radius: var(--radius-sm);
	background: var(--color-background);
	box-shadow: var(--shadow-card);
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}
