/* Master AI Kit — Design System v4 */

/* ==================== FRONT-END REFINEMENT PASS ==================== */
/* Polished proportion, tighter rhythm, better hierarchy, z-index fixes */

/* Card content z-index — ensures glow doesn't occlude interactive content */
.card--category > *:not(style),
.card--guide > *:not(style),
.card--product > *:not(style) {
  position: relative;
  z-index: 2;
}

/* ==================== DESIGN TOKENS ==================== */
:root {
  /* --- Color: Primary (Blue) --- */
  --color-primary-50:  #ebf8ff;
  --color-primary-100: #bee3f8;
  --color-primary-200: #90cdf4;
  --color-primary-300: #63b3ed;
  --color-primary-400: #4299e1;
  --color-primary-500: #3182ce;
  --color-primary-600: #2b6cb0;
  --color-primary-700: #2c5282;
  --color-primary-800: #1e3a5f;
  --color-primary-900: #1a365d;
  --color-primary-950: #0f172a;

  /* --- Color: Accent (Decorative) --- */
  --color-accent-cyan:   #06b6d4;
  --color-accent-purple: #8b5cf6;
  --color-accent-blue:   #3b82f6;

  /* --- Color: Surface --- */
  --color-surface-base:     #0a0a0a;
  --color-surface-elevated: #1a1a1a;
  --color-surface-sunken:   #111111;

  /* --- Color: Border --- */
  --color-border-default: #2d3748;
  --color-border-subtle:  #1e2536;
  --color-border-strong:  #4a5568;

  /* --- Color: Text (all WCAG AA compliant on --color-surface-base) --- */
  --color-text-primary:   #f7fafc;   /* ~18.7:1 on #0a0a0a */
  --color-text-secondary: #a0aec0;   /* ~8.5:1 on #0a0a0a  */
  --color-text-muted:     #718096;   /* ~5.2:1 on #0a0a0a  */
  --color-text-faint:     #718096;   /* Same as muted — floor for 4.5:1; use opacity for visual distinction */

  /* --- Color: Feedback --- */
  --color-feedback-success: #48bb78;
  --color-feedback-warning: #ecc94b;
  --color-feedback-error:   #fc8181;
  --color-feedback-info:    #63b3ed;

  /* --- Accent Opacity Tints --- */
  --accent-subtle: rgba(49, 130, 206, 0.08);
  --accent-muted:  rgba(49, 130, 206, 0.12);
  --accent-glow:   rgba(49, 130, 206, 0.15);
  --accent-medium: rgba(49, 130, 206, 0.20);
  --accent-strong: rgba(49, 130, 206, 0.35);

  /* --- Spacing (4px baseline grid) --- */
  --space-1:  0.25rem;   /*  4px */
  --space-2:  0.5rem;    /*  8px */
  --space-3:  0.75rem;   /* 12px */
  --space-4:  1rem;      /* 16px */
  --space-5:  1.25rem;   /* 20px */
  --space-6:  1.5rem;    /* 24px */
  --space-8:  2rem;      /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */
  --space-16: 4rem;      /* 64px */

  /* --- Typography: Font Families --- */
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-ui:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* --- Typography: Font Sizes (modular ratio ~1.25) --- */
  --font-size-xs:  0.75rem;    /* 12px */
  --font-size-sm:  0.875rem;   /* 14px */
  --font-size-base: 1rem;      /* 16px */
  --font-size-lg:  1.125rem;   /* 18px */
  --font-size-xl:  1.25rem;    /* 20px */
  --font-size-2xl: 1.5rem;     /* 24px */
  --font-size-3xl: 1.875rem;   /* 30px */
  --font-size-4xl: 2.25rem;    /* 36px */
  --font-size-5xl: 3rem;       /* 48px */

  /* --- Typography: Font Weights --- */
  --font-weight-regular:  400;
  --font-weight-medium:   500;
  --font-weight-semibold: 600;
  --font-weight-bold:     700;
  --font-weight-black:    900;

  /* --- Typography: Line Heights --- */
  --line-height-tight:   1.2;
  --line-height-snug:    1.375;
  --line-height-normal:  1.5;
  --line-height-relaxed: 1.75;

  /* --- Typography: Letter Spacing --- */
  --tracking-tight:  -0.025em;
  --tracking-normal: 0;
  --tracking-wide:   0.025em;
  --tracking-wider:  0.05em;

  /* --- Radii --- */
  --radius-sm:   0.25rem;    /*  4px */
  --radius-md:   0.5rem;     /*  8px */
  --radius-lg:   0.75rem;    /* 12px */
  --radius-xl:   1rem;       /* 16px */
  --radius-2xl:  1rem;       /* 16px */
  --radius-full: 9999px;

  /* --- Shadows --- */
  --shadow-sm:   0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md:   0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-lg:   0 8px 30px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(49, 130, 206, 0.15);

  /* --- Motion --- */
  --duration-fast:   150ms;
  --duration-medium: 300ms;
  --duration-slow:   500ms;
  --duration-glacial: 800ms;
  --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-in:      cubic-bezier(0.4, 0, 1, 1);
  --ease-out:     cubic-bezier(0, 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);

  /* --- Semantic Aliases (backward compatibility) --- */
  --bg-primary:    var(--color-surface-base);
  --bg-secondary:  var(--color-surface-sunken);
  --bg-card:       var(--color-surface-elevated);
  --bg-card-hover: #222222;
  --accent:        var(--color-primary-500);
  --accent-light:  var(--color-primary-300);
  --accent-dark:   var(--color-primary-700);
  --text-primary:   var(--color-text-primary);
  --text-secondary: var(--color-text-secondary);
  --text-muted:     var(--color-text-muted);
  --border:        var(--color-border-default);
  --border-light:  var(--color-border-subtle);
  --success:       var(--color-feedback-success);
}

