/* Desktop homepage motion. Loaded with media="screen and (min-width: 769px)";
   js/home-motion.js adds .hm to <html>. One idea throughout, taken from the
   ritual list: what the visitor points at stays, everything around it recedes. */

@media (prefers-reduced-motion: no-preference) {
  /* Copy and the booking button are there at once; the photos only fade in. */
  .hero:has(.hero-strip) .hero-bottom {
    animation: none;
  }

  .hero .hero-strip-photo {
    opacity: 1;
    animation-name: hmFadeIn;
    animation-duration: 900ms;
    animation-timing-function: ease-out;
    animation-fill-mode: backwards;
    transition: filter var(--transition-base), opacity var(--transition-base);
  }

  .hero .hero-strip-num {
    animation-name: hmNumIn;
    animation-duration: 900ms;
    animation-timing-function: ease-out;
  }
}

@keyframes hmFadeIn {
  from { opacity: 0; }
}

@keyframes hmNumIn {
  from { opacity: 0; }
  to { opacity: 0.58; }
}

/* The old reveals fired off screen; the page now simply stands still. */
.hm .summary-inner,
.hm .summary-inner > *,
.hm .footer.section-reveal {
  opacity: 1;
  transform: none;
  filter: none;
  transition: none;
  will-change: auto;
}

.hm-setup .featured-link,
.hm-setup .gallery-item,
.hm-setup .stat-item,
.hm-setup .benefits-card,
.hm-setup .interior-item,
.hm-setup .accordion-item {
  transition: none !important;
}

/* Scroll: the manifesto inks in line by line, its photo settles inside the frame. */
.hm .approach-title span {
  opacity: var(--hm-ink, 1);
}

.hm .approach-media img {
  scale: calc(1 + var(--hm-settle, 0) * 0.08);
}

@media (hover: hover) and (pointer: fine) {
  .hm .service-menu-links .featured-link:hover,
  .hm .service-menu-links .featured-link:focus-visible {
    z-index: 5;
  }

  .hm .service-menu-links:hover .featured-link:not(:hover) .featured-link-word {
    opacity: 0.26;
  }

  .hm .service-menu-links .featured-link .featured-link-visual {
    width: clamp(170px, 15vw, 260px);
    aspect-ratio: 4 / 5;
    border: 0;
    translate: var(--hm-px, 0) var(--hm-py, 0);
  }

  .hm .service-menu-links .featured-link:focus-visible .featured-link-visual {
    opacity: 1;
    transform: translateY(-50%) scale(1) rotate(0deg);
  }

  .hm .header .nav-link,
  .hm .about-preview-main,
  .hm .about-preview-side,
  .hm .booking-artboard-image,
  .hm .gr-card,
  .hm .accordion-item {
    transition: opacity var(--transition-base);
  }

  .hm .stats-row .stat-item {
    transition:
      opacity var(--transition-base),
      background-color var(--transition-base),
      border-color var(--transition-base);
  }

  .hm .benefits-grid .benefits-card {
    transition:
      opacity var(--transition-base),
      background-color var(--transition-base),
      border-color var(--transition-base),
      color var(--transition-base);
  }

  .hm .interior-grid .interior-item {
    transition: opacity var(--transition-base);
  }

  .hm .header .nav-link:hover {
    opacity: 1;
  }

  .hm .stats-row .stat-item:hover {
    transform: none;
    box-shadow: none;
  }

  .hm .stats-row .stat-item:hover .stat-number {
    text-shadow: none;
  }

  .hm .benefits-grid .benefits-card:hover {
    transform: none;
  }

  .hm .header .nav:has(.nav-link:hover) .nav-link:not(:hover),
  .hm .hero-strip:has(.hero-strip-photo:hover) .hero-strip-photo:not(:hover),
  .hm .about-preview-gallery:has(.about-preview-main:hover, .about-preview-side:hover) :is(.about-preview-main, .about-preview-side):not(:hover),
  .hm .stats-row:has(.stat-item:hover) .stat-item:not(:hover),
  .hm .gr-track:has(.gr-card:hover) .gr-card:not(:hover),
  .hm .benefits-grid:has(.benefits-card:hover) .benefits-card:not(:hover),
  .hm .interior-grid:has(.interior-item:hover) .interior-item:not(:hover),
  .hm .booking-artboard:has(.booking-artboard-image:hover) .booking-artboard-image:not(:hover),
  .hm .accordion:has(.accordion-item:hover) .accordion-item:not(:hover, .active) {
    opacity: 0.3;
  }
}
