/* Motion: parallax, float, fade-up, hover, draw-in.
   Front end only. Everything is off for visitors who prefer reduced motion,
   and the scroll-linked parts only run in browsers that support them. */
@keyframes dm-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes dm-hero-in { from { transform: scale(1.06); } to { transform: none; } }
@keyframes dm-par { from { translate: 0 calc(var(--par, 40px) * -1); } to { translate: 0 var(--par, 40px); } }
@keyframes dm-hero-par { from { translate: 0 0; } to { translate: 0 28%; } }
@keyframes dm-rise { from { opacity: .001; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes dm-nudge { 0%, 100% { transform: translateY(-3px); } 50% { transform: translateY(4px); } }

@media (prefers-reduced-motion: no-preference) {
	.dmp-hero .wp-block-cover__image-background { animation: dm-hero-in 2.4s cubic-bezier(.22, 1, .36, 1) both; }
	.scroll-cue svg { animation: dm-nudge 2s ease-in-out infinite; }
	.wp-block-image.is-style-arch { animation: dm-float 8s ease-in-out infinite; will-change: transform; }
	.wp-block-image img { transition: scale .9s cubic-bezier(.22, 1, .36, 1); }
	.who .wp-block-column:hover img, .types .wp-block-column:hover img, .ws-row:hover .is-style-circle img { scale: 1.2; }
	.wp-block-group.is-style-card { transition: transform .4s cubic-bezier(.22, 1, .36, 1), box-shadow .4s cubic-bezier(.22, 1, .36, 1); }
	.wp-block-group.is-style-card:hover { transform: translateY(-6px); box-shadow: 0 22px 50px rgba(52, 51, 48, .12); }

	@supports (animation-timeline: view()) {
		/* Every photo drifts against the scroll; bigger frames move more. */
		.wp-block-post-content .wp-block-image img,
		.quote-band .wp-block-cover__image-background {
			scale: 1.16; animation: dm-par linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; will-change: translate;
		}
		.wp-block-image.is-style-banner img, .quote-band .wp-block-cover__image-background { --par: 70px; scale: 1.3; }
		.wp-block-image.is-style-arch img, .video-card .wp-block-image img { --par: 48px; scale: 1.2; }
		.who .wp-block-image img, .types .wp-block-image img, .ws-row .wp-block-image img { --par: 22px; scale: 1.14; }
		.who .wp-block-column:hover img, .types .wp-block-column:hover img, .ws-row:hover .is-style-circle img { scale: 1.2; }

		/* The hero photo sinks slower than the page as you scroll away. */
		.dmp-hero .wp-block-cover__image-background { animation: dm-hero-in 2.4s cubic-bezier(.22, 1, .36, 1) both, dm-hero-par linear both; animation-timeline: auto, view(); animation-range: normal, exit 0% exit 100%; }

		/* Cards and rows rise in, one after another. */
		.who > .wp-block-column, .types > .wp-block-column, .teachers > .wp-block-column,
		.is-style-rise > .wp-block-column, .ws-row, .is-style-timeline li, .video-card, .sched {
			animation: dm-rise linear both; animation-timeline: view(); animation-range: entry 0% entry 55%;
		}
		:is(.who, .types, .teachers, .is-style-rise) > .wp-block-column:nth-child(2) { animation-range: entry 8% entry 63%; }
		:is(.who, .types, .teachers, .is-style-rise) > .wp-block-column:nth-child(3) { animation-range: entry 16% entry 71%; }
		:is(.who, .types, .teachers, .is-style-rise) > .wp-block-column:nth-child(4) { animation-range: entry 24% entry 79%; }
	}
}
