/**
 * DevviTech motion layer.
 *
 * Follows Motion Rule v1.1 (PROPOSED, pending Sadik's approval). Removing this
 * file removes all motion without touching any content.
 *
 * Rules: content is readable at rest and without scroll-driven animation
 * support; every effect is off under prefers-reduced-motion; only transform,
 * opacity and colour animate (plus the header shadow from the canvas).
 * Hover and focus 150ms, menus 200ms, entrances 500 to 800ms, ease-out.
 */

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

	html {
		scroll-behavior: smooth;
	}

	.wp-block-button__link {
		transition: background-color 150ms ease-out, transform 150ms ease-out;
	}

	.wp-block-button__link:active {
		transform: scale(0.98);
	}

	.dvt-btn-arrow .wp-block-button__link::after,
	.dvt-go a:where(:not(:has(svg)))::after {
		transition: transform 200ms ease-out;
	}

	.dvt-btn-arrow .wp-block-button__link:hover::after,
	.dvt-go a:where(:not(:has(svg))):hover::after {
		transform: translateX(4px);
	}

	.dvt-primary__links a {
		transition: text-decoration-color 150ms ease-out;
	}

	.dvt-dd__toggle svg {
		transition: transform 200ms ease-out;
	}

	.dvt-dd:is(.is-open, :focus-within):not(.is-dismissed) .dvt-dd__toggle svg {
		transform: rotate(180deg);
	}
}

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

	.dvt-dd:hover:not(.is-dismissed) .dvt-dd__toggle svg {
		transform: rotate(180deg);
	}
}

@supports (animation-timeline: view()) {

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

		/* Reading progress bar. */
		.dvt-progress {
			display: block;
			position: fixed;
			top: 0;
			right: 0;
			left: 0;
			z-index: 50;
			height: 2px;
			background: var(--wp--preset--color--accent);
			transform-origin: left center;
			animation: dvt-grow linear both;
			animation-timeline: scroll(root);
		}

		/* The header lifts once the page scrolls. */
		.dvt-hdr {
			animation: dvt-lift linear both;
			animation-timeline: scroll(root);
			animation-range: 0 160px;
		}

		/* Scroll reveal for headings, cards and rows (used from Phase 3). */
		.dvt-reveal {
			animation: dvt-reveal linear both;
			animation-timeline: view();
			animation-range: entry 0% entry 80%;
		}

		/* Footer wordmark slides in. */
		.dvt-slide {
			animation: dvt-slide linear both;
			animation-timeline: view();
			animation-range: entry 0% entry 100%;
		}
	}
}

@keyframes dvt-grow {

	from {
		transform: scaleX(0);
	}

	to {
		transform: scaleX(1);
	}
}

@keyframes dvt-lift {

	to {
		box-shadow: 0 12px 32px -20px #0000008c;
	}
}

@keyframes dvt-reveal {

	from {
		opacity: 0;
		translate: 0 32px;
	}

	to {
		opacity: 1;
		translate: none;
	}
}

@keyframes dvt-slide {

	from {
		transform: translateX(-12%);
	}

	to {
		transform: none;
	}
}
