/* ============================================================================
   theme.css — single styling source of truth for the entire site.

   To REBRAND: edit site-config.php → 'theme' (primary, accent, optional
   neutral and bg). bootstrap.php injects those as --brand-* custom props
   into <head>; everything else in this file derives from them via color-mix.
   To restyle a section, edit the section blocks below.
   ============================================================================ */

:root {
  /* APS is a light-only site (security brand). color-scheme is locked to
     light; the dark @media block has been removed. */
  color-scheme: light;

  /* Brand seeds — these mirror site-config.php -> 'theme'. bootstrap.php
     injects the same values inline; kept here so a static (no-PHP) render of
     the HTML mirror still shows APS navy/red. */
  --brand-primary:    #14294f;  /* deep professional navy */
  --brand-accent:     #c8102e;  /* APS red, used sparingly */
  --brand-neutral:    #16202e;  /* dark slate text base */
  --brand-bg:         #ffffff;
  --brand-on-primary: #ffffff;  /* text color that reads on top of --brand-primary */

  /* Brand — derived (do not hardcode brand colors below this line) */
  --color-primary:        var(--brand-primary);
  --color-primary-hover:  color-mix(in oklch, var(--brand-primary) 85%, black);
  --color-primary-soft:   color-mix(in oklch, var(--brand-primary) 12%, transparent);
  --color-primary-ring:   color-mix(in oklch, var(--brand-primary) 35%, transparent);
  --color-accent:         var(--brand-accent);
  --color-accent-soft:    color-mix(in oklch, var(--brand-accent) 12%, transparent);

  /* Neutrals — derived from --brand-neutral + --brand-bg */
  --color-text:        var(--brand-neutral);
  --color-text-muted:  color-mix(in oklch, var(--brand-neutral) 60%, var(--brand-bg));
  --color-bg:          var(--brand-bg);
  --color-bg-alt:      color-mix(in oklch, var(--brand-neutral) 4%, var(--brand-bg));
  --color-bg-elev:     var(--brand-bg);
  --color-border:      color-mix(in oklch, var(--brand-neutral) 10%, var(--brand-bg));

  /* Status */
  --color-success: #0e9c6d;
  --color-error: #e0413a;

  /* Typography — Inter (body) + Archivo (display), loaded via Google Fonts in
     header.php with a system-font fallback so first paint is never blocked. */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Archivo", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;

  --fs-display: clamp(2.75rem, 5vw + 1rem, 4.75rem);
  --fs-h1: clamp(2.25rem, 4vw + 1rem, 3.5rem);
  --fs-h2: clamp(1.75rem, 2.5vw + 1rem, 2.5rem);
  --fs-h3: clamp(1.375rem, 1.5vw + 1rem, 1.625rem);
  --fs-h4: 1.0625rem;
  --fs-body: 1rem;
  --fs-lead: 1.1875rem;
  --fs-small: 0.875rem;
  --fs-eyebrow: 0.8125rem;

  --lh-tight: 1.08;
  --lh-snug: 1.3;
  --lh-normal: 1.65;

  /* Spacing scale */
  --sp-1: 0.25rem;  --sp-2: 0.5rem;  --sp-3: 0.75rem;
  --sp-4: 1rem;     --sp-5: 1.25rem; --sp-6: 1.5rem;
  --sp-8: 2rem;     --sp-10: 2.5rem; --sp-12: 3rem;
  --sp-16: 4rem;    --sp-20: 5rem;   --sp-24: 6rem;
  --sp-32: 8rem;

  /* Layout */
  --content-max: 72rem;
  --reading-max: 42rem;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Header */
  --nav-height: 72px;
  --nav-bg:     color-mix(in oklch, var(--brand-bg) 78%, transparent);
  --nav-blur:   16px;
  --nav-border: color-mix(in oklch, var(--brand-neutral) 8%, transparent);

  /* Shadows — tinted with the brand neutral so they match cool/warm palettes */
  --shadow-sm: 0 1px 2px  color-mix(in oklch, var(--brand-neutral) 4%, transparent);
  --shadow-md: 0 4px 16px color-mix(in oklch, var(--brand-neutral) 6%, transparent),
               0 1px 3px  color-mix(in oklch, var(--brand-neutral) 4%, transparent);
  --shadow-lg: 0 24px 48px -12px color-mix(in oklch, var(--brand-neutral) 18%, transparent);

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 150ms;
  --dur-base: 250ms;
  --dur-slow: 500ms;
}