/* ==================== LIGHT THEME ==================== */
/* Activate by adding data-theme="light" to <html> */
[data-theme='light'] {
  --color-surface-base:     #ffffff;
  --color-surface-elevated: #f7fafc;
  --color-surface-sunken:   #edf2f7;

  --color-border-default: #e2e8f0;
  --color-border-subtle:  #edf2f7;
  --color-border-strong:  #a0aec0;

  --color-text-primary:   #0f172a;
  --color-text-secondary: #2d3748;
  --color-text-muted:     #4a5568;
  --color-text-faint:     #4a5568;

  --accent-subtle: rgba(49, 130, 206, 0.04);
  --accent-muted:  rgba(49, 130, 206, 0.06);
  --accent-glow:   rgba(49, 130, 206, 0.08);
  --accent-medium: rgba(49, 130, 206, 0.12);
  --accent-strong: rgba(49, 130, 206, 0.20);

  --bg-primary:    var(--color-surface-base);
  --bg-secondary:  var(--color-surface-sunken);
  --bg-card:       var(--color-surface-elevated);
  --bg-card-hover: #edf2f7;

  --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 8px 30px rgba(0, 0, 0, 0.10);
  --shadow-glow: 0 0 20px rgba(49, 130, 206, 0.08);

  --text-primary:   var(--color-text-primary);
  --text-secondary: var(--color-text-secondary);
  --text-muted:     var(--color-text-muted);
  --border:        var(--color-border-default);
  --border-light:  var(--color-border-subtle);
}

/* ==================== RESET & BASE ==================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-ui);
  font-size: var(--font-size-base);
  background: var(--bg-primary);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==================== TYPOGRAPHY TIERS ==================== */

/* Display tier — hero h1, section h2 (Inter 800-900, tight tracking) */
.t-display,
.type-display {
  font-family: var(--font-display);
  font-weight: var(--font-weight-black);
  letter-spacing: var(--tracking-tight);
  line-height: var(--line-height-tight);
}

/* UI tier — body, labels, nav, buttons (Inter 400-600) */
.t-ui,
.type-ui {
  font-family: var(--font-ui);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
}

/* Mono tier — prices, code, data (JetBrains Mono 400-500) */
.t-mono,
.type-mono {
  font-family: var(--font-mono);
  font-weight: var(--font-weight-regular);
}

/* Font-size utilities (prefixed to avoid Tailwind collision) */
.t-xs   { font-size: var(--font-size-xs); }
.t-sm   { font-size: var(--font-size-sm); }
.t-base { font-size: var(--font-size-base); }
.t-lg   { font-size: var(--font-size-lg); }
.t-xl   { font-size: var(--font-size-xl); }
.t-2xl  { font-size: var(--font-size-2xl); }
.t-3xl  { font-size: var(--font-size-3xl); }
.t-4xl  { font-size: var(--font-size-4xl); }
.t-5xl  { font-size: var(--font-size-5xl); }

/* ==================== SCROLLBAR & SELECTION ==================== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-sm); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

::selection { background: var(--accent); color: white; }
code, pre, .font-mono { font-family: var(--font-mono); }

/* ==================== NAVIGATION ==================== */
.nav-glass {
  background: rgba(10, 10, 10, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, var(--accent-light), var(--accent), transparent) 1;
  transition: background var(--duration-medium) var(--ease-default),
              backdrop-filter var(--duration-medium) var(--ease-default),
              border-image var(--duration-medium) var(--ease-default),
              box-shadow var(--duration-medium) var(--ease-default);
}
.nav-glass.scrolled {
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  box-shadow: 0 4px 30px rgba(49, 130, 206, 0.08),
              var(--shadow-lg);
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, var(--accent-light), var(--accent), transparent) 1;
}
.nav-glass.scrolled::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-light), var(--accent), transparent);
  opacity: 0.6;
  pointer-events: none;
}

/* --- Logo --- */
.nav-logo {
  text-decoration: none;
  transition: transform 200ms var(--ease-default), filter 200ms var(--ease-default);
}
.nav-logo:hover {
  transform: scale(1.02);
  filter: drop-shadow(0 0 12px rgba(99, 179, 237, 0.3));
}
.nav-logo-mark {
  flex-shrink: 0;
}

/* --- Nav Links (pill hover) --- */
.nav-link {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--text-muted);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  transition: color 200ms var(--ease-default),
              background-color 200ms var(--ease-default);
  position: relative;
}
.nav-link:hover {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.06);
}

/* Active page indicator */
.nav-link.active {
  color: var(--color-text-primary);
}
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-light);
}

