/*
 * Motion layer. Layout is not changed here, only how things arrive.
 * motion-head.js adds html.mo-js before the first paint, so items can wait without a flash.
 * motion.js adds html.mo-ready and reveals each item once it is on screen.
 * If motion.js never runs, a fail-safe shows everything after 2.5s.
 */
:root{
	--mo-out:cubic-bezier(.16,1,.3,1);   /* soft stop */
	--mo-inout:cubic-bezier(.65,0,.35,1); /* slow start and stop */
	--mo-rise:14px;
}

/* smooth scroll (motion.js adds html.lenis) */
html.lenis,html.lenis body{height:auto}
.lenis.lenis-smooth{scroll-behavior:auto!important}
.lenis.lenis-smooth [data-lenis-prevent]{overscroll-behavior:contain}
.lenis.lenis-stopped{overflow:hidden}
.lenis.lenis-smooth iframe{pointer-events:none}

/* small feedback */
.marquee:hover .mq-track{animation-play-state:paused}

@media (prefers-reduced-motion:no-preference){
	/* hero and page banners: the words arrive one after another */
	@keyframes mo-rise{from{opacity:0;transform:translateY(var(--mo-rise))}to{opacity:1;transform:none}}
	:is(.hero-copy,.banner-in)>*{animation:mo-rise .9s var(--mo-out) both}
	:is(.hero-copy,.banner-in)>:nth-child(1){animation-delay:.15s}
	:is(.hero-copy,.banner-in)>:nth-child(2){animation-delay:.25s}
	:is(.hero-copy,.banner-in)>:nth-child(3){animation-delay:.35s}
	:is(.hero-copy,.banner-in)>:nth-child(4){animation-delay:.45s}
	:is(.hero-copy,.banner-in)>:nth-child(5){animation-delay:.55s}
	:is(.hero-copy,.banner-in)>:nth-child(6){animation-delay:.65s}

	/* hero and banner photos move a little slower than the page (motion.js sets --mo-par) */
	:is(.hero-media,.banner-media) .pic{scale:1.12;translate:0 var(--mo-par,0px);will-change:translate}

	/* waiting state (until motion.js adds .mo-in, then .mo-done) */
	@keyframes mo-show{to{opacity:1;transform:none;clip-path:none}}
	.mo-js :is(.svc-card,.trust-card,.cause,.post-card,.trustee,.way,.gal-i,.info,.stat,.svc-row,.feature):not(.mo-in,.mo-done){opacity:0;transform:translateY(var(--mo-rise));animation:mo-show 0s 2.5s forwards}
	/* photos open from the bottom like a curtain */
	.mo-js :is(.mosaic .pic,.svc-pic .pic,.split > .pic,.cta-art .pic,.round):not(.mo-in,.mo-done){clip-path:inset(100% 0 0 0);animation:mo-show 0s 2.5s forwards}
	/* section headings rise out of a mask */
	.mo-js main h2:not(.mo-in,.mo-done){clip-path:inset(0 0 100% 0);transform:translateY(.35em);animation:mo-show 0s 2.5s forwards}
	/* motion.js is running: no fail-safe needed */
	.mo-js.mo-ready :is(.svc-card,.trust-card,.cause,.post-card,.trustee,.way,.gal-i,.info,.stat,.svc-row,.feature,.mosaic .pic,.svc-pic .pic,.split > .pic,.cta-art .pic,.round),.mo-js.mo-ready main h2{animation:none}

	/* arriving */
	.mo-in{opacity:1;transform:none;clip-path:inset(0 0 0 0);transition:opacity .9s var(--mo-out),transform .9s var(--mo-out),clip-path 1.3s var(--mo-inout)}
	h2.mo-in{transition:transform 1s var(--mo-out),clip-path 1s var(--mo-out)}
}
