/* =========================================================================
   WPB Living — Shared Design System
   A coastal Florida civic-guide aesthetic. Dependency-free, offline-capable.
   No external images: all visual richness is CSS gradients + inline SVG.
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. DESIGN TOKENS (CSS custom properties)
   ------------------------------------------------------------------------- */
:root {
  /* --- Brand palette: ocean / Intracoastal blues + teals --- */
  --c-ocean-900: #08263a;
  --c-ocean-800: #0c3550;
  --c-ocean-700: #114c70;
  --c-ocean-600: #166695;
  --c-ocean-500: #1f86bf;   /* primary brand blue */
  --c-ocean-400: #4aa6d8;
  --c-ocean-300: #86c6e6;
  --c-ocean-200: #bfe2f2;
  --c-ocean-100: #e3f2fa;

  --c-teal-700: #0c6b66;
  --c-teal-600: #0f8a83;
  --c-teal-500: #15a89f;    /* secondary teal */
  --c-teal-400: #46c1b9;
  --c-teal-200: #b6e8e3;

  /* --- Palm / sea-grape greens --- */
  --c-palm-700: #1f5f3f;
  --c-palm-600: #2c7d52;
  --c-palm-500: #3a9a66;
  --c-palm-300: #9bd4b2;

  /* --- Sunset coral / orange accent --- */
  --c-coral-700: #c2410c;
  --c-coral-600: #e15a1f;
  --c-coral-500: #f97e3d;   /* accent */
  --c-coral-400: #ffa066;
  --c-coral-200: #ffd9c2;

  /* --- Warm sand / cream neutrals --- */
  --c-sand-50:  #fdfbf6;
  --c-sand-100: #f8f3e9;
  --c-sand-200: #efe6d4;
  --c-sand-300: #e2d4ba;

  /* --- Functional greys (slightly warm) --- */
  --c-ink-900: #11212b;
  --c-ink-800: #1d3540;
  --c-ink-700: #34505c;
  --c-ink-600: #4f6b77;
  --c-ink-500: #6f8893;
  --c-ink-300: #aabbc3;
  --c-ink-200: #d0dbe0;
  --c-ink-100: #e7eef1;
  --c-white:   #ffffff;

  /* --- Semantic status colors --- */
  --c-info:    #1f86bf;
  --c-info-bg: #e3f2fa;
  --c-tip:     #0f8a83;
  --c-tip-bg:  #e2f6f4;
  --c-warn:    #b45309;   /* hurricane amber */
  --c-warn-bg: #fdf2dc;
  --c-danger:  #c81e1e;   /* emergency red */
  --c-danger-bg: #fce8e8;

  /* --- Semantic role tokens (theme-able) --- */
  --bg:           var(--c-sand-50);
  --bg-subtle:    var(--c-sand-100);
  --surface:      var(--c-white);
  --surface-2:    var(--c-sand-100);
  --border:       var(--c-ink-200);
  --border-strong:var(--c-ink-300);
  --text:         var(--c-ink-900);
  --text-soft:    var(--c-ink-700);
  --text-muted:   var(--c-ink-500);
  --heading:      var(--c-ocean-800);
  --link:         var(--c-ocean-600);
  --link-hover:   var(--c-ocean-700);
  --accent:       var(--c-coral-600);
  --accent-hover: var(--c-coral-700);
  --brand:        var(--c-ocean-500);

  /* --- Typography --- */
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", "Palatino",
                  "Georgia", "Times New Roman", serif;
  --font-body: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont,
               "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Menlo", "Consolas", monospace;

  /* Fluid type scale (clamp: min, preferred-vw, max) */
  --fs-300: clamp(0.78rem, 0.74rem + 0.18vw, 0.86rem);
  --fs-400: clamp(0.95rem, 0.91rem + 0.22vw, 1.05rem);   /* body */
  --fs-500: clamp(1.1rem, 1.03rem + 0.35vw, 1.3rem);
  --fs-600: clamp(1.3rem, 1.18rem + 0.6vw, 1.65rem);
  --fs-700: clamp(1.6rem, 1.35rem + 1.2vw, 2.3rem);
  --fs-800: clamp(2rem, 1.55rem + 2.2vw, 3.2rem);
  --fs-900: clamp(2.4rem, 1.7rem + 3.4vw, 4rem);

  --lh-tight: 1.15;
  --lh-snug: 1.3;
  --lh-base: 1.65;

  /* --- Spacing scale (rem-based, fluid container gutter) --- */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;

  /* --- Layout --- */
  --measure: 70ch;
  --container-max: 76rem;
  --container-pad: clamp(1rem, 0.5rem + 3vw, 2.5rem);
  --header-h: 4.25rem;

  /* --- Radii --- */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --r-pill: 999px;

  /* --- Shadows (soft, coastal-light) --- */
  --shadow-xs: 0 1px 2px rgba(8, 38, 58, 0.06);
  --shadow-sm: 0 2px 6px rgba(8, 38, 58, 0.08), 0 1px 2px rgba(8, 38, 58, 0.05);
  --shadow-md: 0 8px 22px rgba(8, 38, 58, 0.10), 0 2px 6px rgba(8, 38, 58, 0.06);
  --shadow-lg: 0 18px 48px rgba(8, 38, 58, 0.16), 0 6px 14px rgba(8, 38, 58, 0.08);
  --ring: 0 0 0 3px rgba(31, 134, 191, 0.35);

  /* --- Motion --- */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 120ms;
  --t-med: 220ms;
  --t-slow: 380ms;

  /* --- Header translucency --- */
  --header-bg: rgba(253, 251, 246, 0.78);
  --header-border: rgba(17, 76, 112, 0.12);

  color-scheme: light;
}