/* --- CTA button (pulse glow) --- */
.nav-cta {
  position: relative;
}
.nav-cta::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--radius-md) + 2px);
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  opacity: 0;
  z-index: -1;
  animation: navCtaPulse 2.5s ease-in-out infinite;
  transition: opacity var(--duration-medium) var(--ease-default);
}
.nav-cta:hover::after {
  opacity: 0;
}
@keyframes navCtaPulse {
  0%, 100% { opacity: 0; transform: scale(1); }
  50% { opacity: 0.2; transform: scale(1.04); }
}

/* --- Hamburger toggle --- */
.nav-hamburger {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  transition: color var(--duration-fast) var(--ease-default),
              background-color var(--duration-fast) var(--ease-default);
}
.nav-hamburger:hover {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.06);
}
.nav-hamburger .close-icon { display: none; }
.nav-hamburger[aria-expanded="true"] .hamburger-icon { display: none; }
.nav-hamburger[aria-expanded="true"] .close-icon { display: block; }

/* ==================== MOBILE OVERLAY ==================== */
.mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  visibility: hidden;
}
.mobile-overlay.active {
  pointer-events: auto;
  visibility: visible;
}

.mobile-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 300ms var(--ease-default);
}
.mobile-overlay.active .mobile-overlay-backdrop {
  opacity: 1;
}

.mobile-overlay-content {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.96);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--space-16) var(--space-6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms var(--ease-default),
              visibility 300ms var(--ease-default);
}
.mobile-overlay.active .mobile-overlay-content {
  opacity: 1;
  visibility: visible;
}

.mobile-overlay-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  height: 64px;
}

.mobile-overlay-nav {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  text-decoration: none;
  transform: translateY(20px);
  opacity: 0;
  transition: transform 300ms var(--ease-spring),
              opacity 300ms var(--ease-default),
              color var(--duration-fast) var(--ease-default),
              background-color var(--duration-fast) var(--ease-default);
}
.mobile-overlay.active .mobile-nav-link {
  transform: translateY(0);
  opacity: 1;
}
.mobile-overlay.active .mobile-nav-link:nth-child(1) { transition-delay: 80ms; }
.mobile-overlay.active .mobile-nav-link:nth-child(2) { transition-delay: 140ms; }
.mobile-overlay.active .mobile-nav-link:nth-child(3) { transition-delay: 200ms; }

.mobile-nav-link:hover,
.mobile-nav-link:focus-visible {
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.06);
}
.mobile-nav-link.active {
  color: var(--accent-light);
  background: var(--accent-subtle);
}

.mobile-overlay-footer {
  width: 100%;
  max-width: 320px;
  margin-top: var(--space-8);
}

/* ==================== HERO ==================== */
.hero-gradient {
  background: linear-gradient(160deg,
    var(--color-primary-950) 0%,
    var(--color-primary-900) 40%,
    var(--color-primary-800) 70%,
    var(--color-primary-800) 100%
  );
  position: relative;
  overflow: hidden;
}
.hero-gradient::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 80%;
  height: 200%;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}
.hero-gradient::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.25;
}

/* ==================== CARDS ==================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--duration-medium) var(--ease-default);
  text-decoration: none;
  display: block;
}
.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-medium);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--accent-subtle);
}

/* ==================== BUTTONS ==================== */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-semibold);
  transition: all var(--duration-medium) var(--ease-default);
  display: inline-block;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 10px var(--accent-medium);
  text-align: center;
  font-size: var(--font-size-base);
  line-height: var(--line-height-snug);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-medium);
}
.btn-outline {
  border: 1.5px solid var(--border-light);
  color: var(--text-primary);
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-semibold);
  transition: all var(--duration-medium) var(--ease-default);
  display: inline-block;
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  text-align: center;
  font-size: var(--font-size-base);
  line-height: var(--line-height-snug);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  background: var(--accent-glow);
  transform: translateY(-1px);
}

/* ==================== TYPOGRAPHY COMPONENTS ==================== */
.gradient-text {
  background: linear-gradient(135deg, var(--accent-light), #90cdf4, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-divider {
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: var(--radius-sm);
}

/* ==================== STEP NUMBERS ==================== */
.step-number {
  width: 52px;
  height: 52px;
  background: var(--accent-muted);
  border: 1px solid var(--accent-medium);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-xl);
  color: var(--accent-light);
  line-height: 1;
}

/* ==================== FEATURE ICONS ==================== */
.feature-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-muted);
  border: 1px solid var(--accent-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-light);
}
.feature-icon svg {
  width: 22px;
  height: 22px;
}

/* ==================== GUIDE HEADERS ==================== */
.guide-header {
  transition: transform var(--duration-slow) var(--ease-default);
}
.card:hover .guide-header {
  transform: scale(1.02);
}

/* Guide header gradient variants (replaces inline styles) */
.guide-header--cyan {
  background: linear-gradient(135deg,
    var(--color-primary-950) 0%,
    var(--color-primary-800) 50%,
    var(--color-accent-cyan) 100%
  );
}
.guide-header--blue {
  background: linear-gradient(135deg,
    var(--color-primary-950) 0%,
    var(--color-primary-800) 50%,
    var(--color-accent-blue) 100%
  );
}
.guide-header--purple {
  background: linear-gradient(135deg,
    var(--color-primary-950) 0%,
    var(--color-primary-900) 50%,
    var(--color-accent-purple) 100%
  );
}

