/*
 * Layer: components. Scroll-driven reveals for core blocks in the body and
 * on grounds. Front end only; at rest every target is fully visible.
 */
@layer components {

	@media (prefers-reduced-motion: no-preference) {

		/* The piece masthead's Level settles from the derived angle (M7). */
		@keyframes vt-level-settle {

			from {
				rotate: var(--settle, -4deg);
			}
		}

		.vt-piece-page > .vt-site-header--piece .vt-level-mark__bubble {
			transform-box: view-box;
			transform-origin: 32px 32px;
			animation: vt-level-settle 700ms var(--wp--custom--motion--ease-spring);
		}

		@keyframes vt-arrive {

			from {
				opacity: 0;
				translate: 0 var(--wp--custom--motion--arrive-distance);
			}
		}

		@supports ((animation-timeline: view()) and (animation-range: entry)) {

			/* Grounds stay put; their children reveal. No backwards fill. */
			:where(.vt-piece__body, .vt-ground) > :where(p, .wp-block-heading, .wp-block-list, .wp-block-group:not(.vt-ground), .wp-block-details, .wp-block-image, .wp-block-table, .wp-block-quote) {
				animation: vt-arrive auto var(--wp--custom--motion--ease-out);
				animation-timeline: view();
				animation-range: cover 0% cover 25vh;
			}
		}
	}
}
