/* ============================================================
   n8gency — Animations & Reveal System
   ============================================================ */

/* ── Keyframes ── */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(32px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-32px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-32px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(32px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.88);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

@keyframes floatY {

  0%,
  100% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-14px);
  }
}

@keyframes floatYAlt {

  0%,
  100% {
    transform: translateY(-8px);
  }

  50% {
    transform: translateY(8px);
  }
}

@keyframes pulseGlow {

  0%,
  100% {
    box-shadow: 0 0 20px rgba(79, 110, 247, 0.2);
  }

  50% {
    box-shadow: 0 0 50px rgba(79, 110, 247, 0.5);
  }
}

@keyframes pulseDot {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.5);
    opacity: 0.7;
  }
}

@keyframes spinSlow {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes orb {
  0% {
    transform: translate(0, 0) scale(1);
  }

  25% {
    transform: translate(30px, -20px) scale(1.03);
  }

  50% {
    transform: translate(-10px, 25px) scale(0.97);
  }

  75% {
    transform: translate(-25px, -10px) scale(1.02);
  }

  100% {
    transform: translate(0, 0) scale(1);
  }
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% center;
  }

  100% {
    background-position: 200% center;
  }
}

@keyframes borderGlow {

  0%,
  100% {
    border-color: rgba(59, 130, 246, 0.2);
  }

  50% {
    border-color: rgba(59, 130, 246, 0.6);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-60px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(60px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-8px);
  }

  60% {
    transform: translateY(-4px);
  }
}

/* ── Applied Animations ── */

/* Gradient text — animated shift */
.gradient-text {
  background-size: 200% auto;
  animation: gradientShift 4s ease infinite;
}

/* Orbs in hero */
.orb-1 {
  animation: orb 18s ease-in-out infinite;
}

.orb-2 {
  animation: orb 14s ease-in-out infinite reverse;
  animation-delay: -5s;
}

.orb-3 {
  animation: orb 22s ease-in-out infinite;
  animation-delay: -10s;
}

/* Floating tech badges */
.tech-badge:nth-child(1) {
  animation: floatY 4s ease-in-out infinite;
}

.tech-badge:nth-child(2) {
  animation: floatY 5s ease-in-out infinite;
  animation-delay: -1.5s;
}

.tech-badge:nth-child(3) {
  animation: floatY 3.5s ease-in-out infinite;
  animation-delay: -3s;
}

.tech-badge:nth-child(4) {
  animation: floatYAlt 4.5s ease-in-out infinite;
  animation-delay: -0.8s;
}

/* Typing cursor blink */
.typed-cursor {
  animation: blink 0.7s ease infinite;
}

/* Pulse dot (live indicator) */
.tech-badge-dot {
  animation: pulseDot 2s ease-in-out infinite;
}

/* ── Scroll Reveal System ── */

/* Elements start hidden */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.reveal-left {
  transform: translateX(-40px);
}

.reveal.reveal-right {
  transform: translateX(40px);
}

.reveal.reveal-scale {
  transform: scale(0.9);
  opacity: 0;
}

/* When in viewport — added by JS */
.reveal.in-view {
  opacity: 1;
  transform: translate(0) scale(1);
}

/* Stagger delays */
.reveal.stagger-1 {
  transition-delay: 0.1s;
}

.reveal.stagger-2 {
  transition-delay: 0.2s;
}

.reveal.stagger-3 {
  transition-delay: 0.3s;
}

.reveal.stagger-4 {
  transition-delay: 0.4s;
}

.reveal.stagger-5 {
  transition-delay: 0.5s;
}

.reveal.stagger-6 {
  transition-delay: 0.6s;
}

/* ── Hero Entrance Animations ── */
.hero-pretitle {
  animation: fadeInUp 0.7s ease forwards;
}

.hero-title {
  animation: fadeInUp 0.7s 0.15s ease both;
}

.hero-sub {
  animation: fadeInUp 0.7s 0.3s ease both;
}

.hero-cta-row {
  animation: fadeInUp 0.7s 0.45s ease both;
}

.hero-trust {
  animation: fadeInUp 0.7s 0.6s ease both;
}

/* On initial load all above start invisible (animation handles it via "both") */
.hero-pretitle,
.hero-title,
.hero-sub,
.hero-cta-row,
.hero-trust {
  opacity: 0;
}

/* After page load, set opacity to auto (animation's "both" fill handles it) */
body.loaded .hero-pretitle,
body.loaded .hero-title,
body.loaded .hero-sub,
body.loaded .hero-cta-row,
body.loaded .hero-trust {
  opacity: 1;
}

/* ── Utility Animation Classes ── */
.animate-float {
  animation: floatY 4s ease-in-out infinite;
}

.animate-pulse-glow {
  animation: pulseGlow 3s ease-in-out infinite;
}

.animate-spin-slow {
  animation: spinSlow 20s linear infinite;
}

.animate-bounce {
  animation: bounce 2s ease infinite;
}

/* Loading shimmer (for placeholder states) */
.shimmer {
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0.04) 25%,
      rgba(255, 255, 255, 0.1) 50%,
      rgba(255, 255, 255, 0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* ── Page Transition ── */
.page-fade {
  animation: fadeInUp 0.5s ease forwards;
}

/* ── Hover Effects ── */
.hover-lift {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hover-lift:hover {
  transform: translateY(-6px);
}

.hover-glow:hover {
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }
}