/* Guide header overlay (replaces inline radial-gradient styles) */
.guide-header-overlay {
  position: absolute;
  inset: 0;
  opacity: 0.2;
  pointer-events: none;
}
.guide-header-overlay--cyan {
  background-image:
    radial-gradient(circle at 30% 50%, rgba(6, 182, 212, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 70% 30%, rgba(49, 130, 246, 0.2) 0%, transparent 50%);
}
.guide-header-overlay--blue {
  background-image:
    radial-gradient(circle at 30% 50%, rgba(59, 130, 246, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 70% 30%, rgba(99, 179, 237, 0.2) 0%, transparent 50%);
}
.guide-header-overlay--purple {
  background-image:
    radial-gradient(circle at 30% 50%, rgba(139, 92, 246, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 70% 30%, rgba(59, 130, 246, 0.2) 0%, transparent 50%);
}

/* ==================== PRODUCT HERO GRADIENT ==================== */
.product-hero--cyan {
  background: linear-gradient(135deg,
    var(--color-primary-950) 0%,
    #0d2137 50%,
    var(--color-accent-cyan) 150%
  );
}

/* ==================== PROSE (Guide Content) ==================== */
.prose-custom h1 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-black);
  margin-bottom: var(--space-4);
  color: var(--text-primary);
  line-height: var(--line-height-tight);
  letter-spacing: var(--tracking-tight);
}
.prose-custom h2 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  margin-top: var(--space-10);
  margin-bottom: var(--space-3);
  color: var(--text-primary);
  line-height: var(--line-height-snug);
  border-bottom: 1px solid var(--border);
  padding-bottom: var(--space-2);
}
.prose-custom h3 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  margin-top: var(--space-8);
  margin-bottom: var(--space-2);
  color: var(--accent-light);
}
.prose-custom h4 {
  font-size: 1.1rem;
  font-weight: var(--font-weight-semibold);
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}
.prose-custom p {
  margin-bottom: var(--space-5);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
}
.prose-custom ul, .prose-custom ol {
  margin-bottom: var(--space-5);
  padding-left: var(--space-6);
  color: var(--text-secondary);
}
.prose-custom li {
  margin-bottom: var(--space-2);
  line-height: var(--line-height-relaxed);
}
.prose-custom li::marker { color: var(--accent); }
.prose-custom code {
  background: var(--accent-muted);
  padding: 0.15rem var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  color: var(--accent-light);
}
.prose-custom pre {
  background: var(--bg-card) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  overflow-x: auto;
  margin-bottom: var(--space-5);
}
.prose-custom pre code {
  background: none;
  padding: 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.prose-custom blockquote {
  border-left: 4px solid var(--accent);
  padding: var(--space-3) var(--space-4);
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: var(--space-5);
  background: var(--accent-glow);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.prose-custom a {
  color: var(--accent-light);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(99, 179, 237, 0.3);
  transition: text-decoration-color var(--duration-fast);
}
.prose-custom a:hover { text-decoration-color: var(--accent-light); }
.prose-custom strong { color: var(--text-primary); font-weight: var(--font-weight-semibold); }
.prose-custom table { width: 100%; border-collapse: collapse; margin-bottom: var(--space-5); font-size: var(--font-size-sm); }
.prose-custom thead { border-bottom: 2px solid var(--border); }
.prose-custom th {
  background: var(--bg-secondary);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  font-size: 0.85rem;
}
.prose-custom td { padding: 0.6rem var(--space-4); border-bottom: 1px solid var(--border); }
.prose-custom tr:hover td { background: var(--accent-subtle); }
.prose-custom img {
  border-radius: var(--radius-md);
  margin: var(--space-8) 0;
  max-width: 100%;
  box-shadow: var(--shadow-lg);
}
.prose-custom hr { border: none; border-top: 1px solid var(--border); margin: var(--space-8) 0; }

/* ==================== UTILITIES ==================== */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==================== ANIMATIONS ==================== */

/* --- Keyframes (compositor-only: transform + opacity) --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideFromLeft {
  from { opacity: 0; transform: translateX(-32px) scale(0.98); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes slideFromRight {
  from { opacity: 0; transform: translateX(32px) scale(0.98); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes blurIn {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
@keyframes underlineSlide {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes pulseGlow {
  0%, 100% { opacity: 0; }
  50%      { opacity: 1; }
}
@keyframes gradientFlow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-in { animation: fadeInUp 0.6s var(--ease-default) forwards; }

/* --- Scroll Reveal: Base --- */
.reveal {
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: opacity var(--duration-slow) var(--ease-default),
              transform var(--duration-slow) var(--ease-spring);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* --- Scroll Reveal: Variants via data-reveal-type --- */
.reveal[data-reveal-type="slide-left"] {
  transform: translateX(-32px) scale(0.98);
}
.reveal[data-reveal-type="slide-left"].visible {
  transform: translateX(0) scale(1);
}

.reveal[data-reveal-type="slide-right"] {
  transform: translateX(32px) scale(0.98);
}
.reveal[data-reveal-type="slide-right"].visible {
  transform: translateX(0) scale(1);
}

.reveal[data-reveal-type="scale"] {
  transform: scale(0.94);
}
.reveal[data-reveal-type="scale"].visible {
  transform: scale(1);
}

.reveal[data-reveal-type="fade"] {
  transform: scale(0.98);
}
.reveal[data-reveal-type="fade"].visible {
  transform: scale(1);
}

.reveal[data-reveal-type="blur"] {
  opacity: 0;
  transform: translateY(8px) scale(0.97);
}
.reveal[data-reveal-type="blur"].visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* --- Staggered grid children (spring-eased) --- */
.reveal-child {
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transition: opacity var(--duration-medium) var(--ease-default),
              transform var(--duration-medium) var(--ease-spring);
  transition-delay: var(--reveal-delay, 0s);
}
.reveal-child.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* --- Page load stagger --- */
.page-enter > section:nth-child(1) { --page-stagger: 0ms; }
.page-enter > section:nth-child(2) { --page-stagger: 80ms; }
.page-enter > section:nth-child(3) { --page-stagger: 160ms; }
.page-enter > section:nth-child(4) { --page-stagger: 240ms; }
.page-enter > section:nth-child(5) { --page-stagger: 320ms; }
.page-enter > section:nth-child(6) { --page-stagger: 400ms; }
.page-enter > section {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeInUp var(--duration-slow) var(--ease-default) var(--page-stagger, 0ms) forwards;
}

/* --- Page exit --- */
.page-exit {
  opacity: 0.9;
  transition: opacity 100ms var(--ease-default);
}

/* ==================== CARD MICRO-INTERACTIONS ==================== */
.card {
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(
    300px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    var(--accent-glow),
    transparent
  );
  transition: opacity var(--duration-medium) var(--ease-default);
  pointer-events: none;
  z-index: 1;
}
.card:hover::before {
  opacity: 1;
}

/* ==================== BUTTON PRESS STATE ==================== */
.btn-primary:active {
  transform: scale(0.97);
  transition-duration: 80ms;
}
.btn-outline:active {
  transform: scale(0.97);
  transition-duration: 80ms;
}

/* ==================== FOOTER UNDERLINE ANIMATION ==================== */
footer a {
  position: relative;
  text-decoration: none;
  color: var(--text-muted);
  transition: color var(--duration-fast) var(--ease-default);
}
footer a::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--accent-light);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-medium) var(--ease-default);
}
footer a:hover::after {
  transform: scaleX(1);
}

