/* ==========================================================================
   Astriva Technologies — Animations & Scroll Reveal
   animations.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   @keyframes Library
   -------------------------------------------------------------------------- */

/* Fade in from below */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade in from left */
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade in from right */
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Simple fade in */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Gentle float — hero badge, floating elements */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-8px); }
}

/* Pulsing glow — buttons, CTA rings */
@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(79, 142, 247, 0.3),
                0 0 40px rgba(79, 142, 247, 0.1);
  }
  50% {
    box-shadow: 0 0 30px rgba(79, 142, 247, 0.6),
                0 0 60px rgba(79, 142, 247, 0.25);
  }
}

/* Pulsing glow — cyan variant */
@keyframes glowPulseCyan {
  0%, 100% {
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.3),
                0 0 40px rgba(34, 211, 238, 0.1);
  }
  50% {
    box-shadow: 0 0 30px rgba(34, 211, 238, 0.55),
                0 0 60px rgba(34, 211, 238, 0.2);
  }
}

/* Pulsing glow — purple/AI variant */
@keyframes glowPulseAI {
  0%, 100% {
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.3),
                0 0 40px rgba(167, 139, 250, 0.1);
  }
  50% {
    box-shadow: 0 0 35px rgba(167, 139, 250, 0.6),
                0 0 70px rgba(167, 139, 250, 0.25);
  }
}

/* Soft scale pulse — stat numbers, badges */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.04); }
}

/* Spinning orbit ring — CTA banner */
@keyframes orbit {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Reverse orbit */
@keyframes orbitReverse {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(-360deg); }
}

/* Spinner — loading states */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Shimmer — skeleton loading or highlight sweep */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

/* Badge glow breathe */
@keyframes badgeBreathe {
  0%, 100% { opacity: 0.8; }
  50%       { opacity: 1; }
}

/* Gradient shift — hero headline */
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Dot blink — step connectors */
@keyframes dotBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}


/* --------------------------------------------------------------------------
   Hero Section Animations
   -------------------------------------------------------------------------- */

.hero-badge {
  animation: float 4s ease-in-out infinite, fadeIn 0.8s ease both;
  animation-delay: 0s, 0.2s;
}

.hero-headline {
  animation: fadeInUp 0.9s ease both;
  animation-delay: 0.3s;
}

.hero-tagline {
  animation: fadeInUp 0.9s ease both;
  animation-delay: 0.5s;
}

.hero-description {
  animation: fadeInUp 0.9s ease both;
  animation-delay: 0.65s;
}

.hero-ctas {
  animation: fadeInUp 0.9s ease both;
  animation-delay: 0.8s;
}

/* Gradient text animation on headline accent words */
.hero-tagline {
  background-size: 200% 200%;
  animation: gradientShift 5s ease infinite, fadeInUp 0.9s ease both;
  animation-delay: 0s, 0.5s;
}


/* --------------------------------------------------------------------------
   Stat Bar
   -------------------------------------------------------------------------- */

.stat-number {
  animation: pulse 3s ease-in-out infinite;
}

.stat-item:nth-child(1) .stat-number { animation-delay: 0s; }
.stat-item:nth-child(2) .stat-number { animation-delay: 0.4s; }
.stat-item:nth-child(3) .stat-number { animation-delay: 0.8s; }
.stat-item:nth-child(4) .stat-number { animation-delay: 1.2s; }


/* --------------------------------------------------------------------------
   CTA Banner — Orbit Rings
   -------------------------------------------------------------------------- */

.cta-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 1px solid rgba(79, 142, 247, 0.15);
  pointer-events: none;
}

.cta-ring--1 {
  width: 300px;
  height: 300px;
  animation: orbit 12s linear infinite;
  border-color: rgba(79, 142, 247, 0.2);
}

.cta-ring--2 {
  width: 500px;
  height: 500px;
  animation: orbitReverse 18s linear infinite;
  border-color: rgba(34, 211, 238, 0.15);
}

