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

.reveal--left {
  transform: translateX(-40px);
}

.reveal--right {
  transform: translateX(40px);
}

.reveal--scale {
  transform: scale(0.95);
}

.reveal.visible {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

/* Stagger delays for grid children */
.stagger > :nth-child(1) { transition-delay: 0ms; }
.stagger > :nth-child(2) { transition-delay: 80ms; }
.stagger > :nth-child(3) { transition-delay: 160ms; }
.stagger > :nth-child(4) { transition-delay: 240ms; }
.stagger > :nth-child(5) { transition-delay: 320ms; }
.stagger > :nth-child(6) { transition-delay: 400ms; }
.stagger > :nth-child(7) { transition-delay: 480ms; }
.stagger > :nth-child(8) { transition-delay: 560ms; }

/* ── HUD Card Entrance (matches CardView.swift 2s glow) ── */
@keyframes card-slide-in {
  0% {
    opacity: 0;
    transform: translateX(40px);
  }
  20% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes card-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(20, 184, 166, 0);
  }
  15% {
    box-shadow: 0 0 20px 4px rgba(20, 184, 166, 0.25);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(20, 184, 166, 0);
  }
}

@keyframes sparkle-pulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* ── Workflow Demo Animations ── */
@keyframes transcript-line-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes flash-teal {
  0% { background-color: transparent; }
  30% { background-color: rgba(20, 184, 166, 0.15); }
  100% { background-color: transparent; }
}

@keyframes checkmark-in {
  0% { opacity: 0; transform: scale(0.5) rotate(-20deg); }
  60% { transform: scale(1.15) rotate(5deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes fade-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* ── Floating elements (hero background) ── */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes float-slow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}

/* ── Persona tab slide ── */
@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .stagger > * {
    transition-delay: 0ms !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