/* -------------------------------------------------------------------------
   2. DARK THEME
   ------------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:           #0a1a24;
    --bg-subtle:    #0e2330;
    --surface:      #102a38;
    --surface-2:    #0c2230;
    --border:       #1d3e4f;
    --border-strong:#2a5167;
    --text:         #e7f1f6;
    --text-soft:    #c2d6df;
    --text-muted:   #8fa9b5;
    --heading:      #cfeaf7;
    --link:         #7cc6ea;
    --link-hover:   #a9dbf3;
    --accent:       #ff8c52;
    --accent-hover: #ffa066;
    --brand:        #4aa6d8;

    --c-info-bg:   #0d2f44;
    --c-tip-bg:    #0c3733;
    --c-warn-bg:   #3a2a0d;
    --c-danger-bg: #3a1414;
    --c-info:      #6cc0ec;
    --c-tip:       #46c1b9;
    --c-warn:      #f0b35a;
    --c-danger:    #f08a8a;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 8px 22px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.6);
    --ring: 0 0 0 3px rgba(124, 198, 234, 0.45);

    --header-bg: rgba(10, 26, 36, 0.8);
    --header-border: rgba(124, 198, 234, 0.16);

    color-scheme: dark;
  }
}

/* -------------------------------------------------------------------------
   3. RESET & BASE
   ------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

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

body {
  font-family: var(--font-body);
  font-size: var(--fs-400);
  line-height: var(--lh-base);
  color: var(--text);
  background-color: var(--bg);
  /* Layered, image-free coastal background: soft gradient mesh + sun glow */
  background-image:
    radial-gradient(1100px 520px at 88% -8%, rgba(249, 126, 61, 0.10), transparent 60%),
    radial-gradient(900px 600px at -10% 4%, rgba(21, 168, 159, 0.10), transparent 58%),
    radial-gradient(1200px 700px at 50% 120%, rgba(31, 134, 191, 0.08), transparent 60%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

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

ul, ol { padding-left: 1.25em; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.16em; }
a:hover { color: var(--link-hover); }

strong, b { font-weight: 700; color: var(--text); }

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.1em 0.4em;
}

hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
  margin: var(--sp-6) 0;
}

::selection { background: var(--c-coral-200); color: var(--c-ink-900); }

