/* Scroll animations: the prototype's (cmc.css 6 and 6b). Only transform and opacity animate.
   Items wait at opacity 0 (inc/scrollspy.php sets .js-scrollspy when motion is allowed); assets/js/scrollspy.js adds the class. */
.js-scrollspy .animation-item {
	opacity: 0;
	will-change: transform, opacity;
}

@keyframes cmc-slide-left   { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
@keyframes cmc-slide-right  { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes cmc-slide-top    { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: none; } }
@keyframes cmc-slide-bottom { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes cmc-scale-up     { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes cmc-scale-down   { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: none; } }
@keyframes cmc-bg-reveal    { from { opacity: 0; } to { opacity: 1; } }
@keyframes cmc-draw         { to { stroke-dashoffset: 0; } }
@keyframes cmc-fade-out     { from { opacity: 1; } to { opacity: 0; } }

.animate-slide-left-medium  { animation: cmc-slide-left 0.7s var(--wp--custom--ease, cubic-bezier(0.215, 0.61, 0.355, 1)) forwards; }
.animate-slide-right-medium { animation: cmc-slide-right 0.7s var(--wp--custom--ease, cubic-bezier(0.215, 0.61, 0.355, 1)) forwards; }
.animate-slide-top-small    { animation: cmc-slide-top 0.55s var(--wp--custom--ease, cubic-bezier(0.215, 0.61, 0.355, 1)) forwards; }
.animate-slide-bottom-small { animation: cmc-slide-bottom 0.55s var(--wp--custom--ease, cubic-bezier(0.215, 0.61, 0.355, 1)) forwards; }
.animate-scale-up           { animation: cmc-scale-up 0.6s var(--wp--custom--ease, cubic-bezier(0.215, 0.61, 0.355, 1)) forwards; }
.animate-scale-down         { animation: cmc-scale-down 0.6s var(--wp--custom--ease, cubic-bezier(0.215, 0.61, 0.355, 1)) forwards; }
.animate-fade               { animation: cmc-bg-reveal 0.6s var(--wp--custom--ease, cubic-bezier(0.215, 0.61, 0.355, 1)) forwards; }

/* Draw (line art, the About illustration): the group fades in, then the .wh-* parts draw one after another */
.js-scrollspy .wh-draw-line  { stroke-dasharray: 1; stroke-dashoffset: 1; }
.js-scrollspy .wh-fill-layer { opacity: 0; }

.animate-draw-art { animation: cmc-bg-reveal 0.4s ease-out forwards; }
.animate-draw-art .wh-link { animation: cmc-draw 1.5s cubic-bezier(0.4, 0, 0.2, 1) 0.10s forwards; }
.animate-draw-art .wh-ring { animation: cmc-draw 0.9s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.animate-draw-art .wh-ring:nth-of-type(1) { animation-delay: 0.55s; }
.animate-draw-art .wh-ring:nth-of-type(2) { animation-delay: 0.68s; }
.animate-draw-art .wh-ring:nth-of-type(3) { animation-delay: 0.81s; }
.animate-draw-art .wh-ring:nth-of-type(4) { animation-delay: 0.94s; }
.animate-draw-art .wh-icons    { animation: cmc-bg-reveal 1.3s ease-out 1.90s forwards; }
.animate-draw-art .wh-map-fill { animation: cmc-bg-reveal 1.2s ease-out 2.50s forwards; }
.animate-draw-art .wh-transient { animation: cmc-fade-out 1s ease-in 2.60s forwards; }

/* Reduced motion: the end state at once (also covers markup cached before the user changed the setting) */
@media (prefers-reduced-motion: reduce) {
	.js-scrollspy .animation-item {
		opacity: 1 !important;
		transform: none !important;
		animation: none !important;
		will-change: auto;
	}

	.js-scrollspy .wh-draw-line  { stroke-dashoffset: 0; }
	.js-scrollspy .wh-fill-layer { opacity: 1; }
	.js-scrollspy .wh-transient  { opacity: 0; }
	.animate-draw-art *          { animation: none !important; }
}
