/* ═══════════════════════════════════════════════════════════════
   Matteo Solaro — motion.css
   Scroll-revealed homepage motion system styles.
   Separate from style.css / components.css / responsive.css.
   Only opacity / transform / clip-path — no layout-affecting
   properties, no change to reserved element dimensions (no CLS).
═══════════════════════════════════════════════════════════════ */

/* ── Fade / Content Reveal ── */
.ms-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ms-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Image Reveal (clip-path) + delayed text fade ──
   opacity (not clip-path) is the resting hidden state here: observing
   an element whose own clip-path already clips it to a 0-area box
   makes IntersectionObserver report isIntersecting:false forever
   (confirmed root cause). clip-path only runs as a one-shot keyframe
   animation after the trigger, once the observer no longer needs to
   measure this element's geometry. */
.ms-reveal-image {
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ms-reveal-image.is-visible {
  opacity: 1;
  animation: ms-image-reveal 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes ms-image-reveal {
  from {
    clip-path: inset(0 0 100% 0);
  }
  to {
    clip-path: inset(0 0 0% 0);
  }
}

.ms-reveal-image .cta-banner-content {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease 0.15s, transform 0.5s ease 0.15s;
}

.ms-reveal-image.is-visible .cta-banner-content {
  opacity: 1;
  transform: translateY(0);
}

/* ── Reduced Motion: content always visible, no transition ── */
@media (prefers-reduced-motion: reduce) {
  .ms-reveal,
  .ms-reveal-image,
  .ms-reveal-image .cta-banner-content {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
    transition: none !important;
  }

  .ms-reveal-image {
    animation: none !important;
  }
}
