/* Axencia.co — Space Theme: Animated Particles & Cosmic Background */

:root {
  --space-bg: #030712;
  --space-star: rgba(255, 255, 255, 0.9);
  --space-particle: rgba(147, 197, 253, 0.6);
  --space-nebula: rgba(59, 130, 246, 0.08);
  --space-glow: rgba(59, 130, 246, 0.15);
}

/* Space canvas container - covers entire viewport */
.space-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: 
    radial-gradient(ellipse 120% 80% at 50% 0%, rgba(30, 58, 95, 0.4) 0%, transparent 50%),
    radial-gradient(ellipse 80% 60% at 80% 80%, rgba(59, 130, 246, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 60% 80% at 20% 90%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    linear-gradient(180deg, #030712 0%, #0a0f1a 40%, #050810 100%);
}

/* Particle layer */
.space-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Individual particles via CSS (fallback + enhancement) */
.space-particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--space-star);
  border-radius: 50%;
  animation: twinkle 3s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

.space-particle:nth-child(1) { left: 5%; top: 10%; animation-delay: 0s; animation-duration: 2.5s; }
.space-particle:nth-child(2) { left: 15%; top: 25%; animation-delay: 0.5s; animation-duration: 3s; }
.space-particle:nth-child(3) { left: 25%; top: 8%; animation-delay: 1s; animation-duration: 2s; }
.space-particle:nth-child(4) { left: 35%; top: 45%; animation-delay: 0.2s; animation-duration: 3.5s; }
.space-particle:nth-child(5) { left: 45%; top: 15%; animation-delay: 0.8s; animation-duration: 2.8s; }
.space-particle:nth-child(6) { left: 55%; top: 60%; animation-delay: 0.3s; animation-duration: 2.2s; }
.space-particle:nth-child(7) { left: 65%; top: 30%; animation-delay: 1.2s; animation-duration: 3.2s; }
.space-particle:nth-child(8) { left: 75%; top: 5%; animation-delay: 0.6s; animation-duration: 2.6s; }
.space-particle:nth-child(9) { left: 85%; top: 50%; animation-delay: 0.4s; animation-duration: 2.9s; }
.space-particle:nth-child(10) { left: 92%; top: 20%; animation-delay: 1.1s; animation-duration: 2.4s; }
.space-particle:nth-child(11) { left: 8%; top: 70%; animation-delay: 0.7s; animation-duration: 3.1s; }
.space-particle:nth-child(12) { left: 40%; top: 85%; animation-delay: 0.1s; animation-duration: 2.7s; }
.space-particle:nth-child(13) { left: 70%; top: 75%; animation-delay: 0.9s; animation-duration: 2.3s; }
.space-particle:nth-child(14) { left: 20%; top: 55%; animation-delay: 0.5s; animation-duration: 3.4s; }
.space-particle:nth-child(15) { left: 60%; top: 40%; animation-delay: 1.3s; animation-duration: 2.1s; }

@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Grid overlay - subtle cosmic grid */
.space-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(59, 130, 246, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.02) 1px, transparent 1px);
  background-size: 80px 80px;
  -webkit-mask-image: radial-gradient(ellipse 100% 80% at 50% 50%, black 20%, transparent 70%);
  mask-image: radial-gradient(ellipse 100% 80% at 50% 50%, black 20%, transparent 70%);
  animation: gridPulse 8s ease-in-out infinite;
}

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

/* Floating orbs - ambient glow */
.space-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.4;
}

.space-orb-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.2) 0%, transparent 70%);
  top: -10%;
  left: -5%;
  animation-delay: 0s;
}

.space-orb-2 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  bottom: -5%;
  right: -5%;
  animation-delay: -4s;
}

.space-orb-3 {
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.12) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -8s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  33% { transform: translate(calc(-50% + 20px), calc(-50% - 30px)) scale(1.05); }
  66% { transform: translate(calc(-50% - 15px), calc(-50% + 20px)) scale(0.95); }
}

.space-orb-1,
.space-orb-2 {
  animation: orbFloatSimple 12s ease-in-out infinite;
}

.space-orb-3 {
  animation: orbFloat 12s ease-in-out infinite;
}

@keyframes orbFloatSimple {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -30px) scale(1.05); }
  66% { transform: translate(-15px, 20px) scale(0.95); }
}

/* Shooting star effect */
.space-shooting-star {
  position: absolute;
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, rgba(255,255,255,0.8), transparent);
  border-radius: 2px;
  animation: shootingStar 6s ease-in-out infinite;
  opacity: 0;
}

@keyframes shootingStar {
  0% { left: -120px; top: 20%; opacity: 0; }
  5% { opacity: 1; }
  15% { left: 100%; top: 25%; opacity: 0; }
  100% { left: 100%; top: 25%; opacity: 0; }
}

.space-shooting-star:nth-child(2) { animation-delay: 3s; top: 40%; }
.space-shooting-star:nth-child(3) { animation-delay: 6s; top: 60%; }

/* Override body for space theme */
body.space-theme {
  background: transparent;
}

body.space-theme .hero-bg,
body.space-theme .page-header {
  background: transparent;
}

body.space-theme .section {
  position: relative;
  z-index: 1;
}

body.space-theme .footer {
  position: relative;
  z-index: 1;
}

/* Hero content elevation for space theme */
body.space-theme .hero-content {
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

body.space-theme .expertise-card,
body.space-theme .testimonial-card,
body.space-theme .plan-card,
body.space-theme .service-item {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}
