/* ==========================================================================
   BASE — fonts, design tokens (light / dark), reset, typography, buttons
   ========================================================================== */

/* Self-hosted fonts. font-display swap + preload keeps layout shift near zero. */
@font-face {
	font-family: "Bebas Neue";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/bebas-neue-latin-400-normal.woff2") format("woff2");
}
@font-face {
	font-family: "Source Sans 3";
	font-style: normal;
	font-weight: 200 900;
	font-display: swap;
	src: url("../fonts/source-sans-3-latin-wght-normal.woff2") format("woff2");
}

/* ---------- Design tokens: LIGHT (default) ---------- */
:root {
	--gdr-blue: #159af9;
	--gdr-blue-ink: #0a66b2;
	--gdr-navy: #1d283a;
	--gdr-navy-2: #26354f;
	--gdr-red: #cf1717;
	--gdr-red-deep: #a50f0f;
	--gdr-green: #15803d;

	--bg: #ffffff;
	--bg-soft: #f3f8fc;
	--bg-tint: #e1f0f9;
	--surface: #ffffff;
	--surface-2: #f8fbfe;
	--ink: #0a0a0a;
	--ink-2: #2b3544;
	--muted: #4f5b6b;
	--line: #dde5ee;
	--accent: var(--gdr-blue);
	--accent-ink: var(--gdr-blue-ink);
	--band: var(--gdr-navy);
	--band-ink: #ffffff;
	--band-muted: #c3cfe0;
	--logo-bg: #ffffff;
	--shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
	--shadow-md: 0 8px 24px -8px rgba(16, 24, 40, 0.16);
	--shadow-lg: 0 24px 56px -20px rgba(16, 24, 40, 0.28);
	--focus: #0a66b2;

	--font-head: "Bebas Neue", "Arial Narrow", Impact, sans-serif;
	--font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

	--sec: clamp(4rem, 2.6rem + 5.6vw, 7.5rem);
	--gap: clamp(1rem, 0.7rem + 1.2vw, 1.75rem);
	--r-sm: 8px;
	--r-md: 14px;
	--r-lg: 22px;
	--gdr-pad: clamp(1.25rem, 0.8rem + 2vw, 2rem);
	--header-h: 76px;
	--tabbar-h: 68px;
	--ease: cubic-bezier(0.22, 0.8, 0.24, 1);

	--bs-body-font-family: var(--font-body);
	--bs-body-bg: var(--bg);
	--bs-body-color: var(--ink);
	--bs-link-color: var(--accent-ink);
	--bs-border-color: var(--line);
}

/* ---------- Design tokens: DARK ---------- */
html[data-theme="dark"] {
	--bg: #0b1220;
	--bg-soft: #0f192b;
	--bg-tint: #132339;
	--surface: #121c2e;
	--surface-2: #16223a;
	--ink: #eaf0f8;
	--ink-2: #c8d3e3;
	--muted: #9db0c9;
	--line: #25344d;
	--accent: #3ba9fb;
	--accent-ink: #66bcff;
	--band: #0a1424;
	--band-ink: #ffffff;
	--band-muted: #aebdd3;
	--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
	--shadow-md: 0 10px 28px -10px rgba(0, 0, 0, 0.6);
	--shadow-lg: 0 28px 60px -22px rgba(0, 0, 0, 0.75);
	--focus: #66bcff;
}

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

html {
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--header-h) + 12px);
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	-webkit-tap-highlight-color: transparent;
}

body.gdr-body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: clamp(1.0625rem, 1rem + 0.2vw, 1.125rem);
	line-height: 1.65;
	font-weight: 400;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
	overscroll-behavior-y: none;
	transition: background-color 0.25s ease, color 0.25s ease;
}

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

a { color: var(--accent-ink); text-underline-offset: 3px; }
a:hover { color: var(--accent-ink); }

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

