/* Apple-style pinned scroll-zoom for the home page hero.
   Self-contained. Safe to remove: delete this file, hero-zoom.js, and the
   small index.html wrapper/classes to roll back. */

/* The existing site sets overflow-x: hidden on html/body, which can prevent
   position:sticky from working. overflow-x: clip keeps the same overflow
   behavior in modern browsers without breaking a sticky pin. The JS also
   pins with position:fixed as a reliable fallback. */
html, body {
  overflow-x: clip;
  max-width: 100%;
}

.hero-zoom {
  --hero-zoom-track: 200vh; /* ~2 screen heights; ~1 extra screen of pin */
  position: relative;
  height: var(--hero-zoom-track);
}

.hero-zoom__sticky {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 1;
}

.hero-zoom__sticky.is-fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 100vh;
}

.hero-zoom__sticky.is-released {
  position: absolute;
  top: auto;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100vh;
}

.hero-zoom__media,
.hero-zoom__image {
  overflow: hidden;
}

.hero-zoom__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  transform-origin: 50% 42%;
  will-change: transform;
  backface-visibility: hidden;
}

.hero-zoom__deepen {
  background: #000;
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}

.hero-zoom__content {
  will-change: transform, opacity;
}

/* Shorter pin and lighter motion on phones */
@media (max-width: 767px) {
  .hero-zoom {
    --hero-zoom-track: 150vh;
  }
}

/* No zoom / pin when the visitor prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .hero-zoom {
    height: auto;
  }

  .hero-zoom__sticky,
  .hero-zoom__sticky.is-fixed,
  .hero-zoom__sticky.is-released {
    position: relative;
    top: auto;
    bottom: auto;
    left: auto;
    right: auto;
    width: auto;
    height: 100vh;
  }

  .hero-zoom__image {
    transform: none !important;
    will-change: auto;
  }

  .hero-zoom__deepen {
    opacity: 0 !important;
    will-change: auto;
  }

  .hero-zoom__content {
    transform: none !important;
    opacity: 1 !important;
    will-change: auto;
    pointer-events: auto !important;
  }
}
