/**
 * Motion layer: scroll-reveal, 3D card tilt, mobile menu transitions.
 * Split from style.css so the interaction/animation logic lives in one place.
 */

/* Scroll-reveal (paired with IntersectionObserver in main.js) */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.property-grid .reveal:nth-child(2),
.archive-grid .reveal:nth-child(2) { transition-delay: 0.08s; }
.property-grid .reveal:nth-child(3),
.archive-grid .reveal:nth-child(3) { transition-delay: 0.16s; }
.property-grid .reveal:nth-child(4),
.archive-grid .reveal:nth-child(4) { transition-delay: 0.24s; }
.locality-grid .reveal:nth-child(2) { transition-delay: 0.06s; }
.locality-grid .reveal:nth-child(3) { transition-delay: 0.12s; }
.locality-grid .reveal:nth-child(4) { transition-delay: 0.18s; }
.why-us__item.reveal:nth-child(2) { transition-delay: 0.1s; }
.why-us__item.reveal:nth-child(3) { transition-delay: 0.2s; }

/* 3D tilt on property cards -- --tilt-x/--tilt-y/--tilt-lift are set by main.js on mousemove */
.property-card {
  transform: perspective(1200px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) translateY(var(--tilt-lift, 0px));
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
}
.property-card:hover {
  box-shadow: var(--shadow-card-hover);
}

/* Gallery crossfade (paired with property-gallery.js) */
#gallery-main-image {
  transition: opacity 0.15s ease;
}

/* Mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--nivas-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-16px);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out), visibility 0s 0.4s;
}
.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}
.mobile-menu__list { display: flex; flex-direction: column; gap: 26px; text-align: center; }
.mobile-menu__list a { font-family: var(--font-display); font-size: 32px; color: var(--nivas-paper); }

/* Respect reduced-motion preferences: keep the site fully usable without the flourish */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .property-card { transform: none !important; }
  .hero__layer { transform: none !important; }
}
