/* ═══ COLOR FLOW MAP (from design-spec.sections[].bg_context) ═══
 * index.html:
 *   nav        → transparent-on-dark (scrolled: solid #0A1628)
 *   hero       → DARK  (#0A1628)     | text: white (#F0F6FF)
 *   problem    → DARK_ALT (#0F2040)  | text: white
 *   signal-demo→ DARK  (#0A1628)     | text: white
 *   how-it-works-strip → DARK_ALT   | text: white
 *   integrations→ DARK  (#0A1628)   | text: white
 *   testimonials→ DARK_ALT (#0F2040)| text: white
 *   metric-bar → DARK  (#0A1628)     | text: white
 *   final-cta  → DARK_ALT (#0F2040) | text: white
 *   footer     → DARK  (#0A1628)     | text: white-muted
 *
 * product.html: dark-top → nav transparent dark
 *   hero       → DARK  (#0A1628)     | text: white
 *   features   → LIGHT (#F1F5F9)     | text: dark ← POLARITY CHANGE
 *   security   → LIGHT (#F1F5F9)     | text: dark
 *   footer     → DARK
 *
 * how-it-works.html: light-top → nav solid dark
 *   hero       → LIGHT (#F1F5F9)     | text: dark
 *   steps      → WHITE (#FFFFFF)     | text: dark
 *   taxonomy   → LIGHT (#F1F5F9)     | text: dark
 *   faq        → WHITE              | text: dark
 *   footer     → DARK
 *
 * pricing.html: light-top
 *   hero → LIGHT, tiers → WHITE, faq → LIGHT, footer → DARK
 *
 * about.html: dark-top
 *   hero → DARK, story → LIGHT, team → WHITE, values → LIGHT, footer → DARK
 *
 * login/index.html: dark-top
 *   layout: left=DARK, right=WHITE (split), footer omitted (standalone)
 *
 * NAV RULE: dark-top pages → nav text STARTS white; light-top pages → nav forced solid dark = white text still OK
 * ═══════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────────────
   RESET + CUSTOM PROPERTIES
────────────────────────────────────────────────────────────────*/
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Brand palette */
  --wpi-brand-primary:    #0A1628;
  --wpi-brand-secondary:  #0F2040;
  --wpi-accent-decorative:#3B82F6;
  --wpi-accent-dark:      #60A5FA;   /* AA on dark bg */
  --wpi-accent-light:     #1D4ED8;   /* AA on light bg */
  --wpi-accent-warning:   #F59E0B;
  --wpi-accent-success:   #10B981;
  --wpi-accent-danger:    #EF4444;

  /* Foreground tokens */
  --wpi-fg-light-primary:   #0A1628;
  --wpi-fg-light-secondary: #374151;
  --wpi-fg-light-tertiary:  #6B7280;
  --wpi-fg-dark-primary:    #F0F6FF;
  --wpi-fg-dark-secondary:  #94A3B8;
  --wpi-fg-dark-tertiary:   #64748B;

  /* Background tokens */
  --wpi-bg-dark:          #0A1628;
  --wpi-bg-dark-alt:      #0F2040;
  --wpi-bg-dark-elevated: #152B52;
  --wpi-bg-card-dark:     #162035;
  --wpi-bg-light:         #F1F5F9;
  --wpi-bg-white:         #FFFFFF;

  /* Border */
  --wpi-border-dark:  #1E3A5F;
  --wpi-border-light: #E2E8F0;

  /* Shadows */
  --wpi-shadow-dark:  0 4px 24px rgba(0,0,0,0.4);
  --wpi-shadow-hover: 0 8px 40px rgba(59,130,246,0.15);
  --wpi-shadow-glow:  0 0 20px rgba(59,130,246,0.25);

  /* Spacing */
  --wpi-section-py-desk: 100px;
  --wpi-section-py-mob:  64px;

  /* Typography */
  --wpi-font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --wpi-font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  /* Radius */
  --wpi-radius-card:   12px;
  --wpi-radius-btn:    6px;
  --wpi-radius-chip:   4px;
  --wpi-radius-metric: 8px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--wpi-font-sans);
  font-size: 1rem;
  line-height: 1.7;
  background: var(--wpi-bg-white);
  color: var(--wpi-fg-light-primary);
  -webkit-font-smoothing: antialiased;
}

