/* Performance-Optimized Fractal Background System */

.performance-fractal-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  pointer-events: none;
  opacity: 0.15;
  transition: opacity 0.5s ease;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  filter: blur(0.5px);
}

[data-theme="dark"] .performance-fractal-canvas {
  opacity: 0.2;
}

/* Section-specific opacity */
.performance-fractal-canvas.hero {
  opacity: 0.08;
}

.performance-fractal-canvas.mission {
  opacity: 0.06;
}

.performance-fractal-canvas.features {
  opacity: 0.04;
}

.performance-fractal-canvas.platforms {
  opacity: 0.06;
}

.performance-fractal-canvas.download {
  opacity: 0.08;
}

/* Performance optimizations for animations */
.feature-card,
.platform-card,
.mission-point,
.btn,
.terminal-window {
  will-change: transform;
  transform: translateZ(0); /* Hardware acceleration */
}

/* Optimized hover effects */
.feature-card:hover,
.platform-card:hover,
.mission-point:hover {
  transform: 
    translateY(-8px) 
    scale(1.02)
    translateZ(0);
  box-shadow: 
    0 15px 30px -8px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(14, 165, 233, 0.2);
}

/* Disable complex push effects on low-performance devices */
@media (max-width: 1024px), (max-height: 768px) {
  .features-grid:hover .feature-card:not(:hover),
  .platforms-grid:hover .platform-card:not(:hover),
  .mission-points:hover .mission-point:not(:hover) {
    transform: none;
    opacity: 1;
    filter: none;
  }
}

/* Optimized text shine animation */
@keyframes text-shine-optimized {
  0%, 100% {
    background-position: -200% center;
  }
  50% {
    background-position: 200% center;
  }
}

.title-gradient {
  background: linear-gradient(
    90deg,
    var(--primary-500),
    var(--accent-1),
    var(--accent-4),
    var(--primary-500)
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: text-shine-optimized 12s ease-in-out infinite; /* Slower animation */
}

/* Performance-first media queries */
@media (prefers-reduced-motion: reduce) {
  .performance-fractal-canvas,
  .title-gradient,
  .feature-card,
  .platform-card,
  .mission-point,
  .btn,
  .terminal-window {
    animation: none !important;
  }
  
  .feature-card:hover,
  .platform-card:hover,
  .mission-point:hover,
  .btn:hover {
    transform: none !important;
  }
}

/* Low-performance device optimizations */
@media (max-width: 768px), (max-height: 667px) {
  .performance-fractal-canvas {
    display: none; /* Hide fractal background on mobile/low-res devices */
  }
  
  .title-gradient {
    animation: none; /* Disable text shine on mobile */
  }
  
  .feature-card:hover,
  .platform-card:hover,
  .mission-point:hover {
    transform: translateY(-4px); /* Reduced hover effect */
    box-shadow: 
      0 8px 20px -4px rgba(0, 0, 0, 0.2),
      0 0 0 1px rgba(14, 165, 233, 0.15);
  }
}

/* High-performance optimizations */
@media (min-width: 1200px) and (min-height: 800px) {
  .performance-fractal-canvas {
    opacity: 0.12; /* Slightly more visible on high-res screens */
  }
}

/* GPU-intensive effect disabling for low-end devices */
.low-performance-mode .feature-card,
.low-performance-mode .platform-card,
.low-performance-mode .mission-point {
  transform-style: flat;
  transform: none;
}

.low-performance-mode .feature-card:hover,
.low-performance-mode .platform-card:hover,
.low-performance-mode .mission-point:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}