/* ============================================
   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);
  }
}

/* ============================================
   UTILITY STYLES
   ============================================
   Shared patterns used across multiple components.
   ============================================ */

/* --- Container --- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.container-wide {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 48px;
}

/* --- Button Styles --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  background: var(--cta-orange);
  color: var(--text-inverse);
  font-family: var(--font-body);
  font-size: var(--body-size);
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background var(--duration-fast) var(--ease-default),
              transform var(--duration-fast) var(--ease-default);
  cursor: pointer;
  border: none;
}

.btn-primary:hover {
  background: var(--cta-orange-hover);
  transform: translateY(-1px);
  /* 3-stack shadow promoted from CtaSection 2026-04-30 — gives the
     orange CTA real depth (close glow + mid spread + far ambient).
     Matches Stripe-level button polish. */
  box-shadow:
    0 1px 2px rgba(250, 102, 20, 0.10),
    0 4px 12px rgba(250, 102, 20, 0.25),
    0 12px 24px rgba(250, 102, 20, 0.15);
  color: var(--text-inverse);
}

.btn-primary:active {
  transform: scale(0.98);
  box-shadow: 0 1px 4px rgba(255, 106, 20, 0.2);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 2px;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--body-size);
  font-weight: 500;
  border: 1.5px solid var(--border-muted);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: border-color var(--duration-fast) var(--ease-default),
              color var(--duration-fast) var(--ease-default);
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: var(--text-primary);
  background: rgba(0, 0, 0, 0.04);
}

.btn-secondary:active {
  transform: scale(0.98);
}

.btn-secondary:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 2px;
}

/* --- Compact Button (header CTA pattern) ---
   Used in tight chrome (Header, in-card "View tier" links). Pill shape,
   smaller pad, smaller font. Same orange + hover behavior as .btn-primary
   so it reads as the same "deliberate action." */
.btn-compact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--btn-pad-compact);
  background: var(--cta-orange);
  color: var(--text-inverse);
  font-family: var(--font-body);
  font-size: var(--btn-font-compact);
  font-weight: 600;
  border-radius: var(--btn-radius-pill);
  text-decoration: none;
  letter-spacing: 0.01em;
  border: none;
  cursor: pointer;
  box-shadow: var(--btn-shadow-orange-rest);
  transition: background var(--duration-fast) var(--ease-hover),
              transform var(--duration-fast) var(--ease-hover),
              box-shadow var(--duration-fast) var(--ease-hover);
}

.btn-compact:hover {
  background: var(--cta-orange-hover);
  color: var(--text-inverse);
  box-shadow: var(--btn-shadow-orange-hover);
}

.btn-compact:active {
  transform: scale(0.98);
  box-shadow: var(--btn-shadow-orange-rest);
}

.btn-compact:focus-visible {
  outline: 2px solid var(--text-primary);
  outline-offset: 2px;
}

/* --- Compact Secondary (header utility-pill pattern) ---
   Outlined pill used for "Login," "Contact Sales," etc. in the header.
   Same dimensions as .btn-compact but subtle outline + secondary color. */
.btn-compact-secondary {
  display: inline-flex;
  align-items: center;
  padding: var(--btn-pad-compact);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: var(--btn-radius-pill);
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-hover),
              color var(--duration-fast) var(--ease-hover);
}

.btn-compact-secondary:hover {
  color: var(--text-primary);
  border-color: rgba(0, 0, 0, 0.3);
}

.btn-compact-secondary:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 2px;
}

/* --- Dark Background Variants --- */
.bg-dark .btn-secondary {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text-inverse);
}

.bg-dark .btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

/* --- Pill Link --- */
.pill-link {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: var(--small-size);
  font-weight: 500;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 100px;
  text-decoration: none;
  transition: border-color var(--duration-fast) var(--ease-default),
              background var(--duration-fast) var(--ease-default),
              color var(--duration-fast) var(--ease-default);
  cursor: pointer;
}

.pill-link:hover {
  border-color: rgba(0, 0, 0, 0.25);
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-primary);
}

.pill-link.active {
  background: var(--text-primary);
  color: var(--text-inverse);
  border-color: var(--text-primary);
}

.pill-link:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 2px;
}

/* --- Arrow Link (Type 6: standalone directional links) --- */
.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--blue-bright);
  font-size: var(--small-size);
  font-weight: 500;
  text-decoration: none;
  transition: gap var(--duration-fast) var(--ease-default),
              color var(--duration-fast) var(--ease-default);
}

.arrow-link:hover {
  gap: 10px;
  color: var(--blue-primary-hover);
}

.arrow-link:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 2px;
}