/* Light-only: the dark prefers-color-scheme block was intentionally removed
   for APS. color-scheme: light is declared above and in header.php's meta. */

/* ============================================================================
   Reset + base
   ============================================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-height) + 1rem); }
body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }

/* Lock background scroll while the mobile drawer is open (set by footer.php JS). */
body.is-locked { overflow: hidden; }

.skip-link {
  position: absolute; left: -9999px;
  background: var(--color-primary); color: var(--brand-on-primary);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 100;
}
.skip-link:focus { left: var(--sp-4); top: var(--sp-4); }

/* ============================================================================
   Typography
   ============================================================================ */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: var(--lh-tight);
  letter-spacing: -0.025em;
  font-weight: 750;
  color: var(--color-text);
}
h1 { font-size: var(--fs-h1); margin-block: var(--sp-6) var(--sp-4); }
h2 { font-size: var(--fs-h2); margin-block: var(--sp-12) var(--sp-5); letter-spacing: -0.022em; }
h3 { font-size: var(--fs-h3); margin-block: var(--sp-8) var(--sp-3); letter-spacing: -0.018em; }
h4 { font-size: var(--fs-h4); margin-block: var(--sp-5) var(--sp-2); letter-spacing: -0.005em; font-weight: 700; }

p { margin-block: 0 var(--sp-4); max-width: 70ch; }

a {
  color: var(--color-primary);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color var(--dur-fast) var(--ease);
}
a:hover { color: var(--color-primary-hover); text-decoration: underline; }
a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: 2px;
}
::selection { background: var(--color-primary); color: var(--brand-on-primary); }

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-bg-alt);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--color-border);
}

/* ============================================================================
   Layout
   ============================================================================ */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}

main { display: block; min-height: 60vh; }
section + section { margin-top: var(--sp-12); }

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: var(--sp-3);
}

/* ============================================================================
   Header / nav
   ============================================================================ */
/* Two-tier nav: a navy utility strip (scrolls away) above a solid white main
   bar (sticky). See .topbar block in the APS section at the bottom of this file. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-height);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}

.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1875rem;
  letter-spacing: -0.025em;
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
}
.brand:hover { text-decoration: none; color: var(--color-primary); }
.brand__mark { display: inline-flex; flex-shrink: 0; }
.brand__mark svg { width: 32px; height: 32px; border-radius: 9px; }
.brand__logo { height: clamp(40px, 7vw, 50px); width: auto; display: block; }

.nav-desktop { display: none; }
@media (min-width: 880px) {
  .nav-desktop { display: flex; align-items: center; gap: var(--sp-2); }
}
.nav-desktop ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; align-items: center; gap: var(--sp-1);
}
.nav-desktop a {
  color: var(--color-text);
  font-weight: 500;
  font-size: 0.9375rem;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-sm);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.nav-desktop a:hover {
  background: var(--color-bg-alt);
  color: var(--color-primary);
  text-decoration: none;
}
.nav-desktop a[aria-current="page"] { color: var(--color-primary); }
.nav-desktop a.cta {
  background: var(--color-accent);
  color: #fff;
  margin-left: var(--sp-3);
  box-shadow: 0 1px 2px color-mix(in oklch, var(--color-accent) 30%, transparent);
}
.nav-desktop a.cta:hover {
  background: color-mix(in oklch, var(--color-accent) 86%, black);
  color: #fff;
  box-shadow: 0 4px 12px color-mix(in oklch, var(--color-accent) 38%, transparent);
  transform: translateY(-1px);
}

/* Desktop dropdowns */
.has-dropdown { position: relative; }
.has-dropdown > a::after {
  content: "";
  display: inline-block;
  width: 0; height: 0;
  margin-left: 0.4em;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.55;
  vertical-align: middle;
}
.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 240px;
  background: var(--color-bg-elev);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-2);
  list-style: none !important;
  display: flex !important;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition:
    opacity var(--dur-base) var(--ease),
    transform var(--dur-base) var(--ease-out),
    visibility 0s linear var(--dur-base);
}
.has-dropdown:hover > .dropdown,
.has-dropdown:focus-within > .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}
.dropdown a { display: block; padding: var(--sp-2) var(--sp-3); font-size: 0.9375rem; }

/* Hamburger */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border: 1px solid var(--color-border);
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--color-text);
}
.nav-toggle:hover { background: var(--color-bg-alt); }
@media (min-width: 880px) { .nav-toggle { display: none; } }
.nav-toggle svg { width: 22px; height: 22px; }

