/*
 * Base styles: reset, typography, links, focus, layout helpers, buttons, forms.
 * Values come from tokens.css; component styles (header, footer, sections) live in their own files.
 */

/* Reset ------------------------------------------------------------------------------------------ */

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

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

body {
	margin: 0;
	font-family: var(--font-body);
	font-size: var(--text-base);
	line-height: var(--leading-body);
	color: var(--color-ink);
	background: var(--color-cream);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6,
p, ul, ol, figure, blockquote, dl, dd {
	margin: 0;
}

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

img {
	height: auto;
}

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

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

/* Typography ------------------------------------------------------------------------------------- */

h1, h2, h3,
.heading {
	font-family: var(--font-display);
	font-weight: var(--weight-heavy);
	line-height: var(--leading-heading);
	text-wrap: balance;
}

h1, .heading-hero {
	font-size: var(--text-hero);
	line-height: var(--leading-tight);
	letter-spacing: -0.01em;
}

h2, .heading-2 {
	font-size: var(--text-h2);
}

.heading-2-lg {
	font-size: var(--text-h2-lg);
	line-height: var(--leading-tight);
}

.heading-2-sm {
	font-size: var(--text-h2-sm);
}

h3, .heading-3 {
	font-size: var(--text-h3);
}

h4, h5, h6 {
	font-size: var(--text-lg);
	font-weight: var(--weight-bold);
	line-height: var(--leading-snug);
}

.text-lead {
	font-size: var(--text-lead);
	line-height: var(--leading-body);
}

.text-muted {
	color: var(--color-muted);
}

.eyebrow {
	display: inline-flex;
	align-items: center;
	gap: var(--space-8);
	font-size: var(--text-xs);
	font-weight: var(--weight-bold);
	letter-spacing: var(--tracking-eyebrow);
	text-transform: uppercase;
	color: var(--color-blue);
}

/* Readable long-form text (classic-editor content, blog posts) */
.prose > * + * {
	margin-top: 1em;
}

.prose > :is(h2, h3, h4) {
	margin-top: 1.6em;
}

.prose :is(ul, ol) {
	padding-left: 1.25em;
}

.prose li + li {
	margin-top: 0.35em;
}

/* Links ------------------------------------------------------------------------------------------ */

a {
	color: var(--color-blue);
	text-underline-offset: 0.15em;
}

a:hover {
	color: var(--color-blue-hover);
}

.link-arrow {
	display: inline-flex;
	align-items: center;
	gap: var(--space-8);
	min-height: var(--tap-min);
	font-weight: var(--weight-bold);
	text-decoration: none;
}

.link-arrow:hover {
	text-decoration: underline;
}

/* Focus ------------------------------------------------------------------------------------------ */

:focus-visible {
	outline: var(--focus-ring);
	outline-offset: var(--focus-offset);
}

/* Dark and blue surfaces swap the focus color so the ring stays visible. */
.on-dark,
.on-blue {
	--focus-color: var(--color-yellow);
}

.on-yellow {
	--focus-color: var(--color-ink);
}

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

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

.skip-link {
	position: absolute;
	top: var(--space-8);
	left: var(--space-8);
	z-index: 1000;
	padding: var(--space-12) var(--space-16);
	background: var(--color-yellow);
	color: var(--color-ink);
	font-weight: var(--weight-heavy);
	border-radius: var(--radius-sm);
	transform: translateY(-200%);
}

.skip-link:focus {
	transform: none;
}

/* Layout ----------------------------------------------------------------------------------------- */

.container {
	width: min(100% - 2 * var(--gutter), var(--container-max));
	margin-inline: auto;
}

.section {
	padding-block: var(--section-pad);
}

.section--sm {
	padding-block: var(--section-pad-sm);
}

.stack {
	display: flex;
	flex-direction: column;
	gap: var(--stack-gap);
}

.on-dark {
	background: var(--color-ink);
	color: var(--color-white);
}

.on-dark a:not(.btn) {
	color: var(--color-white);
}

.on-blue {
	background: var(--color-blue);
	color: var(--color-white);
}

.on-blue a:not(.btn) {
	color: var(--color-white);
}

.on-yellow {
	background: var(--color-yellow);
	color: var(--color-ink);
}

.on-dark .eyebrow,
.on-blue .eyebrow {
	color: var(--color-yellow);
}

/* Icons ------------------------------------------------------------------------------------------ */

.icon {
	width: 1.25em;
	height: 1.25em;
	flex-shrink: 0;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.icon--solid {
	fill: currentColor;
	stroke: none;
}

/* Buttons ---------------------------------------------------------------------------------------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-10);
	min-height: 52px;
	padding: 0 var(--space-24);
	border: 2px solid transparent;
	border-radius: var(--radius-sm);
	font-family: var(--font-body);
	font-size: var(--text-md);
	font-weight: var(--weight-heavy);
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn--lg {
	min-height: 60px;
	padding: 0 var(--space-28);
	font-size: clamp(1.0625rem, 1.003rem + 0.238vw, 1.1875rem); /* 17 → 19 */
	border-radius: var(--radius-md);
}

.btn--sm {
	min-height: 48px;
	padding: 0 var(--space-20);
	font-size: var(--text-base);
}

.btn--block {
	display: flex;
	width: 100%;
}

.btn--yellow {
	background: var(--color-yellow);
	color: var(--color-ink);
}

.btn--yellow:hover {
	background: #f5c400;
	color: var(--color-ink);
}

.btn--white {
	background: var(--color-white);
	color: var(--color-ink);
}

.btn--white:hover {
	background: var(--color-cream);
	color: var(--color-ink);
}

.btn--white-outline {
	background: var(--color-white);
	color: var(--color-ink);
	border-color: var(--color-ink);
}

.btn--white-outline:hover {
	background: var(--color-cream);
	color: var(--color-ink);
}

.btn--dark {
	background: var(--color-ink);
	color: var(--color-white);
}

.btn--dark:hover {
	background: #000;
	color: var(--color-white);
}

.btn--blue {
	background: var(--color-blue);
	color: var(--color-white);
}

.btn--blue:hover {
	background: var(--color-blue-hover);
	color: var(--color-white);
}

.btn--outline-yellow {
	background: transparent;
	color: var(--color-white);
	border-color: var(--color-yellow);
}

.btn--outline-yellow:hover {
	background: var(--color-yellow);
	color: var(--color-ink);
}

/* Forms ------------------------------------------------------------------------------------------ */

label,
.label {
	display: block;
	margin-bottom: var(--space-8);
	font-size: var(--text-xs);
	font-weight: var(--weight-semibold);
}

input:is([type="text"], [type="email"], [type="tel"], [type="search"], [type="url"], [type="number"], [type="password"]),
select,
textarea {
	width: 100%;
	min-height: 54px;
	padding: 0 var(--space-16);
	border: 1px solid var(--color-line);
	border-radius: var(--radius-sm);
	background: var(--color-white);
	color: var(--color-ink);
	font-size: var(--text-base);
}

textarea {
	min-height: 140px;
	padding-block: var(--space-12);
	line-height: var(--leading-body);
}

input::placeholder,
textarea::placeholder {
	color: #6f695d; /* 5:1 on white; the lighter gray the design implies is too faint */
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
	outline-offset: 0;
	border-color: var(--color-ink);
}
