/*
 * bpsy-core reveal: the old site's Breakdance entrance animations (data-bpsy-anim="slideUp|slideLeft|
 * slideRight|zoomOut"). The hidden state exists only once reveal.js has run and set html.bpsy-motion,
 * so visitors without JavaScript, with reduced motion, or printing always see everything. Only opacity
 * and the individual translate/scale properties move: no layout shift, and any transform the element
 * already has is kept. Elements already on screen when the page loads are never hidden (reveal.js).
 */

@media screen and (prefers-reduced-motion: no-preference) {
	/* Before entering: invisible but still in the layout, the accessibility tree and the tab order
	   (reveal.js reveals an element as soon as focus moves into it). */
	html.bpsy-motion [data-bpsy-anim]:not(.bpsy-anim-run):not(.bpsy-anim-done) {
		opacity: 0;
	}

	/* No transitions while hidden or entering: a button's own "transition: all" would otherwise take
	   over the opacity change. */
	html.bpsy-motion [data-bpsy-anim]:not(.bpsy-anim-done) {
		transition: none !important;
	}

	/* Breakdance: 500ms, GSAP power1.out (1 - (1 - t)^2, exactly this cubic-bezier), 100px. */
	html.bpsy-motion .bpsy-anim-run {
		animation-duration: 0.5s;
		animation-timing-function: cubic-bezier(0.3333, 0.6667, 0.6667, 1);
		animation-fill-mode: both;
	}

	html.bpsy-motion .bpsy-anim-run[data-bpsy-anim="slideUp"] { animation-name: bpsy-slide-up; }
	html.bpsy-motion .bpsy-anim-run[data-bpsy-anim="slideLeft"] { animation-name: bpsy-slide-left; }
	html.bpsy-motion .bpsy-anim-run[data-bpsy-anim="slideRight"] { animation-name: bpsy-slide-right; }
	html.bpsy-motion .bpsy-anim-run[data-bpsy-anim="zoomOut"] { animation-name: bpsy-zoom-out; }
	html.bpsy-motion .bpsy-anim-run[data-bpsy-anim="fade"] { animation-name: bpsy-fade; }
}

/* Breakdance names: slideLeft enters from the left (x -100px -> 0), slideRight from the right. */
@keyframes bpsy-slide-up { from { opacity: 0; translate: 0 100px; } }
@keyframes bpsy-slide-left { from { opacity: 0; translate: -100px 0; } }
@keyframes bpsy-slide-right { from { opacity: 0; translate: 100px 0; } }
@keyframes bpsy-zoom-out { from { opacity: 0; scale: 1.2; } }
@keyframes bpsy-fade { from { opacity: 0; } }