/* -------------------------------------------------------------------------
   4. TYPOGRAPHY
   ------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  color: var(--heading);
  font-optical-sizing: auto;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-800); font-weight: 700; }
h2 { font-size: var(--fs-700); margin-top: var(--sp-7); }
h3 { font-size: var(--fs-600); margin-top: var(--sp-6); }
h4 { font-size: var(--fs-500); margin-top: var(--sp-5); }

p { max-width: var(--measure); }
p + p { margin-top: var(--sp-4); }

main :is(h2, h3, h4) + p,
main :is(h2, h3, h4) + ul,
main :is(h2, h3, h4) + ol { margin-top: var(--sp-3); }

main p, main ul, main ol { margin-top: var(--sp-4); }
main li + li { margin-top: var(--sp-2); }
main li { max-width: var(--measure); }

.lead {
  font-size: var(--fs-500);
  line-height: var(--lh-snug);
  color: var(--text-soft);
  max-width: var(--measure);
  font-weight: 450;
}

/* -------------------------------------------------------------------------
   5. ACCESSIBILITY HELPERS
   ------------------------------------------------------------------------- */
.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;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--c-ocean-500);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.skip-link {
  position: absolute;
  left: var(--sp-3);
  top: -100px;
  z-index: 1000;
  background: var(--c-ocean-700);
  color: #fff;
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  transition: top var(--t-med) var(--ease);
}
.skip-link:focus { top: var(--sp-3); color: #fff; }

/* -------------------------------------------------------------------------
   6. LAYOUT: container, section
   ------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

main.container { padding-bottom: var(--sp-9); }

.section { margin-block: var(--sp-7); }
.section:first-child { margin-top: var(--sp-6); }
.section > h2:first-child,
.section > h3:first-child { margin-top: 0; }

/* -------------------------------------------------------------------------
   7. SITE HEADER + NAV
   ------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--header-border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  min-height: var(--header-h);
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-500);
  color: var(--heading);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand:hover { color: var(--heading); }
.brand__mark {
  width: 2.1rem; height: 2.1rem;
  flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 50% 120%, var(--c-ocean-500), var(--c-ocean-700) 70%);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.25);
  color: #fff;
}
.brand__mark svg { width: 1.35rem; height: 1.35rem; }
.brand__name b { color: var(--accent); font-weight: 700; }

/* Nav layout */
.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
}
.nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  margin: 0;
  padding: 0;
}
.nav-list > li { position: relative; }

/* Top-level links and dropdown triggers share base look */
.nav-link,
.nav-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  font: inherit;
  font-weight: 600;
  font-size: var(--fs-400);
  color: var(--text-soft);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-pill);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--t-fast) var(--ease),
              background-color var(--t-fast) var(--ease);
}
.nav-link:hover,
.nav-toggle-btn:hover,
.nav-item:hover .nav-toggle-btn {
  color: var(--link-hover);
  background: color-mix(in srgb, var(--c-ocean-500) 12%, transparent);
}
.nav-link[aria-current="page"] {
  color: var(--c-ocean-700);
  background: color-mix(in srgb, var(--c-ocean-500) 16%, transparent);
}
.nav-toggle-btn .chev {
  width: 0.7em; height: 0.7em;
  transition: transform var(--t-fast) var(--ease);
}
.nav-item[data-open="true"] .nav-toggle-btn .chev { transform: rotate(180deg); }

/* Dropdown panel */
.nav-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 16rem;
  list-style: none;
  margin: 0;
  padding: var(--sp-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(6px);
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--t-med) var(--ease),
              transform var(--t-med) var(--ease),
              visibility var(--t-med);
}
.nav-menu::before {
  /* hover bridge so the menu doesn't close in the gap */
  content: "";
  position: absolute;
  inset: -0.6rem 0 auto 0;
  height: 0.6rem;
}
.nav-item:hover .nav-menu,
.nav-item:focus-within .nav-menu,
.nav-item[data-open="true"] .nav-menu {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
}
/* keep the last menu from overflowing the right edge */
.nav-list > li:last-child .nav-menu,
.nav-list > li:nth-last-child(2) .nav-menu { left: auto; right: 0; }

.nav-menu a {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  color: var(--text-soft);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--fs-400);
  line-height: 1.35;
  transition: background-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease);
}
.nav-menu a:hover {
  background: var(--c-ocean-100);
  color: var(--c-ocean-700);
}
.nav-menu a[aria-current="page"] {
  background: color-mix(in srgb, var(--c-ocean-500) 16%, transparent);
  color: var(--c-ocean-700);
  font-weight: 700;
}