/* ==================== SKELETON / SHIMMER STATES ==================== */
.skeleton {
  background: var(--bg-card);
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.04) 50%,
    transparent 100%
  );
  animation: shimmer 1.5s var(--ease-in-out) infinite;
}

/* Button spinner */
.btn-spinner {
  position: relative;
  pointer-events: none;
  color: transparent !important;
}
.btn-spinner::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 600ms linear infinite;
  top: 50%;
  left: 50%;
  margin-top: -9px;
  margin-left: -9px;
}

/* Image placeholder shimmer — ::after defined in IMAGE PLACEHOLDERS section */

/* ==================== AMBIENT MOTION ==================== */

/* Hero gradient mesh: slow 20s cycle */
.hero-gradient {
  background-size: 200% 200%;
  animation: gradientShift 20s ease-in-out infinite;
}
.hero-gradient::before {
  animation: pulseGlow 8s ease-in-out infinite;
}

/* Section divider: slow color shift */
.section-divider--animated {
  background: linear-gradient(
    90deg,
    var(--accent),
    var(--color-accent-cyan),
    var(--accent-light),
    var(--accent)
  );
  background-size: 300% 100%;
  animation: gradientShift 8s ease-in-out infinite;
}

/* Logo gradient text: very slow color flow */
.gradient-text--flow {
  background: linear-gradient(
    90deg,
    var(--accent-light),
    #90cdf4,
    var(--color-accent-cyan),
    var(--accent),
    var(--accent-light)
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientFlow 30s linear infinite;
}

/* ==================== IMAGE PLACEHOLDERS ==================== */
.img-placeholder {
  background: linear-gradient(135deg,
    var(--bg-card) 0%,
    #1a1f2e 50%,
    var(--bg-secondary) 100%
  );
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  position: relative;
  overflow: hidden;
}
.img-placeholder::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.03) 50%,
    transparent 100%
  );
  animation: shimmer 2s var(--ease-in-out) infinite;
}

/* ==================== ACCESSIBILITY ==================== */

/* Skip navigation link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: var(--color-primary-500);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 0 0 0.5rem 0.5rem;
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 0;
  outline: 3px solid var(--color-primary-300);
  outline-offset: 2px;
}

/* Focus-visible ring */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Screen-reader only utility */
.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;
}

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

/* ==================== RESPONSIVE ==================== */
@media (max-width: 640px) {
  .hero-gradient { padding-top: 7rem; padding-bottom: 3rem; }
  .hero-gradient h1 { font-size: var(--font-size-4xl) !important; }
  .guide-header { height: 7rem !important; }
  .step-number { width: 44px; height: 44px; font-size: 1rem; }
  .steps-container::before { display: none; }
  .card--product .product-ribbon { display: none; }
  .card--feature { padding: var(--space-5); }
  .card--category { padding: var(--space-4) !important; }
}