.gdr-skip {
	position: fixed;
	left: 1rem;
	top: -120px;
	z-index: 2000;
	padding: 0.75rem 1.1rem;
	background: var(--gdr-navy);
	color: #fff;
	font-weight: 700;
	border-radius: var(--r-sm);
	transition: top 0.2s;
}
.gdr-skip:focus { top: 1rem; color: #fff; }

.container { max-width: 1240px; padding-inline: var(--gdr-pad); }
/* Rows never poke past the container padding (stops 1–8px sideways scroll on phones). */
.gdr-main .row,
.gdr-footer .row { --bs-gutter-x: min(3rem, calc(2 * var(--gdr-pad))); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
	font-family: var(--font-head);
	font-weight: 400;
	letter-spacing: 0.015em;
	line-height: 1.04;
	color: var(--ink);
	margin: 0 0 0.5em;
	text-wrap: balance;
}
.gdr-h2 {
	font-size: clamp(2.25rem, 1.5rem + 3.2vw, 4rem);
	margin-bottom: 0.4em;
}
.gdr-h2--light { color: #fff; }

p { margin: 0 0 1.1em; }
.gdr-lead {
	font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.375rem);
	line-height: 1.55;
	color: var(--ink-2);
	max-width: 36em;
}
.gdr-sub {
	font-size: clamp(1.05rem, 1rem + 0.3vw, 1.25rem);
	color: var(--muted);
	max-width: 40em;
}
.gdr-prose p { color: var(--ink-2); max-width: 42em; }
.gdr-prose a { font-weight: 600; }

/* Eyebrow label with a tick-mark bar */
.gdr-eyebrow {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin: 0 0 1rem;
	font-size: 0.9375rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--accent-ink);
}
.gdr-eyebrow::before {
	content: "";
	flex: none;
	width: 40px;
	height: 10px;
	background:
		repeating-linear-gradient(90deg, currentColor 0 3px, transparent 3px 7px);
	opacity: 0.9;
}
.gdr-eyebrow--light { color: #fff; }

/* ---------- Layout helpers ---------- */
.gdr-section { padding-block: var(--sec); position: relative; }
.gdr-head { margin-bottom: clamp(2rem, 1.2rem + 3vw, 3.5rem); }
.gdr-head--center { text-align: center; }
.gdr-head--center .gdr-eyebrow { justify-content: center; }
.gdr-head--center .gdr-sub { margin-inline: auto; }
.gdr-head--split {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1.5rem 2rem;
}
.gdr-head--split .gdr-h2 { margin-bottom: 0; }

.gdr-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.875rem;
	margin-top: 1.75rem;
}