/* Hamburger button (hidden on desktop) */
.nav-hamburger {
  display: none;
  margin-left: auto;
  width: 2.75rem; height: 2.75rem;
  align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--heading);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}
.nav-hamburger svg { width: 1.4rem; height: 1.4rem; }
.nav-hamburger .icon-close { display: none; }
.nav-hamburger[aria-expanded="true"] .icon-open { display: none; }
.nav-hamburger[aria-expanded="true"] .icon-close { display: block; }

/* ---- Mobile nav ---- */
@media (max-width: 900px) {
  .nav-hamburger { display: inline-flex; }
  .site-nav {
    position: fixed;
    inset: var(--header-h) 0 0 auto;
    width: min(92vw, 22rem);
    background: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: var(--sp-5) var(--sp-4) var(--sp-8);
    overflow-y: auto;
    transform: translateX(110%);
    transition: transform var(--t-med) var(--ease);
    margin-left: 0;
  }
  .site-nav[data-open="true"] { transform: translateX(0); }
  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-1);
    width: 100%;
  }
  .nav-list > li { width: 100%; }
  .nav-link, .nav-toggle-btn { width: 100%; justify-content: space-between; }

  .nav-menu {
    position: static;
    opacity: 1;
    visibility: hidden;
    transform: none;
    pointer-events: none;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--border);
    border-radius: 0;
    margin: 0 0 var(--sp-2) var(--sp-3);
    padding: 0 0 0 var(--sp-2);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--t-med) var(--ease), visibility var(--t-med);
  }
  .nav-item[data-open="true"] .nav-menu {
    visibility: visible;
    pointer-events: auto;
    max-height: 40rem;
  }
  .nav-list > li:last-child .nav-menu,
  .nav-list > li:nth-last-child(2) .nav-menu { left: auto; right: auto; }
}

/* Scrim behind mobile nav */
.nav-scrim {
  position: fixed;
  inset: 0;
  background: rgba(8, 38, 58, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-med) var(--ease), visibility var(--t-med);
  z-index: 99;
}
.nav-scrim[data-open="true"] { opacity: 1; visibility: visible; }
@media (min-width: 901px) { .nav-scrim { display: none; } }

/* -------------------------------------------------------------------------
   8. PAGE HERO + BREADCRUMB
   ------------------------------------------------------------------------- */
.page-hero {
  position: relative;
  overflow: hidden;
  color: #eaf6fc;
  background:
    linear-gradient(165deg, var(--c-ocean-700) 0%, var(--c-ocean-600) 45%, var(--c-teal-600) 115%);
  padding-block: clamp(2.5rem, 1.5rem + 5vw, 5rem);
  margin-bottom: var(--sp-7);
}
/* layered SVG wave + sun motif, image-free */
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(420px 420px at 86% -22%, rgba(255, 188, 120, 0.55), transparent 62%),
    radial-gradient(280px 280px at 90% -10%, rgba(255, 224, 150, 0.5), transparent 60%);
  pointer-events: none;
}
.page-hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 70px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 70' preserveAspectRatio='none'%3E%3Cpath d='M0,40 C150,68 300,12 450,30 C620,50 760,72 920,46 C1040,26 1130,38 1200,30 L1200,70 L0,70 Z' fill='%23fdfbf6'/%3E%3C/svg%3E")
    bottom / 100% 70px no-repeat;
  pointer-events: none;
}
@media (prefers-color-scheme: dark) {
  .page-hero::after {
    background-image:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 70' preserveAspectRatio='none'%3E%3Cpath d='M0,40 C150,68 300,12 450,30 C620,50 760,72 920,46 C1040,26 1130,38 1200,30 L1200,70 L0,70 Z' fill='%230a1a24'/%3E%3C/svg%3E");
  }
}
.page-hero__inner {
  position: relative;
  z-index: 1;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}