/* Mobile drawer — Popover API. A popover toggles display:none<->block, which
   snaps unless we transition `display`/`overlay` with allow-discrete and give
   an @starting-style for the entry. Closed state = slid off-canvas + faded;
   :popover-open = on-screen. Reduced-motion users get the instant version via
   the global prefers-reduced-motion block below. */
/* Full-screen navy overlay. The popover toggles display none<->(our flex) with
   allow-discrete; closed state is faded + slightly raised. base sets no display
   so the closed popover stays display:none; :popover-open switches to flex. */
.nav-mobile {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100vh;          /* fallback for browsers without dvh */
  height: 100dvh;         /* matches the real mobile viewport (no chrome jump) */
  margin: 0;
  border: none;
  padding: var(--sp-16) var(--sp-6) var(--sp-12);
  background: var(--color-primary);
  box-shadow: none;
  color: #fff;
  transform: translateY(-12px);
  opacity: 0;
  transition:
    transform var(--dur-base) var(--ease-out),
    opacity   var(--dur-base) var(--ease-out),
    overlay   var(--dur-base) var(--ease-out) allow-discrete,
    display   var(--dur-base) var(--ease-out) allow-discrete;
}
.nav-mobile:popover-open {
  display: flex;
  flex-direction: column;
  justify-content: center;
  transform: translateY(0);
  opacity: 1;
}
@starting-style {
  .nav-mobile:popover-open {
    transform: translateY(-12px);
    opacity: 0;
  }
}
.nav-mobile::backdrop {
  background: rgba(0,0,0,0);
  backdrop-filter: blur(0);
  transition:
    background       var(--dur-base) var(--ease),
    backdrop-filter  var(--dur-base) var(--ease),
    overlay          var(--dur-base) var(--ease) allow-discrete,
    display          var(--dur-base) var(--ease) allow-discrete;
}
.nav-mobile:popover-open::backdrop {
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
}
@starting-style {
  .nav-mobile:popover-open::backdrop {
    background: rgba(0,0,0,0);
    backdrop-filter: blur(0);
  }
}
.nav-mobile__close {
  position: absolute; top: var(--sp-4); right: var(--sp-4);
  width: 46px; height: 46px;
  background: transparent; border: 1px solid rgba(255,255,255,.4);
  border-radius: var(--radius-sm);
  font-size: 1.9rem; line-height: 1; cursor: pointer; color: #fff;
}
.nav-mobile__close:hover { background: rgba(255,255,255,.12); }
.nav-mobile ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); }
.nav-mobile a {
  display: block;
  padding: var(--sp-2) var(--sp-5);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
}
.nav-mobile a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.nav-mobile a[aria-current="page"] { color: #fff; background: rgba(255,255,255,.12); }

/* Mobile overlay actions (call + quote) */
.nav-mobile__actions { margin-top: var(--sp-10); display: flex; flex-direction: column; align-items: center; gap: var(--sp-5); }
.nav-mobile__call { display: inline-flex; align-items: center; gap: var(--sp-2); color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 1.375rem; }
.nav-mobile__call:hover { color: #fff; text-decoration: none; }
.nav-mobile__call svg { width: 22px; height: 22px; color: var(--color-accent); }
.nav-mobile__actions .btn { background: var(--color-accent); color: #fff; min-width: 220px; justify-content: center; }
.nav-mobile__actions .btn:hover { background: color-mix(in oklch, var(--color-accent) 86%, black); color: #fff; }
.nav-mobile details summary {
  padding: var(--sp-3) var(--sp-4);
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-weight: 500;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav-mobile details summary::-webkit-details-marker { display: none; }
.nav-mobile details summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--color-text-muted);
  transition: transform var(--dur-base) var(--ease);
}
.nav-mobile details[open] summary::after { transform: rotate(45deg); }
.nav-mobile details[open] summary { color: var(--color-primary); }
.nav-mobile details ul { padding-left: var(--sp-4); margin-top: var(--sp-1); margin-bottom: var(--sp-3); }

/* ============================================================================
   Footer
   ============================================================================ */
.site-footer {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding-block: var(--sp-20) var(--sp-8);
  margin-top: var(--sp-32);
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: var(--sp-12);
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}
@media (max-width: 760px) { .site-footer__grid { grid-template-columns: 1fr 1fr; gap: var(--sp-8); } }
@media (max-width: 480px) { .site-footer__grid { grid-template-columns: 1fr; } }

.site-footer__tagline { margin-top: var(--sp-3); color: var(--color-text-muted); }
.site-footer__address {
  font-style: normal;
  margin-top: var(--sp-4);
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  line-height: 1.7;
}
.site-footer h4 {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin: 0 0 var(--sp-4);
  font-weight: 600;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.site-footer a { color: var(--color-text); font-size: 0.9375rem; }
.site-footer a:hover { color: var(--color-primary); }
.site-footer__bottom {
  max-width: var(--content-max);
  margin: var(--sp-16) auto 0;
  padding: var(--sp-6) var(--sp-6) 0;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-4);
  font-size: var(--fs-small);
  color: var(--color-text-muted);
}
/* "Powered by Spark" credit — mandatory, do not remove. The Spark mark keeps its
   fixed brand orange (#f15924) on any footer background. display:inline-block is
   required: the global reset sets `svg { display: block }`, which would drop the
   mark onto its own line. */
.spark-mark {
  display: inline-block;
  width: 1.6em;
  height: 1.6em;
  margin-left: 0.15em;
  vertical-align: -0.5em;
}

/* ============================================================================
   Consent banner (includes/consent-banner.php) — fixed bottom, JS-toggled
   ============================================================================ */
.consent-banner {
  position: fixed;
  left: 50%;
  bottom: var(--sp-4);
  transform: translate(-50%, calc(100% + var(--sp-8)));
  z-index: 90;
  width: min(640px, calc(100vw - var(--sp-8)));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-4) var(--sp-6);
  padding: var(--sp-4) var(--sp-5);
  background: var(--color-bg-elev);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out);
}
.consent-banner.is-visible { transform: translate(-50%, 0); opacity: 1; }
.consent-banner__text {
  flex: 1 1 16rem;
  margin: 0;
  max-width: none;
  font-size: var(--fs-small);
  line-height: 1.55;
  color: var(--color-text-muted);
}
.consent-banner__text a { font-weight: 600; }
.consent-banner__actions { display: flex; gap: var(--sp-3); flex-shrink: 0; }
.consent-banner__actions .btn { padding: var(--sp-2) var(--sp-5); font-size: 0.875rem; }
@media (max-width: 520px) {
  .consent-banner { bottom: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; width: 100vw; }
  .consent-banner__actions { width: 100%; }
  .consent-banner__actions .btn { flex: 1; }
}

/* ============================================================================
   Buttons
   ============================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--color-primary);
  color: var(--brand-on-primary);
  box-shadow: 0 1px 2px color-mix(in oklch, var(--brand-primary) 30%, transparent);
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  color: var(--brand-on-primary);
  box-shadow: 0 8px 16px color-mix(in oklch, var(--brand-primary) 25%, transparent);
}
.btn-ghost { background: transparent; color: var(--color-text); border-color: var(--color-border); }
.btn-ghost:hover { background: var(--color-bg-alt); }

.btn-lg { padding: var(--sp-4) var(--sp-8); font-size: 1rem; }

/* ============================================================================
   Forms
   ============================================================================ */
.form { display: grid; gap: var(--sp-5); max-width: 36rem; }
.form-row { display: grid; gap: var(--sp-2); }
.form label { font-weight: 500; font-size: 0.9375rem; }
.form input, .form textarea, .form select {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.form input:focus, .form textarea:focus, .form select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--brand-primary) 18%, transparent);
}
.form textarea { min-height: 140px; resize: vertical; }
.form .hp { position: absolute; left: -10000px; opacity: 0; pointer-events: none; }
.form-help { font-size: var(--fs-small); color: var(--color-text-muted); }
.form-status { padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-sm); display: none; font-size: 0.9375rem; }
.form-status[data-state="ok"]    { display: block; background: color-mix(in oklch, var(--color-success) 12%, transparent); color: var(--color-success); border: 1px solid color-mix(in oklch, var(--color-success) 30%, transparent); }
.form-status[data-state="error"] { display: block; background: color-mix(in oklch, var(--color-error) 12%, transparent);   color: var(--color-error);   border: 1px solid color-mix(in oklch, var(--color-error) 30%, transparent); }

