/* ==========================================================
   Respond — Charles Warner Digital edition
   Mobile first: base styles are the phone; min-width queries grow the layout.
   ========================================================== */

/* ---------- Brand tokens ---------- */
:root {
	--navy: #0D274C;
	--blue: #1F67AE;
	--white: #F5F7F8;
	--yellow: #EDDFB8; /* CWD Brand Yellow */

	--bg: #FFFFFF;
	--surface: var(--white);
	--ink: var(--navy);
	--muted: #3E5170;
	--rule: #D5DCE5;
	--link: var(--blue);
	--focus: var(--blue);

	--font: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
	--max: 980px;
	--gutter: 1rem;
	--radius: 4px;
	--header-h: 72px;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: var(--navy);
		--surface: #16335C;
		--ink: var(--white);
		--muted: #C3CCD8;
		--rule: #2A4670;
		--link: var(--yellow);
		--focus: var(--yellow);
	}
}
:root[data-theme="dark"] {
	--bg: var(--navy);
	--surface: #16335C;
	--ink: var(--white);
	--muted: #C3CCD8;
	--rule: #2A4670;
	--link: var(--yellow);
	--focus: var(--yellow);
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1rem); }

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font);
	font-size: 1.0625rem;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

a { color: var(--link); font-weight: 600; text-underline-offset: 3px; }
a:hover { color: var(--ink); }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

.skip {
	position: absolute; left: -9999px; top: 0; z-index: 200;
	background: var(--yellow); color: var(--navy); padding: .6rem 1rem;
}
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- Header ---------- */
header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--navy);
	border-bottom: 4px solid var(--yellow);
}

.header-inner {
	max-width: calc(var(--max) + 2 * var(--gutter));
	margin: 0 auto;
	padding: 0 var(--gutter);
	height: var(--header-h);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

#logo { display: block; width: 200px; height: 40px; flex: none; }
#logo svg, #logo img { width: 100%; height: 100%; display: block; }

nav { position: relative; }

/* Menu button: shown on small screens only */
#menu-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	min-width: 48px;
	height: 48px;
	padding: 0 .85rem;
	background: var(--yellow);
	color: var(--navy);
	border: 0;
	border-radius: var(--radius);
	font: 600 .9375rem var(--font);
	cursor: pointer;
}
#menu-icon:hover { background: var(--white); }
#menu-icon:focus-visible { outline-color: var(--yellow); }
#menu-icon .icon { width: 24px; height: 24px; }

nav ul { list-style: none; margin: 0; padding: 0; }

#primary-menu {
	padding: .5rem;
	position: absolute;
	right: 0;
	top: calc(100% + 12px);
	width: min(18rem, calc(100vw - 2 * var(--gutter)));
	max-height: calc(100vh - var(--header-h) - 2rem);
	overflow-y: auto;
	background: var(--navy);
	border: 2px solid var(--yellow);
	border-radius: var(--radius);
	box-shadow: 0 12px 28px rgba(13, 39, 76, .35);
}

/* JS hides the menu until the button opens it; without JS it stays visible */
.js #primary-menu { display: none; }
.js nav.open #primary-menu { display: block; }

nav li { margin: 0; }

nav a {
	display: block;
	padding: .8rem 1rem;
	color: var(--white);
	text-decoration: none;
	border-radius: 2px;
}
nav a:hover { background: rgba(245, 247, 248, .1); color: var(--yellow); }
nav a:focus-visible { outline-color: var(--yellow); }

nav a.current,
nav a[aria-current="page"] { color: var(--yellow); box-shadow: inset 3px 0 0 var(--yellow); }

/* ---------- Dropdowns (phone/tablet: accordion inside the menu panel) ---------- */
.visually-hidden {
	position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.item-row { display: flex; align-items: stretch; }
.item-row > a { flex: 1; }

.sub-toggle {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	min-height: 48px;
	padding: 0;
	background: none;
	border: 0;
	border-radius: 2px;
	color: var(--white);
	cursor: pointer;
}
.sub-toggle:hover { background: rgba(245, 247, 248, .1); color: var(--yellow); }
.sub-toggle:focus-visible { outline-color: var(--yellow); }

.chevron {
	width: 20px; height: 20px;
	fill: none; stroke: currentColor; stroke-width: 2.5;
	stroke-linecap: round; stroke-linejoin: round;
	transition: transform .15s ease;
}
.sub-toggle[aria-expanded="true"] { color: var(--yellow); }
.sub-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.submenu {
	margin: 0 0 .35rem .85rem;
	padding-left: .5rem;
	border-left: 2px solid rgba(237, 223, 184, .4);
}
.submenu a { padding: .65rem .85rem; font-weight: 500; font-size: .9688rem; }

/* JS collapses submenus until opened; without JS they stay visible */
.js .submenu { display: none; }
.js .has-sub.open > .submenu { display: block; }

@media (prefers-reduced-motion: reduce) {
	.chevron { transition: none; }
}

/* ---------- Main ---------- */
main {
	max-width: calc(var(--max) + 2 * var(--gutter));
	margin: 0 auto;
	padding: 1.5rem var(--gutter) 3rem;
}

.featured { border-radius: 8px; overflow: hidden; }

.eyebrow {
	margin: 2rem 0 .5rem;
	font-size: .8125rem;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--muted);
}