/* Dark-top pages: body bg dark so transparent nav looks right */
body.wpi-page--dark-top {
  background: var(--wpi-bg-dark);
}

body.wpi-page--light-top {
  background: var(--wpi-bg-light);
}

img, svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: inherit;
}

/* ──────────────────────────────────────────────────────────────
   CONTAINER
────────────────────────────────────────────────────────────────*/
.wpi-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (min-width: 768px) {
  .wpi-container {
    padding: 0 40px;
  }
}

/* ──────────────────────────────────────────────────────────────
   TYPOGRAPHY SCALE
────────────────────────────────────────────────────────────────*/
.wpi-hero-headline {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.wpi-section-headline {
  font-size: clamp(1.875rem, 3vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.wpi-sub-headline {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
}

.wpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.wpi-caption {
  font-size: 0.875rem;
}

.wpi-mono {
  font-family: var(--wpi-font-mono);
  font-size: 0.875rem;
  font-weight: 500;
}

/* ──────────────────────────────────────────────────────────────
   EYEBROW / LABEL (SCOPED PER BG CONTEXT)
────────────────────────────────────────────────────────────────*/
.wpi-section--dark .wpi-eyebrow,
.wpi-section--dark-alt .wpi-eyebrow,
.wpi-hero .wpi-eyebrow,
.wpi-auth-brand .wpi-eyebrow {
  color: var(--wpi-accent-dark);
}

.wpi-section--light .wpi-eyebrow,
.wpi-section--white .wpi-eyebrow,
.wpi-subhero .wpi-eyebrow {
  color: var(--wpi-accent-light);
}

/* ──────────────────────────────────────────────────────────────
   SECTION BACKGROUNDS
────────────────────────────────────────────────────────────────*/
.wpi-section--dark {
  background: var(--wpi-bg-dark);
}

.wpi-section--dark-alt {
  background: var(--wpi-bg-dark-alt);
}

.wpi-section--light {
  background: var(--wpi-bg-light);
}

.wpi-section--white {
  background: var(--wpi-bg-white);
}

/* ──────────────────────────────────────────────────────────────
   SECTION PADDING
────────────────────────────────────────────────────────────────*/
.wpi-section {
  padding: var(--wpi-section-py-mob) 0;
}

@media (min-width: 1024px) {
  .wpi-section {
    padding: var(--wpi-section-py-desk) 0;
  }
}

/* ──────────────────────────────────────────────────────────────
   BUTTONS
────────────────────────────────────────────────────────────────*/
.wpi-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--wpi-radius-btn);
  border: 2px solid transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
  text-decoration: none;
  cursor: pointer;
  font-family: var(--wpi-font-sans);
  white-space: nowrap;
}

.wpi-btn:active {
  transform: translateY(1px);
}

/* Primary */
.wpi-btn--primary {
  background: var(--wpi-accent-decorative);
  color: #FFFFFF;
  border-color: var(--wpi-accent-decorative);
}

.wpi-btn--primary:hover {
  background: #2563EB;
  border-color: #2563EB;
  color: #FFFFFF;
}

/* Primary small */
.wpi-btn--primary-sm {
  background: var(--wpi-accent-decorative);
  color: #FFFFFF;
  border-color: var(--wpi-accent-decorative);
  padding: 8px 18px;
  font-size: 0.875rem;
}

.wpi-btn--primary-sm:hover {
  background: #2563EB;
  border-color: #2563EB;
  color: #FFFFFF;
}

/* Ghost on dark */
.wpi-btn--ghost-dark {
  background: transparent;
  color: var(--wpi-fg-dark-primary);
  border-color: var(--wpi-border-dark);
}

.wpi-btn--ghost-dark:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--wpi-accent-dark);
  color: var(--wpi-fg-dark-primary);
}

/* Outline light */
.wpi-btn--outline-light {
  background: transparent;
  color: var(--wpi-accent-light);
  border-color: var(--wpi-accent-light);
}

.wpi-btn--outline-light:hover {
  background: var(--wpi-accent-light);
  color: #FFFFFF;
}