.page-hero h1 {
  color: #fff;
  text-shadow: 0 1px 18px rgba(8, 38, 58, 0.25);
  margin-top: var(--sp-3);
}
.page-hero .lead {
  color: rgba(255, 255, 255, 0.92);
  margin-top: var(--sp-4);
}
.page-hero a { color: #fff; }

/* Homepage big hero variant */
.page-hero--home { padding-block: clamp(3.5rem, 2rem + 8vw, 7rem); }
.page-hero--home h1 { font-size: var(--fs-900); }

.breadcrumb {
  font-size: var(--fs-300);
  color: rgba(255, 255, 255, 0.82);
}
.page-hero .breadcrumb a { color: rgba(255, 255, 255, 0.92); text-decoration: none; }
.page-hero .breadcrumb a:hover { text-decoration: underline; }
.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4em;
  padding: 0; margin: 0;
}
.breadcrumb li { display: inline-flex; align-items: center; gap: 0.4em; }
.breadcrumb li + li::before {
  content: "›";
  opacity: 0.7;
  font-weight: 700;
}
.breadcrumb [aria-current="page"] { color: #fff; font-weight: 600; }

/* breadcrumb used on a light background (standalone) */
.breadcrumb--plain { color: var(--text-muted); }
.breadcrumb--plain a { color: var(--link); }

/* -------------------------------------------------------------------------
   9. BUTTONS
   ------------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--heading);
  --btn-bd: var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  font: inherit;
  font-weight: 600;
  font-size: var(--fs-400);
  line-height: 1.1;
  padding: 0.7em 1.3em;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-fg);
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease),
              box-shadow var(--t-med) var(--ease),
              background-color var(--t-fast) var(--ease),
              filter var(--t-fast) var(--ease);
  box-shadow: var(--shadow-xs);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn svg { width: 1.1em; height: 1.1em; }

.btn--primary {
  --btn-fg: #fff;
  --btn-bd: transparent;
  background-image: linear-gradient(135deg, var(--c-coral-500), var(--c-coral-600));
  color: #fff;
}
.btn--primary:hover { color: #fff; filter: saturate(112%) brightness(1.03); }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--link);
  --btn-bd: color-mix(in srgb, var(--c-ocean-500) 45%, transparent);
}
.btn--ghost:hover { background: color-mix(in srgb, var(--c-ocean-500) 12%, transparent); color: var(--link-hover); }

/* On the hero (dark) ghost buttons go light */
.page-hero .btn--ghost {
  --btn-fg: #fff;
  --btn-bd: rgba(255,255,255,0.6);
  color: #fff;
}
.page-hero .btn--ghost:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* -------------------------------------------------------------------------
   10. CARDS
   ------------------------------------------------------------------------- */
.card-grid {
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-med) var(--ease),
              box-shadow var(--t-med) var(--ease),
              border-color var(--t-med) var(--ease);
}
.card > :last-child { margin-bottom: 0; }

.card__icon {
  width: 3rem; height: 3rem;
  flex: none;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  color: var(--c-ocean-700);
  background: linear-gradient(140deg, var(--c-ocean-100), var(--c-teal-200));
}
.card__icon svg { width: 1.6rem; height: 1.6rem; }

.card__title {
  font-family: var(--font-display);
  font-size: var(--fs-500);
  font-weight: 600;
  color: var(--heading);
  margin: 0;
  line-height: var(--lh-snug);
}
.card__body {
  color: var(--text-soft);
  font-size: var(--fs-400);
  margin: 0;
}
.card__body p { max-width: none; }
.card__body > :first-child { margin-top: 0; }

/* clickable variant */
.card--link {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.card--link::after {
  content: "→";
  position: absolute;
  right: var(--sp-5);
  bottom: var(--sp-5);
  color: var(--accent);
  font-weight: 700;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease);
}
.card--link:hover,
.card--link:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--c-ocean-500) 45%, var(--border));
  color: inherit;
}
.card--link:hover::after,
.card--link:focus-visible::after { opacity: 1; transform: translateX(0); }
.card--link .card__title { color: var(--heading); }

/* accent top edge for link cards */
.card--link .card__title::before {
  content: "";
  display: block;
  width: 2.5rem; height: 3px;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--c-coral-500), var(--c-teal-500));
  margin-bottom: var(--sp-3);
  transition: width var(--t-med) var(--ease);
}
.card--link:hover .card__title::before { width: 4rem; }

/* -------------------------------------------------------------------------
   11. CALLOUTS
   ------------------------------------------------------------------------- */
