/* Base */
html {
  scroll-behavior: smooth;
}

/* Reduced motion - CRITICAL for accessibility */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .animate-on-scroll {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Scroll-triggered animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children delays */
.stagger-children > *:nth-child(1) { transition-delay: 0ms; }
.stagger-children > *:nth-child(2) { transition-delay: 150ms; }
.stagger-children > *:nth-child(3) { transition-delay: 300ms; }
.stagger-children > *:nth-child(4) { transition-delay: 450ms; }

/* Nav background on scroll */
.nav-scrolled {
  background-color: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dark .nav-scrolled {
  background-color: rgba(9, 9, 11, 0.95) !important;
}

/* Mobile menu animation */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.mobile-menu.open {
  max-height: 500px;
}

/* Phone mockup */
.phone-mockup {
  width: 280px;
  height: 560px;
  border-radius: 40px;
  background: linear-gradient(135deg, #4338CA 0%, #818CF8 50%, #22A06B 100%);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: white;
  overflow: hidden;
}

.phone-mockup::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 24px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
}

.dark .phone-mockup {
  background: linear-gradient(135deg, #312E81 0%, #4338CA 50%, #166534 100%);
}

/* Comparison table mobile scroll */
.comparison-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.comparison-wrapper table {
  min-width: 640px;
}

/* Step connector lines (How It Works) */
.step-connector {
  border-top: 2px dashed #E4E4E7;
  position: absolute;
  top: 2rem;
  left: calc(50% + 2rem);
  right: calc(-50% + 2rem);
}

.dark .step-connector {
  border-color: #27272A;
}

/* Form states */
.form-success {
  color: #22A06B;
  font-weight: 500;
}

.form-error {
  color: #DC2626;
  font-weight: 500;
}

/* Subtle pulse for CTA buttons */
@keyframes subtle-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(67, 56, 202, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(67, 56, 202, 0); }
}

.pulse-cta {
  animation: subtle-pulse 3s infinite;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #D4D4D8;
  border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb {
  background: #3F3F46;
}

/* Selection */
::selection {
  background: rgba(67, 56, 202, 0.2);
}

.dark ::selection {
  background: rgba(129, 140, 248, 0.3);
}

/* Hamburger animation */
.hamburger-line {
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger-active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger-active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}
