/* ================================================
   KALEDO MENTORS — Animations
   ================================================ */

/* ===== KEYFRAMES ===== */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-18px); }
}
@keyframes floatSlow {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}
@keyframes floatCard1 {
  0%, 100% { transform: translateY(0px) rotate(-1.5deg); }
  50% { transform: translateY(-12px) rotate(1deg); }
}
@keyframes floatCard2 {
  0%, 100% { transform: translateY(0px) rotate(1.5deg); }
  50% { transform: translateY(-14px) rotate(-1deg); }
}
@keyframes floatOrb1 {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(12px,-16px) scale(1.12); }
  66% { transform: translate(-6px,-8px) scale(0.94); }
}
@keyframes floatOrb2 {
  0%, 100% { transform: translate(0,0); }
  50% { transform: translate(8px,-14px); }
}
@keyframes floatOrb3 {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-5px,-20px) scale(1.25); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.82); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(36px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideLeft {
  from { opacity: 0; transform: translateX(36px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes slideRight {
  from { opacity: 0; transform: translateX(-36px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.88); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes loaderPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
@keyframes gradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ===== FLOATING CLASSES ===== */
.animate-float       { animation: float 4s ease-in-out infinite; will-change: transform; }
.animate-float-slow  { animation: floatSlow 6s ease-in-out infinite; will-change: transform; }
.animate-float-d1    { animation: float 4.5s ease-in-out 0.8s infinite; will-change: transform; }
.animate-float-d2    { animation: float 5s ease-in-out 1.6s infinite; will-change: transform; }
.animate-pulse       { animation: pulse 2.2s ease-in-out infinite; }

/* Hero orbs */
.hero-orb-1 { animation: floatOrb1 7s ease-in-out infinite; }
.hero-orb-2 { animation: floatOrb2 5.5s ease-in-out infinite; }
.hero-orb-3 { animation: floatOrb3 4.5s ease-in-out infinite; }
.float-card-1 { animation: floatCard1 5s ease-in-out infinite; }
.float-card-2 { animation: floatCard2 6s ease-in-out infinite; }

/* ===== PAGE LOADER ===== */
.loader-brand { animation: loaderPulse 1.6s ease-in-out infinite; }

/* ===== HERO ENTRANCE ===== */
.hero-content > * {
  animation: slideUp 0.75s cubic-bezier(0.4,0,0.2,1) both;
}
.hero-content > *:nth-child(1) { animation-delay: 0.05s; }
.hero-content > *:nth-child(2) { animation-delay: 0.15s; }
.hero-content > *:nth-child(3) { animation-delay: 0.25s; }
.hero-content > *:nth-child(4) { animation-delay: 0.35s; }
.hero-content > *:nth-child(5) { animation-delay: 0.45s; }
.hero-visual { animation: slideLeft 0.75s cubic-bezier(0.4,0,0.2,1) 0.2s both; }

/* ===== SCROLL ANIMATIONS ===== */
/* Base: elements start hidden */
[data-anim] {
  opacity: 0;
  transition: opacity 0.65s cubic-bezier(0.4,0,0.2,1),
              transform 0.65s cubic-bezier(0.4,0,0.2,1);
}
[data-anim="up"]     { transform: translateY(40px); }
[data-anim="left"]   { transform: translateX(40px); }
[data-anim="right"]  { transform: translateX(-40px); }
[data-anim="scale"]  { transform: scale(0.85); }
[data-anim="fade"]   { /* opacity only */ }

[data-anim].in-view {
  opacity: 1;
  transform: translateY(0) translateX(0) scale(1);
}

/* Stagger container */
[data-stagger] > * {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.6s cubic-bezier(0.4,0,0.2,1),
              transform 0.6s cubic-bezier(0.4,0,0.2,1);
}
[data-stagger].in-view > *:nth-child(1)  { opacity: 1; transform: none; transition-delay: 0ms; }
[data-stagger].in-view > *:nth-child(2)  { opacity: 1; transform: none; transition-delay: 100ms; }
[data-stagger].in-view > *:nth-child(3)  { opacity: 1; transform: none; transition-delay: 200ms; }
[data-stagger].in-view > *:nth-child(4)  { opacity: 1; transform: none; transition-delay: 300ms; }
[data-stagger].in-view > *:nth-child(5)  { opacity: 1; transform: none; transition-delay: 400ms; }
[data-stagger].in-view > *:nth-child(6)  { opacity: 1; transform: none; transition-delay: 500ms; }
[data-stagger].in-view > *:nth-child(7)  { opacity: 1; transform: none; transition-delay: 600ms; }
[data-stagger].in-view > *:nth-child(8)  { opacity: 1; transform: none; transition-delay: 700ms; }

/* Delay modifiers */
[data-delay="100"] { transition-delay: 100ms !important; }
[data-delay="200"] { transition-delay: 200ms !important; }
[data-delay="300"] { transition-delay: 300ms !important; }
[data-delay="400"] { transition-delay: 400ms !important; }

/* ===== HOVER UTILITIES ===== */
.hover-lift { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.hover-lift:hover { transform: translateY(-6px); box-shadow: 0 20px 50px rgba(0,0,0,0.1); }

/* ===== GRADIENT ANIMATED BACKGROUND ===== */
.grad-animated {
  background-size: 200% 200%;
  animation: gradientFlow 5s ease infinite;
}

/* ===== SHIMMER ===== */
.shimmer {
  background: linear-gradient(90deg, #f0f2f8 25%, #e6e9f4 50%, #f0f2f8 75%);
  background-size: 400px 100%;
  animation: shimmer 1.4s linear infinite;
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  [data-anim], [data-stagger] > *, .hero-content > *, .hero-visual,
  .animate-float, .animate-float-slow, .animate-float-d1, .animate-float-d2,
  .animate-pulse, .hero-orb-1, .hero-orb-2, .hero-orb-3,
  .float-card-1, .float-card-2, .loader-brand {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ===== MOBILE ANIMATION OPTIMISATIONS ===== */
@media (max-width: 768px) {
  /* Faster entrance — mobile users won't wait 0.45s for content */
  .hero-content > *:nth-child(1) { animation-delay: 0s; }
  .hero-content > *:nth-child(2) { animation-delay: 0.08s; }
  .hero-content > *:nth-child(3) { animation-delay: 0.14s; }
  .hero-content > *:nth-child(4) { animation-delay: 0.20s; }
  .hero-content > *:nth-child(5) { animation-delay: 0.26s; }

  /* Shorter stagger delays on mobile */
  [data-stagger].in-view > *:nth-child(2) { transition-delay: 60ms; }
  [data-stagger].in-view > *:nth-child(3) { transition-delay: 120ms; }
  [data-stagger].in-view > *:nth-child(4) { transition-delay: 180ms; }
  [data-stagger].in-view > *:nth-child(5) { transition-delay: 240ms; }
  [data-stagger].in-view > *:nth-child(6) { transition-delay: 300ms; }
  [data-stagger].in-view > *:nth-child(7) { transition-delay: 360ms; }
  [data-stagger].in-view > *:nth-child(8) { transition-delay: 420ms; }

  /* Smaller travel distance for scroll animations */
  [data-anim="up"]   { transform: translateY(22px); }
  [data-stagger] > * { transform: translateY(18px); }

  /* Disable CPU-heavy float & orb animations — saves battery */
  .animate-float, .animate-float-slow,
  .animate-float-d1, .animate-float-d2,
  .hero-orb-1, .hero-orb-2, .hero-orb-3,
  .float-card-1, .float-card-2 {
    animation: none;
    will-change: auto;
  }
}