h1 {
	margin: 0 0 1rem;
	font-size: clamp(2rem, 7vw, 3.25rem);
	line-height: 1.08;
	letter-spacing: -.025em;
	font-weight: 700;
	color: var(--ink);
	max-width: 16ch;
}

.lead { font-size: 1.1875rem; color: var(--muted); max-width: 60ch; margin: 0 0 2rem; }

.tip {
	display: inline-block;
	margin: 0 0 2.5rem;
	padding: .55rem .9rem;
	background: var(--yellow);
	color: var(--navy);
	border-radius: var(--radius);
	font-size: .9375rem;
	font-weight: 500;
}
.tip .now { font-weight: 700; }

.screens {
	list-style: none;
	margin: 0 0 2.5rem;
	padding: 0;
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
}

.screen {
	background: var(--surface);
	border-top: 4px solid var(--blue);
	border-radius: var(--radius);
	padding: 1.25rem 1.25rem 1.4rem;
}
.screen h2 { margin: 0 0 .4rem; font-size: 1.1875rem; letter-spacing: -.01em; }
.screen p { margin: 0; color: var(--muted); }
.screen.is-now { border-top-color: var(--yellow); }
.screen .badge {
	display: inline-block;
	margin-left: .4rem;
	padding: .05rem .45rem;
	border-radius: 100px;
	background: var(--yellow);
	color: var(--navy);
	font-size: .75rem;
	font-weight: 700;
	vertical-align: .15em;
}
.screen:not(.is-now) .badge { display: none; }

.approach { max-width: 62ch; margin: 0 0 2rem; }
.approach h2 { font-size: 1.5rem; letter-spacing: -.015em; margin: 0 0 .5rem; }
.approach p { margin: 0 0 1rem; }

.actions { display: flex; flex-wrap: wrap; gap: .75rem; }

.btn {
	display: inline-flex;
	align-items: center;
	min-height: 48px;
	padding: 0 1.25rem;
	border-radius: var(--radius);
	text-decoration: none;
	font-weight: 600;
}
button.btn { font: inherit; font-weight: 600; border: 0; cursor: pointer; }
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--blue); color: var(--white); }
.btn-secondary,
button.btn-secondary { border: 2px solid var(--ink); color: var(--ink); background: transparent; }
.btn-secondary:hover { background: var(--ink); color: var(--bg); }

/* ---------- Form pages ---------- */
.form-page { max-width: calc(780px + 2 * var(--gutter)); }
.form-page .lead { margin-bottom: 1.75rem; }

.card-form {
	background: var(--surface);
	border-top: 4px solid var(--navy);
	border-radius: var(--radius);
	padding: 1.5rem 1.25rem;
	scroll-margin-top: calc(var(--header-h) + 1rem);
}
#comment { border-top-color: var(--yellow); }
.card-form h3 { margin: 0 0 1.25rem; font-size: 1.375rem; letter-spacing: -.01em; }

.field { margin: 0 0 1.1rem; min-width: 0; }
.field label,
.checks legend { display: block; font-weight: 600; font-size: .9375rem; margin-bottom: .35rem; }
.req { color: var(--blue); }
.hint { display: block; font-weight: 400; font-size: .875rem; color: var(--muted); margin: .25rem 0 0; }
.checks legend .hint { display: inline; margin-left: .35rem; }

.card-form input[type="text"],
.card-form input[type="email"],
.card-form input[type="tel"],
.card-form select,
.card-form textarea {
	width: 100%;
	min-height: 48px;
	padding: .65rem .8rem;
	font: inherit;
	font-size: 1rem;
	color: var(--ink);
	background: var(--bg);
	border: 2px solid #8C9AAE;
	border-radius: var(--radius);
}
.card-form textarea { resize: vertical; min-height: 7rem; }
.card-form select { appearance: none; -webkit-appearance: none; padding-right: 2.5rem;
	background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
	background-position: right 1.15rem center, right .8rem center;
	background-size: 6px 6px; background-repeat: no-repeat; }