/* ---------- Buttons ---------- */
.gdr-btn {
	--btn-bg: var(--gdr-navy);
	--btn-fg: #fff;
	--btn-bd: transparent;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	min-height: 48px;
	padding: 0.7rem 1.4rem;
	font-family: var(--font-body);
	font-weight: 700;
	font-size: 1.0625rem;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	color: var(--btn-fg);
	background: var(--btn-bg);
	border: 2px solid var(--btn-bd);
	border-radius: var(--r-sm);
	box-shadow: var(--shadow-sm);
	transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background-color 0.18s, color 0.18s, border-color 0.18s;
	touch-action: manipulation;
}
.gdr-btn:hover,
.gdr-btn:focus-visible { color: var(--btn-fg); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.gdr-btn:active { transform: translateY(0) scale(0.98); }
.gdr-btn .bi { font-size: 1.1em; flex: none; }
.gdr-btn--lg { min-height: 56px; padding: 0.85rem 1.7rem; font-size: 1.125rem; }

.gdr-btn--call { --btn-bg: var(--gdr-green); }
.gdr-btn--call:hover { --btn-bg: #116a32; }
.gdr-btn--red { --btn-bg: #cf1717; }
.gdr-btn--red:hover { --btn-bg: #a50f0f; }
.gdr-btn--navy { --btn-bg: var(--gdr-navy); }
.gdr-btn--navy:hover { --btn-bg: var(--gdr-navy-2); }
html[data-theme="dark"] .gdr-btn--navy { --btn-bg: #1f3a5f; }
html[data-theme="dark"] .gdr-btn--navy:hover { --btn-bg: #2a4d7d; }
.gdr-btn--outline {
	--btn-bg: transparent;
	--btn-fg: var(--ink);
	--btn-bd: var(--ink);
	box-shadow: none;
}
.gdr-btn--outline:hover { --btn-bg: var(--ink); --btn-fg: var(--bg); }
.gdr-btn--outline:hover { color: var(--bg); }
.gdr-btn--white { --btn-bg: #fff; --btn-fg: #a50f0f; }
.gdr-btn--white:hover { color: #a50f0f; }
.gdr-btn--ghost {
	--btn-bg: rgba(255, 255, 255, 0.12);
	--btn-fg: #fff;
	--btn-bd: rgba(255, 255, 255, 0.7);
	box-shadow: none;
}
.gdr-btn--ghost:hover { --btn-bg: #fff; --btn-fg: #a50f0f; color: #a50f0f; }

.gdr-iconbtn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	font-size: 1.35rem;
	color: var(--ink);
	background: transparent;
	border: 1px solid var(--line);
	border-radius: 50%;
	cursor: pointer;
	transition: background-color 0.18s, border-color 0.18s, transform 0.18s;
	touch-action: manipulation;
}
.gdr-iconbtn:hover { background: var(--bg-soft); border-color: var(--accent); }
.gdr-iconbtn:active { transform: scale(0.92); }
.gdr-iconbtn--ring { width: 52px; height: 52px; }

.gdr-stars { display: inline-flex; gap: 2px; color: #f5a623; font-size: 0.95em; }

/* ---------- Plain pages (404, posts) ---------- */
.gdr-page { padding-block: var(--sec); }
.gdr-page__inner { max-width: 860px; }
.gdr-page__title { font-size: clamp(2.5rem, 1.8rem + 3vw, 4rem); }
.gdr-404__code { font-family: var(--font-head); font-size: clamp(6rem, 4rem + 12vw, 12rem); line-height: 1; color: var(--accent); margin: 0; }
.gdr-postlist { display: grid; gap: 1.5rem; }
.gdr-postcard { padding: 1.5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.gdr-postcard h2 { font-size: 2rem; }
.gdr-postcard h2 a { text-decoration: none; color: var(--ink); }

/* ---------- Reveal on scroll (only when JS is running) ---------- */
.gdr-js [data-reveal] {
	opacity: 0;
	transform: translateY(22px);
	transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
	transition-delay: var(--d, 0s);
}
.gdr-js [data-reveal].is-in { opacity: 1; transform: none; }

@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;
	}
	.gdr-js [data-reveal] { opacity: 1; transform: none; }
}

.visually-hidden-focusable:not(:focus):not(:focus-within) { position: absolute; }

/* Bootstrap .btn:hover/:active/:focus must not override the theme's button colours */
.btn.gdr-btn:hover,
.btn.gdr-btn:focus,
.btn.gdr-btn:focus-visible,
.btn.gdr-btn:active,
.btn.gdr-btn.active {
	color: var(--btn-fg);
	background-color: var(--btn-bg);
	border-color: var(--btn-bd);
}
.btn.gdr-btn--ghost:hover, .btn.gdr-btn--ghost:focus-visible { color: #a50f0f; }
.btn.gdr-btn--white:hover, .btn.gdr-btn--white:focus-visible { color: #a50f0f; }
.btn.gdr-btn--outline:hover, .btn.gdr-btn--outline:focus-visible { color: var(--bg); }
.btn.gdr-btn:focus-visible { outline: 3px solid var(--gdr-blue); outline-offset: 3px; }
