/* ── Motion ─────────────────────────────────────────────────
   .js-reveal is set in <head> only when IntersectionObserver is available
   and the visitor hasn't asked for reduced motion, so nothing is ever hidden
   without a way to bring it back. Hidden states use :not(.is-revealed) so
   revealed elements fall back to their normal styles. Reveals use the
   individual translate/scale properties so they never fight a component's
   own transform (e.g. button press states).

   data-reveal values:
     ""          fade up (fade down when re-entering from above)
     "drop"      fade down from above
     "wipe-ltr"  image wipes in left to right (watched through its parent)
     "wipe-rtl"  image wipes in right to left (watched through its parent)
     "zoom"      image fades up from a slight zoom (watched through its parent)
     "line"      rule draws across from the left
   main.js staggers elements that enter together via --reveal-delay. */

.js-reveal [data-reveal] {
  transition:
    opacity 0.9s var(--ease-out),
    translate 0.9s var(--ease-out);
  transition-delay: var(--reveal-delay, 0s);
}

.js-reveal [data-reveal]:not(.is-revealed) {
  opacity: 0;
  translate: 0 1.5rem;
}

.js-reveal [data-reveal=""][data-from="above"]:not(.is-revealed) {
  translate: 0 -1.5rem;
}

.js-reveal [data-reveal="drop"]:not(.is-revealed) {
  translate: 0 -1rem;
}

/* Buttons keep their own hover/press transitions, undelayed */
.js-reveal .btn[data-reveal] {
  transition:
    opacity 0.9s var(--ease-out),
    translate 0.9s var(--ease-out),
    transform 0.2s,
    color 0.45s var(--ease-in-out),
    border-color 0.3s;
  transition-delay: var(--reveal-delay, 0s), var(--reveal-delay, 0s), 0s, 0s, 0s;
}

.js-reveal [data-reveal^="wipe"] {
  transition:
    clip-path 1.6s cubic-bezier(0.77, 0, 0.18, 1),
    scale 2.2s var(--ease-out),
    opacity 1.2s ease-out;
}

.js-reveal [data-reveal^="wipe"]:not(.is-revealed) {
  opacity: 0.5;
  translate: 0 var(--parallax, 0px);
  scale: 1.15;
}

.js-reveal [data-reveal="wipe-ltr"]:not(.is-revealed) {
  clip-path: inset(0 100% 0 0);
}

.js-reveal [data-reveal="wipe-rtl"]:not(.is-revealed) {
  clip-path: inset(0 0 0 100%);
}

.js-reveal [data-reveal="zoom"] {
  transition:
    opacity 1.6s ease-out,
    scale 2.4s var(--ease-out);
}

.js-reveal [data-reveal="zoom"]:not(.is-revealed) {
  translate: 0 var(--parallax, 0px);
  scale: 1.2;
}

.js-reveal [data-reveal="line"] {
  transform-origin: left;
  transition: scale 1.4s cubic-bezier(0.77, 0, 0.18, 1);
  transition-delay: var(--reveal-delay, 0s);
}

.js-reveal [data-reveal="line"]:not(.is-revealed) {
  opacity: 1;
  translate: none;
  scale: 0 1;
}

/* Hero photo settles in on load */
.js-reveal .hero__image img,
.js-reveal .inner-hero__figure img {
  animation: hero-settle 2.4s var(--ease-out) both;
}

@keyframes hero-settle {
  from {
    opacity: 0;
    scale: 1.12;
  }
  to {
    opacity: 1;
    scale: 1;
  }
}

/* The address card slides in after the photo */
.js-reveal .address-card {
  animation: card-in 1.2s var(--ease-out) 0.6s both;
}

/* Animates transform, not translate, so the card's hover lift still works
   once the animation has filled. */
@keyframes card-in {
  from {
    opacity: 0;
    transform: translateX(-2rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Parallax: images are oversized so the shift never exposes an edge.
   main.js writes --parallax and clamps it to the overhang. */
.js-reveal [data-parallax] {
  top: -15%;
  height: 130%;
  translate: 0 var(--parallax, 0px);
  will-change: translate;
}

/* Hero copy drifts up and fades as you scroll past */
.js-reveal .hero__content,
.js-reveal .inner-hero__content {
  opacity: calc(1 - var(--hero-progress, 0) * 1.4);
  translate: 0 calc(var(--hero-progress, 0) * -6rem);
}
