/* ==========================================================================
   PANGLOBE PHARMA ANIMATIONS & 3D MOTION CHOREOGRAPHY
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. SCROLL ENTRY REVEALS (Driven by IntersectionObserver)
   -------------------------------------------------------------------------- */
.reveal-fade-up {
  opacity: 0;
  transform: translateY(32px);
  filter: blur(4px);
  transition: opacity 0.75s var(--ease-spring), transform 0.75s var(--ease-spring), filter 0.75s var(--ease-spring);
  will-change: opacity, transform, filter;
}

.reveal-fade-in {
  opacity: 0;
  transition: opacity 0.75s var(--ease-spring);
  will-change: opacity;
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.75s var(--ease-spring), transform 0.75s var(--ease-spring);
  will-change: opacity, transform;
}

.reveal-fade-left {
  opacity: 0;
  transform: translateX(-36px);
  transition: opacity 0.75s var(--ease-spring), transform 0.75s var(--ease-spring);
  will-change: opacity, transform;
}

.reveal-fade-right {
  opacity: 0;
  transform: translateX(36px);
  transition: opacity 0.75s var(--ease-spring), transform 0.75s var(--ease-spring);
  will-change: opacity, transform;
}

/* In-View Active State */
.is-revealed {
  opacity: 1 !important;
  transform: translate(0, 0) scale(1) !important;
  filter: blur(0px) !important;
}

/* Stagger Delays */
.delay-100 { transition-delay: 80ms; }
.delay-200 { transition-delay: 160ms; }
.delay-300 { transition-delay: 240ms; }
.delay-400 { transition-delay: 320ms; }
.delay-500 { transition-delay: 400ms; }
.delay-600 { transition-delay: 480ms; }
.delay-700 { transition-delay: 560ms; }
.delay-800 { transition-delay: 640ms; }

/* --------------------------------------------------------------------------
   2. 3D TILT & PERSPECTIVE STYLES
   -------------------------------------------------------------------------- */
.tilt-3d {
  transform-style: preserve-3d;
  transition: transform 0.15s ease-out;
  will-change: transform;
  position: relative;
}

.tilt-3d-child {
  transform: translateZ(24px);
  transition: transform 0.15s ease-out;
}

.tilt-glare {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.45) 0%, transparent 65%);
  opacity: 0;
  mix-blend-mode: overlay;
  transition: opacity 0.3s ease;
  z-index: 10;
}

/* --------------------------------------------------------------------------
   3. BADGE FLIP ANIMATION
   -------------------------------------------------------------------------- */
.flip-card {
  perspective: 1000px;
}

.flip-card-inner {
  transition: transform 0.8s var(--ease-spring);
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-front, .flip-back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flip-back {
  transform: rotateY(180deg);
  position: absolute;
  inset: 0;
}

/* --------------------------------------------------------------------------
   4. PULSING MARKERS & SHINE SWEEP
   -------------------------------------------------------------------------- */
.pulse-circle {
  animation: pulse-ring 2.5s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
  transform-origin: center;
}

@keyframes pulse-ring {
  0% { transform: scale(0.8); opacity: 0.8; }
  50% { transform: scale(1.6); opacity: 0.2; }
  100% { transform: scale(2.2); opacity: 0; }
}

.shine-sweep {
  position: relative;
  overflow: hidden;
}

.shine-sweep::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 20%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  transform: rotate(25deg);
  pointer-events: none;
  animation: shine-sweep-loop 6s infinite ease-in-out;
}

@keyframes shine-sweep-loop {
  0%, 70% { left: -60%; }
  100% { left: 140%; }
}

/* 404 Airplane Motion */
@keyframes plane-fly {
  0% { transform: translate(-100px, 40px) rotate(-5deg); }
  50% { transform: translate(50vw, -20px) rotate(5deg); }
  100% { transform: translate(110vw, 40px) rotate(-2deg); }
}

.plane-animation {
  animation: plane-fly 14s infinite linear;
}

/* --------------------------------------------------------------------------
   5. REDUCED MOTION (PRD Section 7 & 10.2)
   -------------------------------------------------------------------------- */
@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;
  }
  
  .reveal-fade-up,
  .reveal-fade-in,
  .reveal-scale,
  .reveal-fade-left,
  .reveal-fade-right {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  
  .marquee-content {
    animation: none !important;
  }
  
  .floating-card {
    animation: none !important;
  }
  
  .hero-blob {
    display: none !important;
  }
}