.callout {
  --co-accent: var(--c-info);
  --co-bg: var(--c-info-bg);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-2) var(--sp-4);
  background: var(--co-bg);
  border: 1px solid color-mix(in srgb, var(--co-accent) 35%, transparent);
  border-left: 5px solid var(--co-accent);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
  color: var(--text);
  margin-block: var(--sp-5);
}
.callout::before {
  content: "";
  width: 1.4rem; height: 1.4rem;
  margin-top: 0.15rem;
  background: var(--co-accent);
  -webkit-mask: var(--co-icon) center / contain no-repeat;
  mask: var(--co-icon) center / contain no-repeat;
  flex: none;
}
.callout__title {
  grid-column: 2;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-500);
  color: var(--co-accent);
  margin: 0;
  line-height: var(--lh-snug);
}
.callout > :not(.callout__title):not(::before) { grid-column: 2; max-width: var(--measure); }
.callout > *:nth-child(2) { margin-top: 0; }
.callout p { max-width: none; }
.callout a { color: var(--co-accent); font-weight: 600; }

/* default info icon */
.callout {
  --co-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 2a10 10 0 100 20 10 10 0 000-20zm0 5a1.3 1.3 0 110 2.6A1.3 1.3 0 0112 7zm1.4 11h-2.8v-1.3h.7v-3.6h-.7V12h2.1v5.4h.7V18z'/%3E%3C/svg%3E");
}
.callout--info { --co-accent: var(--c-info); --co-bg: var(--c-info-bg); }
.callout--tip {
  --co-accent: var(--c-tip); --co-bg: var(--c-tip-bg);
  --co-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 2a7 7 0 00-4 12.7c.6.5 1 1.2 1 2v.3h6v-.3c0-.8.4-1.5 1-2A7 7 0 0012 2zM9 20h6v1a2 2 0 01-2 2h-2a2 2 0 01-2-2v-1z'/%3E%3C/svg%3E");
}
.callout--warn {
  --co-accent: var(--c-warn); --co-bg: var(--c-warn-bg);
  --co-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 2L1 21h22L12 2zm0 6c.7 0 1.2.6 1.1 1.3l-.4 5.2a.7.7 0 01-1.4 0l-.4-5.2A1.2 1.2 0 0112 8zm0 9.2a1.2 1.2 0 110 2.4 1.2 1.2 0 010-2.4z'/%3E%3C/svg%3E");
}
.callout--danger {
  --co-accent: var(--c-danger); --co-bg: var(--c-danger-bg);
  --co-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 2a10 10 0 100 20 10 10 0 000-20zm1.2 14.5h-2.4v-2.4h2.4v2.4zm0-4h-2.4V6h2.4v6.5z'/%3E%3C/svg%3E");
}

/* -------------------------------------------------------------------------
   12. FACTS (at-a-glance figures)
   ------------------------------------------------------------------------- */
.facts {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  margin-block: var(--sp-5);
  padding: 0;
  list-style: none;
}
.fact {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
  box-shadow: var(--shadow-xs);
  border-top: 3px solid var(--c-teal-500);
}
.fact__label {
  display: block;
  font-size: var(--fs-300);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--text-muted);
}
.fact__value {
  display: block;
  font-family: var(--font-display);
  font-size: var(--fs-700);
  font-weight: 600;
  color: var(--heading);
  line-height: 1.1;
  margin-top: var(--sp-1);
}

/* -------------------------------------------------------------------------
   13. CONTACTS
   ------------------------------------------------------------------------- */
.contacts {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  list-style: none;
  padding: 0;
  margin-block: var(--sp-5);
}
.contact {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.contact__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-500);
  color: var(--heading);
  margin: 0;
}
.contact__detail {
  color: var(--text-soft);
  font-size: var(--fs-400);
  margin: 0;
}
.contact__detail strong { color: var(--text); }
.contact a { font-weight: 600; }

/* -------------------------------------------------------------------------
   14. RESOURCES (official external links)
   ------------------------------------------------------------------------- */
.resources {
  list-style: none;
  padding: 0;
  margin-block: var(--sp-5);
  display: grid;
  gap: var(--sp-3);
}
.resource {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
  box-shadow: var(--shadow-xs);
  transition: border-color var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
}
.resource:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.resource a {
  font-weight: 700;
  font-size: var(--fs-500);
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;
}
/* clear external-link marker */
.resource a[target="_blank"]::after,
a.external::after {
  content: "↗";
  font-size: 0.78em;
  color: var(--accent);
  margin-left: 0.15em;
  font-weight: 700;
}
.resource__note {
  display: block;
  color: var(--text-muted);
  font-size: var(--fs-300);
  margin-top: var(--sp-1);
  max-width: var(--measure);
}