/* Tablet: category grid goes 3-col */
@media (min-width: 641px) and (max-width: 1023px) {
  .grid.lg\:grid-cols-5 {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* Newsletter input focus glow */
form input[type="email"]:focus {
  box-shadow: 0 0 0 3px var(--accent-muted);
}

/* Footer links (color transitions — underline animation is in FOOTER section above) */
footer a:hover { color: var(--text-secondary); }

/* Product card image zoom on hover */
.card.overflow-hidden img.w-full.h-full {
  object-fit: cover;
  transition: transform 400ms var(--ease-default);
}
.card.overflow-hidden:hover img.w-full.h-full {
  transform: scale(1.05);
}

/* ==================== CATEGORY CARD ENHANCEMENTS ==================== */
.card--category {
  position: relative;
  overflow: hidden;
}
.card--category::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(135deg, var(--accent), var(--color-accent-cyan), var(--color-accent-purple));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--duration-medium) var(--ease-default);
  pointer-events: none;
}
.card--category:hover::before {
  opacity: 1;
}
.card--category .category-arrow {
  display: inline-block;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity var(--duration-medium) var(--ease-default),
              transform var(--duration-medium) var(--ease-default);
  margin-left: 4px;
}
.card--category:hover .category-arrow {
  opacity: 1;
  transform: translateX(0);
}
.card--category .price-pill {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: var(--accent-subtle);
  color: var(--accent-light);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-top: var(--space-2);
}
/* Category glow variants */
.card--category::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity var(--duration-medium) var(--ease-default);
  pointer-events: none;
}
.card--category:hover::after {
  opacity: 1;
}
.card--category[data-glow="blue"]::after {
  box-shadow: inset 0 0 30px rgba(49, 130, 206, 0.06), 0 0 20px rgba(49, 130, 206, 0.08);
}
.card--category[data-glow="cyan"]::after {
  box-shadow: inset 0 0 30px rgba(6, 182, 212, 0.06), 0 0 20px rgba(6, 182, 212, 0.08);
}
.card--category[data-glow="purple"]::after {
  box-shadow: inset 0 0 30px rgba(139, 92, 246, 0.06), 0 0 20px rgba(139, 92, 246, 0.08);
}
.card--category[data-glow="green"]::after {
  box-shadow: inset 0 0 30px rgba(72, 187, 120, 0.06), 0 0 20px rgba(72, 187, 120, 0.08);
}
.card--category[data-glow="amber"]::after {
  box-shadow: inset 0 0 30px rgba(236, 201, 75, 0.06), 0 0 20px rgba(236, 201, 75, 0.08);
}

/* ==================== FEATURE CARD ENHANCEMENTS ==================== */
.card--feature {
  position: relative;
  padding: var(--space-6);
  overflow: hidden;
}
.card--feature::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--color-accent-cyan));
  opacity: 0;
  transition: opacity var(--duration-medium) var(--ease-default);
}
.card--feature:hover::before {
  opacity: 1;
}
.card--feature .feature-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent-medium), rgba(6, 182, 212, 0.15));
  border: 1px solid rgba(49, 130, 206, 0.15);
  transition: transform var(--duration-medium) var(--ease-default);
}
.card--feature:hover .feature-icon {
  animation: iconPulse var(--duration-slow) var(--ease-default);
}
@keyframes iconPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* ==================== GUIDE CARD ENHANCEMENTS ==================== */
.card--guide .guide-emoji {
  display: inline-block;
  animation: floatEmoji 3s ease-in-out infinite;
}
@keyframes floatEmoji {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.card--guide .reading-pill {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  background: rgba(49, 130, 206, 0.08);
  color: var(--color-text-muted);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border-light);
}
.card--guide .read-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.card--guide .read-link .read-arrow {
  display: inline-block;
  transition: transform var(--duration-medium) var(--ease-default);
}
.card--guide:hover .read-link .read-arrow {
  transform: translateX(4px);
}
/* Guide glow border variants */
.card--guide {
  position: relative;
  overflow: hidden;
}
.card--guide::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--duration-medium) var(--ease-default);
  pointer-events: none;
}
.card--guide:hover::before {
  opacity: 1;
}
.card--guide[data-glow="cyan"]::before {
  background: linear-gradient(135deg, var(--color-accent-cyan), transparent);
}
.card--guide[data-glow="blue"]::before {
  background: linear-gradient(135deg, var(--color-accent-blue), transparent);
}
.card--guide[data-glow="purple"]::before {
  background: linear-gradient(135deg, var(--color-accent-purple), transparent);
}

