/* Motion layer for Waterfront by Missoni.
   Everything here is gated behind html.mo, which motion.js adds only when scripts run,
   IntersectionObserver exists and the visitor has not asked for reduced motion.
   Without that class the page renders exactly as before, fully visible and static. */

:root{--mo-ease:cubic-bezier(.22,.61,.36,1)}

/* ---------- Scroll reveals ----------
   Keep this selector list identical to REVEAL in motion.js. */
.mo :is(
  .stats>div,
  .story .visual,.story .copy>*,
  .scene-text>*,
  .split>.copy>*,.split>img,
  .location>img,.location .copy>*,
  .facts>.kicker,.facts>h2,.factlead>div,.factgrid>div,.facts>.fine,
  .sectionhead>div>*,.sectionhead>.textlink,.cards>a,
  .market>div:first-child>*,.quotes>a,.market>.finenote,
  .paygrid>div>*,
  .lease>img,.leasecopy>*,
  .stripe .wrap>h2,.docs>a,
  .faq>div:first-child>*,.faq details,
  .contact .copy>*,.contact form
):not(.mo-in){opacity:0;transform:translateY(40px)}

/* Headings travel a little further. Photographs wipe open from the bottom edge instead of fading. */
.mo :is(.story .copy,.scene-text,.split>.copy,.location .copy,.facts,.sectionhead>div,.market>div:first-child,.paygrid>div,.leasecopy,.stripe .wrap,.faq>div:first-child,.contact .copy) h2:not(.mo-in){transform:translateY(64px)}
.mo :is(.story .visual,.split>img,.location>img,.lease>img):not(.mo-in){opacity:1;transform:translateY(28px);clip-path:inset(100% 0 0 0)}
.mo :is(.story .visual,.split>img,.location>img,.lease>img).mo-in{clip-path:inset(0)}

.mo .mo-in:not(.mo-done){transition:opacity .9s var(--mo-ease) var(--mo-d,0ms),transform 1.1s var(--mo-ease) var(--mo-d,0ms),clip-path 1.2s var(--mo-ease) var(--mo-d,0ms)}

/* The sections used to fade in as one block. The staggered reveals above replace that. */
.mo .motion-section.is-entered{animation:none}

/* ---------- Hero and page mastheads ---------- */
.mo .hero-copy{animation:none}
.mo .hero-copy>*,.mo .mast-copy>*{animation:mo-rise-lg 1.1s var(--mo-ease) both}
.mo .hero-copy>:nth-child(1),.mo .mast-copy>:nth-child(1){animation-delay:.1s}
.mo .hero-copy>:nth-child(2),.mo .mast-copy>:nth-child(2){animation-delay:.32s}
.mo .hero-copy>:nth-child(3),.mo .mast-copy>:nth-child(3){animation-delay:.54s}
.mo .hero-photo>img,.mo .mast-image{animation:mo-unfold 2s var(--mo-ease) both}

/* ---------- Payment chart ----------
   The bar draws from zero to the plan's pre-handover share when it enters view. */
.mo .cashbar:not(.mo-in) i{width:0}
/* The bar draws slowly enough to be read as a chart filling. */
.mo .cashbar i{transition:width 1.5s var(--mo-ease) var(--mo-d,0ms)}
.mo .cashbar.mo-done i{transition-delay:0s}

/* Schedule rows follow one another when a plan is chosen. */
.mo .cash-change{animation:none}
.mo .cash-change tr{animation:mo-rise .6s var(--mo-ease) both}
.mo .cash-change tr:nth-child(2){animation-delay:70ms}
.mo .cash-change tr:nth-child(3){animation-delay:140ms}
.mo .cash-change tr:nth-child(4){animation-delay:210ms}
.mo .cash-change tr:nth-child(5){animation-delay:280ms}
.mo .cash-change tr:nth-child(6){animation-delay:350ms}
.mo .cash-change tr:nth-child(7){animation-delay:420ms}
.mo .cash-change tr:nth-child(8){animation-delay:490ms}
.mo .cash-change tr:nth-child(9){animation-delay:560ms}
.mo #planstory,.mo #cashlegend{transition:opacity .25s ease}

/* ---------- Interaction ---------- */
.mo :is(.btn,.cta,.choices button,.journey-filters button,.layout-switch button,.ctabar a){transition:background-color .25s ease,color .25s ease,border-color .25s ease}
.mo .chapters a{transition:color .25s ease}
.mo :is(.btn,.cta):hover{transform:translateY(-2px)}
.mo :is(.btn,.cta){transition:background-color .25s ease,color .25s ease,border-color .25s ease,transform .3s var(--mo-ease)}
.mo .cards>a.mo-done{transition:transform .45s var(--mo-ease)}
.mo .cards>a.mo-done:hover{transform:translateY(-8px)}
.mo details[open]>:not(summary){animation:mo-rise .4s var(--mo-ease) both}
.mo .mobilemenu:not([hidden]){animation:mo-fade .25s ease both}
.mo dialog[open]{animation:mo-rise .35s var(--mo-ease) both}
.mo dialog[open]::backdrop{animation:mo-fade .35s ease both}
.mo .gallery-item{animation:mo-fade .5s ease both}

@keyframes mo-rise{from{opacity:0;transform:translateY(26px)}to{opacity:1;transform:none}}
@keyframes mo-rise-lg{from{opacity:0;transform:translateY(52px)}to{opacity:1;transform:none}}
@keyframes mo-fade{from{opacity:0}to{opacity:1}}
@keyframes mo-unfold{from{opacity:.35;transform:scale(1.14)}to{opacity:1;transform:scale(1)}}

/* ---------- Static fallbacks ---------- */
@media print{
  .mo *{opacity:1!important;transform:none!important;clip-path:none!important;animation:none!important;transition:none!important}
}
@media(prefers-reduced-motion:reduce){
  .mo *,.mo *:before,.mo *:after{opacity:1;transform:none;clip-path:none;animation:none!important;transition:none!important}
}
