/* ════════════════════════════════════════════════════════════════════
   Bluewater Capital — shared site stylesheet

   What lives here: design tokens, base typography, header, mobile nav,
   footer, buttons, and shared accessibility utilities.
   What stays inline in each page: page-specific section CSS only.

   Load order: link this file BEFORE the page's <style> blocks so
   page-level rules of equal specificity can override it.

   Changelog (2026-10):
   - --text-muted #6B7785 → #5C6875 (old value failed WCAG AA for body text
     on --bg #FAFAFA and --bg-cool #F4F6FA)
   - Added --hub, --center-measure and the 8-point spacing scale here; the
     404 page used --s3/--s5 with no definition (margins silently collapsed)
   - Added skip-link styles, [id] scroll-margin-top, prefers-reduced-motion
   - Consolidated header / footer / mobile nav / buttons / eyebrow that were
     duplicated inline on every page
   - Nav dropdown breakpoint is 1080px in CSS and JS alike (the old inline
     script closed the menu at 768px — a real mismatch on every page)
   ════════════════════════════════════════════════════════════════════ */

:root {
  /* Surfaces */
  --bg: #FAFAFA;
  --bg-card: #FFFFFF;
  --bg-white: #FFFFFF;
  --bg-cool: #F4F6FA;
  --bg-dark: #0A2540;        /* deep accent — closing strip */
  --bg-darker: #061A30;      /* near-black with deep blue undertone */

  /* Text */
  --text: #0A1628;
  --text-muted: #5C6875;
  --text-light: #FFFFFF;
  --text-light-muted: rgba(255, 255, 255, 0.68);
  --border: #E6E9EE;
  --border-dark: rgba(255, 255, 255, 0.10);

  /* Deep blue family — working range #0A2540 → #1A3A6E */
  --blue-1: #0A2540;
  --blue-2: #0E2D50;
  --blue-3: #133356;
  --blue-4: #16395F;
  --blue-5: #1A3A6E;
  --blue-l1: #1A3A6E;
  --blue-l2: #234A85;
  --blue-l3: #2F5C9C;
  --blue-l4: #3E72B4;
  --blue-l5: #5089C4;
  --blue-quiet: #6B8AB5;

  /* Typography — Geist stands in for Söhne; to re-font the site change
     these two tokens and the Google Fonts link in the pages. */
  --font-body: 'Geist', sans-serif;
  --font-display: 'Geist', sans-serif;
  --t-label:    12px;
  --t-caption:  13px;
  --t-small:    15px;
  --t-body:     17px;
  --t-prose:    18px;
  --t-lead:     20px;
  --t-h3:       24px;
  --t-h2:       clamp(28px, 3.2vw, 38px);
  --t-h1:       clamp(34px, 4.4vw, 50px);
  --t-display:  clamp(40px, 5.6vw, 64px);

  /* Layout */
  --container: 1280px;
  --hub: 1200px;
  --center-measure: 960px;
  --gutter: 32px;

  /* 8-point spacing scale */
  --s1: 8px;  --s2: 16px; --s3: 24px; --s4: 32px;
  --s5: 48px; --s6: 64px; --s7: 96px;

  /* Section vertical padding — homepage default; hub pages override with
     clamp(64px, 9vw, 96px) in a small page-level :root. */
  --section-py: clamp(80px, 12vw, 128px);
}

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

html { scroll-behavior: smooth; scrollbar-gutter: stable both-edges; }

