/* ================================================================
   RAX VOICE STUDIO — animations.css
   All keyframes, micro-interactions, scroll animations
   ================================================================ */

/* ── PAGE LOAD ANIMATIONS ────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideDownFade {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(8px); }
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

/* ── ANIMATION CLASSES ───────────────────────────────────────── */
.animate-in {
  opacity: 0;
  animation: fadeUp 0.3s ease-out forwards;
}
.animate-in.delay-1 { animation-delay: 60ms; }
.animate-in.delay-2 { animation-delay: 120ms; }
.animate-in.delay-3 { animation-delay: 180ms; }
.animate-in.delay-4 { animation-delay: 240ms; }
.animate-in.delay-5 { animation-delay: 300ms; }
.animate-in.delay-6 { animation-delay: 360ms; }

.animate-scale { animation: scaleIn 0.3s ease-out forwards; }
.animate-fade  { animation: fadeIn  0.3s ease-out forwards; }

/* Scroll-triggered (JS adds .visible via IntersectionObserver) */
.scroll-animate {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}
.scroll-animate.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── SHIMMER ─────────────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}

/* ── WAVEFORM BARS ───────────────────────────────────────────── */
@keyframes wave1 { 0%,100% { height: 8px;  } 50% { height: 28px; } }
@keyframes wave2 { 0%,100% { height: 16px; } 50% { height: 36px; } }
@keyframes wave3 { 0%,100% { height: 24px; } 50% { height: 12px; } }
@keyframes wave4 { 0%,100% { height: 10px; } 50% { height: 32px; } }
@keyframes wave5 { 0%,100% { height: 20px; } 50% { height: 8px;  } }
@keyframes waveSlow1 { 0%,100% { height: 6px;  } 50% { height: 14px; } }
@keyframes waveSlow2 { 0%,100% { height: 10px; } 50% { height: 18px; } }
@keyframes waveSlow3 { 0%,100% { height: 14px; } 50% { height: 8px;  } }

.waveform-bar:nth-child(1) { height: 8px;  animation: waveSlow1 2.2s ease-in-out infinite; }
.waveform-bar:nth-child(2) { height: 16px; animation: waveSlow2 1.8s ease-in-out infinite 0.1s; }
.waveform-bar:nth-child(3) { height: 24px; animation: waveSlow3 2.4s ease-in-out infinite 0.2s; }
.waveform-bar:nth-child(4) { height: 10px; animation: waveSlow1 1.9s ease-in-out infinite 0.15s; }
.waveform-bar:nth-child(5) { height: 18px; animation: waveSlow2 2.1s ease-in-out infinite 0.05s; }

/* Playing state — faster */
.waveform-bars.playing .waveform-bar:nth-child(1) { animation: wave1 0.6s ease-in-out infinite; }
.waveform-bars.playing .waveform-bar:nth-child(2) { animation: wave2 0.5s ease-in-out infinite 0.08s; }
.waveform-bars.playing .waveform-bar:nth-child(3) { animation: wave3 0.7s ease-in-out infinite 0.16s; }
.waveform-bars.playing .waveform-bar:nth-child(4) { animation: wave4 0.55s ease-in-out infinite 0.04s; }
.waveform-bars.playing .waveform-bar:nth-child(5) { animation: wave5 0.65s ease-in-out infinite 0.12s; }

/* ── BLOB ANIMATIONS (hero bg) ───────────────────────────────── */
@keyframes blobMove1 {
  0%,100% { transform: translate(0,0)    scale(1); }
  33%     { transform: translate(30px,-20px) scale(1.05); }
  66%     { transform: translate(-20px,15px) scale(0.97); }
}
@keyframes blobMove2 {
  0%,100% { transform: translate(0,0)    scale(1); }
  33%     { transform: translate(-25px,20px) scale(1.03); }
  66%     { transform: translate(15px,-25px) scale(0.98); }
}
@keyframes blobMove3 {
  0%,100% { transform: translate(0,0)    scale(1); }
  50%     { transform: translate(20px,25px) scale(1.04); }
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}
.blob-1 {
  width: 500px; height: 500px;
  background: var(--accent);
  opacity: 0.07;
  top: -150px; left: -100px;
  animation: blobMove1 10s ease-in-out infinite;
}
.blob-2 {
  width: 400px; height: 400px;
  background: var(--accent2);
  opacity: 0.06;
  bottom: -100px; right: -80px;
  animation: blobMove2 12s ease-in-out infinite;
}
.blob-3 {
  width: 300px; height: 300px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  opacity: 0.05;
  top: 40%; right: 15%;
  animation: blobMove3 8s ease-in-out infinite;
}
@media (max-width: 768px) {
  .blob-1 { width: 300px; height: 300px; }
  .blob-2 { width: 250px; height: 250px; }
  .blob-3 { width: 180px; height: 180px; }
}

/* ── PULSE ───────────────────────────────────────────────────── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}
.animate-pulse { animation: pulse 2s ease-in-out infinite; }

/* ── SPIN ────────────────────────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(var(--accent-rgb),0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

/* ── TOKEN COUNT TICK ────────────────────────────────────────── */
@keyframes tokenTick {
  0%  { transform: translateY(0); }
  30% { transform: translateY(-4px); }
  60% { transform: translateY(2px); }
  100%{ transform: translateY(0); }
}
.token-tick { animation: tokenTick 0.4s ease-out; }

/* ── CHECKMARK SCALE ─────────────────────────────────────────── */
@keyframes checkPop {
  0%   { transform: scale(0) rotate(-20deg); }
  70%  { transform: scale(1.2) rotate(5deg); }
  100% { transform: scale(1) rotate(0); }
}
.check-pop { animation: checkPop 0.35s cubic-bezier(0.34,1.56,0.64,1) forwards; }

/* ── LIGHT SWEEP (on buttons/cards) ──────────────────────────── */
@keyframes lightSweep {
  0%   { transform: translateX(-100%) skewX(-15deg); }
  100% { transform: translateX(300%)  skewX(-15deg); }
}
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 40%;
  height: 100%;
  background: rgba(255,255,255,0.15);
  transform: translateX(-100%) skewX(-15deg);
  pointer-events: none;
}
.btn-primary:hover::before {
  animation: lightSweep 0.5s ease-out forwards;
}
.btn-primary { position: relative; overflow: hidden; }

/* ── GRADIENT BORDER ANIMATION ───────────────────────────────── */
@keyframes borderRotate {
  to { --angle: 360deg; }
}

/* ── HERO TEXT ENTRANCE ──────────────────────────────────────── */
.hero-title   { animation: fadeUp 0.5s ease-out 0.1s both; }
.hero-sub     { animation: fadeUp 0.5s ease-out 0.25s both; }
.hero-actions { animation: fadeUp 0.5s ease-out 0.4s both; }
.hero-note    { animation: fadeUp 0.5s ease-out 0.55s both; }
.hero-demo    { animation: fadeUp 0.5s ease-out 0.7s both; }