/* -------------------------------------------------------------------------
   15. TABLE OF CONTENTS (.toc)
   ------------------------------------------------------------------------- */
.toc {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  margin-block: var(--sp-6);
  max-width: var(--measure);
}
.toc__title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-500);
  color: var(--heading);
  margin: 0 0 var(--sp-3);
}
.toc ol, .toc ul {
  margin: 0;
  padding-left: 1.1em;
  display: grid;
  gap: var(--sp-2);
}
.toc a { color: var(--link); text-decoration: none; font-weight: 500; }
.toc a:hover { text-decoration: underline; color: var(--link-hover); }

/* -------------------------------------------------------------------------
   16. RELATED PAGES
   ------------------------------------------------------------------------- */
.related {
  margin-block: var(--sp-7);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
}
.related__title {
  font-family: var(--font-display);
  font-size: var(--fs-500);
  font-weight: 600;
  color: var(--heading);
  margin: 0 0 var(--sp-3);
}
.related ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  padding: 0; margin: 0;
}
.related li { margin: 0; }
.related a {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: var(--sp-2) var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--fs-400);
  color: var(--link);
  transition: transform var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease);
}
.related a::before { content: "→"; color: var(--accent); }
.related a:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--c-ocean-500) 45%, var(--border));
  box-shadow: var(--shadow-sm);
}

/* -------------------------------------------------------------------------
   17. BADGE + PILL ROW
   ------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-size: var(--fs-300);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.3em 0.75em;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--c-ocean-500) 16%, transparent);
  color: var(--c-ocean-700);
  border: 1px solid color-mix(in srgb, var(--c-ocean-500) 30%, transparent);
  line-height: 1.4;
}
.badge--accent { background: var(--c-coral-200); color: var(--c-coral-700); border-color: color-mix(in srgb, var(--c-coral-500) 40%, transparent); }
.badge--teal { background: var(--c-teal-200); color: var(--c-teal-700); border-color: color-mix(in srgb, var(--c-teal-500) 35%, transparent); }
.badge--palm { background: var(--c-palm-300); color: var(--c-palm-700); border-color: color-mix(in srgb, var(--c-palm-500) 35%, transparent); }
@media (prefers-color-scheme: dark) {
  .badge { color: var(--c-ocean-200); }
  .badge--accent { color: var(--c-coral-200); }
  .badge--teal { color: var(--c-teal-200); }
  .badge--palm { color: var(--c-palm-300); }
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  list-style: none;
  padding: 0;
  margin-block: var(--sp-4);
}
.pill-row li { margin: 0; }
.pill-row > * {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.4em 0.9em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: var(--fs-400);
  font-weight: 500;
  color: var(--text-soft);
}
.pill-row a { text-decoration: none; }
.pill-row a:hover { border-color: var(--border-strong); color: var(--link-hover); }

/* -------------------------------------------------------------------------
   18. TABLE (zebra + responsive scroll)
   ------------------------------------------------------------------------- */
.table {
  width: 100%;
  margin-block: var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-xs);
  background: var(--surface);
}
.table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 32rem;
  font-size: var(--fs-400);
}
.table caption {
  caption-side: top;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  padding: var(--sp-3) var(--sp-4) 0;
  font-size: var(--fs-300);
}
.table th, .table td {
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table thead th {
  background: var(--c-ocean-700);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--fs-300);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
}
.table tbody tr:nth-child(even) { background: var(--surface-2); }
.table tbody tr:hover { background: var(--c-ocean-100); }
.table tbody tr:last-child td { border-bottom: none; }
@media (prefers-color-scheme: dark) {
  .table tbody tr:hover { background: color-mix(in srgb, var(--c-ocean-500) 14%, transparent); }
}

/* -------------------------------------------------------------------------
   19. BACK-TO-TOP (.to-top) — injected by app.js
   ------------------------------------------------------------------------- */