body {
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.hub {
  max-width: var(--hub);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

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

/* Anchor jumps land clear of the sticky header (≈66px tall) */
[id] { scroll-margin-top: 84px; }

/* ─── SKIP LINK ─── */
.skip-link {
  position: absolute; left: 16px; top: -56px; z-index: 200;
  background: var(--blue-1); color: #fff;
  padding: 10px 18px; border-radius: 4px;
  font-size: var(--t-small); font-weight: 500;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 12px; }

/* ─── HEADINGS / EYEBROW ─── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.04;
  color: var(--text);
}

.eyebrow {
  font-family: var(--font-display);
  font-size: var(--t-label);
  line-height: 1.2;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--blue-l3);
  margin-bottom: 16px;
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 28px;
  background: var(--blue-1);
  color: #fff;
  font-family: var(--font-body);
  font-size: var(--t-small); line-height: 1.5; font-weight: 500;
  border-radius: 4px;
  transition: background 0.18s ease, transform 0.18s ease;
}
.btn:hover { background: var(--blue-5); }
.btn svg { width: 14px; height: 14px; stroke: currentColor; }

/* ─── HEADER ─── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 250, 250, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex; align-items: center; justify-content: space-between;
  gap: 32px;
}
.site-header .logo { flex-shrink: 0; }
.site-header .logo img { height: 26px; width: auto; }
.site-header nav { display: flex; align-items: center; gap: 28px; }
.site-header nav a {
  font-size: var(--t-body); line-height: 1.6; font-weight: 400;
  color: var(--text);
  transition: color 0.15s ease;
  white-space: nowrap;
}
.site-header nav a:hover { color: var(--blue-3); }
.site-header nav a[aria-current="page"] {
  color: var(--blue-1); font-weight: 600;
  text-decoration: underline; text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}
.site-header nav .nav-gap { display: inline-block; width: 24px; height: 1px; }

/* ─── MOBILE NAV (hamburger, ≤1080) ───
   Switches at 1080, not 768: below ~1060px the full menu cannot fit beside
   the logo and the logo was being squeezed to a sliver. */
.nav-toggle {
  display: none; appearance: none; -webkit-appearance: none;
  background: none; border: 0; padding: 8px; margin: -8px -8px -8px 0;
  cursor: pointer; color: var(--text); line-height: 0;
}
.nav-toggle svg { width: 24px; height: 24px; display: block; stroke: currentColor; }
.nav-toggle .nav-x { display: none; }
.nav-toggle[aria-expanded="true"] .nav-bars { display: none; }
.nav-toggle[aria-expanded="true"] .nav-x { display: block; }
@media (max-width: 1080px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .site-header .inner { flex-wrap: nowrap; gap: 16px; }
  .site-header nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0; flex-wrap: nowrap;
    background: rgba(250, 250, 250, 0.98);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 18px 40px -20px rgba(10, 37, 64, 0.28);
    padding: 4px var(--gutter) 12px; display: none;
  }
  .site-header nav[data-open="true"] { display: flex; }
  .site-header nav a { font-size: var(--t-body); line-height: 1.6; padding: 14px 0; border-bottom: 1px solid var(--border); }
  .site-header nav a:last-of-type { border-bottom: 0; }
  .site-header nav .nav-gap { display: none; }
}

/* ─── FOOTER ─── */
.site-footer {
  background: #0A2540;
  color: var(--text-light-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: var(--section-py) 0 40px;
}
.site-footer .ftr-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.site-footer .ftr-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
}
.site-footer .ftr-h {
  font-family: var(--font-display);
  font-size: var(--t-label);
  line-height: 1.2;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #FFFFFF;
  margin-bottom: 20px;
}
.site-footer a {
  color: var(--text-light-muted);
  transition: color 0.15s ease;
}
.site-footer a:hover { color: #FFFFFF; }
.site-footer .ftr-contact p {
  font-size: var(--t-small);
  line-height: 1.5;
  margin-bottom: 14px;
}
.site-footer .ftr-contact a {
  display: block;
  font-size: var(--t-small);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.site-footer .ftr-links { list-style: none; }
.site-footer .ftr-links li { line-height: 2.1; }
.site-footer .ftr-links a { font-size: var(--t-small); line-height: 1.5; }
.site-footer .ftr-rule {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  margin: 48px 0 28px;
}
.site-footer .ftr-legal {
  font-size: var(--t-caption);
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.55);
}
.site-footer .ftr-legal p { margin-bottom: 8px; max-width: 1040px; }
@media (max-width: 900px) {
  .site-footer .ftr-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
}
@media (max-width: 560px) {
  .site-footer .ftr-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 960px) {
  :root { --gutter: 24px; }
  .site-header nav { gap: 18px; }
  /* Tablet: 3-up card grids drop to 2-up (hub / insights pages) */
  .insight-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  /* 80px floor reads as dead space between sections on a phone. */
  :root { --section-py: clamp(32px, 8vw, 40px); }

  .site-header .inner { padding: 14px var(--gutter); gap: 16px; }
}

@media (max-width: 480px) {
  :root {
    --t-lead:    18px;
    --t-h3:      21px;
    --t-h2:      26px;
    --t-h1:      28px;
    --t-display: 32px;
  }
  /* Display tracking and leading are set for the desktop size.
     Loosen both where headings drop to their phone-width floors. */
  .hero h1, .cta-band h2, .section-head h2, .stat .val, .problem p, .team-initials {
    line-height: 1.20;
    letter-spacing: -0.012em;
  }
  .hero h1 { line-height: 1.10; }
}

/* ─── REDUCED MOTION ─── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .qa-item[open] .qa-answer { animation: none; }
  .btn, .insight-card, .read-more, .insight-read, .skip-link { transition: none; }
}
