/* ============================================
   CRITICAL START DESIGN TOKENS
   ============================================
   Source: D19 Option B "Textured Light" prototype
   Reference: D16 Component Library, D1 Brand Guidelines, D18 Interaction Specs

   These tokens are imported by every component's CSS module.
   Since code components run in Shadow DOM, tokens must be
   explicitly imported — they do not cascade from the page.
   ============================================ */

:host, :host {
  /* Backgrounds — Cool Steel palette (approved 2026-04-21)
     Body and alt-section surfaces carry a subtle blue tint that reads more
     technical/platform-leaning than the previous neutral near-whites. */
  --bg-primary: #F4F8FD;       /* Cool Steel body (was #FAFAFA) */
  --bg-white: #FFFFFF;
  --bg-muted: #EAF1F9;         /* Cool Steel alt-section (was #F4F4F5) */
  --bg-dark: #1E1E1E;
  --bg-charcoal: #121820;      /* Cool Steel near-black (was #343741) — StatRow, Footer, Outcomes, Transparency, dark accordions all inherit */
  --bg-navy: #004C97;
  --dark-section-bg: linear-gradient(135deg, #003A73 0%, #00264A 100%); /* Cool Steel deep-navy band — Final CTA etc. */

  /* Section background recipes (2026-04-29) — the canonical Two-Container Rule
     surfaces. Use these on every <section>: alternate light/dark for the
     dark→light→dark→light scroll rhythm Cameron likes from stripe.com.
     Light: subtle white→cool-steel gradient, almost imperceptible. Dark:
     deep navy gradient. Page bodies prepend the Ambient Background which
     sits over both. */
  --bg-light-section: linear-gradient(180deg, #FFFFFF 0%, #F4F8FD 100%);
  --bg-dark-section: linear-gradient(135deg, #003A73 0%, #00264A 100%); /* Alias of --dark-section-bg, keep both for back-compat */

  /* Text */
  --text-primary: #1E1E1E;
  --text-secondary: #52525B;
  --text-muted: #71717A;
  --text-inverse: #FFFFFF;
  --text-faint: #A1A1AA;
  --text-inverse-muted: rgba(255, 255, 255, 0.55);

  /* Brand blues — consolidated 3-blue palette (2026-04-27)
     Replaces the earlier 5-blue brand set. Three roles:
       --blue-primary  workhorse for CTAs, links, fills, borders, focus on light bg
       --blue-bright   accent + on-dark text. Wordmark, gradient highlight, dark surfaces.
       --blue-deep     navy anchor for gradient endpoints and deep-navy section bands. */
  --blue-bright: #009CDE;          /* Brand blue. AA text on charcoal (5.96:1 on #121820). */
  --blue-primary: #0072B5;         /* AA text on white (5.15:1) and on muted (4.69:1). */
  --blue-primary-hover: #005A91;   /* Hover state for --blue-primary on light surfaces. */
  --blue-deep: #004C97;            /* Navy. Gradient endpoint, dark section accents. */
  --brand-red: #EF3340;
  --brand-red-accessible: #E22C3F;        /* 4.50:1 on white. WCAG AA text. */
  --brand-gradient: linear-gradient(135deg, var(--blue-bright) 0%, var(--blue-deep) 100%);

  /* Accent — CTAs */
  --cta-orange: #FA6614;                  /* 3.01:1 on white — WCAG AA large text */
  --cta-orange-hover: #E55D0F;

  /* Typography */
  --font-body: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Typography Scale — Desktop */
  --display-size: 56px;
  --display-weight: 700;
  --display-line-height: 1.1;

  /* HeroSplit variant — deliberately tighter than --display-size (the
     centered HeroStandard pattern). 2026-04-30: extracted from inline
     font-size declarations so the responsive overrides (44/36 → 40/32)
     are part of the token system, not bespoke @media in the component. */
  --hero-split-display-size: 54px;

  --h2-size: 40px;
  --h2-weight: 700;
  --h2-line-height: 1.2;

  --h3-size: 28px;
  --h3-weight: 600;
  --h3-line-height: 1.25;

  --h4-size: 20px;
  --h4-weight: 600;
  --h4-line-height: 1.3;

  --body-size: 16px;
  --body-weight: 400;
  --body-line-height: 1.6;

  --body-large-size: 18px;
  --body-large-weight: 400;
  --body-large-line-height: 1.6;

  --small-size: 14px;
  --micro-size: 12px;

  /* Spacing */
  --section-pad: 96px;
  --section-pad-tablet: 64px;
  --section-pad-mobile: 48px;
  --container: 1200px;       /* DEFAULT — most sections, body grids */
  --container-narrow: 960px; /* Articles, legal, narrow forms */
  --container-wide: 1440px;  /* Hero rows that benefit from extra breathing room */
  --container-padding: 32px;
  --container-padding-mobile: 20px;

  /* Button geometry (2026-04-29 codification) — three sizes only.
     Compact = pill-shaped header CTAs and inline navigation actions.
     Default = body CTAs (CtaSection, hero primary, form submits).
     Large = reserved for the homepage hero showpiece if needed.
     Pill radius for compact (signals "always-available"); md radius for
     body buttons (signals "deliberate action"). */
  --btn-pad-compact: 7px 14px;
  --btn-pad-default: 14px 32px;
  --btn-pad-large: 18px 40px;
  --btn-radius-pill: 100px;
  --btn-radius-default: var(--radius-sm);
  --btn-font-compact: 14px;
  --btn-font-default: var(--body-size);
  --btn-shadow-orange-rest: 0 1px 2px rgba(250, 102, 20, 0.18);
  --btn-shadow-orange-hover: 0 4px 12px rgba(250, 102, 20, 0.28);

  /* Motion (D18 tokens) */
  --duration-instant: 100ms;
  --duration-fast: 200ms;
  --duration-normal: 300ms;
  --duration-slow: 500ms;
  --duration-gentle: 800ms;
  --ease-default: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-enter: cubic-bezier(0, 0, 0.2, 1);

  /* Borders — cooler neutral to match Cool Steel palette */
  --border-light: #D6DEE8;     /* Cool Steel (was #E4E4E7) */
  --border-muted: #C4CEDE;     /* Cool Steel (was #D4D4D8) */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  /* Shadows — legacy single-layer (kept for back-compat) */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);

  /* Modern multi-layer elevation system (2026-04-28)
     Stripe-inspired stacked shadows in navy tint. Each elevation level
     uses 2-4 stacked shadows that compound into real-feeling depth. The
     navy tint (rgba 0, 76, 151) makes the shadows feel like part of the
     brand instead of generic gray. Use these in place of --shadow-* on
     all card/container surfaces. */
  --elev-1:
    0 1px 2px rgba(0, 76, 151, 0.04),
    0 4px 12px rgba(0, 76, 151, 0.04);
  --elev-2:
    0 2px 4px rgba(0, 76, 151, 0.06),
    0 8px 20px rgba(0, 76, 151, 0.07),
    0 16px 32px rgba(0, 76, 151, 0.05);
  --elev-3:
    0 4px 8px rgba(0, 76, 151, 0.06),
    0 12px 24px rgba(0, 76, 151, 0.08),
    0 24px 48px rgba(0, 76, 151, 0.10);

  /* Dark variants — for cards on charcoal/navy section backgrounds */
  --elev-1-dark:
    0 1px 2px rgba(0, 0, 0, 0.12),
    0 4px 12px rgba(0, 38, 74, 0.18);
  --elev-2-dark:
    0 2px 4px rgba(0, 0, 0, 0.14),
    0 8px 20px rgba(0, 38, 74, 0.24),
    0 16px 32px rgba(0, 38, 74, 0.20);

  /* Inset highlight for the top edge of cards — the "object catching
     light" detail. Pair with one of the --elev-* shadows. */
  --elev-inset-light: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  --elev-inset-dark: inset 0 1px 0 rgba(255, 255, 255, 0.06);

  /* Standard transition timing for hover states. cubic-bezier(0.4, 0, 0.2, 1)
     is the "natural" feel — quick start, gentle settle. */
  --ease-hover: cubic-bezier(0.4, 0, 0.2, 1);

  /* Interactive card surfaces — Cool Steel gradient (approved 2026-04-21)
     Cooler/more saturated than the prior V2 tokens — pairs with the new
     Cool Steel body tint above. Applied to "selectable" cards that sit on
     the light body surface: Bento Grid tiles, Threat Intelligence Callout
     cards, and (in Phase 2) Industry / Solution / Partner Benefits /
     Related Resources / Differentiator / Threat / Step cards. Do NOT
     apply to Service Portfolio (already dark), Stat Row, Outcomes Ticker,
     Leadership Grid, Integration Logo Bar, or Footer. */
  --gradient-card-rest:      linear-gradient(135deg, #E3EEFB 0%, #C4D8F0 100%);
  --gradient-card-hover:     linear-gradient(135deg, #D4E4F7 0%, #AFC8EA 100%);
  --border-card-blue:        rgba(0, 114, 181, 0.32);
  --border-card-blue-hover:  rgba(0, 114, 181, 0.52);
  --shadow-card-hover:       0 8px 24px rgba(0, 76, 151, 0.14);
}

/* Mobile typography overrides */
@media (max-width: 767px) {
  :host, :host {
    --display-size: 36px;
    --hero-split-display-size: 32px;
    --h2-size: 28px;
    --h3-size: 22px;
    --h4-size: 18px;
    --body-large-size: 17px;
    --section-pad: var(--section-pad-mobile);
    --container-padding: var(--container-padding-mobile);
  }
}

/* Tablet typography overrides */
@media (min-width: 768px) and (max-width: 1199px) {
  :host, :host {
    --display-size: 44px;
    --hero-split-display-size: 40px;
    --h2-size: 34px;
    --h3-size: 24px;
    --section-pad: var(--section-pad-tablet);
  }
}

/* ============================================
   BRAND-COLOR GRADIENT BLOBS (2026-04-28)
   ============================================
   Atmospheric layer — five large soft-blurred blobs in mid/deep brand
   blues. Sits below the noise pixel layer (z-index 0 vs 9998). Fixed
   to viewport so blobs are stable as content scrolls past. Heavy blur
   (140px) + low opacity (0.20–0.32) keeps them as ATMOSPHERE, not
   distinct shapes. Bright blue held back to 0.20 so the frosted
   header never reads aqua.

   Mix-blend-mode: soft-light keeps blobs visible on dark sections
   (charcoal, navy) AND on light sections, without overpowering either.
*/
.AmbientBackground-module__blobLayer--EPuKt {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.AmbientBackground-module__blob--mKFdp {
  position: absolute;
  border-radius: 50%;
  filter: blur(140px);
  mix-blend-mode: soft-light;
  will-change: transform;
}
.AmbientBackground-module__blob1--PYwle {
  width: 720px; height: 720px;
  background: #0072B5;
  opacity: 0.32;
  top: -180px; left: -200px;
}
.AmbientBackground-module__blob2--UTGnG {
  width: 680px; height: 680px;
  background: #004C97;
  opacity: 0.30;
  top: 280px; right: -220px;
}
.AmbientBackground-module__blob3--u9rdk {
  width: 540px; height: 540px;
  background: #009CDE;
  opacity: 0.20;
  top: 1100px; left: 18%;
}
.AmbientBackground-module__blob4--D2EXn {
  width: 620px; height: 620px;
  background: #0072B5;
  opacity: 0.30;
  top: 1700px; right: 5%;
}
.AmbientBackground-module__blob5--N_OIJ {
  width: 700px; height: 700px;
  background: #004C97;
  opacity: 0.32;
  top: 2400px; left: -150px;
}

/* ============================================
   AMBIENT BACKGROUND — galaxy-wisp pixel field
   ============================================
   Two fixed-position layers that paint a fine pixel-grid "wispy" field
   along the left and right edges of the viewport, fading to a clean
   white center. Rendered via SVG inside each layer; procedurally
   generated in the component so nothing is bundled as a static asset.

   Positioning: position: fixed, so it covers the viewport regardless of
   where the component is dropped in the page. pointer-events: none, so
   clicks always fall through to actual content. Masked with a linear
   gradient per side to dissolve into the center.

   Final settings (approved 2026-04-21):
   - Motion: drift on, two different durations + phase offset per side
   - Density: Sparse  (densityMultiplier = 0.90)
   - Opacity: Whisper (opacityCap = 0.14)
   - Glitch:  High    (tickMs 80, perTick 3)
*/

.AmbientBackground-module__ambientLayer--egTjf {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 28vw;
  pointer-events: none;
  /* Sits ABOVE section backgrounds (which is why the z-index is high)
     but visually invisible on white/light surfaces (text, buttons,
     white content cards) thanks to mix-blend-mode: multiply.

     The blend mode does the heavy lifting:
       - white  × low-opacity blue  ≈ white  → dots invisible on white
       - dark navy × low-opacity blue ≈ deeper navy → dots visible
       - light card × low-opacity blue ≈ very faint tint → barely visible
     Result: noise pixels show on colored section backgrounds (where we
     want them) and disappear over white content (where we don't).

     The header sits at z-index 10000 — above this — so it's never
     painted over even though its glassy bg is technically a "colored
     background." */
  z-index: 9998;
  mix-blend-mode: multiply;
  /* Fade toward the center so the pixel field dissolves into white */
  -webkit-mask-image: linear-gradient(
    to var(--mask-dir),
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.9) 30%,
    rgba(0, 0, 0, 0) 100%
  );
          mask-image: linear-gradient(
    to var(--mask-dir),
    rgba(0, 0, 0, 1) 0%,
    rgba(0, 0, 0, 0.9) 30%,
    rgba(0, 0, 0, 0) 100%
  );
}

.AmbientBackground-module__left--DvjQ1  { left: 0;  --mask-dir: right; }
.AmbientBackground-module__right--A1yhv { right: 0; --mask-dir: left;  }

/* Whisper-level drift — pixel-level glitches (via JS) carry the real motion.
   Different durations + phase offset so left and right never sync. */
@keyframes AmbientBackground-module__cs-ambient-drift--tZDzv {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}

.AmbientBackground-module__motionOn--sJBXD.AmbientBackground-module__left--DvjQ1  { animation: AmbientBackground-module__cs-ambient-drift--tZDzv 60s ease-in-out infinite; }
.AmbientBackground-module__motionOn--sJBXD.AmbientBackground-module__right--A1yhv { animation: AmbientBackground-module__cs-ambient-drift--tZDzv 72s ease-in-out infinite -18s; }

.AmbientBackground-module__ambientLayer--egTjf svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Respect user motion preference — no drift, no glitches (component
   suppresses the glitch loop in JS when this matches). */
@media (prefers-reduced-motion: reduce) {
  .AmbientBackground-module__motionOn--sJBXD.AmbientBackground-module__left--DvjQ1, .AmbientBackground-module__motionOn--sJBXD.AmbientBackground-module__right--A1yhv {
    animation: none;
  }
}