/* ============================================================================
   Hero — the "beautiful" landing section
   ============================================================================ */
.hero {
  position: relative;
  isolation: isolate;
  padding-block: var(--sp-24) var(--sp-20);
  text-align: center;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10%;
  z-index: -2;
  background:
    radial-gradient(45% 55% at 18% 20%,  color-mix(in oklch, var(--brand-primary) 20%, transparent), transparent 70%),
    radial-gradient(40% 50% at 85% 25%,  color-mix(in oklch, var(--brand-accent) 16%, transparent),  transparent 70%),
    radial-gradient(50% 50% at 50% 110%, color-mix(in oklch, var(--brand-primary) 12%, transparent), transparent 70%);
  filter: blur(2px);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right,  color-mix(in oklch, var(--brand-neutral) 6%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in oklch, var(--brand-neutral) 6%, transparent) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at center, black, transparent 70%);
          mask-image: radial-gradient(ellipse at center, black, transparent 70%);
}
.hero h1 {
  font-size: var(--fs-display);
  letter-spacing: -0.035em;
  line-height: 1.04;
  font-weight: 800;
  margin-block: 0 var(--sp-6);
  max-width: 18ch;
  margin-inline: auto;
}
.hero p.lead {
  font-size: var(--fs-lead);
  color: var(--color-text-muted);
  max-width: 52ch;
  margin-inline: auto;
  margin-bottom: var(--sp-8);
  line-height: 1.55;
}
.hero__actions { display: flex; gap: var(--sp-3); justify-content: center; flex-wrap: wrap; }

