
/* ==========================================
   WHAT IF LAB
   Shared Animation System — Version 1.0
   ========================================== */

/* 01. FLOATING OBJECTS */

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

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

/* 02. PLANET ROTATION */

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-rotate {
  animation: rotate 20s linear infinite;
}

.animate-rotate-slow {
  animation: rotate 60s linear infinite;
}

.animate-rotate-fast {
  animation: rotate 5s linear infinite;
}

/* 03. ORBITAL MOTION */

@keyframes orbit {
  from {
    transform: rotate(0deg)
      translateX(var(--orbit-radius, 80px))
      rotate(0deg);
  }

  to {
    transform: rotate(360deg)
      translateX(var(--orbit-radius, 80px))
      rotate(-360deg);
  }
}

.animate-orbit {
  animation: orbit
    var(--orbit-duration, 8s)
    linear infinite;
}

/* 04. PULSE EFFECT */

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: .65;
    transform: scale(1.06);
  }
}

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

/* 05. GLOW EFFECT */

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 15px
      var(--accent, #a69aff);
  }

  50% {
    box-shadow: 0 0 35px
      var(--accent, #a69aff);
  }
}

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

/* 06. STAR TWINKLE */

@keyframes twinkle {
  0%, 100% {
    opacity: .25;
  }

  50% {
    opacity: .9;
  }
}

.animate-twinkle {
  animation: twinkle
    var(--twinkle-duration, 3s)
    ease-in-out infinite;

  animation-delay:
    var(--twinkle-delay, 0s);
}

/* 07. FADE IN */

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.animate-fade-in {
  animation: fade-in .6s ease both;
}

/* 08. FADE UP */

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-up {
  animation: fade-up .7s ease both;
}

/* 09. SLIDE ANIMATIONS */

@keyframes slide-left {
  from {
    opacity: 0;
    transform: translateX(30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slide-right {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-slide-left {
  animation: slide-left .6s ease both;
}

.animate-slide-right {
  animation: slide-right .6s ease both;
}

/* 10. SCALE REVEAL */

@keyframes scale-in {
  from {
    opacity: 0;
    transform: scale(.94);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-scale-in {
  animation: scale-in .45s ease both;
}

/* 11. STAGGERED ENTRANCE */

.stagger-children > * {
  animation: fade-up .65s ease both;
}

.stagger-children > :nth-child(1) {
  animation-delay: .05s;
}

.stagger-children > :nth-child(2) {
  animation-delay: .12s;
}

.stagger-children > :nth-child(3) {
  animation-delay: .19s;
}

.stagger-children > :nth-child(4) {
  animation-delay: .26s;
}

.stagger-children > :nth-child(5) {
  animation-delay: .33s;
}

.stagger-children > :nth-child(6) {
  animation-delay: .40s;
}

/* 12. HOVER EFFECTS */

.hover-lift {
  transition:
    transform .25s ease,
    box-shadow .25s ease,
    border-color .25s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.hover-scale {
  transition: transform .25s ease;
}

.hover-scale:hover {
  transform: scale(1.035);
}

.hover-glow {
  transition: box-shadow .3s ease;
}

.hover-glow:hover {
  box-shadow: 0 0 25px
    var(--accent, #a69aff);
}

/* 13. LOADING ANIMATION */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner {
  width: 28px;
  height: 28px;

  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;

  animation: spin .8s linear infinite;
}

/* 14. SHIMMER EFFECT */

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }

  to {
    background-position: -200% 0;
  }
}

.skeleton {
  border-radius: var(--radius-md);

  background: linear-gradient(
    90deg,
    var(--panel) 25%,
    var(--surface-hover) 50%,
    var(--panel) 75%
  );

  background-size: 200% 100%;

  animation: shimmer 1.8s linear infinite;
}

/* 15. ANIMATION DELAYS */

.delay-100 {
  animation-delay: 100ms;
}

.delay-200 {
  animation-delay: 200ms;
}

.delay-300 {
  animation-delay: 300ms;
}

.delay-500 {
  animation-delay: 500ms;
}

.delay-700 {
  animation-delay: 700ms;
}

/* 16. ANIMATION CONTROLS */

.animation-paused,
.animation-paused *,
.animation-paused::before,
.animation-paused::after {
  animation-play-state: paused !important;
}

.animation-disabled,
.animation-disabled *,
.animation-disabled::before,
.animation-disabled::after {
  animation: none !important;
  transition: none !important;
}

/* 17. ACCESSIBILITY */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .hover-lift:hover,
  .hover-scale:hover {
    transform: none;
  }

}

/* END OF SHARED ANIMATION SYSTEM */
