/* ==========================================================================
   THE NEXUS LOGIC — ANIMATIONS & MICRO-INTERACTIONS
   Hardware-accelerated CSS3 animations & transition engine
   ========================================================================== */

/* 1. KEYFRAME ANIMATIONS */
@keyframes ticker-slide {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes marquee-scroll-ltr {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes marquee-scroll-rtl {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

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

/* 2. SCROLL REVEALS */
.reveal-on-scroll,
.reveal-up {
  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-fade {
  opacity: 0;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity;
}

.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.is-revealed {
  opacity: 1 !important;
  transform: translate(0, 0) !important;
}

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

/* 3. CUSTOM DESKTOP CURSOR */
.nexus-cursor-dot {
  position: fixed;
  top: -4px;
  left: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--cyan-accent);
  box-shadow: 0 0 10px var(--cyan-accent);
  pointer-events: none;
  z-index: 9999;
  transition: opacity 0.2s ease, transform 0.05s linear;
}

.nexus-cursor-ring {
  position: fixed;
  top: -18px;
  left: -18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(0, 140, 255, 0.45);
  pointer-events: none;
  z-index: 9998;
  transition: width 0.25s ease, height 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.nexus-cursor-ring.cursor-hover {
  width: 54px;
  height: 54px;
  top: -27px;
  left: -27px;
  border-color: var(--orange-bright);
  background-color: rgba(255, 114, 0, 0.08);
  box-shadow: 0 0 16px rgba(255, 114, 0, 0.25);
}

.nexus-cursor-dot.cursor-hover-dot {
  background-color: var(--orange-bright);
  box-shadow: 0 0 12px var(--orange-bright);
}

/* 4. PAGE TRANSITION OVERLAY */
#page-transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #020817;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

#page-transition-overlay.is-active {
  opacity: 1;
  pointer-events: all;
}

.transition-spinner {
  width: 40px;
  height: 40px;
  border: 2px solid rgba(0, 140, 255, 0.2);
  border-top-color: var(--cyan-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* 5. 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;
  }

  .reveal-on-scroll,
  .reveal-up,
  .reveal-fade,
  .reveal-left,
  .reveal-right {
    opacity: 1 !important;
    transform: none !important;
  }

  .ticker-track,
  .testimonials-track {
    animation: none !important;
  }

  .nexus-cursor-dot,
  .nexus-cursor-ring {
    display: none !important;
  }
}