.arrow-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Legacy alias — .text-link maps to arrow-link behavior */
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--blue-bright);
  font-weight: 500;
  text-decoration: none;
  transition: gap var(--duration-fast) var(--ease-default),
              color var(--duration-fast) var(--ease-default);
}

.text-link:hover {
  gap: 10px;
  color: var(--blue-primary-hover);
}

.text-link:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 2px;
}

.text-link svg,
.arrow-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* --- Inline Content Link (Type 3: text links in body copy) --- */
.content-link {
  color: var(--blue-bright);
  text-decoration: none;
  transition: color var(--duration-instant) var(--ease-default);
}

.content-link:hover {
  color: var(--blue-primary-hover);
  text-decoration: underline;
}

/* --- Navigation Link (Type 7) --- */
.nav-link {
  color: var(--text-secondary);
  font-size: var(--small-size);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-default);
}

.nav-link:hover {
  color: var(--text-primary);
}

/* --- Breadcrumb (Type 7 variant) --- */
.breadcrumb a {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 400;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-default);
}

.breadcrumb a:hover {
  color: var(--text-primary);
}

.breadcrumb .current {
  color: var(--text-primary);
  font-weight: 500;
}

.breadcrumb .separator {
  color: var(--text-faint);
  margin: 0 8px;
}

/* --- Footer Link (Type 8) --- */
.footer-link {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-default);
}

.footer-link:hover {
  color: var(--text-inverse);
}

/* --- Section Header --- */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: var(--h2-size);
  font-weight: var(--h2-weight);
  line-height: var(--h2-line-height);
  color: var(--text-primary);
}

.section-header p {
  font-size: var(--body-large-size);
  color: var(--text-secondary);
  margin-top: 12px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Scroll Reveal (CSS portion) --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration-slow) var(--ease-enter),
              transform var(--duration-slow) var(--ease-enter);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 80ms; }
.reveal-delay-2 { transition-delay: 160ms; }
.reveal-delay-3 { transition-delay: 240ms; }
.reveal-delay-4 { transition-delay: 320ms; }
.reveal-delay-5 { transition-delay: 400ms; }

/* ============================================
   TWO-CONTAINER RULE (2026-04-29 codification)
   ============================================
   Every container on the site is one of two recipes:

   .filled-card    — for cards on LIGHT sections
   .frosted-card   — for cards on DARK sections (navy/charcoal)

   Both recipes share the same radius, padding, hover lift, and inset
   highlight. Only the palette swaps. This is what gives the site its
   "consistent surface" feel as users scroll dark→light→dark→light.

   When a designer wants visual emphasis WITHOUT breaking the rule, vary
   the GRID (size, span) — not the palette. (One exception is documented
   below: BentoGrid intentionally uses dark navy tiles on a light section
   per Cameron 2026-04-28. That is a "dark+filled" emphasis variant; do
   not generalize it.)
   ============================================ */

.filled-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--elev-1), var(--elev-inset-light);
  transition: background var(--duration-fast) var(--ease-hover),
              border-color var(--duration-fast) var(--ease-hover),
              box-shadow var(--duration-fast) var(--ease-hover),
              transform var(--duration-fast) var(--ease-hover);
}

.filled-card:hover {
  border-color: var(--border-card-blue);
  box-shadow: var(--elev-2), var(--elev-inset-light);
  transform: translateY(-2px);
}

.frosted-card {
  background: rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
          backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--elev-1-dark), var(--elev-inset-dark);
  transition: background var(--duration-fast) var(--ease-hover),
              border-color var(--duration-fast) var(--ease-hover),
              box-shadow var(--duration-fast) var(--ease-hover),
              transform var(--duration-fast) var(--ease-hover);
}

.frosted-card:hover {
  border-color: rgba(0, 156, 222, 0.42);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: var(--elev-2-dark), var(--elev-inset-dark);
  transform: translateY(-2px);
}

/* ============================================
   SECTION SURFACE HELPERS
   ============================================
   Use these on the outer <section> wrapper to lock in the alternating
   light/dark scroll rhythm. Pages prepend AmbientBackground globally; these
   surfaces sit beneath the ambient layer and provide the page contrast. */

.section-light {
  background: var(--bg-light-section);
  color: var(--text-primary);
  padding: var(--section-pad) 0;
}

.section-dark {
  background: var(--bg-dark-section);
  color: var(--text-inverse);
  padding: var(--section-pad) 0;
}

.section-charcoal {
  background: var(--bg-charcoal);
  color: var(--text-inverse);
  padding: var(--section-pad) 0;
}

/* On dark sections, force secondary text to a readable inverse-muted */
.section-dark .text-secondary,
.section-charcoal .text-secondary {
  color: var(--text-inverse-muted);
}

