/**
 * Base layer: reset + typography scale + base element styles.
 * No colour, font, spacing, or radius value is hard-coded here — every
 * value pulls from assets/css/tokens.css.
 *
 * Margin strategy (see also components.css): headings/paragraphs/lists are
 * reset to zero margin using :where(), which carries zero specificity. That
 * means any later section- or component-level selector can set spacing
 * without a specificity fight or !important. Natural vertical rhythm inside
 * a block of content is opt-in via the .flow utility below (a "lobotomized
 * owl" — margin only between siblings, never on the block's own edges), so
 * a section's own padding and a heading's own margin never double up.
 */

/* Box model reset */
*,
*::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;
	}
}

:where(body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd) {
	margin: 0;
}

:where(ul, ol) {
	margin: 0;
	padding: 0;
	list-style: none;
}

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

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

/* Base document styles */
body {
	background-color: var(--color-cream);
	color: var(--color-charcoal);
	font-family: var(--font-body);
	font-weight: var(--weight-body-regular);
	font-size: var(--text-body);
	line-height: var(--leading-body);
	letter-spacing: var(--tracking-body);
}

/* Typography scale */
h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--font-display);
	font-weight: var(--weight-display-medium);
	line-height: var(--leading-tight);
	color: var(--color-ink);
}

h1 {
	font-size: var(--text-4xl);
}

h2 {
	font-size: var(--text-3xl);
}

h3 {
	font-size: var(--text-2xl);
}

h4 {
	font-size: var(--text-xl);
}

h5 {
	font-size: var(--text-lg);
}

h6 {
	font-size: var(--text-md);
}

p {
	max-width: 68ch;
}

small {
	font-size: var(--text-sm);
	line-height: var(--leading-body-sm);
	color: var(--color-mist);
}

/* The underline is drawn as a background-image, not text-decoration, so
   it can grow in from 0% width on hover instead of just snapping on —
   text-decoration has no transitionable width, so toggling it jumps. */
a {
	color: inherit;
	text-decoration: none;
	background-image: linear-gradient(var(--color-blue), var(--color-blue));
	background-repeat: no-repeat;
	background-position: 0 100%;
	background-size: 0% 1px;
	transition: color var(--t-fast) var(--ease), background-size var(--t-base) var(--ease);
}

a:hover,
a:focus-visible {
	color: var(--color-blue);
	background-size: 100% 1px;
}

/* Accessible focus state — never remove an outline without replacing it */
:focus-visible {
	outline: 2px solid var(--color-blue);
	outline-offset: 2px;
}

::selection {
	background-color: var(--color-gold-soft);
	color: var(--color-ink);
}

/* Labels / mono data — IBM Plex Mono, uppercase, small sizes only, per design system */
.eyebrow {
	display: inline-block;
	font-family: var(--font-mono);
	font-weight: var(--weight-mono-medium);
	font-size: var(--text-xs);
	letter-spacing: var(--tracking-label);
	text-transform: uppercase;
	color: var(--color-blue);
}

/* Layout primitives */
.container {
	width: 100%;
	max-width: var(--container-max);
	margin-inline: auto;
	padding-inline: var(--space-5); /* 24px on mobile */
}

@media (min-width: 640px) {
	.container {
		padding-inline: var(--container-padding); /* 32px from tablet up */
	}
}

/* Vertical rhythm utility: spacing lives between siblings only, so a block
   never carries its own top/bottom margin that could double up with a
   parent section's padding. */
.flow > * + * {
	margin-block-start: var(--space-flow, var(--space-4));
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--color-ink);
	color: var(--color-cream);
	padding: var(--space-2) var(--space-4);
	z-index: 1000;
	border-radius: var(--radius-sm);
}

.skip-link:focus {
	left: var(--space-4);
	top: var(--space-4);
}

/* Visually hidden but still available to screen readers — used for things
   like the hamburger button's "Menu" label, which is redundant on-screen
   next to its icon but necessary for assistive tech. */
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