.hero__highlight {
  background: linear-gradient(120deg, var(--color-primary) 0%, var(--color-accent) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
}

/* ============================================================================
   Cards / sections
   ============================================================================ */
.section-title {
  text-align: center;
  margin-bottom: var(--sp-10);
}
.section-title h2 { margin-top: 0; }
.section-title p { margin-inline: auto; color: var(--color-text-muted); font-size: var(--fs-lead); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--sp-5);
}
.card {
  position: relative;
  padding: var(--sp-8) var(--sp-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-elev);
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.card h3 { margin-top: var(--sp-3); margin-bottom: var(--sp-2); }
.card p { color: var(--color-text-muted); margin-bottom: 0; }
.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-primary-soft), var(--color-accent-soft));
  color: var(--color-primary);
}
.card__icon svg { width: 22px; height: 22px; }

/* Stats strip */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-6);
  padding: var(--sp-10);
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  text-align: center;
}
.stats__num {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw + 1rem, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stats__label { color: var(--color-text-muted); font-size: var(--fs-small); margin-top: var(--sp-1); }

/* CTA section */
.cta-band {
  text-align: center;
  padding: var(--sp-16) var(--sp-6);
  background: linear-gradient(135deg, var(--color-primary), color-mix(in oklch, var(--color-primary) 70%, var(--color-accent)));
  color: var(--brand-on-primary);
  border-radius: var(--radius-xl);
  margin-block: var(--sp-16);
}
.cta-band h2 { color: var(--brand-on-primary); margin-top: 0; }
.cta-band p { color: color-mix(in oklch, var(--brand-on-primary) 85%, transparent); margin-inline: auto; max-width: 50ch; font-size: var(--fs-lead); }
.cta-band .btn-primary { background: var(--brand-on-primary); color: var(--color-primary); margin-top: var(--sp-6); }
.cta-band .btn-primary:hover { background: color-mix(in oklch, var(--brand-on-primary) 90%, var(--brand-neutral)); color: var(--color-primary-hover); }

/* Reading content (about/service body) */
.prose { max-width: var(--reading-max); margin-inline: auto; }
.prose h2:first-child, .prose h1:first-child { margin-top: 0; }

/* Anchor offset for sticky header */
:target { scroll-margin-top: calc(var(--nav-height) + var(--sp-6)); }

/* ============================================================================
   Breadcrumbs
   ============================================================================ */
.breadcrumbs {
  font-size: var(--fs-small);
  color: var(--color-text-muted);
  margin-top: var(--sp-12);
  margin-bottom: 0;
}
.breadcrumbs ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
}
.breadcrumbs li { display: inline-flex; align-items: center; gap: var(--sp-2); }
.breadcrumbs li:not(:last-child)::after {
  content: "›";
  color: var(--color-text-muted);
  opacity: 0.55;
}
.breadcrumbs a { color: var(--color-text-muted); }
.breadcrumbs a:hover { color: var(--color-primary); }
.breadcrumbs [aria-current="page"] { color: var(--color-text); font-weight: 500; }

/* ============================================================================
   Accessibility & motion
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ============================================================================
   APS — bespoke sections (extends the base system above). All brand colors
   come from the tokens; header/footer chrome uses the base classes untouched.
   ============================================================================ */

