/* Nov 28, 2026: homepage hero parallax and light scroll effects.
   Transform/opacity only (GPU friendly, no layout shift). Everything is off under
   prefers-reduced-motion. Hidden-until-revealed states only apply under .js, like style.css.
   Loaded only on the homepage (index.php sets $extraCss). */

/* ---- 1. Gentle hero parallax on the still photo ----
   The current hero <img> stays the LCP image: it is in the HTML, preloaded, and never
   hidden or delayed. JS sets --py as you scroll (translate only). The photo is scaled
   slightly so a translate never shows a gap at the edges. This also turns off the
   20s Ken Burns zoom in style.css, which would fight the same transform.
   --py defaults to 0, so the first paint is a still, slightly closer crop (1.14x). */
.hero__media img {
    animation: none;
    transform: translate3d(0, var(--py, 0px), 0) scale(1.14);
    will-change: transform;
}

/* Hero words rise in one after another on load (the photo itself is never delayed). */
.js .hero__content > * { animation: fx-rise 0.9s var(--ease, cubic-bezier(.2,.7,.2,1)) both; }
.js .hero__content > :nth-child(1) { animation-delay: 0.10s; }
.js .hero__content > :nth-child(2) { animation-delay: 0.22s; }
.js .hero__content > :nth-child(3) { animation-delay: 0.34s; }
.js .hero__content > :nth-child(4) { animation-delay: 0.46s; }
.js .hero__content > :nth-child(5) { animation-delay: 0.58s; }
@keyframes fx-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---- 2. Slide-ins (extends the existing data-reveal fade-up) ---- */
.js [data-reveal].fx-left  { transform: translateX(-28px); }
.js [data-reveal].fx-right { transform: translateX(28px); }
.js [data-reveal].fx-left.is-visible,
.js [data-reveal].fx-right.is-visible { transform: none; }
@media (max-width: 700px) {   /* phones: gentler, mostly vertical */
    .js [data-reveal].fx-left, .js [data-reveal].fx-right { transform: translateY(16px); }
}

/* ---- 3. Slow zoom on gallery photos as they enter the view ----
   Photo starts 1.14x and eases to 1.0x while its frame fades in (frame is overflow:hidden). */
.js .editorial-grid .eg-media img,
.js .styles-row__item img { transform: scale(1.14); transition: transform 2.2s cubic-bezier(.16,.7,.2,1); will-change: transform; }
.js .editorial-grid [data-reveal].is-visible .eg-media img,
.js .styles-row__item.is-visible img { transform: scale(1); }
.js .editorial-grid [data-reveal].is-visible a:hover .eg-media img,
.js .editorial-grid a:hover img { transform: scale(1.04); }
.styles-row__item { overflow: hidden; }

/* ---- 4. Light parallax on the big "after dark" photo ----
   JS sets --py (about -24px..24px) while the photo is on screen. Photo is scaled 1.16 so the frame never shows an edge. */
.night__main .bh-photo img { transform: translate3d(0, var(--py, 0px), 0) scale(1.16); will-change: transform; }

@media (prefers-reduced-motion: reduce) {
    .hero__media img { animation: none; transform: none; will-change: auto; }
    .js [data-reveal].fx-left, .js [data-reveal].fx-right { transform: none; }
    .js .editorial-grid .eg-media img, .js .styles-row__item img { transform: none; will-change: auto; }
    .night__main .bh-photo img { transform: none; will-change: auto; }
    .js .hero__content > * { animation: none; }
}
