/* ============================================
   PULSE v2 Design System — Mobile-First + AI-First
   Vibrant Purple + Pink Palette
   Outfit + Plus Jakarta Sans
   For: AdVerse (mylang.org)
   ============================================ */

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

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

:root {
  /* Type Scale — fluid clamp */
  --text-xs:   clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl:  clamp(2.5rem, 1rem + 4vw, 5rem);

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

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;

  /* Typography */
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Pulse Light Colors */
  --purple: #8b5cf6;
  --purple-hover: #7c3aed;
  --purple-light: #ede9fe;
  --purple-mid: #a78bfa;
  --pink: #ec4899;
  --pink-light: #fce7f3;
  --purple-glow: rgba(139,92,246,0.15);

  --color-bg: #faf5ff;
  --color-surface: #ffffff;
  --color-surface-2: #f5f3ff;
  --color-border: #e9d5ff;
  --color-text: #1e1b4b;
  --color-text-muted: #6b7280;
  --color-text-faint: #9ca3af;
  --color-primary: #8b5cf6;
  --color-primary-hover: #7c3aed;
  --color-accent: #ec4899;
  --color-success: #10b981;
  --color-error: #ef4444;
  --color-warning: #f59e0b;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(30,27,75,0.05);
  --shadow-md: 0 4px 6px -1px rgba(30,27,75,0.07), 0 2px 4px rgba(30,27,75,0.04);
  --shadow-lg: 0 10px 25px -5px rgba(30,27,75,0.08), 0 8px 10px rgba(30,27,75,0.04);
  --shadow-xl: 0 20px 40px -10px rgba(30,27,75,0.12);

  /* Transitions */
  --transition-fast: 180ms cubic-bezier(0.16,1,0.3,1);
  --transition-smooth: 300ms cubic-bezier(0.16,1,0.3,1);

  /* Nav */
  --nav-height: 64px;
}

/* Dark Mode */
[data-theme="dark"] {
  --color-bg: #0f0d1a;
  --color-surface: #1a1730;
  --color-surface-2: #252240;
  --color-border: #3b3660;
  --color-text: #f5f3ff;
  --color-text-muted: #a5a0c0;
  --color-text-faint: #706b8a;
  --color-primary: #a78bfa;
  --color-primary-hover: #8b5cf6;
  --color-accent: #f472b6;
  --purple-glow: rgba(139,92,246,0.2);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0f0d1a;
    --color-surface: #1a1730;
    --color-surface-2: #252240;
    --color-border: #3b3660;
    --color-text: #f5f3ff;
    --color-text-muted: #a5a0c0;
    --color-text-faint: #706b8a;
    --color-primary: #a78bfa;
    --color-primary-hover: #8b5cf6;
    --color-accent: #f472b6;
    --purple-glow: rgba(139,92,246,0.2);
  }
}

/* Base */
html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + var(--space-4));
}
body {
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
}
img, picture, video, svg { display: block; max-width: 100%; height: auto; }
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }
a { text-decoration: none; color: inherit; }
h1,h2,h3,h4,h5,h6 { text-wrap: balance; line-height: 1.15; font-family: var(--font-display); }
p, li, figcaption { text-wrap: pretty; max-width: 72ch; }

::selection { background: rgba(139,92,246,0.2); }
:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; border-radius: var(--radius-sm); }

@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;
}

/* ---- LAYOUT ---- */
.container {
  width: 100%;
  max-width: var(--content-wide);
  margin: 0 auto;
  padding-inline: var(--space-4);
}
@media (min-width: 768px) {
  .container { padding-inline: var(--space-8); }
}

/* ---- NAVIGATION ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: oklch(from var(--color-bg) l c h / 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow var(--transition-fast);
}
.nav.scrolled { box-shadow: var(--shadow-sm); }
.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--color-text);
}
.nav-links {
  display: none;
  list-style: none;
  gap: var(--space-6);
  align-items: center;
}
@media (min-width: 768px) {
  .nav-links { display: flex; }
}
.nav-links a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
  padding: var(--space-2) 0;
}
.nav-links a:hover { color: var(--color-primary); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Mobile Menu */
.nav-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--color-text);
}
@media (min-width: 768px) {
  .nav-menu-btn { display: none; }
}

.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  padding: var(--space-6) var(--space-4);
  transform: translateX(100%);
  transition: transform var(--transition-smooth);
}
.mobile-nav.open { transform: translateX(0); }
.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-8);
}
.mobile-nav a {
  display: block;
  padding: var(--space-4) 0;
  font-size: var(--text-lg);
  font-weight: 500;
  border-bottom: 1px solid var(--color-border);
}

/* Dark mode toggle */
.theme-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}
.theme-toggle:hover { background: var(--color-surface-2); }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-body);
  line-height: 1;
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
  min-height: 44px;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 1px 3px rgba(139,92,246,0.3);
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 4px 12px rgba(139,92,246,0.35);
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover {
  background: var(--color-surface-2);
  border-color: var(--color-text-muted);
}