.container--wide { max-width: 80rem; }
.section-pad { padding-block: var(--sp-16); }
.bg-alt { background: var(--color-bg-alt); }
.nowrap { white-space: nowrap; }
.text-center { text-align: center; }
.lead-block { max-width: 62ch; margin-inline: auto; text-align: center; }
.lead-block p { margin-inline: auto; }
/* Tighten the gap between the eyebrow and the page headline (contact + services) */
.lead-block .eyebrow { margin-bottom: var(--sp-2); }
.lead-block h1 { margin-top: 0; }

/* ---- Two-tier nav: navy utility strip above the main bar ---------------- */
.topbar { background: var(--color-primary); color: #fff; font-size: var(--fs-small); }
.topbar__inner {
  max-width: var(--content-max); margin-inline: auto;
  padding: 7px var(--sp-6);
  display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-5);
}
.topbar__item { display: inline-flex; align-items: center; gap: 6px; color: rgba(255,255,255,.92); }
.topbar a.topbar__item:hover { color: #fff; text-decoration: none; }
.topbar__item svg { width: 15px; height: 15px; color: var(--color-accent); }
.topbar__item + .topbar__item { border-left: 1px solid rgba(255,255,255,.22); padding-left: var(--sp-5); }
@media (max-width: 600px) {
  .topbar__inner { justify-content: center; }
  .topbar__hide { display: none; }
  .topbar__item + .topbar__item { border-left: 0; padding-left: 0; }
}

/* Scroll-reveal — JS-gated so no-JS users still see everything. footer.php
   adds .js-reveal to <html> and toggles .is-visible as elements enter view. */
.js-reveal .reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
.js-reveal .reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) { .js-reveal .reveal { opacity: 1; transform: none; } }

/* ---- Image hero ---------------------------------------------------------- */
.hero--aps {
  position: relative;
  isolation: isolate;
  padding-block: var(--sp-32) var(--sp-20);
  text-align: center;
  color: #fff;
  overflow: hidden;
}
.hero--aps::before { content: none; }            /* drop stock gradient mesh */
.hero--aps::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(10,23,48,0.74) 0%, rgba(10,23,48,0.88) 100%),
    var(--hero-image, none) center 35% / cover no-repeat;
  -webkit-mask-image: none; mask-image: none;
}
.hero--aps .eyebrow { color: #fff; opacity: .92; }
.hero--aps h1 { color: #fff; max-width: 20ch; margin-inline: auto; text-shadow: 0 1px 26px rgba(0,0,0,.28); }
.hero--aps p.lead { color: rgba(255,255,255,.9); margin-inline: auto; max-width: 60ch; }
.hero--aps .hero__actions { justify-content: center; }
.hero--aps .btn-ghost { color: #fff; border-color: rgba(255,255,255,.55); }
.hero--aps .btn-ghost:hover { background: rgba(255,255,255,.12); }
.hero__assurances { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-3) var(--sp-6); margin-top: var(--sp-8); font-size: var(--fs-small); color: rgba(255,255,255,.88); }
.hero__assurances span { display: inline-flex; align-items: center; gap: var(--sp-2); }
.hero__assurances svg { width: 18px; height: 18px; color: var(--color-accent); }
@media (max-width: 640px) { .hero--aps { padding-block: var(--sp-24) var(--sp-16); } }

/* ---- Trust bar (navy band) ---------------------------------------------- */
.aps-trustbar { background: var(--color-primary); color: #fff; }
/* Trust bar butts directly against the hero (cancel the generic section gap). */
.hero + .aps-trustbar { margin-top: 0; }
.aps-trustbar__grid {
  max-width: var(--content-max); margin-inline: auto; padding: var(--sp-10) var(--sp-6);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-6); text-align: center;
}
.aps-trustbar__item { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); }
.aps-trustbar__item svg { width: 30px; height: 30px; color: #fff; }
.aps-trustbar__num { font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 800; letter-spacing: -.02em; }
.aps-trustbar__label { font-size: var(--fs-small); color: rgba(255,255,255,.82); }
@media (max-width: 760px) { .aps-trustbar__grid { grid-template-columns: 1fr 1fr; gap: var(--sp-8); } }

/* ---- Split (image + content) -------------------------------------------- */
.aps-split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-12); align-items: center; }
.aps-split--reverse .aps-split__media { order: 2; }
.aps-split__media img, .aps-split__media .img-ph { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.aps-split__body h2 { margin-top: 0; }
@media (max-width: 860px) { .aps-split { grid-template-columns: 1fr; gap: var(--sp-8); } .aps-split--reverse .aps-split__media { order: 0; } }

/* Image placeholder (until client photos arrive) */
.img-ph {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, color-mix(in oklch, var(--color-primary) 14%, var(--color-bg)), color-mix(in oklch, var(--color-primary) 5%, var(--color-bg)));
  border: 1px dashed var(--color-border); color: var(--color-text-muted);
  font-size: var(--fs-small); padding: var(--sp-6);
}
.img-ph svg { width: 40px; height: 40px; opacity: .55; margin-bottom: var(--sp-2); color: var(--color-primary); }