/* ==================== PRODUCT CARD ENHANCEMENTS ==================== */
.card--product {
  position: relative;
  overflow: hidden;
}
/* Product ribbon — positioned inside image wrap for horizontal layout */
.card--product .product-ribbon {
  position: absolute;
  top: 12px;
  left: -28px;
  background: linear-gradient(135deg, var(--color-accent-cyan), var(--accent));
  color: white;
  font-size: 0.6rem;
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  padding: 3px 32px;
  transform: rotate(-45deg);
  z-index: 10;
  box-shadow: var(--shadow-md);
}
.card--product .product-image-wrap {
  position: relative;
  overflow: hidden;
}
.card--product .product-image-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.04) 50%,
    transparent 100%
  );
  transition: none;
  pointer-events: none;
}
.card--product:hover .product-image-wrap::after {
  animation: shimmerSlide var(--duration-slow) var(--ease-default);
}
@keyframes shimmerSlide {
  from { left: -100%; }
  to   { left: 150%; }
}
.card--product .discount-badge {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  background: rgba(72, 187, 120, 0.15);
  color: var(--color-feedback-success);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-weight: var(--font-weight-medium);
}
.card--product .price-current {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
}
.card--product .price-original {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  text-decoration: line-through;
}
.card--product .star-rating {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: var(--space-2);
}
.card--product .star-rating svg {
  width: 14px;
  height: 14px;
  fill: #ecc94b;
  color: #ecc94b;
}
.card--product .star-rating .rating-text {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-left: 6px;
}

/* ==================== STEP NUMBER ENHANCEMENTS ==================== */
.step-number {
  width: 52px;
  height: 52px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-xl);
  color: var(--accent-light);
  line-height: 1;
  position: relative;
  background-image: linear-gradient(var(--bg-card), var(--bg-card)),
                    linear-gradient(135deg, var(--accent), var(--color-accent-cyan));
  background-origin: border-box;
  background-clip: padding-box, border-box;
}
/* Connecting line between steps */
.steps-container {
  position: relative;
}
.steps-container::before {
  content: '';
  position: absolute;
  top: 26px;
  left: calc(16.67% + 26px);
  right: calc(16.67% + 26px);
  height: 0;
  border-top: 2px dashed var(--border-light);
  z-index: 0;
}
.steps-container > div {
  position: relative;
  z-index: 1;
}

/* ==================== NEWSLETTER ENHANCEMENTS ==================== */
.newsletter-section {
  position: relative;
}
.newsletter-section::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1.5px;
  background: linear-gradient(135deg, var(--accent), var(--color-accent-cyan), var(--color-accent-purple));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.newsletter-field {
  position: relative;
}
.newsletter-field input {
  width: 100%;
  padding: 14px 20px 8px;
  font-size: var(--font-size-base);
}
.newsletter-field label {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  pointer-events: none;
  transition: all var(--duration-fast) var(--ease-default);
}
.newsletter-field input:focus + label,
.newsletter-field input:not(:placeholder-shown) + label {
  top: 8px;
  transform: translateY(0);
  font-size: 0.625rem;
  color: var(--accent-light);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
}
/* Success state */
.newsletter-success {
  display: none;
  text-align: center;
}
.newsletter-success.active {
  display: block;
  animation: fadeInUp var(--duration-slow) var(--ease-default);
}
.newsletter-success .checkmark-circle {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-feedback-success), rgba(72, 187, 120, 0.7));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
  animation: checkPop var(--duration-medium) var(--ease-default);
}
.newsletter-success .checkmark-circle svg {
  width: 28px;
  height: 28px;
  stroke: white;
  stroke-width: 3;
  fill: none;
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: drawCheck 0.4s var(--duration-medium) var(--ease-default) forwards;
}
@keyframes checkPop {
  0%   { transform: scale(0); opacity: 0; }
  50%  { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}
/* Confetti particles */
.confetti {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  opacity: 0;
  pointer-events: none;
}
.newsletter-success.active .confetti {
  animation: confettiBurst 0.8s var(--ease-out) forwards;
}
.confetti:nth-child(1)  { background: var(--color-accent-cyan);   animation-delay: 0.1s; --cx: -30px; --cy: -50px; }
.confetti:nth-child(2)  { background: var(--color-accent-purple); animation-delay: 0.15s; --cx: 20px; --cy: -60px; }
.confetti:nth-child(3)  { background: var(--color-feedback-success); animation-delay: 0.12s; --cx: -50px; --cy: -20px; }
.confetti:nth-child(4)  { background: var(--color-feedback-warning); animation-delay: 0.18s; --cx: 40px; --cy: -30px; }
.confetti:nth-child(5)  { background: var(--accent-light); animation-delay: 0.14s; --cx: -20px; --cy: -65px; }
.confetti:nth-child(6)  { background: var(--color-accent-cyan); animation-delay: 0.2s; --cx: 50px; --cy: -15px; }
@keyframes confettiBurst {
  0%   { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
  100% { opacity: 0; transform: translate(var(--cx), var(--cy)) rotate(360deg) scale(0.3); }
}

/* ==================== 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;
  }
  .reveal, .reveal-child {
    opacity: 1;
    transform: none;
  }
  .page-enter > section {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

/* ==================== NEWSLETTER SECTION ==================== */
.newsletter-gradient-separator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    var(--color-accent-cyan),
    var(--accent),
    var(--color-accent-purple),
    var(--accent),
    var(--color-accent-cyan)
  );
  background-size: 200% 100%;
  animation: gradientShift 6s ease infinite;
}

.lead-magnet-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-light);
}

/* Floating label input */
.newsletter-input-wrap {
  position: relative;
}

.newsletter-input {
  transition: border-color var(--duration-medium) var(--ease-default),
              box-shadow var(--duration-medium) var(--ease-default);
}

.newsletter-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-medium);
}

/* Gradient border on focus */
.newsletter-input:focus:not(:placeholder-shown) {
  border-image: none;
}

