/* SAGEN website base layer (light direction): design tokens, reset, typography, shared chrome
   (header, navigation, footer), buttons, keyboard focus, icons and section transitions.
   Loaded first on every public page; styles.css (homepage), page.css (inner pages) and
   legal.css (legal/utility pages) build on top of it. Decisions are recorded in CLAUDE.md. */
:root {
  --navy: #04152f;
  --navy2: #072542;
  --teal: #087f7a;
  --teal-ink: #075f5b;
  --teal-wash: #e6f3f2;
  --mint: #55d6cf;
  --gold: #c4a85c;
  --ink: #0a1c35;
  --muted: #536277;
  --line: #d9e1e7;
  --white: #ffffff;
  --paper: #f7f8f6;   /* page ground */
  --stone: #eff2ee;   /* alternate light surface */
  --mist: var(--stone);
  --max: 1220px;
  --gutter: max(24px, calc((100vw - var(--max)) / 2));
  --r-card: 16px;
  --r-ctl: 12px;
  --soft: 0 1px 0 rgba(10,28,53,.04), 0 18px 40px rgba(10,28,53,.06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: light; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--font); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; }
p { margin-top: 0; }
section[id] { scroll-margin-top: 104px; }

/* Typography: Georgia display for h1/h2, system sans for everything else, system mono for labels. */
h1, h2, h3, h4 { margin-top: 0; text-wrap: balance; }
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: -.03em; }
h1 em, h2 em { font-style: italic; color: var(--teal-ink); }
h3 { font-family: var(--font); font-weight: 600; letter-spacing: -.01em; }
.kicker, .eyebrow { display: block; margin: 0; font-family: var(--mono); font-size: 12.5px; font-weight: 500; letter-spacing: .02em; text-transform: none; color: var(--teal-ink); }
.kicker::before, .eyebrow::before { content: "/ "; color: var(--gold); }
:where(.spotlight-section, .cta, .site-footer, .cr) .kicker { color: var(--mint); }

/* Inline icons from /icons.svg. They inherit the text colour; always aria-hidden. */
.i { flex: none; width: .9em; height: .9em; margin-left: .4em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.08em; }
.i-lead { margin: 0 .35em 0 0; }

