/* ============================================================
   KOJILABS — Animations & Motion Utilities
   
   Keyframe definitions, scroll-triggered reveal classes,
   stagger helpers, hover micro-interactions, and the
   foundational glassmorphism surface styles.
   ============================================================ */


/* ────────────────────────────────────────────────────────────
   K E Y F R A M E S
   ──────────────────────────────────────────────────────────── */

/* Fade in while rising upward — the workhorse entrance. */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Simple opacity fade — for overlays, modals, tooltips. */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes pulseOrange {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}
.pulse-dot {
  display: inline-block;
  animation: pulseOrange 1.5s infinite ease-in-out;
}

/* Slide in from the left edge. */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide in from the right edge. */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale up from slightly smaller — great for cards & modals. */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Gentle pulsing opacity — loading indicators, live badges. */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

/* Horizontal shimmer sweep — skeleton loading states. */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Breathing glow tied to the theme's accent color. */
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px var(--accent-glow);
  }
  50% {
    box-shadow: 0 0 40px var(--accent-glow),
                0 0 60px var(--accent-glow);
  }
}

/* Gentle vertical float — decorative elements, icons. */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}


/* ────────────────────────────────────────────────────────────
   S C R O L L - T R I G G E R E D   R E V E A L
   
   Elements start hidden (.animate-in) and transition to
   their final state when .visible is added via JS
   IntersectionObserver.
   ──────────────────────────────────────────────────────────── */

.animate-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ────────────────────────────────────────────────────────────
   S T A G G E R   D E L A Y S
   
   Apply .stagger-1 through .stagger-6 alongside .animate-in
   for cascading entrance sequences.
   ──────────────────────────────────────────────────────────── */

.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; }


/* ────────────────────────────────────────────────────────────
   H O V E R   M I C R O - I N T E R A C T I O N S
   ──────────────────────────────────────────────────────────── */

/* Lift card upward with a deeper shadow on hover. */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Accent-colored glow ring on hover. */
.hover-glow {
  transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
  box-shadow: 0 0 30px var(--accent-glow);
}


/* ────────────────────────────────────────────────────────────
   G L A S S M O R P H I S M   S U R F A C E S
   
   The signature frosted-glass aesthetic. Two variants:
   • .glass       — raw surface (no radius / shadow)
   • .glass-card  — complete card with radius + shadow
   ──────────────────────────────────────────────────────────── */

.glass {
  -webkit-backdrop-filter: blur(var(--blur-strength));
          backdrop-filter: blur(var(--blur-strength));
  background: var(--blur-tint);
  border: 1px solid var(--surface-border);
}

.glass-card {
  -webkit-backdrop-filter: blur(var(--blur-strength));
          backdrop-filter: blur(var(--blur-strength));
  background: var(--blur-tint);
  border: 1px solid var(--surface-border);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
}

/* ────────────────────────────────────────────────────────────
   ANIMATED COSMIC AMBIENT BACKGROUND
   ──────────────────────────────────────────────────────────── */
.cosmic-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.cosmic-orb--left {
  position: absolute;
  top: 15%;
  left: -150px;
  width: 650px;
  height: 650px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 180, 216, 0.18) 0%, rgba(0, 240, 255, 0.08) 45%, transparent 70%);
  filter: blur(60px);
  animation: floatLeftOrb 16s ease-in-out infinite alternate;
}

.cosmic-orb--right {
  position: absolute;
  top: 20%;
  right: -150px;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(162, 0, 255, 0.2) 0%, rgba(108, 92, 231, 0.1) 45%, transparent 70%);
  filter: blur(70px);
  animation: floatRightOrb 20s ease-in-out infinite alternate;
}

.cosmic-orb--center {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 350px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 210, 255, 0.12) 0%, rgba(162, 0, 255, 0.1) 40%, transparent 70%);
  filter: blur(80px);
  animation: pulseCenterNebula 12s ease-in-out infinite alternate;
}

.cosmic-ring-left {
  position: absolute;
  top: 10%;
  left: -200px;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 240, 255, 0.12);
  box-shadow: 0 0 60px rgba(0, 240, 255, 0.08);
  filter: blur(1px);
  animation: rotateRingLeft 40s linear infinite;
}

.cosmic-ring-right {
  position: absolute;
  top: 15%;
  right: -220px;
  width: 750px;
  height: 750px;
  border-radius: 50%;
  border: 1.5px solid rgba(162, 0, 255, 0.15);
  box-shadow: 0 0 70px rgba(162, 0, 255, 0.1);
  filter: blur(1px);
  animation: rotateRingRight 50s linear infinite reverse;
}

@keyframes floatLeftOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60px, 40px) scale(1.08); }
  100% { transform: translate(-30px, 80px) scale(0.95); }
}

@keyframes floatRightOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-50px, 60px) scale(1.1); }
  100% { transform: translate(40px, -40px) scale(0.92); }
}

@keyframes pulseCenterNebula {
  0% { opacity: 0.6; transform: translateX(-50%) scale(0.95); }
  100% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

@keyframes rotateRingLeft {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes rotateRingRight {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

