/* ============================================================================
   AXIOM AI 1.0 — "The Singularity" Animation System
   Keyframes · Motion · Life
   ============================================================================ */

/* ============================================================================
   PULSE-HEARTBEAT
   Idle portal breathing — organic, alive rhythm
   ============================================================================ */
@keyframes pulse-heartbeat {
  0% {
    transform: scale(1);
    opacity: 0.85;
  }
  15% {
    transform: scale(1.04);
    opacity: 1;
  }
  30% {
    transform: scale(1);
    opacity: 0.9;
  }
  45% {
    transform: scale(1.05);
    opacity: 1;
  }
  60% {
    transform: scale(1);
    opacity: 0.85;
  }
  100% {
    transform: scale(1);
    opacity: 0.85;
  }
}

/* ============================================================================
   NEURAL-GLOW
   Box-shadow cycling through blue intensities
   Evokes synaptic firing
   ============================================================================ */
@keyframes neural-glow {
  0% {
    box-shadow:
      0 0 15px rgba(0, 212, 255, 0.15),
      0 0 30px rgba(0, 212, 255, 0.05),
      inset 0 0 15px rgba(0, 212, 255, 0.02);
  }
  25% {
    box-shadow:
      0 0 25px rgba(0, 212, 255, 0.35),
      0 0 50px rgba(0, 212, 255, 0.15),
      0 0 80px rgba(0, 212, 255, 0.05),
      inset 0 0 25px rgba(0, 212, 255, 0.05);
  }
  50% {
    box-shadow:
      0 0 20px rgba(0, 255, 224, 0.25),
      0 0 40px rgba(0, 212, 255, 0.2),
      0 0 70px rgba(0, 212, 255, 0.08),
      inset 0 0 20px rgba(0, 255, 224, 0.04);
  }
  75% {
    box-shadow:
      0 0 30px rgba(0, 212, 255, 0.4),
      0 0 60px rgba(0, 212, 255, 0.15),
      0 0 90px rgba(0, 212, 255, 0.06),
      inset 0 0 30px rgba(0, 212, 255, 0.06);
  }
  100% {
    box-shadow:
      0 0 15px rgba(0, 212, 255, 0.15),
      0 0 30px rgba(0, 212, 255, 0.05),
      inset 0 0 15px rgba(0, 212, 255, 0.02);
  }
}

/* ============================================================================
   PARTICLE-DRIFT
   Subtle floating movement for ambient particles
   ============================================================================ */
@keyframes particle-drift {
  0% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.6;
  }
  50% {
    transform: translate(30px, -40px) rotate(180deg);
    opacity: 0.3;
  }
  90% {
    opacity: 0.5;
  }
  100% {
    transform: translate(-20px, -80px) rotate(360deg);
    opacity: 0;
  }
}

@keyframes particle-drift-alt {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 0;
  }
  20% {
    opacity: 0.5;
  }
  50% {
    transform: translate(-25px, -50px) scale(1.2);
    opacity: 0.2;
  }
  80% {
    opacity: 0.4;
  }
  100% {
    transform: translate(15px, -90px) scale(0.8);
    opacity: 0;
  }
}

/* ============================================================================
   TYPING-CURSOR
   Classic terminal blink
   ============================================================================ */
