/* ========================================
   ANIMATIONS
   Scroll reveals, hover effects, transitions
   ======================================== */

/* --- Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Staggered children */
.stagger-children .reveal:nth-child(1) { transition-delay: 0ms; }
.stagger-children .reveal:nth-child(2) { transition-delay: 100ms; }
.stagger-children .reveal:nth-child(3) { transition-delay: 200ms; }
.stagger-children .reveal:nth-child(4) { transition-delay: 300ms; }
.stagger-children .reveal:nth-child(5) { transition-delay: 400ms; }
.stagger-children .reveal:nth-child(6) { transition-delay: 500ms; }

/* --- Hero Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 212, 170, 0.1);
  }
  50% {
    box-shadow: 0 0 40px rgba(0, 212, 170, 0.25);
  }
}

.hero-text {
  animation: fadeInUp 0.8s ease forwards;
}

.hero-image {
  animation: fadeInRight 0.8s ease 0.2s forwards;
  opacity: 0;
}

.hero-image .browser-mockup {
  animation: pulseGlow 4s ease-in-out infinite;
}

/* --- Counter Animation --- */
@keyframes countUp {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

.stat-item.visible .number {
  animation: countUp 0.5s ease forwards;
}

/* --- Step Connector Pulse --- */
@keyframes linePulse {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

.steps::before {
  background: linear-gradient(90deg,
    var(--color-accent),
    var(--color-primary-lighter),
    var(--color-accent)
  );
  background-size: 200% 100%;
  animation: linePulse 3s linear infinite;
}

/* --- Floating Effect (for hero screenshot) --- */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.float {
  animation: float 4s ease-in-out infinite;
}

/* --- Button Hover Effects --- */
.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}

.btn-primary:hover::after {
  width: 300px;
  height: 300px;
}

/* --- Card Hover Glow --- */
.card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity var(--transition-base);
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(0, 212, 170, 0.2);
}

.card:hover::after {
  opacity: 1;
}

/* --- Comparison Table Row Highlight --- */
.comparison-table tbody tr {
  transition: background var(--transition-fast);
}

/* --- Tab Switch Transition --- */
.persona-content {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.persona-content.active {
  opacity: 1;
  transform: translateY(0);
}

/* --- FAQ Expand/Collapse --- */
.faq-answer {
  transition: max-height 0.4s ease;
}

/* --- Scroll Progress Bar (optional) --- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--color-accent);
  z-index: 1001;
  transition: width 0.1s linear;
}

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

  .reveal,
  .reveal-left,
  .reveal-right {
    opacity: 1;
    transform: none;
  }

  .hero-text,
  .hero-image {
    animation: none;
    opacity: 1;
  }
}
