/*
 * Design tokens + shared primitives. TOKENS.md is the source of truth for every value here.
 * Loaded on the front end and injected into the editor via add_editor_style().
 */

:root {
	/* Color */
	--nvs-navy: #0A1F3C;
	--nvs-navy-deep: #081A32;
	--nvs-blue: #0F7EB8;
	--nvs-blue-dark: #0A5E8A;
	--nvs-blue-light: #63C0EA;
	--nvs-green: #078767;
	--nvs-ink: #55677B;
	--nvs-ink-muted: #6C7E92;
	--nvs-ink-faint: #8494A6;
	--nvs-on-dark: #C2D5E6;
	--nvs-on-dark-muted: #97AABF;
	--nvs-surface: #FFFFFF;
	--nvs-surface-alt: #F5F8FB;
	--nvs-border: #E4EAF1;
	--nvs-border-input: #D5DFEA;
	--nvs-danger: #C0392B;

	/* Type */
	--nvs-font-heading: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
	--nvs-font-body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

	--nvs-size-h1: clamp(38px, 5vw, 62px);
	--nvs-size-h1-sub: clamp(34px, 4vw, 52px);
	--nvs-size-h2: clamp(30px, 3.4vw, 44px);
	--nvs-size-h2-narrow: clamp(25px, 2.8vw, 36px);
	--nvs-size-cta-h3: clamp(21px, 2.2vw, 28px);
	--nvs-size-card-h3: 21px;
	--nvs-size-tile-h4: 18px;
	--nvs-size-eyebrow: 13px;
	--nvs-size-label: 12px;
	--nvs-size-lead: clamp(17px, 1.5vw, 20px);
	--nvs-size-body: 17px;
	--nvs-size-card-body: 15.5px;
	--nvs-size-stat: 34px;

	/* Layout */
	--nvs-width-wide: 1280px;
	--nvs-width-narrow: 980px;
	--nvs-width-faq: 900px;
	--nvs-gutter: 32px;

	--nvs-pad-section: clamp(64px, 8vw, 108px);
	--nvs-pad-prose: clamp(52px, 6vw, 88px);
	--nvs-pad-hero: clamp(64px, 8vw, 104px);
	--nvs-pad-hero-page: clamp(80px, 11vw, 148px);
	--nvs-pad-cta-panel: clamp(72px, 9vw, 120px);
	--nvs-gap-split: clamp(40px, 5vw, 72px);

	/* Radii, borders, motion */
	--nvs-radius-control: 3px;
	--nvs-radius-card: 4px;
	--nvs-shadow-hover: 0 22px 48px rgba(10, 31, 60, 0.13);
	--nvs-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
	--nvs-duration-hover: 220ms;
	--nvs-duration-reveal: 640ms;

	--nvs-scrim-hero: linear-gradient(90deg, rgba(10, 31, 60, 0.94) 0%, rgba(10, 31, 60, 0.82) 48%, rgba(10, 31, 60, 0.45) 100%);
	--nvs-scrim-cta: rgba(8, 26, 50, 0.72);
}

/* -------------------------------------------------------------------------
 * Base
 * ---------------------------------------------------------------------- */

body {
	font-family: var(--nvs-font-body);
	font-size: var(--nvs-size-body);
	line-height: 1.75;
	color: var(--nvs-ink);
	background: var(--nvs-surface);
	-webkit-font-smoothing: antialiased;
}

/*
 * Generic link colour, wrapped in :where() so it contributes no specificity. A plain
 * `.nvs-section a` rule (0,1,1) would out-rank every single-class button rule like
 * `.nvs-btn--primary` (0,1,0) and paint button labels blue on blue.
 */
.nvs-section :where(a) {
	color: var(--nvs-blue);
	text-decoration: none;
}

.nvs-section :where(a):hover {
	color: var(--nvs-blue-dark);
}

/* -------------------------------------------------------------------------
 * Section chrome
 * ---------------------------------------------------------------------- */

.nvs-section {
	position: relative;
}

.nvs-section--bg-white {
	background: var(--nvs-surface);
}

.nvs-section--bg-light {
	background: var(--nvs-surface-alt);
}

.nvs-container {
	margin: 0 auto;
	padding-left: var(--nvs-gutter);
	padding-right: var(--nvs-gutter);
}

.nvs-container--wide {
	max-width: var(--nvs-width-wide);
}

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

.nvs-container--faq {
	max-width: var(--nvs-width-faq);
}

.nvs-section--pad-section > .nvs-container {
	padding-top: var(--nvs-pad-section);
	padding-bottom: var(--nvs-pad-section);
}

.nvs-section--pad-prose > .nvs-container {
	padding-top: var(--nvs-pad-prose);
	padding-bottom: var(--nvs-pad-prose);
}

.nvs-section--pad-none > .nvs-container {
	padding-top: 0;
	padding-bottom: 0;
}

.nvs-section__header {
	max-width: 820px;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

/* -------------------------------------------------------------------------
 * Type primitives
 * ---------------------------------------------------------------------- */

.nvs-eyebrow {
	font-family: var(--nvs-font-heading);
	font-size: var(--nvs-size-eyebrow);
	font-weight: 800;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--nvs-blue);
	line-height: 1.3;
}

