/*
═══════════════════════════════════════════════════════════════
AEO-REX ANIMATIONS & DYNAMIC EFFECTS
═══════════════════════════════════════════════════════════════
Professional animations for tech-forward brand
Optimized for performance and accessibility
═══════════════════════════════════════════════════════════════
*/

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   ACCESSIBILITY: Respect 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;
  }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   KEYFRAME ANIMATIONS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* Logo Fade In */
@keyframes logoFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Logo Glow Pulse */
@keyframes logoGlow {
  0%, 100% {
    filter: drop-shadow(0 0 10px rgba(0, 243, 255, 0.5));
  }
  50% {
    filter: drop-shadow(0 0 20px rgba(0, 243, 255, 0.8));
  }
}

/* Hero Fade Up */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero Gradient Animation */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Tech Rings Rotation */
@keyframes rotateRing {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Reverse Rotation */
@keyframes rotateRingReverse {
  from {
    transform: rotate(360deg);
  }
  to {
    transform: rotate(0deg);
  }
}

/* CTA Button Pulse */
@keyframes ctaPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 40px rgba(0, 243, 255, 0.8);
    transform: scale(1.02);
  }
}

/* Particle Float */
@keyframes particleFloat {
  0%, 100% {
    transform: translateY(0) translateX(0);
    opacity: 0.3;
  }
  25% {
    transform: translateY(-20px) translateX(10px);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-10px) translateX(-10px);
    opacity: 0.8;
  }
  75% {
    transform: translateY(-30px) translateX(5px);
    opacity: 0.5;
  }
}

/* Circuit Line Animation */
@keyframes circuitPulse {
  0%, 100% {
    opacity: 0.3;
    stroke-dashoffset: 0;
  }
  50% {
    opacity: 1;
    stroke-dashoffset: 200;
  }
}

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

/* Shimmer Effect */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* Card Lift */
@keyframes cardLift {
  from {
    transform: translateY(0);
    box-shadow: 0 4px 20px rgba(0, 243, 255, 0.1);
  }
  to {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 243, 255, 0.3);
  }
}

/* Border Glow */
@keyframes borderGlow {
  0%, 100% {
    box-shadow:
      inset 0 0 10px rgba(0, 243, 255, 0.3),
      0 0 10px rgba(0, 243, 255, 0.2);
  }
  50% {
    box-shadow:
      inset 0 0 20px rgba(0, 243, 255, 0.6),
      0 0 20px rgba(0, 243, 255, 0.4);
  }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   LOGO ANIMATIONS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.logo-animated {
  animation: logoFadeIn 1s ease-out;
  transition: all 0.3s ease;
}

.logo-animated:hover {
  animation: logoGlow 2s ease-in-out infinite;
  transform: scale(1.05);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   HERO SECTION ANIMATIONS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.hero-animated {
  position: relative;
  overflow: hidden;
}

.hero-animated::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(10, 10, 26, 0.95),
    rgba(0, 60, 80, 0.7),
    rgba(0, 243, 255, 0.1),
    rgba(10, 10, 26, 0.95)
  );
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  z-index: 0;
  pointer-events: none;
}

.hero-headline-animated {
  animation: fadeUp 1s ease-out 0.3s backwards;
  position: relative;
  z-index: 1;
}

.hero-subheadline-animated {
  animation: fadeUp 1s ease-out 0.6s backwards;
  position: relative;
  z-index: 1;
}

.hero-cta-animated {
  animation: fadeUp 1s ease-out 0.9s backwards;
  position: relative;
  z-index: 1;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   TECH RINGS BACKGROUND
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.tech-rings-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 800px;
  pointer-events: none;
  opacity: 0.15;
  z-index: 0;
}

.tech-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 2px solid;
  border-color: rgba(0, 243, 255, 0.5);
  transform: translate(-50%, -50%);
}

.tech-ring-1 {
  width: 200px;
  height: 200px;
  animation: rotateRing 20s linear infinite;
  border-style: dashed;
}

.tech-ring-2 {
  width: 400px;
  height: 400px;
  animation: rotateRingReverse 30s linear infinite;
  border-style: dotted;
}

.tech-ring-3 {
  width: 600px;
  height: 600px;
  animation: rotateRing 40s linear infinite;
  border-style: solid;
  opacity: 0.3;
}

.tech-ring-4 {
  width: 800px;
  height: 800px;
  animation: rotateRingReverse 50s linear infinite;
  border-style: dashed;
  opacity: 0.2;
}

/* Mobile: Reduce ring sizes */
@media (max-width: 768px) {
  .tech-rings-container {
    width: 400px;
    height: 400px;
  }

  .tech-ring-1 { width: 100px; height: 100px; }
  .tech-ring-2 { width: 200px; height: 200px; }
  .tech-ring-3 { width: 300px; height: 300px; }
  .tech-ring-4 { width: 400px; height: 400px; }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   BUTTON ANIMATIONS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.btn-animated {
  position: relative;
  transition: all 0.3s ease;
  overflow: hidden;
}

.btn-animated::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.btn-animated:hover::before {
  left: 100%;
}

.btn-animated:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 30px rgba(0, 243, 255, 0.4);
}

.btn-animated:active {
  transform: scale(0.98);
}

/* CTA Button with Pulse */
.btn-cta {
  animation: ctaPulse 3s ease-in-out infinite;
}