.cta-ring--3 {
  width: 700px;
  height: 700px;
  animation: orbit 25s linear infinite;
  border-color: rgba(79, 142, 247, 0.1);
}

/* Orbit ring dot marker */
.cta-ring::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
  transform: translateX(-50%);
  box-shadow: 0 0 8px rgba(79, 142, 247, 0.8);
}

.cta-ring--2::before {
  background: var(--color-accent);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.8);
}


/* --------------------------------------------------------------------------
   Button Animations
   -------------------------------------------------------------------------- */

.btn-primary {
  animation: glowPulse 3s ease-in-out infinite;
}

.btn-primary:hover {
  animation: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(79, 142, 247, 0.5);
}


/* --------------------------------------------------------------------------
   Scroll Reveal — Base States
   -------------------------------------------------------------------------- */

/* Elements start hidden, become visible when .visible is added by JS */

.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

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

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

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

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

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

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays for grid children */
.reveal-stagger > *:nth-child(1)  { transition-delay: 0.05s; }
.reveal-stagger > *:nth-child(2)  { transition-delay: 0.12s; }
.reveal-stagger > *:nth-child(3)  { transition-delay: 0.19s; }
.reveal-stagger > *:nth-child(4)  { transition-delay: 0.26s; }
.reveal-stagger > *:nth-child(5)  { transition-delay: 0.33s; }
.reveal-stagger > *:nth-child(6)  { transition-delay: 0.40s; }
.reveal-stagger > *:nth-child(7)  { transition-delay: 0.47s; }
.reveal-stagger > *:nth-child(8)  { transition-delay: 0.54s; }

/* Stagger individual reveal items */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }


/* --------------------------------------------------------------------------
   Card Hover Micro-Interactions
   -------------------------------------------------------------------------- */

/* Service cards lift on hover */
.service-card {
  transition: transform var(--transition), box-shadow var(--transition),
              border-color var(--transition);
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(79, 142, 247, 0.12);
  border-color: rgba(79, 142, 247, 0.35);
}

/* AI card has purple glow */
.service-card-ai {
  transition: transform var(--transition), box-shadow var(--transition),
              border-color var(--transition);
}

.service-card-ai:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(167, 139, 250, 0.18);
  border-color: rgba(167, 139, 250, 0.45);
}

/* Tech tiles */
.tech-tile {
  transition: transform var(--transition), box-shadow var(--transition),
              background var(--transition), border-color var(--transition);
}

.tech-tile:hover {
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 12px 30px rgba(79, 142, 247, 0.15);
  border-color: rgba(79, 142, 247, 0.4);
  background: #142040;
}

/* AI tech tile */
.tech-tile--ai:hover {
  box-shadow: 0 12px 30px rgba(167, 139, 250, 0.2);
  border-color: rgba(167, 139, 250, 0.5);
  background: #1a1030;
}

/* Step cards */
.step-card {
  transition: transform var(--transition), box-shadow var(--transition),
              border-color var(--transition);
}

.step-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(79, 142, 247, 0.1);
  border-color: rgba(79, 142, 247, 0.3);
}

/* Nav links slide indicator */
.nav-link::after {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: 2px;
  width: 0;
  transition: width 0.3s ease;
  margin-top: 2px;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}


/* --------------------------------------------------------------------------
   Service Card Icon Glow on Hover
   -------------------------------------------------------------------------- */

.service-card:hover .service-icon {
  animation: glowPulse 1.5s ease-in-out infinite;
  color: var(--color-primary);
}

.service-card-ai:hover .service-icon {
  animation: glowPulseAI 1.5s ease-in-out infinite;
}


/* --------------------------------------------------------------------------
   Section Badge Animation
   -------------------------------------------------------------------------- */

.section-badge {
  animation: badgeBreathe 3s ease-in-out infinite;
}


/* --------------------------------------------------------------------------
   Prefers Reduced Motion — Accessibility
   -------------------------------------------------------------------------- */

@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,
  .reveal-scale {
    opacity: 1;
    transform: none;
  }
}
