/* ---------- motion system ----------
   One orchestrated moment: the hero opens through vertical louvres (the facade's fins).
   Everything else is quiet: soft reveals and responses to user actions.
*/
@keyframes cue { 0% { transform: translateY(-100%); } 60%, 100% { transform: translateY(260%); } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(202, 133, 76, .55); } 70%, 100% { box-shadow: 0 0 0 16px rgba(202, 133, 76, 0); } }
@keyframes louvre { to { transform: scaleX(0); } }
@keyframes settle { from { transform: scale(1.12); } to { transform: scale(1); } }
@keyframes rise { from { transform: translateY(105%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.js .hero .louvres span { animation: louvre 1.25s var(--ease-out) both; animation-delay: calc(var(--i) * 55ms + .15s); }
.js .hero__media img { animation: settle 3.2s var(--ease-out) both; }
.js .hero__title .line > span { animation: rise 1.1s var(--ease-out) both; animation-delay: calc(.9s + var(--i, 0) * .12s); }
.js .hero__sub, .js .hero__foot { animation: fade 1.2s var(--ease) both; animation-delay: 1.5s; }
.js .hero .scroll-cue { animation: fade 1s var(--ease) both; animation-delay: 2.2s; }
.no-js .louvres { display: none; }

/* reveal on scroll (added by JS only, so content is visible without JS) */
.js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1.1s var(--ease-out); transition-delay: calc(var(--d, 0) * 90ms); }
.js [data-reveal].is-in { opacity: 1; transform: none; }


@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .louvres { display: none; }
  .js [data-reveal], .js [data-reveal="clip"] { opacity: 1; transform: none; clip-path: none; }
  .teaser__visual .dot, .scroll-cue::after { animation: none; }
}

/* ======================================================
   Image motion layer (js/image-fx.js)
   ====================================================== */
.js [data-reveal="clip"] { opacity: 1; transform: none; }

.ir { display: block; position: relative; overflow: hidden; height: 100%; isolation: isolate; }
.ir img {
  display: block;
  translate: 0 var(--py, 0%);
  scale: var(--ir-base, 1);
  transition: scale 1.6s var(--ease-out), filter 1.2s var(--ease);
  will-change: scale, translate;
}
.ir--px { --ir-base: 1.12; }

/* 1 · unveil: the image lifts open from the bottom behind a copper line, settling from a gentle zoom */
.has-ir .ir:not(.is-shown) img {
  clip-path: inset(100% 0 0 0);
  scale: calc(var(--ir-base, 1) * 1.22);
  filter: saturate(.55) brightness(.82);
}
.has-ir .ir.is-shown:not(.is-done) img {
  transition: clip-path 1.45s cubic-bezier(.77, 0, .18, 1), scale 2.3s cubic-bezier(.16, 1, .3, 1), filter 1.8s var(--ease);
}
.has-ir .ir.is-shown img { clip-path: inset(0 0 0 0); }
.ir::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 1px; z-index: 2;
  background: linear-gradient(90deg, transparent, var(--copper) 18%, #F3C79B 50%, var(--copper) 82%, transparent);
  box-shadow: 0 0 18px 2px rgba(202, 133, 76, .55);
  opacity: 0; pointer-events: none;
}
.has-ir .ir.is-shown:not(.is-done)::after { animation: ir-line 1.45s cubic-bezier(.77, 0, .18, 1) both; }
@keyframes ir-line {
  0% { top: 100%; opacity: 0; }
  12% { opacity: 1; }
  85% { opacity: 1; }
  100% { top: 0%; opacity: 0; }
}
/* transparent cutaways: fade and rise instead of a hard clip */
.has-ir .ir--alpha:not(.is-shown) img { clip-path: none; opacity: 0; translate: 0 6%; }
.has-ir .ir--alpha.is-shown:not(.is-done) img { transition: opacity 1.4s var(--ease), translate 1.8s var(--ease-out), scale 2.2s var(--ease-out), filter 1.6s; }
.ir--alpha::after { display: none; }

/* 2 · hover: slow, deliberate push-in with a soft warm sheen on clickable images */
.ir--link::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 236, 214, .22) 48%, transparent 62%);
  translate: -120% 0; transition: translate 1.4s var(--ease-out);
}
@media (hover: hover) {
  .ir--link:hover img, a:hover > .ir--link img, button:hover > .ir--link img { scale: calc(var(--ir-base, 1) * 1.07); filter: saturate(1.08) contrast(1.03); }
  .ir--link:hover::before, a:hover > .ir--link::before, button:hover > .ir--link::before { translate: 120% 0; }
  .ir--link { cursor: none; }
}
.ir--link:focus-within img { scale: calc(var(--ir-base, 1) * 1.04); }

/* "View" cursor */
.view-cursor {
  position: fixed; left: 0; top: 0; z-index: 400; pointer-events: none;
  width: 0; height: 0;
}
.view-cursor span {
  position: absolute; left: -44px; top: -44px; width: 88px; height: 88px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(58, 45, 39, .88); color: var(--ivory);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font: 400 .78rem/1 var(--f-body); letter-spacing: .14em; text-transform: uppercase;
  box-shadow: 0 0 0 1px rgba(202, 133, 76, .6), 0 10px 30px rgba(28, 21, 17, .3);
  scale: 0; opacity: 0;
  transition: scale .55s var(--ease-out), opacity .35s var(--ease);
}
html[lang="gu"] .view-cursor span { text-transform: none; letter-spacing: .02em; font-size: .9rem; }
.view-cursor.is-on span { scale: 1; opacity: 1; }
.view-cursor.is-on.is-press span { scale: .86; }

/* 3 · hero: slow continuous drift + scroll depth */
.hero__media { translate: 0 var(--hero-y, 0px); }
.hero__media img.is-drifting { animation: hero-drift 26s ease-in-out infinite alternate; }
@keyframes hero-drift { from { transform: scale(1) translate3d(0, 0, 0); } to { transform: scale(1.07) translate3d(-1.2%, -1%, 0); } }
.hero__inner { opacity: var(--hero-fade, 1); }

/* info panel + lightbox images: a quick, soft settle when they change */
.info-panel__media img, .lightbox .viewer__stage img { animation: ir-pop .9s var(--ease-out) both; }
@keyframes ir-pop { from { opacity: 0; scale: 1.06; filter: blur(6px); } to { opacity: 1; scale: 1; filter: blur(0); } }

/* layout helpers for wrapped images */
.mosaic .m-a .ir, .amen-feature__media button .ir { height: 100%; }
.masonry .ir, .amenity-rail .ir { height: auto; }

@media (prefers-reduced-motion: reduce) {
  .ir img { clip-path: none !important; scale: 1 !important; translate: none !important; filter: none !important; opacity: 1 !important; }
  .ir::after, .ir::before, .view-cursor { display: none !important; }
  .hero__media { translate: none; }
  .hero__media img.is-drifting { animation: none; }
  .info-panel__media img, .lightbox .viewer__stage img { animation: none; }
}