.btn-cta:hover {
  animation: none;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   CARD ANIMATIONS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.card-animated {
  transition: all 0.4s ease;
  position: relative;
}

.card-animated:hover {
  transform: translateY(-8px);
  box-shadow:
    0 12px 40px rgba(0, 243, 255, 0.3),
    inset 0 0 20px rgba(0, 243, 255, 0.1);
}

.card-animated::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  border: 2px solid transparent;
  transition: border-color 0.4s ease;
  pointer-events: none;
}

.card-animated:hover::after {
  border-color: rgba(0, 243, 255, 0.5);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   LINK ANIMATIONS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.link-animated {
  position: relative;
  color: #00f3ff;
  text-decoration: none;
  transition: color 0.3s ease;
}

.link-animated::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #00f3ff, #b400ff);
  transition: width 0.3s ease;
}

.link-animated:hover {
  color: #ffffff;
}

.link-animated:hover::after {
  width: 100%;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   FORM INPUT ANIMATIONS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.input-animated {
  position: relative;
  border: 2px solid rgba(0, 243, 255, 0.3);
  transition: all 0.3s ease;
  background: rgba(10, 10, 26, 0.5);
}

.input-animated:focus {
  outline: none;
  border-color: #00f3ff;
  box-shadow:
    0 0 20px rgba(0, 243, 255, 0.3),
    inset 0 0 10px rgba(0, 243, 255, 0.1);
  background: rgba(10, 10, 26, 0.8);
  animation: borderGlow 2s ease-in-out infinite;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   PARTICLE EFFECTS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.particles-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(0, 243, 255, 0.6);
  border-radius: 50%;
  animation: particleFloat 6s ease-in-out infinite;
}

.particle:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; animation-duration: 6s; }
.particle:nth-child(2) { left: 20%; top: 40%; animation-delay: 1s; animation-duration: 7s; }
.particle:nth-child(3) { left: 30%; top: 60%; animation-delay: 2s; animation-duration: 8s; }
.particle:nth-child(4) { left: 40%; top: 80%; animation-delay: 0.5s; animation-duration: 6.5s; }
.particle:nth-child(5) { left: 50%; top: 30%; animation-delay: 1.5s; animation-duration: 7.5s; }
.particle:nth-child(6) { left: 60%; top: 50%; animation-delay: 2.5s; animation-duration: 8.5s; }
.particle:nth-child(7) { left: 70%; top: 70%; animation-delay: 0.8s; animation-duration: 6.8s; }
.particle:nth-child(8) { left: 80%; top: 25%; animation-delay: 1.8s; animation-duration: 7.8s; }
.particle:nth-child(9) { left: 90%; top: 45%; animation-delay: 2.8s; animation-duration: 8.8s; }
.particle:nth-child(10) { left: 15%; top: 65%; animation-delay: 0.3s; animation-duration: 6.3s; }

/* Reduce particles on mobile */
@media (max-width: 768px) {
  .particle:nth-child(n+6) {
    display: none;
  }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   CIRCUIT BOARD DIVIDER
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.circuit-divider {
  position: relative;
  height: 60px;
  width: 100%;
  overflow: hidden;
  background: rgba(10, 10, 26, 0.5);
}

.circuit-line {
  position: absolute;
  height: 2px;
  background: linear-gradient(90deg,
    transparent,
    rgba(0, 243, 255, 0.8),
    transparent
  );
  animation: circuitPulse 3s ease-in-out infinite;
}

.circuit-line-1 {
  top: 20px;
  left: 0;
  width: 40%;
  animation-delay: 0s;
}

.circuit-line-2 {
  top: 40px;
  right: 0;
  width: 60%;
  animation-delay: 1s;
}

.circuit-node {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #00f3ff;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.8);
  animation: ctaPulse 2s ease-in-out infinite;
}

.circuit-node-1 { top: 18px; left: 20%; }
.circuit-node-2 { top: 38px; right: 30%; }
.circuit-node-3 { top: 28px; left: 50%; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   LOADING ANIMATION
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0a0a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-spinner {
  position: relative;
  width: 120px;
  height: 120px;
}

.spinner-ring {
  position: absolute;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #00f3ff;
  animation: spin 1.5s linear infinite;
}

.spinner-ring-1 {
  width: 120px;
  height: 120px;
  border-top-color: #00f3ff;
  animation-duration: 1.5s;
}

.spinner-ring-2 {
  width: 90px;
  height: 90px;
  top: 15px;
  left: 15px;
  border-top-color: #b400ff;
  animation-duration: 2s;
  animation-direction: reverse;
}

.spinner-ring-3 {
  width: 60px;
  height: 60px;
  top: 30px;
  left: 30px;
  border-top-color: #00ff88;
  animation-duration: 1s;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   SMOOTH SCROLL BEHAVIOR
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

html {
  scroll-behavior: smooth;
}

/* Disable smooth scroll if prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   PARALLAX EFFECTS (Subtle)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.parallax-bg {
  transform: translateZ(0);
  will-change: transform;
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   MOBILE OPTIMIZATIONS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

@media (max-width: 768px) {
  /* Reduce animation complexity on mobile */
  .tech-rings-container {
    opacity: 0.08;
  }

  .particles-container {
    opacity: 0.5;
  }

  /* Faster animations on mobile for better performance */
  .hero-animated::before {
    animation-duration: 20s;
  }

  .btn-animated:hover {
    transform: scale(1.02);
  }

  .card-animated:hover {
    transform: translateY(-4px);
  }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   PERFORMANCE OPTIMIZATIONS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* Use GPU acceleration for animations */
.hero-animated,
.tech-rings-container,
.particles-container,
.btn-animated,
.card-animated,
.logo-animated {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Remove will-change after animation completes */
.animation-complete {
  will-change: auto;
}
