/* parallax.css — Parallax depth scrolling styles */

/* Base parallax container */
[data-parallax],
[data-parallax-speed],
[data-parallax-offset] {
  transform: translateZ(0);
  will-change: transform;
  transition: transform 0.05s ease-out;
}

/* Speed presets */
[data-parallax="slow"] {
  --parallax-speed: 0.3;
}

[data-parallax="medium"] {
  --parallax-speed: 0.5;
}

[data-parallax="fast"] {
  --parallax-speed: 0.8;
}

/* Container with background parallax */
.parallax-container {
  position: relative;
  overflow: hidden;
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
}

.parallax-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1;
}

/* Parallax image wrapper */
.parallax-image {
  position: relative;
  overflow: hidden;
  height: 100%;
  z-index: 0;
}

.parallax-image img {
  width: 100%;
  height: 120%;
  object-fit: cover;
  object-position: center;
  transform: translateY(0);
}

/* Parallax depth layers */
.parallax-layer {
  position: absolute;
  width: 100%;
  will-change: transform;
}

.parallax-layer-bg {
  z-index: -1;
}

.parallax-layer-mid {
  z-index: 1;
}

.parallax-layer-fg {
  z-index: 2;
}

/* Parallax reveal effect */
.parallax-reveal {
  position: relative;
  overflow: hidden;
}

.parallax-reveal-inner {
  transform: translateY(0);
  will-change: transform;
}

/* Parallax scroll indicators */
.parallax-scroll-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  animation: parallax-bounce 2s ease-in-out infinite;
}

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

/* Mobile: disable fixed backgrounds (performance) */
@media (max-width: 768px) {
  .parallax-container {
    background-attachment: scroll;
  }

  [data-parallax],
  [data-parallax-speed],
  [data-parallax-offset] {
    transform: none;
  }
}

/* Reduce motion: disable parallax */
@media (prefers-reduced-motion: reduce) {
  [data-parallax],
  [data-parallax-speed],
  [data-parallax-offset],
  .parallax-reveal-inner,
  .parallax-image img {
    transform: none !important;
    will-change: auto;
    transition: none;
  }

  .parallax-scroll-hint {
    animation: none;
  }

  .parallax-container {
    background-attachment: scroll;
  }
}

/* Prevent layout shift */
[data-parallax],
[data-parallax-speed],
[data-parallax-offset] {
  transform-origin: center;
  backface-visibility: hidden;
}
