/*
 * Solid Teens: motion. Every rule sits inside prefers-reduced-motion: no-preference,
 * so nothing moves for anyone who has asked for less motion.
 */

@media (prefers-reduced-motion: no-preference) {
	/* Page-to-page cross-fade where the browser supports cross-document View Transitions. */
	@view-transition {
		navigation: auto;
	}

	::view-transition-old(root),
	::view-transition-new(root) {
		animation-duration: 0.25s;
	}

	/* The header stays put while the page changes under it. */
	.styi-site-header {
		view-transition-name: styi-header;
	}

	/* Scroll reveals. theme.js adds styi-motion to <html> and is-revealed as each item comes into view. */
	.styi-motion .styi-reveal {
		transition:
			opacity 0.7s ease-out,
			transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
	}

	.styi-motion .styi-reveal:not(.is-revealed) {
		opacity: 0;
		transform: translateY(1.5rem);
	}

	a,
	.wp-element-button,
	.wp-block-button__link,
	.styi-nav__icon::before,
	.styi-nav__icon::after {
		transition:
			background-color 0.2s ease,
			color 0.2s ease,
			transform 0.2s ease;
	}

	/* The hero smile rises from behind the top edge once. Transform only, so nothing shifts. */
	:is(.styi-home-hero, .styi-page-hero)::before {
		animation: styi-smile-rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
	}

	@keyframes styi-smile-rise {
		from {
			transform: translateY(-100%);
		}
	}

	/* Arrow links nudge their chevron forward on hover. */
	.styi-link-arrow a::after {
		transition: transform 0.2s ease;
	}

	.styi-link-arrow a:hover::after {
		transform: translateX(0.2em) rotate(45deg);
	}

	/* Question chevrons turn as they open and close. */
	.wp-block-details > summary::after {
		transition: transform 0.2s ease;
	}
}

/* The still behind the camp frame drifts slowly. No film loop is needed for movement. */
@media (prefers-reduced-motion: no-preference) {
	.styi-camp-slot__still {
		animation: styi-camp-drift 40s ease-in-out infinite alternate;
	}

	@keyframes styi-camp-drift {
		from {
			transform: scale(1) translate3d(0, 0, 0);
		}

		to {
			transform: scale(1.04) translate3d(-1%, -0.75%, 0);
		}
	}
}
