/* ==========================================================================
   eboibd.site - Smooth Animations
   Respects prefers-reduced-motion
   ========================================================================== */

/* 1. Hero Book Floating Effect */
@keyframes floatGentle {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-12px) rotate(0.8deg);
  }
}

.animate-float {
  animation: floatGentle 4.5s ease-in-out infinite;
  will-change: transform;
}

/* 2. Yellow Marker Underline Grow Animation */
@keyframes highlightGrow {
  0% {
    transform: scaleX(0);
  }
  100% {
    transform: scaleX(1);
  }
}

.marker-highlight::before {
  transform-origin: left;
  animation: highlightGrow 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
  transform: scaleX(0);
}

/* 3. Primary Button Soft Shine Sweep */
@keyframes shineSweep {
  0% {
    left: -120%;
    opacity: 0;
  }
  30% {
    opacity: 0.6;
  }
  60% {
    left: 140%;
    opacity: 0;
  }
  100% {
    left: 140%;
    opacity: 0;
  }
}

.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -120%;
  width: 60%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent 0%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 100%
  );
  transform: rotate(25deg);
  pointer-events: none;
  animation: shineSweep 4.5s infinite ease-in-out;
}

/* 4. Dark Tilted Marquee Strip Scrolling */
@keyframes marqueeScroll {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-50%);
  }
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marqueeScroll 28s linear infinite;
  will-change: transform;
}

.marquee-strip:hover .marquee-track {
  animation-play-state: paused;
}

/* 5. Scroll Fade & Slide Up (IntersectionObserver) */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

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

/* Stagger delays for children */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }

/* 6. Live Pulse Dot */
@keyframes pulseDot {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.35);
    opacity: 0.6;
  }
}

.pulse-dot {
  animation: pulseDot 2s ease-in-out infinite;
}

/* 7. Spinner */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Accessibility: Prefers Reduced Motion */
@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;
  }
  
  .animate-float {
    animation: none !important;
    transform: none !important;
  }
  
  .marker-highlight::before {
    animation: none !important;
    transform: scaleX(1) !important;
  }
  
  .btn-primary::after {
    display: none !important;
  }
  
  .marquee-track {
    animation: none !important;
    transform: none !important;
  }
  
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
