/* ==========================================================================
   Base: reset, document rhythm, typography, accessibility foundation.
   ========================================================================== */

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	/* Offset anchor targets so the sticky header never hides a heading. */
	scroll-padding-top: calc(7rem + var(--wt-adminbar-h));
}

body {
	margin: 0;
	overflow-x: clip;
	background: var(--wt-bg);
	color: var(--wt-text);
	font-family: var(--wt-font-body);
	font-size: var(--wt-text-md);
	line-height: var(--wt-leading-normal);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	/* Reserve room for the fixed mobile action bar. */
	padding-bottom: var(--wt-mobile-bar-h);
}

.wt-page-lead {
	font-size: var(--wt-text-lg);
	color: var(--wt-text-muted);
}

@media (min-width: 768px) {
	body {
		padding-bottom: 0;
	}
}

h1, h2, h3, h4, h5, h6 {
	margin: 0 0 var(--wt-space-4);
	font-family: var(--wt-font-display);
	font-weight: var(--wt-weight-bold);
	line-height: var(--wt-leading-tight);
	color: var(--wt-heading);
	text-wrap: balance;
}

h1 { font-size: var(--wt-text-3xl); }
h2 { font-size: var(--wt-text-2xl); }
h3 { font-size: var(--wt-text-xl); }
h4 { font-size: var(--wt-text-lg); }

p, ul, ol, dl, blockquote, figure, table {
	margin: 0 0 var(--wt-space-4);
}

p {
	text-wrap: pretty;
	max-width: 68ch;
}

a {
	color: var(--wt-link);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	transition: color var(--wt-duration-fast) var(--wt-ease);
}

a:hover {
	color: var(--wt-link-hover);
}

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

/* Prevent layout shift: every image should carry width and height attributes,
   and the aspect ratio is honoured here. */
img[width][height] {
	height: auto;
}

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

hr {
	border: 0;
	border-top: 1px solid var(--wt-border);
	margin: var(--wt-space-7) 0;
}

/* --------------------------------------------------------------- utilities */

.wt-container {
	width: 100%;
	max-width: var(--wt-container);
	margin-inline: auto;
	padding-inline: var(--wt-gutter);
}

.wt-container--narrow {
	max-width: var(--wt-container-narrow);
}

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

.wt-section--dark {
	background: var(--wt-bg-dark);
	color: var(--wt-text-on-dark);
}

.wt-section--navy {
	background: var(--wt-bg-navy);
	color: var(--wt-text-on-dark);
}

.wt-section--raised {
	background: var(--wt-bg-raised);
}

.wt-section--dark h1, .wt-section--dark h2, .wt-section--dark h3, .wt-section--dark h4,
.wt-section--navy h1, .wt-section--navy h2, .wt-section--navy h3, .wt-section--navy h4 {
	color: var(--wt-heading-on-dark);
}

.wt-section--dark a:not(.wt-btn),
.wt-section--navy a:not(.wt-btn) {
	color: var(--wt-white);
}

.wt-grid {
	display: grid;
	gap: var(--wt-space-5);
}

@media (min-width: 768px) {
	.wt-grid--2 { grid-template-columns: repeat(2, 1fr); }
	.wt-grid--3 { grid-template-columns: repeat(2, 1fr); }
	.wt-grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
	.wt-grid--3 { grid-template-columns: repeat(3, 1fr); }
	.wt-grid--4 { grid-template-columns: repeat(4, 1fr); }
}

.wt-eyebrow {
	font-family: var(--wt-font-display);
	font-size: var(--wt-text-sm);
	font-weight: var(--wt-weight-bold);
	letter-spacing: var(--wt-tracking-wider);
	text-transform: uppercase;
	color: var(--wt-accent-text);
	margin-bottom: var(--wt-space-2);
}

.wt-section--dark .wt-eyebrow,
.wt-section--navy .wt-eyebrow {
	color: var(--wt-orange);
}

.wt-section-heading {
	margin-bottom: var(--wt-space-6);
	max-width: 46rem;
}

.wt-section-heading--center {
	margin-inline: auto;
	text-align: center;
}

.wt-section-heading__intro {
	font-size: var(--wt-text-md);
	color: var(--wt-text-muted);
	margin-bottom: 0;
}

.wt-section--dark .wt-section-heading__intro,
.wt-section--navy .wt-section-heading__intro {
	color: var(--wt-text-on-dark-muted);
}

.wt-actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wt-space-3);
	align-items: center;
}

/* ----------------------------------------------------------- accessibility */

.wt-sr-only {
	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. Visible as soon as it receives keyboard focus. */
.wt-skip-link {
	position: absolute;
	left: var(--wt-space-4);
	top: -100%;
	z-index: 999;
	padding: var(--wt-space-3) var(--wt-space-5);
	background: var(--wt-navy);
	color: var(--wt-white);
	font-weight: var(--wt-weight-bold);
	border-radius: 0 0 var(--wt-radius) var(--wt-radius);
	text-decoration: none;
}

.wt-skip-link:focus {
	top: var(--wt-adminbar-h);
	color: var(--wt-white);
}

/* A single, consistent focus ring everywhere. Focus is never removed. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: var(--wt-focus);
	outline-offset: var(--wt-focus-offset);
	border-radius: var(--wt-radius-sm);
}

.wt-section--dark :where(a, button, input, select, textarea):focus-visible,
.wt-section--navy :where(a, button, input, select, textarea):focus-visible {
	outline-color: var(--wt-white);
}

/* Minimum touch target on every interactive control. */
:where(a.wt-btn, button, .wt-nav__toggle, .wt-mobile-bar__item) {
	min-height: 44px;
}

/* ------------------------------------------------------------------ motion */

.wt-reveal {
	opacity: 0;
	transform: translateY(12px);
	transition: opacity var(--wt-duration-slow) var(--wt-ease),
	            transform var(--wt-duration-slow) var(--wt-ease);
}

.wt-reveal.is-visible {
	opacity: 1;
	transform: none;
}

/* Reduced motion: no transitions, no transforms, no smooth scrolling, no
   parallax, no autoplaying hero video. Content is fully available. */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

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

	.wt-reveal {
		opacity: 1;
		transform: none;
	}
}

/* Honour the operating-system contrast preference. */
@media (prefers-contrast: more) {
	:root {
		--wt-text-muted: var(--wt-graphite);
		--wt-border: var(--wt-steel);
	}
}

/* --------------------------------------------------------------- print */

@media print {
	.wt-contact-strip,
	.wt-header,
	.wt-mobile-bar,
	.wt-footer__nav,
	.wt-skip-link {
		display: none !important;
	}

	body {
		padding-bottom: 0;
		background: var(--wt-print-bg);
		color: var(--wt-print-text);
	}
}