.skip-link {
  position: fixed; z-index: 100; top: 12px; left: 12px; padding: 12px 16px;
  color: #fff; border-radius: 6px; background: var(--navy); transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

/* Keyboard focus: teal ring with a white halo on light surfaces, gold ring with a navy halo on dark ones. */
:where(a, button, summary):focus-visible {
  outline: 3px solid var(--teal); outline-offset: 3px; box-shadow: 0 0 0 3px #fff;
}
:where(.spotlight-section, .cta, .dashboard-mock, .cr-hero, .cr-dark, .cr-cta, .site-footer) :where(a, button, summary):focus-visible {
  outline-color: #f1cf6a; box-shadow: 0 0 0 3px var(--navy);
}

/* Buttons and text links */
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 22px;
  border: 1px solid transparent; border-radius: var(--r-ctl); background: var(--teal); color: #fff;
  font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform .2s, background .2s;
}
.button:hover { transform: translateY(-1px); background: var(--teal-ink); }
.button:active { transform: scale(.98); }
.button.secondary, .button.outline { border-color: var(--line); background: var(--white); color: var(--ink); }
.button.secondary:hover, .button.outline:hover { background: var(--stone); }
:where(.spotlight-section, .cta) .button.secondary, :where(.spotlight-section, .cta) .button.outline { border-color: rgba(255,255,255,.3); background: transparent; color: #fff; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--teal-ink); font-size: 15px; font-weight: 700; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.textlink { display: inline-flex; align-items: center; min-height: 52px; padding: 0 6px; color: var(--muted); font-size: 15px; font-weight: 600; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 5px; }
.textlink:hover { color: var(--ink); text-decoration-color: var(--teal); }

/* Soft transitions between bands */
.wave { display: block; width: 100%; height: 56px; margin-bottom: -1px; }
.wave--white path { fill: var(--white); }
.wave--navy path { fill: var(--navy); }
.wave--paper path { fill: var(--paper); }
.wave.on-stone { background: var(--stone); }
.wave.on-navy { background: var(--navy); }
.wave.on-white { background: var(--white); }

/* ---------- Header and navigation ---------- */
/* Solid white: the light logo file has a white ground, so the header must match it exactly. */
.site-header { position: sticky; top: 0; z-index: 40; color: var(--ink); background: var(--white); border-bottom: 1px solid var(--line); }
.header-inner {
  position: relative; width: min(calc(100% - 48px), var(--max)); min-height: 80px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 30px;
}
.brand { display: flex; align-items: center; width: 200px; min-height: 44px; }
.brand img { display: block; width: 100%; height: auto; }
.site-nav { display: flex; align-items: center; gap: 28px; font-size: 14px; font-weight: 500; }
.site-nav a { color: var(--muted); text-decoration: none; transition: color .2s; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav > a, .nav-item > a { display: inline-flex; align-items: center; min-height: 44px; }
.site-nav .nav-cta { min-height: 44px; padding: 0 16px; border-radius: var(--r-ctl); background: var(--teal); color: #fff; font-weight: 700; }
.site-nav .nav-cta:hover { background: var(--teal-ink); color: #fff; }
.nav-item.has-submenu { position: relative; }
.nav-item.has-submenu > a::after {
  content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 0 3px 8px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg);
}
.submenu {
  position: absolute; top: 100%; left: -12px; z-index: 30; display: none; flex-direction: column;
  min-width: 260px; margin-top: 12px; padding: 8px; border: 1px solid var(--line);
  border-radius: var(--r-ctl); background: var(--white); box-shadow: var(--soft);
}
.submenu a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--ink); white-space: nowrap; }
.submenu a:hover, .submenu a:focus-visible, .submenu a[aria-current="page"] { background: var(--stone); color: var(--ink); }
.nav-item.has-submenu:hover .submenu, .nav-item.has-submenu:focus-within .submenu { display: flex; }
.menu { display: none; }

@media (min-width: 981px) {
  /* Bridge the gap so moving the pointer into the dropdown keeps it open. */
  .submenu::before { content: ""; position: absolute; left: -1px; right: -1px; top: -13px; height: 13px; }
}
@media (max-width: 980px) {
  .header-inner { min-height: 72px; }
  .menu { display: grid; place-content: center; gap: 7px; width: 44px; height: 44px; margin-right: -8px; border: 0; background: transparent; color: var(--ink); cursor: pointer; }
  .menu span { display: block; width: 25px; height: 1.5px; background: currentColor; transition: transform .2s; }
  .menu[aria-expanded="true"] span:first-child { transform: translateY(4.25px) rotate(45deg); }
  .menu[aria-expanded="true"] span:nth-child(2) { transform: translateY(-4.25px) rotate(-45deg); }
  .menu em { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .site-nav {
    position: absolute; top: 100%; left: -24px; right: -24px; z-index: 45; display: none; flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px 24px 22px; background: var(--white); border-bottom: 1px solid var(--line); box-shadow: 0 24px 40px rgba(10,28,53,.10); font-size: 17px;
  }
  .site-nav.open { display: flex; }
  .site-nav > a:not(.nav-cta), .nav-item.has-submenu > a { display: flex; align-items: center; min-height: 52px; border-bottom: 1px solid var(--line); color: var(--ink); }
  .nav-item.has-submenu { display: flex; flex-direction: column; }
  .nav-item.has-submenu > a::after { display: none; }
  .submenu { position: static; display: flex; flex-direction: column; min-width: 0; margin: 0; padding: 0 0 0 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; }
  .submenu a { padding: 0; color: var(--muted); font-size: 15px; }
  .site-nav .nav-cta { min-height: 52px; margin-top: 16px; justify-content: center; font-size: 15px; }
}

/* ---------- Footer (the grounding dark band) ---------- */
.site-footer { padding: 48px var(--gutter) 28px; color: #fff; background: var(--navy); font-size: 14px; }
main:has(> .cta:last-child) ~ .wave--footer { display: none; }
main:has(> .cta:last-child) ~ .site-footer { border-top: 1px solid rgba(255,255,255,.12); }
.footer-top { display: grid; grid-template-columns: auto 1fr auto; gap: 30px; align-items: center; padding-bottom: 30px; border-bottom: 1px solid rgba(255,255,255,.14); }
.footer-top p { max-width: 520px; margin: 0; color: rgba(255,255,255,.7); font-size: 15px; line-height: 1.6; }
.footer-email { display: inline-flex; align-items: center; min-height: 44px; color: var(--mint); font-size: 13px; font-weight: 700; text-decoration: none; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0 22px; padding: 12px 0; font-size: 13px; }
.footer-links a, .footer-links .cookie-settings {
  display: inline-flex; align-items: center; min-height: 44px; color: rgba(255,255,255,.82);
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; transition: text-decoration-color .2s, color .2s;
}
.footer-links a:hover, .footer-links .cookie-settings:hover, .footer-links a[aria-current="page"] { color: #fff; text-decoration-color: currentColor; }
.cookie-settings { padding: 0; border: 0; background: transparent; cursor: pointer; }
.footer-base { display: flex; justify-content: space-between; gap: 20px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.14); color: rgba(255,255,255,.62); font-size: 12px; }

@media (max-width: 980px) {
  .footer-top { grid-template-columns: 1fr; gap: 20px; justify-items: start; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .header-inner { width: calc(100% - 36px); }
  .brand { width: 170px; }
  .site-nav { left: -18px; right: -18px; padding-left: 18px; padding-right: 18px; }
  .footer-base { flex-direction: column; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .site-nav a, .footer-links a, .footer-links .cookie-settings, .button, .menu span { transition: none; }
}