.to-top {
  position: fixed;
  right: clamp(0.9rem, 2vw, 1.75rem);
  bottom: clamp(0.9rem, 2vw, 1.75rem);
  z-index: 90;
  width: 3rem; height: 3rem;
  display: grid; place-items: center;
  border: none;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--c-ocean-600), var(--c-ocean-700));
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.9);
  transition: opacity var(--t-med) var(--ease),
              transform var(--t-med) var(--ease),
              visibility var(--t-med);
}
.to-top svg { width: 1.3rem; height: 1.3rem; }
.to-top:hover { transform: translateY(0) scale(1.06); }
.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

/* -------------------------------------------------------------------------
   20. SITE FOOTER
   ------------------------------------------------------------------------- */
.emergency-strip {
  background: linear-gradient(90deg, var(--c-danger), #a51616);
  color: #fff;
  text-align: center;
  font-weight: 700;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-400);
}
.emergency-strip a { color: #fff; text-decoration: underline; text-underline-offset: 0.2em; }
.emergency-strip .sep { opacity: 0.6; margin-inline: 0.6em; }
.emergency-strip strong { color: #fff; }

.site-footer {
  background: var(--c-ocean-900);
  color: var(--c-ocean-200);
  margin-top: var(--sp-8);
}
@media (prefers-color-scheme: dark) {
  .site-footer { background: #061620; }
}
.site-footer a { color: var(--c-ocean-200); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }

.site-footer__inner {
  max-width: var(--container-max);
  margin-inline: auto;
  padding: var(--sp-7) var(--container-pad) var(--sp-5);
  display: grid;
  gap: var(--sp-6);
  grid-template-columns: minmax(14rem, 1.4fr) repeat(auto-fit, minmax(9rem, 1fr));
}
.footer-brand .brand { color: #fff; }
.footer-brand .brand:hover { color: #fff; }
.footer-brand p {
  margin-top: var(--sp-3);
  color: var(--c-ocean-200);
  font-size: var(--fs-300);
  max-width: 34ch;
  line-height: var(--lh-snug);
}
.footer-col h3 {
  font-family: var(--font-body);
  font-size: var(--fs-300);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--c-ocean-300);
  margin: 0 0 var(--sp-3);
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-2); }
.footer-col a { font-size: var(--fs-400); }
.site-footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: var(--sp-4) var(--container-pad);
}
.site-footer__bottom .container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-300);
  color: var(--c-ocean-300);
  padding-inline: 0;
}

/* -------------------------------------------------------------------------
   21. UTILITIES
   ------------------------------------------------------------------------- */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.measure { max-width: var(--measure); }
.flow > * + * { margin-top: var(--sp-4); }
.mt-0 { margin-top: 0; }
.stack-cta { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-5); }

/* -------------------------------------------------------------------------
   22. REDUCED MOTION
   ------------------------------------------------------------------------- */
@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;
    scroll-behavior: auto !important;
  }
  .btn:hover, .card--link:hover, .related a:hover, .to-top:hover { transform: none; }
}

/* -------------------------------------------------------------------------
   23. PRINT
   ------------------------------------------------------------------------- */
@media print {
  :root {
    --bg: #fff; --surface: #fff; --text: #000; --heading: #000;
    --text-soft: #222; --text-muted: #444; --border: #bbb;
  }
  body { background: #fff; color: #000; }
  .site-header, .nav-scrim, .to-top, .emergency-strip,
  .site-footer__bottom, .nav-hamburger, .related { display: none !important; }
  .page-hero {
    background: none !important;
    color: #000;
    padding-block: 0;
    margin-bottom: var(--sp-5);
    border-bottom: 2px solid #000;
  }
  .page-hero::before, .page-hero::after { display: none !important; }
  .page-hero h1, .page-hero .lead, .page-hero a, .breadcrumb { color: #000 !important; text-shadow: none; }
  .card, .callout, .fact, .contact, .resource, .toc, .table {
    box-shadow: none !important;
    border: 1px solid #999 !important;
    break-inside: avoid;
  }
  a { color: #000; text-decoration: underline; }
  .resource a[href^="http"]::after,
  a.external[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
  .site-footer { background: #fff; color: #000; }
  .site-footer a { color: #000; }
}