/* Checklist */
.aps-checklist { list-style: none; padding: 0; margin: var(--sp-5) 0 0; display: grid; gap: var(--sp-4); }
.aps-checklist li { display: flex; gap: var(--sp-3); align-items: flex-start; }
.aps-checklist > li > svg { width: 24px; height: 24px; flex-shrink: 0; color: var(--color-primary); margin-top: 1px; }
.aps-checklist strong { display: block; }
.aps-checklist .muted { color: var(--color-text-muted); font-size: 0.95rem; }

/* ---- Signature: managed monitoring band --------------------------------- */
.aps-managed { background: var(--color-primary); color: #fff; border-radius: var(--radius-xl); padding: clamp(2rem, 4vw, var(--sp-20)); position: relative; overflow: hidden; }
.aps-managed::after { content: ""; position: absolute; right: -12%; top: -30%; width: 60%; height: 160%; background: radial-gradient(closest-side, color-mix(in oklch, var(--color-accent) 38%, transparent), transparent); opacity: .5; z-index: 0; }
.aps-managed > * { position: relative; z-index: 1; }
.aps-managed h2 { color: #fff; margin-top: 0; max-width: 22ch; }
.aps-managed .lead { color: rgba(255,255,255,.86); font-size: var(--fs-lead); max-width: 62ch; }
.aps-managed__pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-6); margin-top: var(--sp-10); }
.aps-pillar { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius-lg); padding: var(--sp-6); }
.aps-pillar svg { width: 30px; height: 30px; color: #fff; margin-bottom: var(--sp-3); }
.aps-pillar h3 { color: #fff; font-size: var(--fs-h4); margin: 0 0 var(--sp-2); }
.aps-pillar p { color: rgba(255,255,255,.82); margin: 0; font-size: 0.95rem; }
@media (max-width: 760px) { .aps-managed__pillars { grid-template-columns: 1fr; } }

/* ---- Quotes / testimonials ---------------------------------------------- */
.aps-quotes { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
.aps-quotes--two { grid-template-columns: repeat(2, 1fr); max-width: 60rem; margin-inline: auto; align-items: start; }
@media (max-width: 860px) { .aps-quotes--two { grid-template-columns: 1fr; } }
.aps-quote { border: 1px solid var(--color-border); border-left: 4px solid var(--color-accent); border-radius: var(--radius-md); background: var(--color-bg-elev); padding: var(--sp-6); }
.aps-quote p { font-size: var(--fs-lead); color: var(--color-text); margin: 0 0 var(--sp-3); }
.aps-quote cite { color: var(--color-text-muted); font-size: var(--fs-small); font-style: normal; }
@media (max-width: 860px) { .aps-quotes { grid-template-columns: 1fr; } }

/* ---- Service rows (services page) --------------------------------------- */
/* Alternating rounded service cards (styled like the .aps-managed band) */
.aps-services-stack { display: grid; gap: var(--sp-8); }
.aps-service-card { border-radius: var(--radius-xl); padding: clamp(2rem, 4vw, var(--sp-16)); position: relative; overflow: hidden; }
.aps-service-card--alt { background: var(--color-bg-alt); border: 1px solid var(--color-border); }
.aps-service-card--dark { background: var(--color-primary); color: #fff; }
.aps-service-card--dark::after { content: ""; position: absolute; right: -12%; top: -30%; width: 60%; height: 160%; background: radial-gradient(closest-side, color-mix(in oklch, var(--color-accent) 38%, transparent), transparent); opacity: .5; z-index: 0; }
.aps-service-card--dark > * { position: relative; z-index: 1; }
.aps-service-card--dark .aps-service__head h2 { color: #fff; }
.aps-service-card--dark .aps-service__grid p { color: rgba(255,255,255,.86); }
.aps-service-card--dark .aps-service__features li { color: rgba(255,255,255,.82); }
.aps-service-card--dark .aps-service__features svg { color: #fff; }
.aps-service-card--dark .aps-service__icon { background: rgba(255,255,255,.10); color: #fff; }
.aps-service__head { display: flex; gap: var(--sp-4); align-items: center; margin-bottom: var(--sp-5); }
.aps-service__icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: var(--radius-md); background: var(--color-primary-soft); color: var(--color-primary); flex-shrink: 0; }
.aps-service__icon svg { width: 28px; height: 28px; }
.aps-service__head h2 { margin: 0; }
.aps-service__grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--sp-10); align-items: start; }
.aps-service__features { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.aps-service__features li { display: flex; gap: var(--sp-2); align-items: flex-start; font-size: 0.95rem; color: var(--color-text-muted); }
.aps-service__features svg { width: 18px; height: 18px; color: var(--color-accent); flex-shrink: 0; margin-top: 3px; }
@media (max-width: 860px) { .aps-service__grid { grid-template-columns: 1fr; gap: var(--sp-6); } .aps-service__features { grid-template-columns: 1fr; } }

/* ---- Industries --------------------------------------------------------- */
.aps-industries { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-8); }
.aps-industry { border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--sp-8); background: var(--color-bg-elev); }
.aps-industry h3 { margin-top: 0; }
.aps-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-4); }
.aps-chip { font-size: var(--fs-small); padding: var(--sp-1) var(--sp-3); border-radius: 999px; background: var(--color-bg-alt); border: 1px solid var(--color-border); color: var(--color-text-muted); }
@media (max-width: 760px) { .aps-industries { grid-template-columns: 1fr; } }

/* ---- FAQ ---------------------------------------------------------------- */
.aps-faq { max-width: 52rem; margin-inline: auto; }
.aps-faq details { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-3); background: var(--color-bg-elev); }
.aps-faq summary { cursor: pointer; font-weight: 700; font-family: var(--font-display); list-style: none; display: flex; justify-content: space-between; gap: var(--sp-4); align-items: center; }
.aps-faq summary::-webkit-details-marker { display: none; }
.aps-faq summary::after { content: "+"; color: var(--color-accent); font-size: 1.5rem; line-height: 1; }
.aps-faq details[open] summary::after { content: "\2013"; }
.aps-faq details p { margin: var(--sp-3) 0 0; color: var(--color-text-muted); }

