/**
 * Parallax CSS - GPU-accelerated transforms
 * Optimized for performance and Core Web Vitals
 */

/* Base parallax element styles */
[data-parallax] {
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  perspective: 1000px;
}

/* Parallax container for background elements */
.parallax-container {
  position: relative;
  overflow: hidden;
}

.parallax-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 120%; /* Extra height for parallax movement */
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  z-index: -1;
}

/* Hero section parallax backgrounds */
.hero-parallax-bg {
  position: absolute;
  top: -10%;
  left: 0;
  width: 100%;
  height: 120%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  z-index: -1;
}

/* Decorative elements with parallax */
.parallax-decoration {
  position: absolute;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  pointer-events: none;
}

/* Performance optimizations */
.parallax-optimized {
  contain: layout style paint;
  transform: translateZ(0);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  [data-parallax],
  .parallax-bg,
  .hero-parallax-bg,
  .parallax-decoration {
    transform: none !important;
    will-change: auto;
  }
}

/* Mobile optimizations */
@media (max-width: 768px) {
  [data-parallax] {
    /* Reduce parallax intensity on mobile */
    transform: translate3d(0, 0, 0);
  }
  
  .parallax-bg,
  .hero-parallax-bg {
    /* Simpler transforms on mobile */
    transform: translate3d(0, 0, 0);
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .parallax-bg,
  .hero-parallax-bg {
    opacity: 0.8;
  }
}

/* Print styles - disable parallax */
@media print {
  [data-parallax],
  .parallax-bg,
  .hero-parallax-bg,
  .parallax-decoration {
    transform: none !important;
    position: static !important;
  }
}