@keyframes typing-cursor {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* ============================================================================
   KNOWLEDGE-EXPAND
   Result appearance — scale from void to reality
   ============================================================================ */
@keyframes knowledge-expand {
  0% {
    transform: scale(0.6);
    opacity: 0;
    filter: blur(8px);
  }
  50% {
    filter: blur(2px);
  }
  100% {
    transform: scale(1);
    opacity: 1;
    filter: blur(0);
  }
}

/* ============================================================================
   VERIFICATION-SWEEP
   Light sweep left-to-right for Wolfram verification status
   ============================================================================ */
@keyframes verification-sweep {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

/* ============================================================================
   GLOW-PULSE
   Text-shadow cycling for slogan / emphasis text
   ============================================================================ */
@keyframes glow-pulse {
  0%, 100% {
    text-shadow:
      0 0 4px rgba(0, 212, 255, 0.3),
      0 0 12px rgba(0, 212, 255, 0.1);
  }
  33% {
    text-shadow:
      0 0 8px rgba(0, 212, 255, 0.5),
      0 0 24px rgba(0, 212, 255, 0.2),
      0 0 48px rgba(0, 212, 255, 0.08);
  }
  66% {
    text-shadow:
      0 0 6px rgba(0, 255, 224, 0.4),
      0 0 18px rgba(0, 255, 224, 0.15),
      0 0 36px rgba(0, 212, 255, 0.1);
  }
}

/* ============================================================================
   FADE-IN-UP
   Elegant entrance from below
   ============================================================================ */
@keyframes fade-in-up {
  0% {
    transform: translateY(20px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fade-in-down {
  0% {
    transform: translateY(-20px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fade-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* ============================================================================
   PROCESSING-SPIN
   Rotate 360° — outer portal ring during processing
   ============================================================================ */
@keyframes processing-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes processing-spin-reverse {
  0% {
    transform: rotate(360deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

/* ============================================================================
   TIER-REVEAL
   Each result tier slides in with a staggered delay
   ============================================================================ */
@keyframes tier-reveal {
  0% {
    transform: translateX(-30px);
    opacity: 0;
    filter: blur(4px);
  }
  60% {
    filter: blur(0);
  }
  100% {
    transform: translateX(0);
    opacity: 1;
    filter: blur(0);
  }
}

/* ============================================================================
   NODE-ACTIVATE
   Nodes brighten when processing data
   ============================================================================ */
@keyframes node-activate {
  0% {
    opacity: 0.2;
    box-shadow: 0 0 4px rgba(0, 212, 255, 0.1);
    transform: scale(1);
  }
  50% {
    opacity: 1;
    box-shadow:
      0 0 12px rgba(0, 212, 255, 0.5),
      0 0 24px rgba(0, 212, 255, 0.2);
    transform: scale(1.3);
  }
  100% {
    opacity: 0.2;
    box-shadow: 0 0 4px rgba(0, 212, 255, 0.1);
    transform: scale(1);
  }
}

@keyframes node-activate-cascade {
  0%, 20% {
    opacity: 0.15;
    background: rgba(0, 212, 255, 0.1);
  }
  40% {
    opacity: 1;
    background: rgba(0, 212, 255, 0.6);
  }
  60%, 100% {
    opacity: 0.15;
    background: rgba(0, 212, 255, 0.1);
  }
}

/* ============================================================================
   GRID-PULSE
   Grid coordinate lines briefly brighten
   ============================================================================ */
@keyframes grid-pulse {
  0%, 100% {
    opacity: 0.03;
  }
  50% {
    opacity: 0.08;
  }
}

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

/* --- Shimmer / Skeleton Loading ------------------------------------------ */
@keyframes shimmer {
  0% {
    background-position: -400px 0;
  }
  100% {
    background-position: 400px 0;
  }
}

/* --- Ripple Effect ------------------------------------------------------- */
@keyframes ripple {
  0% {
    transform: scale(0.5);
    opacity: 0.5;
  }
  100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* --- Data Stream (vertical) ---------------------------------------------- */
@keyframes data-stream {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 0 100%;
  }
}

/* --- Orbit — rings around the portal ------------------------------------- */
@keyframes orbit {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes orbit-reverse {
  0% {
    transform: rotate(360deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

/* --- Breathe — subtle scale for ambient elements ------------------------- */
@keyframes breathe {
  0%, 100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.02);
    opacity: 0.8;
  }
}

/* --- Signal Ping — expanding circle ping --------------------------------- */
@keyframes signal-ping {
  0% {
    transform: scale(0.8);
    opacity: 0.8;
    border-width: 2px;
  }
  100% {
    transform: scale(2);
    opacity: 0;
    border-width: 0.5px;
  }
}

/* --- Text Reveal — characters appearing ---------------------------------- */
@keyframes text-reveal {
  0% {
    width: 0;
  }
  100% {
    width: 100%;
  }
}

/* --- Checkmark Draw — SVG stroke animation ------------------------------- */
@keyframes checkmark-draw {
  0% {
    stroke-dashoffset: 24;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

/* --- Status Dot Pulse ---------------------------------------------------- */
@keyframes status-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 currentColor;
  }
  50% {
    box-shadow: 0 0 0 4px transparent;
  }
}

/* ============================================================================
   ANIMATION UTILITY CLASSES
   ============================================================================ */
.animate-fade-in-up {
  animation: fade-in-up 0.5s var(--ease-smooth, cubic-bezier(0.4, 0, 0.2, 1)) forwards;
}

.animate-fade-in {
  animation: fade-in 0.4s ease forwards;
}

.animate-knowledge-expand {
  animation: knowledge-expand 0.6s var(--ease-spring, cubic-bezier(0.175, 0.885, 0.32, 1.275)) forwards;
}

.animate-pulse-heartbeat {
  animation: pulse-heartbeat 3s ease-in-out infinite;
}

.animate-glow-pulse {
  animation: glow-pulse 4s ease-in-out infinite;
}

.animate-processing-spin {
  animation: processing-spin 2s linear infinite;
}

.animate-typing-cursor {
  animation: typing-cursor 1s step-end infinite;
}

/* Stagger delays for tier reveals */
.animate-tier-reveal {
  animation: tier-reveal 0.6s var(--ease-decel, cubic-bezier(0, 0, 0.2, 1)) forwards;
  opacity: 0;
}

.animate-tier-reveal:nth-child(1) { animation-delay: 0ms; }
.animate-tier-reveal:nth-child(2) { animation-delay: 150ms; }
.animate-tier-reveal:nth-child(3) { animation-delay: 300ms; }
.animate-tier-reveal:nth-child(4) { animation-delay: 450ms; }
.animate-tier-reveal:nth-child(5) { animation-delay: 600ms; }
