/* ============================================
   🍎 Animations — Keyframes & Scroll Reveals
   ============================================ */

/* ── Scroll Reveal Base States ── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--duration-slower) var(--ease-out),
              transform var(--duration-slower) var(--ease-out);
}

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

/* ── Reveal Variants ── */
.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity var(--duration-slower) var(--ease-out),
              transform var(--duration-slower) var(--ease-out);
}

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

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity var(--duration-slower) var(--ease-out),
              transform var(--duration-slower) var(--ease-out);
}

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

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity var(--duration-slower) var(--ease-out),
              transform var(--duration-slower) var(--ease-out);
}

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

/* ── Stagger Delays ── */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }
.stagger-7 { transition-delay: 0.7s; }
.stagger-8 { transition-delay: 0.8s; }

/* ── Hero Entrance ── */
@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-content > * {
  animation: heroFadeIn 0.8s var(--ease-out) both;
}

.hero-content > *:nth-child(1) { animation-delay: 0.2s; }
.hero-content > *:nth-child(2) { animation-delay: 0.4s; }
.hero-content > *:nth-child(3) { animation-delay: 0.5s; }
.hero-content > *:nth-child(4) { animation-delay: 0.6s; }
.hero-content > *:nth-child(5) { animation-delay: 0.7s; }
.hero-content > *:nth-child(6) { animation-delay: 0.8s; }
.hero-content > *:nth-child(7) { animation-delay: 0.9s; }

/* ── Gradient Shift ── */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.gradient-animated {
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
}

/* ── Pulse ── */
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
}

/* ── Spin ── */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

.shimmer {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.04) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 3s infinite;
}

/* ── Glow Pulse ── */
@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 5px rgba(0, 122, 255, 0.2),
                0 0 20px rgba(0, 122, 255, 0.1);
  }
  50% {
    box-shadow: 0 0 10px rgba(0, 122, 255, 0.4),
                0 0 40px rgba(0, 122, 255, 0.2);
  }
}

/* ── Text Gradient Animation ── */
@keyframes textGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.animated-gradient-text {
  background: linear-gradient(
    270deg,
    #007AFF,
    #5856D6,
    #AF52DE,
    #5AC8FA,
    #007AFF
  );
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: textGradient 6s ease infinite;
}

/* ── Counter animation helper ── */
.count-up {
  display: inline-block;
}

/* ── Loading dots ── */
@keyframes loadingDots {
  0%, 20% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

.loading-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-blue);
  animation: loadingDots 1.4s infinite;
}

.loading-dot:nth-child(2) { animation-delay: 0.2s; }
.loading-dot:nth-child(3) { animation-delay: 0.4s; }

/* ── Float animation for various elements ── */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

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

/* ── Slide in from bottom for mobile menu ── */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-mobile.open .nav-link {
  animation: slideUp 0.4s var(--ease-out) both;
}

.nav-mobile.open .nav-link:nth-child(1) { animation-delay: 0.1s; }
.nav-mobile.open .nav-link:nth-child(2) { animation-delay: 0.15s; }
.nav-mobile.open .nav-link:nth-child(3) { animation-delay: 0.2s; }
.nav-mobile.open .nav-link:nth-child(4) { animation-delay: 0.25s; }
.nav-mobile.open .nav-link:nth-child(5) { animation-delay: 0.3s; }
.nav-mobile.open .nav-link:nth-child(6) { animation-delay: 0.35s; }
.nav-mobile.open .nav-link:nth-child(7) { animation-delay: 0.4s; }