.card-form input:focus-visible,
.card-form select:focus-visible,
.card-form textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }

.card-form [aria-invalid="true"] { border-color: #B3261E; }
.error { margin: .3rem 0 0; font-size: .875rem; font-weight: 600; color: #B3261E; }
.error:empty { display: none; }

.checks { border: 0; padding: 0; margin: 0 0 1.25rem; display: grid; grid-template-columns: 1fr; gap: .25rem; }
.checks .error { grid-column: 1 / -1; }
.check {
	display: flex; align-items: center; gap: .65rem;
	min-height: 44px; padding: .2rem .6rem;
	border-radius: var(--radius); cursor: pointer; font-weight: 500;
}
.check:hover { background: color-mix(in srgb, var(--yellow) 35%, transparent); }
.check input { width: 1.2rem; height: 1.2rem; margin: 0; flex: none; accent-color: var(--navy); }

.form-status { margin: 1rem 0 0; font-weight: 600; color: #B3261E; }
.form-status:empty { display: none; }

/* ---------- Thank-you page ---------- */
.thanks-page {
	min-height: calc(100vh - var(--header-h) - 9rem);
	display: grid;
	place-items: center;
	padding-top: 3rem;
	padding-bottom: 4rem;
}
.thanks-card { max-width: 36rem; text-align: center; }
.thanks-card h1 { max-width: none; }
.thanks-card .lead { margin-left: auto; margin-right: auto; }
.thanks-card .actions { justify-content: center; }
.thanks-mark {
	width: 72px; height: 72px; margin: 0 auto 1rem; display: block;
	fill: var(--yellow); stroke: var(--navy); stroke-width: 3.5;
	stroke-linecap: round; stroke-linejoin: round;
}
.thanks-mark circle { stroke: none; }

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .card-form { border-top-color: var(--blue); }
	:root:not([data-theme="light"]) .req { color: var(--yellow); }
	:root:not([data-theme="light"]) .error { color: #FFB4AB; }
	:root:not([data-theme="light"]) .card-form [aria-invalid="true"] { border-color: #FFB4AB; }
	:root:not([data-theme="light"]) .check input { accent-color: var(--yellow); }
}
:root[data-theme="dark"] .card-form { border-top-color: var(--blue); }
:root[data-theme="dark"] .req { color: var(--yellow); }
:root[data-theme="dark"] .error { color: #FFB4AB; }
:root[data-theme="dark"] .card-form [aria-invalid="true"] { border-color: #FFB4AB; }
:root[data-theme="dark"] .check input { accent-color: var(--yellow); }

/* ---------- Footer ---------- */
footer { background: var(--navy); color: var(--white); border-top: 4px solid var(--yellow); }
.footer-inner {
	max-width: calc(var(--max) + 2 * var(--gutter));
	margin: 0 auto;
	padding: 2rem var(--gutter) 1.5rem;
}
footer p { margin: 0; }
footer a { color: var(--yellow); }
footer a:hover { color: var(--white); }

.footer-top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1.25rem 2rem;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid rgba(245, 247, 248, .18);
}
.slogan {
	font-size: clamp(1.375rem, 4vw, 1.75rem);
	font-weight: 700;
	letter-spacing: -.02em;
	line-height: 1.15;
	color: var(--yellow);
}

.footer-bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: .5rem 1.5rem;
	padding-top: 1.25rem;
	font-size: .9375rem;
	color: #C3CCD8;
}

.social { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .6rem; }
.social a {
	display: inline-flex; align-items: center; gap: .55rem;
	min-height: 44px; padding: 0 1rem 0 .85rem;
	border: 2px solid var(--yellow); border-radius: 100px;
	color: var(--yellow); text-decoration: none; font-weight: 600; font-size: .9375rem;
}
.social a:hover { background: var(--yellow); color: var(--navy); }
.social a:focus-visible { outline-color: var(--yellow); }
.social svg { width: 1.1rem; height: 1.1rem; flex: none; }

/* Dark theme: the brand navy already is the page, so lift buttons to yellow */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .btn-primary { background: var(--yellow); color: var(--navy); }
	:root:not([data-theme="light"]) .btn-primary:hover { background: var(--white); }
	:root:not([data-theme="light"]) header,
	:root:not([data-theme="light"]) footer { background: #081B36; }
}
:root[data-theme="dark"] .btn-primary { background: var(--yellow); color: var(--navy); }
:root[data-theme="dark"] .btn-primary:hover { background: var(--white); }
:root[data-theme="dark"] header,
:root[data-theme="dark"] footer { background: #081B36; }

/* ---------- Tablet: 641px and up ---------- */
@media only screen and (min-width: 641px) {
	:root { --gutter: 1.5rem; }
	main { padding-top: 2rem; }
	.screens { grid-template-columns: repeat(2, 1fr); }
	.screens li:last-child { grid-column: 1 / -1; }
	.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
	.checks { grid-template-columns: 1fr 1fr; }
	.card-form { padding: 1.75rem; }
}

/* ---------- Desktop: 900px and up — full nav across the top ---------- */
@media only screen and (min-width: 900px) {
	#menu-icon { display: none; }

	#primary-menu,
	.js #primary-menu {
		display: flex;
		align-items: center;
		position: static;
		width: auto;
		max-height: none;
		overflow: visible;
		padding: 0;
		gap: .25rem;
		background: none;
		border: 0;
		box-shadow: none;
	}

	nav a { padding: .55rem .85rem; }
	nav a.current,
	nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--yellow); }

	/* Dropdown panels under each parent item */
	.has-sub { position: relative; }
	.item-row { align-items: center; }
	.item-row > a { padding-right: .2rem; }
	.sub-toggle { width: 28px; min-height: 40px; margin-right: .25rem; }

	.submenu,
	.js .submenu {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		z-index: 10;
		min-width: 15rem;
		margin: 0;
		padding: .5rem;
		background: var(--navy);
		border: 0;
		border-top: 3px solid var(--yellow);
		border-radius: 0 0 var(--radius) var(--radius);
		box-shadow: 0 14px 30px rgba(13, 39, 76, .35);
	}
	.has-sub:last-child .submenu { left: auto; right: 0; }

	.js .has-sub.open > .submenu,
	.has-sub:focus-within > .submenu { display: block; }

	.submenu a { white-space: nowrap; }
	.submenu a:hover { box-shadow: inset 3px 0 0 var(--yellow); }
}

/* Open on hover only where a real pointer can hover */
@media only screen and (min-width: 900px) and (hover: hover) {
	.has-sub:hover > .submenu,
	.js .has-sub:hover > .submenu { display: block; }
}

@media only screen and (min-width: 900px) {
	.screens { grid-template-columns: repeat(3, 1fr); }
	.screens li:last-child { grid-column: auto; }
}

/* Spam honeypot: hidden from people, left in place for bots */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Cookie notice ---------- */
.cookie-notice {
	position: fixed;
	z-index: 150;
	left: var(--gutter);
	right: var(--gutter);
	bottom: var(--gutter);
	max-width: 34rem;
	max-height: calc(100vh - 2 * var(--gutter));
	overflow-y: auto;
	padding: 1.25rem 1.25rem 1.35rem;
	background: var(--navy);
	color: var(--white);
	border-top: 4px solid var(--yellow);
	border-radius: var(--radius);
	box-shadow: 0 16px 40px rgba(13, 39, 76, .4);
	font-size: .9688rem;
}
.cookie-notice[hidden] { display: none; }
.cookie-notice h2 { margin: 0 0 .4rem; font-size: 1.125rem; }
.cookie-notice p { margin: 0 0 .75rem; }
.cookie-notice a { color: var(--yellow); }
.cookie-notice :focus-visible { outline-color: var(--yellow); }

.cookie-notice details { margin: 0 0 1rem; }
.cookie-notice summary {
	cursor: pointer; font-weight: 600; color: var(--yellow);
	min-height: 44px; display: flex; align-items: center;
}
.cookie-notice dl { margin: .25rem 0 0; }
.cookie-notice dt { font-weight: 600; margin-top: .6rem; }
.cookie-notice dd { margin: .15rem 0 0; color: #C3CCD8; }
.cookie-notice code { font-size: .875em; color: var(--white); }

.cookie-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.cookie-actions .btn { flex: 1 1 10rem; justify-content: center; }
.cookie-notice .btn-primary { background: var(--yellow); color: var(--navy); }
.cookie-notice .btn-primary:hover { background: var(--white); }
.cookie-notice .btn-secondary { border-color: var(--white); color: var(--white); }
.cookie-notice .btn-secondary:hover { background: var(--white); color: var(--navy); }

/* Keep the footer reachable above the notice */
body.has-cookie-notice { padding-bottom: 16rem; }

/* Footer link that reopens the notice */
.link-button {
	padding: 0; border: 0; background: none; cursor: pointer;
	font: inherit; font-weight: 600; color: var(--yellow);
	text-decoration: underline; text-underline-offset: 3px;
	min-height: 32px;
}
.link-button:hover { color: var(--white); }
.link-button:focus-visible { outline-color: var(--yellow); }
