/* ===========================
   ANIMAZIONI KEYFRAMES
=========================== */

@keyframes gridPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(10px); }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 10px rgba(74, 184, 232, 0.2);
  }
  50% {
    box-shadow: 0 0 30px rgba(74, 184, 232, 0.5);
  }
}

@keyframes lineGrow {
  from { height: 0; }
  to { height: 100%; }
}

@keyframes counterUp {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes floatY {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
}

/* ===========================
   SCROLL REVEAL
=========================== */

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

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

.reveal.scale {
  transform: scale(0.9);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0) translateX(0) scale(1);
}

/* Stagger delays */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* ===========================
   HERO ENTRY ANIMATIONS
=========================== */

.hero-badge {
  animation: fadeInUp 0.8s ease 0.2s both;
}

.hero h1 {
  animation: fadeInUp 0.8s ease 0.4s both;
}

.hero-subtitle {
  animation: fadeInUp 0.8s ease 0.6s both;
}

.hero-cta {
  animation: fadeInUp 0.8s ease 0.8s both;
}

.hero-stats {
  animation: fadeInUp 0.8s ease 1s both;
}

/* ===========================
   PARTICLES HERO BG
=========================== */

.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: floatY 6s ease-in-out infinite;
}

/* ===========================
   NAVBAR ACTIVE LINK
=========================== */

.nav-links a.active {
  color: var(--blue);
}

.nav-links a.active::after {
  width: 100%;
}

/* ===========================
   LOADING STATE BTN
=========================== */

.btn.loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn.loading::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-left: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===========================
   SVG HERO ANIMATIONS
=========================== */

@keyframes svgRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes shieldGlow {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(74,184,232,0.3)); }
  50%       { filter: drop-shadow(0 0 18px rgba(74,184,232,0.7)); }
}

@keyframes nodePulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50%       { opacity: 1;   transform: scale(1.15); }
}

.svg-orbit-slow {
  transform-origin: 240px 240px;
  animation: svgRotate 28s linear infinite;
}

.svg-orbit-med {
  transform-origin: 240px 240px;
  animation: svgRotate 14s linear infinite reverse;
}

.svg-scan {
  transform-origin: 240px 240px;
  animation: svgRotate 5s linear infinite;
}

.svg-shield {
  animation: shieldGlow 3.5s ease-in-out infinite;
}

.svg-node {
  animation: nodePulse 3s ease-in-out infinite;
}
.svg-node:nth-child(2) { animation-delay: 0.5s; }
.svg-node:nth-child(3) { animation-delay: 1s; }
.svg-node:nth-child(4) { animation-delay: 1.5s; }
.svg-node:nth-child(5) { animation-delay: 2s; }
.svg-node:nth-child(6) { animation-delay: 2.5s; }

/* ===========================
   CITY SVG ANIMATIONS
=========================== */

@keyframes cityHubPulse {
  0%, 100% { r: 5; opacity: 0.6; }
  50%       { r: 7; opacity: 1; }
}

@keyframes cityBlink {
  0%, 80%, 100% { opacity: 1; }
  90%           { opacity: 0.1; }
}

.city-hub {
  animation: nodePulse 2.8s ease-in-out infinite;
}

.city-blink {
  animation: cityBlink 3s ease-in-out infinite;
}

.city-blink-orange {
  animation: cityBlink 2.2s ease-in-out infinite;
}

/* ===========================
   RADAR SVG ANIMATIONS
=========================== */

.radar-sweep {
  transform-origin: 160px 160px;
  animation: svgRotate 4s linear infinite;
}

@keyframes radarBlip {
  0%, 60%, 100% { opacity: 0; transform: scale(0.5); }
  70%           { opacity: 1; transform: scale(1.4); }
  85%           { opacity: 0.6; transform: scale(1); }
}

.radar-blip {
  animation: radarBlip 4s ease-in-out infinite;
}

/* ===========================
   BUILDING BLUEPRINT ANIMATIONS
=========================== */

@keyframes camSweepAnim {
  0%   { transform: rotate(-22deg); }
  100% { transform: rotate(26deg); }
}

.cam-l-sweep {
  transform-box: fill-box;
  transform-origin: 0% 0%;
  animation: camSweepAnim 3.2s ease-in-out infinite alternate;
}

.cam-r-sweep {
  transform-box: fill-box;
  transform-origin: 100% 0%;
  animation: camSweepAnim 3.2s ease-in-out 1.6s infinite alternate;
}