.nvs-label {
	font-family: var(--nvs-font-heading);
	font-size: var(--nvs-size-label);
	font-weight: 800;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--nvs-blue);
}

.nvs-h1,
.nvs-h2,
.nvs-h3,
.nvs-h4 {
	font-family: var(--nvs-font-heading);
	color: var(--nvs-navy);
	margin: 0;
	text-wrap: pretty;
}

.nvs-h1 {
	font-size: var(--nvs-size-h1);
	line-height: 1.08;
	font-weight: 800;
	letter-spacing: -0.02em;
}

.nvs-h1--sub {
	font-size: var(--nvs-size-h1-sub);
	line-height: 1.1;
}

.nvs-h2 {
	font-size: var(--nvs-size-h2);
	line-height: 1.15;
	font-weight: 800;
	letter-spacing: -0.02em;
}

.nvs-h2--narrow {
	font-size: var(--nvs-size-h2-narrow);
	line-height: 1.2;
}

.nvs-h3 {
	font-size: var(--nvs-size-card-h3);
	line-height: 1.3;
	font-weight: 700;
}

.nvs-h4 {
	font-size: var(--nvs-size-tile-h4);
	line-height: 1.4;
	font-weight: 700;
}

.nvs-lead {
	margin: 0;
	font-size: var(--nvs-size-lead);
	line-height: 1.65;
	color: var(--nvs-ink);
	text-wrap: pretty;
}

/*
 * EDITOR-CONSTRAINTS.md § 1 — <em> inside a block heading is the green accent, not italic.
 * Same hex on light and dark; deliberately not lightened on navy.
 */
.nvs-h1 em,
.nvs-h2 em,
.nvs-h3 em,
.nvs-h4 em,
.nvs-hero h1 em,
.nvs-card h3 em {
	font-style: normal;
	color: var(--nvs-green);
}

/* Inside body copy <em> stays a real italic. */
.nvs-prose em {
	font-style: italic;
	color: inherit;
}

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

.nvs-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: center;
}

/*
 * Buttons are <a> elements, which browsers box as content-box — unlike <button>, which the UA
 * stylesheet gives border-box. Without the two declarations below, the `min-height: 44px` touch
 * target the narrow breakpoint sets was *added* to the padding (44 + 36 = 80px) and the label sat
 * at the top of that content box, so a one-line button rendered two lines tall. border-box makes
 * min-height a floor on the whole box; inline-flex centres the label if that floor ever bites.
 */
.nvs-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	font-family: var(--nvs-font-body);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	padding: 16px 30px;
	border-radius: var(--nvs-radius-control);
	border: 1px solid transparent;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color var(--nvs-duration-hover) ease, color var(--nvs-duration-hover) ease, border-color var(--nvs-duration-hover) ease;
}

.nvs-btn--primary {
	background: var(--nvs-blue);
	color: #ffffff;
}

.nvs-btn--primary:hover {
	color: var(--nvs-navy);
	background: #ffffff;
}

.nvs-btn--primary.nvs-btn--on-light:hover {
	background: var(--nvs-navy);
	color: #ffffff;
}

.nvs-btn--inverse {
	background: #ffffff;
	color: var(--nvs-navy);
}

.nvs-btn--inverse:hover {
	background: var(--nvs-navy);
	color: #ffffff;
}

.nvs-btn--ghost {
	background: transparent;
	border-color: rgba(255, 255, 255, 0.55);
	color: #ffffff;
}

.nvs-btn--ghost:hover {
	background: #ffffff;
	color: var(--nvs-navy);
	border-color: #ffffff;
}

.nvs-btn--ghost.nvs-btn--on-light {
	border-color: var(--nvs-border-input);
	color: var(--nvs-navy);
}

.nvs-btn--ghost.nvs-btn--on-light:hover {
	background: var(--nvs-navy);
	color: #ffffff;
	border-color: var(--nvs-navy);
}

.nvs-btn--hero {
	padding: 18px 34px;
}

.nvs-textlink {
	font-size: 15px;
	font-weight: 600;
	color: var(--nvs-blue);
	text-decoration: none;
}

.nvs-textlink:hover {
	color: var(--nvs-blue-dark);
}

/* -------------------------------------------------------------------------
 * Motion
 * ---------------------------------------------------------------------- */

[data-nvs-reveal].is-armed {
	opacity: 0;
	transform: translateY(20px);
	transition: opacity var(--nvs-duration-reveal) var(--nvs-ease), transform var(--nvs-duration-reveal) var(--nvs-ease);
}

[data-nvs-reveal].is-revealed {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	[data-nvs-reveal],
	[data-nvs-reveal].is-armed {
		opacity: 1 !important;
		transform: none !important;
		transition: none !important;
	}

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

/* Utility */
.nvs-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.nvs-skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 1000;
	background: #ffffff;
	color: var(--nvs-navy);
	padding: 12px 20px;
	border-radius: var(--nvs-radius-control);
}

.nvs-skip-link:focus {
	left: 12px;
	top: 12px;
}

:where(.nvs-section, .nvs-header, .nvs-footer) :focus-visible {
	outline: 2px solid var(--nvs-blue);
	outline-offset: 2px;
}
