/* ==========================================================================
   EduKando — Animaciones y microinteracciones
   ========================================================================== */

/* --------------------------------------------------------------------------
   Entrada de la portada
   -------------------------------------------------------------------------- */
.hero__copy > * {
  animation: hero-rise 0.78s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.hero__copy > *:nth-child(1) {
  animation-delay: 0.06s;
}

.hero__copy > *:nth-child(2) {
  animation-delay: 0.13s;
}

.hero__copy > *:nth-child(3) {
  animation-delay: 0.22s;
}

.hero__copy > *:nth-child(4) {
  animation-delay: 0.3s;
}

.hero__copy > *:nth-child(5) {
  animation-delay: 0.38s;
}

@keyframes hero-rise {
  from {
    opacity: 0;
    translate: 0 18px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

.showcase__device {
  animation: device-in 0.95s 0.18s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

@keyframes device-in {
  from {
    opacity: 0;
    translate: 0 26px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

.kando {
  animation: kando-in 0.9s 0.42s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

@keyframes kando-in {
  from {
    opacity: 0;
    translate: 0 20px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

.kando__img {
  animation: kando-bob 6s 1.6s ease-in-out infinite;
}

@keyframes kando-bob {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -5px;
  }
}

/* --------------------------------------------------------------------------
   Cielo
   -------------------------------------------------------------------------- */
.cloud--one {
  animation: cloud-drift 24s 1s ease-in-out infinite alternate;
}

.cloud--two {
  animation: cloud-drift 19s 0s ease-in-out infinite alternate-reverse;
}

.cloud--three {
  animation: cloud-drift 28s 2s ease-in-out infinite alternate;
}

@keyframes cloud-drift {
  from {
    translate: 0 0;
  }
  to {
    translate: 22px -7px;
  }
}

.sparkle {
  animation: twinkle 4.2s ease-in-out infinite;
}

.sparkle--two {
  animation-delay: 0.9s;
  animation-duration: 3.4s;
}

.sparkle--three {
  animation-delay: 1.7s;
  animation-duration: 5s;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.35;
    scale: 0.72;
    rotate: 0deg;
  }
  50% {
    opacity: 1;
    scale: 1;
    rotate: 18deg;
  }
}

/* --------------------------------------------------------------------------
   Descubre el mundo
   -------------------------------------------------------------------------- */
.world.is-reveal-ready [data-reveal] {
  opacity: 0;
}

.world.is-reveal-ready [data-reveal].is-visible {
  animation: world-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--reveal-delay, 0s);
}

@keyframes world-rise {
  from {
    opacity: 0;
    translate: 0 22px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

/* --------------------------------------------------------------------------
   Conoce a nuestros amigos
   -------------------------------------------------------------------------- */
.friends.is-reveal-ready [data-reveal] {
  opacity: 0;
}

.friends.is-reveal-ready [data-reveal].is-visible {
  animation: world-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--reveal-delay, 0s);
}

.friends__kando-img {
  animation: kando-bob 6s 1.2s ease-in-out infinite;
}

.friends.is-reveal-ready .friends__feature.is-visible .friends__bubble {
  animation: friends-bubble-in 0.45s 0.35s both;
}

@keyframes friends-bubble-in {
  from {
    opacity: 0;
    scale: 0.88;
    translate: 0 6px;
  }
  to {
    opacity: 1;
    scale: 1;
    translate: 0 0;
  }
}

/* --------------------------------------------------------------------------
   Aprender jugando
   -------------------------------------------------------------------------- */
.learn.is-reveal-ready [data-reveal] {
  opacity: 0;
}

.learn.is-reveal-ready [data-reveal].is-visible {
  animation: world-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--reveal-delay, 0s);
}

/* --------------------------------------------------------------------------
   Navegación móvil
   -------------------------------------------------------------------------- */
@keyframes nav-in {
  from {
    opacity: 0;
    translate: 0 -8px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

/* --------------------------------------------------------------------------
   Ventanas modales
   -------------------------------------------------------------------------- */
.modal[open] .modal__panel {
  animation: modal-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes modal-in {
  from {
    opacity: 0;
    translate: 0 12px;
    scale: 0.975;
  }
  to {
    opacity: 1;
    translate: 0 0;
    scale: 1;
  }
}

/* --------------------------------------------------------------------------
   Accesibilidad: menos movimiento
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .friends__kando-img,
  .friends.is-reveal-ready .friends__feature.is-visible .friends__bubble {
    animation: none;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