.newsletter-input:focus {
  border-color: transparent;
  background-image: linear-gradient(var(--bg-card), var(--bg-card)),
                    linear-gradient(135deg, var(--color-accent-cyan), var(--accent), var(--color-accent-purple));
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

.newsletter-floating-label {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  pointer-events: none;
  transition: all var(--duration-medium) var(--ease-default);
  background: transparent;
  padding: 0;
}

.newsletter-input:focus + .newsletter-floating-label,
.newsletter-input:not(:placeholder-shown) + .newsletter-floating-label {
  top: -0.5rem;
  left: 1rem;
  font-size: var(--font-size-xs);
  color: var(--accent-light);
  background: var(--color-surface-base);
  padding: 0 0.25rem;
}

/* Error state */
.newsletter-input.input-error {
  border-color: var(--color-feedback-error) !important;
  background-image: none !important;
  animation: shake 0.4s var(--ease-default);
}

.newsletter-error {
  color: var(--color-feedback-error);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

/* Success state */
.newsletter-input.input-success {
  border-color: var(--color-feedback-success) !important;
  background-image: none !important;
}

.newsletter-submit-btn {
  position: relative;
  min-width: 10rem;
}

.newsletter-submit-btn .btn-success {
  display: none;
}

.newsletter-submit-btn.success .btn-text {
  display: none;
}

.newsletter-submit-btn.success .btn-success {
  display: inline;
}

.newsletter-submit-btn.success {
  background: var(--color-feedback-success) !important;
  background-image: none !important;
  pointer-events: none;
}

/* Confetti animation */
.confetti-container {
  position: absolute;
  left: 50%;
  top: 0;
  width: 200px;
  height: 200px;
  pointer-events: none;
  overflow: visible;
  z-index: 10;
}

.confetti-container.active {
  display: block;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: confettiFall 1.2s var(--ease-out) forwards;
}

@keyframes confettiFall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(120px) rotate(720deg) scale(0.3);
  }
}

.newsletter-success {
  animation: fadeInUp 0.4s var(--ease-default) forwards;
}

/* ==================== FOOTER ==================== */
.footer-main {
  position: relative;
  margin-top: 0;
  background: var(--color-surface-base);
}

/* Gradient separator at footer top */
.footer-main::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent,
    var(--color-accent-cyan),
    var(--accent),
    var(--color-accent-purple),
    var(--accent),
    var(--color-accent-cyan),
    transparent
  );
  background-size: 200% 100%;
  animation: gradientShift 8s ease infinite;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-10);
  text-align: center;
}

/* Center flex items in footer cols on mobile/tablet */
.footer-col .max-w-xs {
  margin-left: auto;
  margin-right: auto;
}

.footer-col > .flex {
  justify-content: center;
}

/* Desktop override: left-align */
@media (min-width: 1024px) {
  .footer-col .max-w-xs {
    margin-left: 0;
    margin-right: 0;
  }

  .footer-col > .flex {
    justify-content: flex-start;
  }
}

.footer-col--bordered {
  position: relative;
}

/* Desktop: 5-column grid with vertical dividers */
@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1.2fr;
    gap: var(--space-8);
    text-align: left;
  }

  .footer-col--bordered::before {
    content: '';
    position: absolute;
    left: calc(-1 * var(--space-4));
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--color-border-subtle);
  }
}

/* Tablet: 3-column, newsletter spans full width below */
@media (min-width: 641px) and (max-width: 1023px) {
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
    text-align: center;
  }

  .footer-col:last-child {
    grid-column: 1 / -1;
    border-top: 1px solid var(--color-border-subtle);
    padding-top: var(--space-8);
  }
}

/* Footer link hover underline animation */
.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  position: relative;
  display: inline-block;
  transition: color var(--duration-fast) var(--ease-default);
}

.footer-link::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent-light);
  transition: width var(--duration-medium) var(--ease-default);
}

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

.footer-link:hover::after {
  width: 100%;
}

/* Avatar circles for social proof */
.avatar-circle {
  width: 26px;
  height: 26px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: var(--font-weight-semibold);
  color: white;
  border: 1.5px solid var(--color-surface-base);
  text-transform: uppercase;
  line-height: 1;
}

/* Trust badges */
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--accent-subtle);
  border: 1px solid var(--color-border-subtle);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

/* Heartbeat animation */
.heart-beat {
  display: inline-block;
  animation: heartbeat 1.4s ease-in-out infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14%      { transform: scale(1.2); }
  28%      { transform: scale(1); }
  42%      { transform: scale(1.15); }
  56%      { transform: scale(1); }
}

/* Footer mini-form */
.footer-mini-form input[type="email"]:focus {
  box-shadow: 0 0 0 3px var(--accent-muted);
}

/* ==================== BACK TO TOP ==================== */
.back-to-top {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 42px;
  height: 42px;
  border-radius: 9999px;
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--duration-medium) var(--ease-default),
              visibility var(--duration-medium) var(--ease-default),
              transform var(--duration-medium) var(--ease-default),
              background var(--duration-fast) var(--ease-default);
  z-index: 40;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent-light);
  transform: translateY(-2px);
}

.back-to-top:active {
  transform: translateY(0);
}