.btn-ghost {
  background: transparent;
  color: var(--color-primary);
}
.btn-ghost:hover { background: rgba(139,92,246,0.08); }

/* ---- HERO ---- */
.hero {
  padding: clamp(var(--space-12), 10vw, var(--space-24)) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  background: var(--purple-glow);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: 600;
  margin-bottom: var(--space-6);
  border: 1px solid rgba(139,92,246,0.2);
}
.hero h1 {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
  max-width: 18ch;
  margin-inline: auto;
}
.hero p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 52ch;
  margin: 0 auto var(--space-8);
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
}

/* Gradient mesh background */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.5;
  background:
    radial-gradient(ellipse 60% 50% at 20% 40%, rgba(139,92,246,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 80% 60%, rgba(236,72,153,0.08) 0%, transparent 70%);
}

/* ---- SECTIONS ---- */
.section {
  padding: clamp(var(--space-12), 8vw, var(--space-24)) 0;
}
.section-alt { background: var(--color-surface); }
.section-header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--space-12);
}
.section-header h2 {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-3);
}
.section-header p {
  color: var(--color-text-muted);
  font-size: var(--text-base);
  margin-inline: auto;
}

/* ---- CARDS ---- */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
@media (min-width: 640px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: all var(--transition-smooth);
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: var(--purple-glow);
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}
.card h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.card p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* ---- STATS ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}
@media (min-width: 768px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
.stat-item {
  text-align: center;
  padding: var(--space-6);
}
.stat-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--space-1);
}
.stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---- TESTIMONIALS ---- */
.testimonial {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
}
.testimonial blockquote {
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text);
  margin-bottom: var(--space-4);
  font-style: italic;
}
.testimonial-author {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.testimonial-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-primary);
}
.testimonial-name { font-weight: 600; font-size: var(--text-sm); }
.testimonial-role { font-size: var(--text-xs); color: var(--color-text-muted); }

/* ---- CTA SECTION ---- */
.cta-section {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
  color: #fff;
  padding: clamp(var(--space-12), 8vw, var(--space-24)) 0;
  text-align: center;
  border-radius: var(--radius-2xl);
  margin: var(--space-4);
}
.cta-section h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
}
.cta-section p {
  color: rgba(255,255,255,0.7);
  margin: 0 auto var(--space-6);
  max-width: 48ch;
}

/* ---- FOOTER ---- */
.footer {
  border-top: 1px solid var(--color-border);
  padding: var(--space-12) 0 var(--space-6);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-10);
}
@media (min-width: 640px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: 2fr repeat(3, 1fr); }
}
.footer-brand p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  max-width: 32ch;
  margin-top: var(--space-3);
}
.footer-col h4 {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}
.footer-col a {
  display: block;
  padding: var(--space-1) 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}
.footer-col a:hover { color: var(--color-primary); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border);
  font-size: var(--text-xs);
  color: var(--color-text-faint);
}
.footer-bottom a { color: var(--color-text-muted); }
.footer-bottom a:hover { color: var(--color-primary); }

/* ---- SCROLL REVEAL ---- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16,1,0.3,1), transform 0.6s cubic-bezier(0.16,1,0.3,1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- AI FEATURES SECTION ---- */
.ai-features {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
@media (min-width: 768px) {
  .ai-features { grid-template-columns: repeat(2, 1fr); }
}
.ai-feature-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  display: flex;
  gap: var(--space-4);
  transition: all var(--transition-smooth);
}
.ai-feature-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(139,92,246,0.3);
}
.ai-feature-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--purple-glow);
  color: var(--color-primary);
  flex-shrink: 0;
}
.ai-feature-card h3 { font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--space-1); }
.ai-feature-card p { font-size: var(--text-xs); color: var(--color-text-muted); line-height: 1.5; }

/* ---- PRICING ---- */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}
@media (min-width: 768px) {
  .pricing-grid { grid-template-columns: repeat(3, 1fr); }
}
.pricing-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  display: flex;
  flex-direction: column;
}
.pricing-card.featured {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary), var(--shadow-lg);
  position: relative;
}
.pricing-card.featured::before {
  content: 'Most Popular';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: #fff;
  padding: 4px 16px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}
.pricing-tier { font-size: var(--text-sm); font-weight: 600; color: var(--color-text-muted); margin-bottom: var(--space-2); }
.pricing-price { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700; margin-bottom: var(--space-4); }
.pricing-price span { font-size: var(--text-sm); font-weight: 400; color: var(--color-text-muted); }
.pricing-features { list-style: none; flex: 1; margin-bottom: var(--space-6); }
.pricing-features li {
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.pricing-features li::before {
  content: '✓';
  color: var(--color-success);
  font-weight: 700;
}

/* ---- UTILITIES ---- */
.text-center { text-align: center; }
.text-primary { color: var(--color-primary); }
.text-muted { color: var(--color-text-muted); }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }
