/* ============================================================
   THE FUNNEL UP — Design Tokens
   All colors, typography, spacing, shadows, and animation
   variables live here. No component styles.
   ============================================================ */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root {
  /* ── Brand Colors (Vibrant/Neon) ── */
  --primary: #FF107A;         /* Neon Pink */
  --primary-light: #FF5E9F;
  --primary-dark: #C20055;
  --primary-rgb: 255, 16, 122;

  --cta: #7D2AE8;             /* Neon Purple */
  --cta-light: #A56DFF;
  --cta-dark: #5800C4;
  --cta-rgb: 125, 42, 232;

  --background: #FEF3C7;      /* Warm Cream */
  --background-alt: #FDF6E3;
  --background-rgb: 254, 243, 199;

  --text: #1F2937;            /* Charcoal */
  --text-light: #4B5563;
  --text-muted: #6B7280;
  --text-inverse: #FEFCE8;
  --text-rgb: 31, 41, 55;

  --accent: #FF5500;          /* Neon Orange */
  --accent-light: #FF884D;
  --accent-dark: #CC4400;
  --accent-rgb: 255, 85, 0;

  /* ── Semantic Colors ── */
  --color-success: #10B981;
  --color-error: #EF4444;
  --color-warning: #F59E0B;
  --color-info: #3B82F6;

  /* ── Surface Colors (for cards, modals, sections) ── */
  --surface-white: #FFFFFF;
  --surface-cream: var(--background);
  --surface-dark: #1A1625;
  --surface-darker: #0F0B1A;
  --surface-glass: rgba(255, 255, 255, 0.08);
  --surface-glass-border: rgba(255, 255, 255, 0.12);
  --surface-glass-light: rgba(254, 243, 199, 0.6);
  --surface-glass-light-border: rgba(236, 72, 153, 0.12);

  /* ── Typography ── */
  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  /* Type scale — modular, mobile-first values */
  --fs-xs: 0.8rem;       /* ~13px */
  --fs-sm: 0.9375rem;    /* 15px */
  --fs-base: 1.125rem;   /* 18px */
  --fs-md: 1.25rem;      /* 20px */
  --fs-lg: 1.125rem;       /* Reduced from 1.5rem (~30%) */
  --fs-xl: 1.75rem;      /* 28px */
  --fs-2xl: 2.25rem;     /* 36px */
  --fs-3xl: 3rem;        /* 48px */
  --fs-4xl: 3.5rem;      /* 56px */
  --fs-5xl: 4.5rem;      /* 72px */
  --fs-hero: clamp(2.2rem, 4.5vw + 1rem, 4.2rem); /* Reduced from 5.5rem max (~30% reduction) */

  --lh-tight: 1.1;
  --lh-snug: 1.25;
  --lh-normal: 1.6;
  --lh-relaxed: 1.8;

  --ls-tight: -0.02em;
  --ls-normal: 0;
  --ls-wide: 0.02em;
  --ls-wider: 0.06em;

  /* ── Spacing (8px grid) ── */
  --space-1: 0.25rem;    /* 4px */
  --space-2: 0.5rem;     /* 8px */
  --space-3: 0.75rem;    /* 12px */
  --space-4: 1rem;       /* 16px */
  --space-5: 1.5rem;     /* 24px */
  --space-6: 2rem;       /* 32px */
  --space-8: 3rem;       /* 48px */
  --space-10: 4rem;      /* 64px */
  --space-12: 5rem;      /* 80px */
  --space-16: 6rem;      /* 96px */
  --space-20: 8rem;      /* 128px */
  --space-section: clamp(5rem, 10vw, 9rem);

  /* ── Horizontal Scroll Tokens ── */
  --hs-height: 400vh; /* Scroll length */
  --hs-item-width: 80vw;
  --hs-gap: var(--space-8);

  /* ── Border Radius ── */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* ── Shadows / Elevation ── */
  --shadow-sm: 0 1px 3px rgba(31, 41, 55, 0.06), 0 1px 2px rgba(31, 41, 55, 0.04);
  --shadow-md: 0 4px 12px rgba(31, 41, 55, 0.08), 0 2px 4px rgba(31, 41, 55, 0.04);
  --shadow-lg: 0 12px 40px rgba(31, 41, 55, 0.12), 0 4px 12px rgba(31, 41, 55, 0.06);
  --shadow-xl: 0 24px 60px rgba(31, 41, 55, 0.16), 0 8px 20px rgba(31, 41, 55, 0.08);
  --shadow-glow-primary: 0 0 40px rgba(var(--primary-rgb), 0.4);
  --shadow-glow-cta: 0 0 40px rgba(var(--cta-rgb), 0.4);
  --shadow-glow-accent: 0 0 40px rgba(var(--accent-rgb), 0.4);
  --shadow-neon: 0 0 10px rgba(var(--primary-rgb), 0.6), 0 0 20px rgba(var(--primary-rgb), 0.4), 0 0 40px rgba(var(--cta-rgb), 0.2);

  /* ── Transitions (from plan: 150-300ms, cubic-bezier) ── */
  --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 400ms;
  --duration-reveal: 600ms;
  --transition-base: all var(--duration-base) var(--ease-out);
  --transition-fast: all var(--duration-fast) var(--ease-out);
  --transition-slow: all var(--duration-slow) var(--ease-out);

  /* ── Z-Index Scale ── */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal-backdrop: 300;
  --z-modal: 400;
  --z-toast: 500;
  --z-max: 9999;

  /* ── Glassmorphism Tokens ── */
  --glass-blur: 12px;
  --glass-saturate: 180%;
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-border: 1px solid rgba(255, 255, 255, 0.15);
  --glass-bg-light: rgba(254, 243, 199, 0.65);
  --glass-border-light: 1px solid rgba(236, 72, 153, 0.1);

  /* ── Container widths ── */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1200px;
  --container-2xl: 1400px;
}

/* ── Global Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--text);
  background-color: var(--background);
  overflow-x: hidden;
}

/* ── Typography Defaults ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--text);
}

h1 { font-size: var(--fs-hero); }
h2 { font-size: clamp(1.75rem, 3vw + 0.5rem, var(--fs-3xl)); }
h3 { font-size: clamp(1.25rem, 2vw + 0.25rem, var(--fs-xl)); }
h4 { font-size: var(--fs-lg); }

p {
  max-width: 68ch;
  line-height: var(--lh-normal);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── Selection ── */
::selection {
  background: rgba(var(--primary-rgb), 0.2);
  color: var(--text);
}

/* ── Focus (Accessibility — plan: 3px outline, high contrast) ── */
:focus-visible {
  outline: 3px solid rgba(var(--cta-rgb), 0.5);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── Scrollbar ── */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--background);
}
::-webkit-scrollbar-thumb {
  background: rgba(var(--primary-rgb), 0.3);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--primary-rgb), 0.5);
}

/* ── Accessibility: Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Keyframe Animations ── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes gradientRotate {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes beamSweep {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(200%) rotate(45deg); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.15); }
  50% { box-shadow: 0 0 40px rgba(var(--primary-rgb), 0.3); }
}

/* ── Scroll Reveal Base ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration-reveal) var(--ease-out),
              transform var(--duration-reveal) var(--ease-out);
}

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

/* Stagger children */
.reveal-stagger > .reveal:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 100ms; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 200ms; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 300ms; }
.reveal-stagger > .reveal:nth-child(5) { transition-delay: 400ms; }
.reveal-stagger > .reveal:nth-child(6) { transition-delay: 500ms; }
.reveal-stagger > .reveal:nth-child(7) { transition-delay: 600ms; }
.reveal-stagger > .reveal:nth-child(8) { transition-delay: 700ms; }
.reveal-stagger > .reveal:nth-child(9) { transition-delay: 800ms; }
.reveal-stagger > .reveal:nth-child(10) { transition-delay: 900ms; }
.reveal-stagger > .reveal:nth-child(11) { transition-delay: 1000ms; }
.reveal-stagger > .reveal:nth-child(12) { transition-delay: 1100ms; }

/* ── Reading Progress Bar ── */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--cta));
  z-index: var(--z-max);
  transition: width 80ms linear;
}