/* Outline dark */
.wpi-btn--outline-dark {
  background: transparent;
  color: var(--wpi-fg-dark-primary);
  border-color: rgba(255,255,255,0.3);
}

.wpi-btn--outline-dark:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.6);
  color: var(--wpi-fg-dark-primary);
}

/* Ghost on light */
.wpi-btn--ghost-light {
  background: transparent;
  color: var(--wpi-fg-light-secondary);
  border-color: var(--wpi-border-light);
}

.wpi-btn--ghost-light:hover {
  background: var(--wpi-bg-light);
  border-color: var(--wpi-fg-light-secondary);
  color: var(--wpi-fg-light-primary);
}

/* Danger */
.wpi-btn--danger {
  background: var(--wpi-accent-danger);
  color: #FFFFFF;
  border-color: var(--wpi-accent-danger);
}

/* ──────────────────────────────────────────────────────────────
   CHIPS / BADGES
────────────────────────────────────────────────────────────────*/
.wpi-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--wpi-radius-chip);
  letter-spacing: 0.02em;
}

.wpi-chip--blue-dark {
  background: rgba(59,130,246,0.15);
  color: var(--wpi-accent-dark);
  border: 1px solid rgba(59,130,246,0.25);
}

.wpi-chip--blue-light {
  background: rgba(29,78,216,0.08);
  color: var(--wpi-accent-light);
  border: 1px solid rgba(29,78,216,0.2);
}

.wpi-chip--success {
  background: rgba(16,185,129,0.1);
  color: #059669;
  border: 1px solid rgba(16,185,129,0.2);
}

.wpi-chip--warning {
  background: rgba(245,158,11,0.1);
  color: #D97706;
  border: 1px solid rgba(245,158,11,0.2);
}

.wpi-chip--danger {
  background: rgba(239,68,68,0.1);
  color: #DC2626;
  border: 1px solid rgba(239,68,68,0.2);
}

/* ──────────────────────────────────────────────────────────────
   FADE-IN ANIMATION
────────────────────────────────────────────────────────────────*/
.wpi-fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.wpi-fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Failsafe: reveal after 1.2s regardless of IntersectionObserver */
@keyframes wpi-failsafe-reveal {
  to { opacity: 1; transform: translateY(0); }
}

.wpi-fade-in {
  animation: wpi-failsafe-reveal 0.5s ease 1.2s forwards;
}

.wpi-fade-in.is-visible {
  animation: none;
}

/* ──────────────────────────────────────────────────────────────
   UTILITY
────────────────────────────────────────────────────────────────*/
.wpi-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.wpi-text-center { text-align: center; }
.wpi-text-left   { text-align: left; }

/* Text colors (utility) — not for body text, only decorative/headline */
.wpi-text--accent-dark { color: var(--wpi-accent-dark); }
.wpi-text--accent-light { color: var(--wpi-accent-light); }

/* ──────────────────────────────────────────────────────────────
   GRID HELPERS
────────────────────────────────────────────────────────────────*/
.wpi-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

.wpi-grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.wpi-grid-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

@media (min-width: 768px) {
  .wpi-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .wpi-grid-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
  .wpi-grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ──────────────────────────────────────────────────────────────
   COOKIE BANNER
────────────────────────────────────────────────────────────────*/
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--wpi-bg-dark-alt);
  border-top: 1px solid var(--wpi-border-dark);
  padding: 16px 24px;
}

.cookie-banner__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.cookie-banner__text {
  flex: 1;
  min-width: 200px;
  font-size: 0.875rem;
  color: var(--wpi-fg-dark-secondary);
  line-height: 1.5;
}

.cookie-banner__text a {
  color: var(--wpi-accent-dark);
  text-decoration: underline;
}

.cookie-banner__actions {
  flex-shrink: 0;
}

.cookie-banner__btn {
  padding: 8px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--wpi-radius-btn);
  border: none;
  cursor: pointer;
  font-family: var(--wpi-font-sans);
}

.cookie-banner__btn--primary {
  background: var(--wpi-accent-decorative);
  color: #FFFFFF;
}

.cookie-banner__btn--primary:hover {
  background: #2563EB;
}
