/* ==========================================================================
   Plixlify — Fluid Animations & Micro-Interactions
   ========================================================================== */

/* Ambient mesh orb floating keyframes */
@keyframes floatOrb1 {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  50% {
    transform: translate(60px, 45px) scale(1.12) rotate(15deg);
  }
  100% {
    transform: translate(-40px, 70px) scale(0.95) rotate(-10deg);
  }
}

@keyframes floatOrb2 {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  50% {
    transform: translate(-70px, 60px) scale(1.08) rotate(-20deg);
  }
  100% {
    transform: translate(50px, -40px) scale(1.02) rotate(10deg);
  }
}

@keyframes floatOrb3 {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(45px, -65px) scale(1.15);
  }
  100% {
    transform: translate(-55px, -20px) scale(0.92);
  }
}

/* Ambient halo slow rotation and breathing */
@keyframes haloSpinBreath {
  0% {
    transform: translate(-50%, -50%) rotate(0deg) scale(0.96);
    opacity: 0.7;
  }
  50% {
    transform: translate(-50%, -50%) rotate(180deg) scale(1.08);
    opacity: 0.95;
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg) scale(0.96);
    opacity: 0.7;
  }
}

/* Milestone Node entry pop */
@keyframes nodePop {
  0% {
    transform: scale(0.65);
    opacity: 0;
  }
  70% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Phone floating levitation */
@keyframes phoneFloat {
  0% {
    transform: translateY(0px) rotate3d(0, 0, 0, 0deg);
  }
  50% {
    transform: translateY(-12px) rotate3d(1, -1, 0, 1.5deg);
  }
  100% {
    transform: translateY(4px) rotate3d(-1, 1, 0, 1deg);
  }
}

/* Status indicator dot wave pulse */
@keyframes pulseDot {
  0% {
    box-shadow: 0 0 0 0 currentColor;
    opacity: 1;
  }
  70% {
    box-shadow: 0 0 0 7px transparent;
    opacity: 0.9;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
    opacity: 1;
  }
}

/* Live pill beacon animation */
@keyframes liveBeacon {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.35);
    opacity: 0.4;
  }
}

.live-beacon {
  position: relative;
}

.live-beacon::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 9999px;
  background: inherit;
  opacity: 0.5;
  animation: liveBeacon 2s infinite ease-in-out;
  z-index: -1;
}

/* Card entry animation */
@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.animate-card-reveal {
  animation: cardReveal 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Shimmer gleam for special hero badges */
@keyframes lightShimmer {
  0% {
    transform: translateX(-150%) skewX(-20deg);
  }
  100% {
    transform: translateX(200%) skewX(-20deg);
  }
}

.shimmer-badge {
  position: relative;
  overflow: hidden;
}

.shimmer-badge::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  transform: translateX(-150%) skewX(-20deg);
  animation: lightShimmer 5s infinite ease-in-out;
}

/* Dynamic Island bounce when switching screens */
@keyframes islandBounce {
  0% { transform: translateX(-50%) scale(1); }
  40% { transform: translateX(-50%) scale(1.15, 0.85); width: 110px; }
  75% { transform: translateX(-50%) scale(0.95, 1.05); }
  100% { transform: translateX(-50%) scale(1); width: 90px; }
}

.island-animate {
  animation: islandBounce 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Screen transition within the mobile mockup */
.screen-fade-in {
  animation: screenFade 0.35s ease-out forwards;
}

@keyframes screenFade {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Staggered Scroll Reveal Elements with Guaranteed Fail-Safe */
.reveal-on-scroll {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Delay modifiers for smooth cascades */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* Phone Screen Dynamic Specular Reflection */
.phone-mockup-frame::after {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 200%;
  height: 100%;
  background: linear-gradient(
    115deg,
    transparent 0%,
    transparent 40%,
    rgba(255, 255, 255, 0.25) 45%,
    rgba(255, 255, 255, 0.4) 50%,
    rgba(255, 255, 255, 0.15) 55%,
    transparent 60%,
    transparent 100%
  );
  border-radius: 48px;
  pointer-events: none;
  transform: translateX(-100%);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 40;
}

.phone-mockup-frame:hover::after {
  transform: translateX(100%);
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  ::before,
  ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .mesh-blob,
  .phone-mockup-frame {
    animation: none !important;
  }
}