/* ---- Bespoke CTA (intentionally not the stock .cta-band) ----------------- */
.aps-cta { background: var(--color-primary); color: #fff; border-radius: var(--radius-xl); padding: clamp(2rem, 4vw, var(--sp-16)); display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--sp-10); align-items: center; }
.aps-cta h2 { color: #fff; margin: 0 0 var(--sp-3); }
.aps-cta p { color: rgba(255,255,255,.86); margin: 0; max-width: 48ch; }
.aps-cta__actions { display: flex; flex-direction: column; gap: var(--sp-3); align-items: flex-start; }
.aps-cta__phone { font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 800; color: #fff; display: inline-flex; align-items: center; gap: var(--sp-2); }
.aps-cta__phone svg { width: 26px; height: 26px; color: var(--color-accent); }
.aps-cta__phone:hover { color: #fff; text-decoration: none; }
.aps-cta .btn-primary { background: #fff; color: var(--color-primary); }
.aps-cta .btn-primary:hover { background: rgba(255,255,255,.9); color: var(--color-primary); }
.aps-cta__note { font-size: var(--fs-small); color: rgba(255,255,255,.72); }
@media (max-width: 760px) { .aps-cta { grid-template-columns: 1fr; gap: var(--sp-6); } }

/* ---- Contact page layout ------------------------------------------------ */
.aps-contact { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--sp-12); align-items: start; }
.aps-contact__aside { border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--sp-8); background: var(--color-bg-alt); }
.aps-contact__aside h3 { margin-top: 0; }
.aps-detail { display: flex; gap: var(--sp-3); align-items: flex-start; margin-bottom: var(--sp-5); }
.aps-detail svg { width: 22px; height: 22px; color: var(--color-primary); flex-shrink: 0; margin-top: 2px; }
.aps-detail a { font-weight: 600; }
.aps-detail__label { display: block; font-size: var(--fs-small); color: var(--color-text-muted); }
@media (max-width: 860px) { .aps-contact { grid-template-columns: 1fr; gap: var(--sp-8); } }
