/* First-load entrance: elements fade/rise in one after another */

:root {
	--t-appear: 0.9s;
	--t-appear-step: 0.12s;
	--e-appear: cubic-bezier(0.2, 0.7, 0.2, 1);
	--s-appear-rise: 0.4em;
	/* order: the frame draws in (--t-shell-draw), the head bursts in once it
	   is done (--t-scene-delay, read by three-scene.js, which also waits
	   until then to decode the model), and the menu rises in last, once
	   the head has mostly settled (--t-appear-delay) */
	--t-shell-draw: 1.2s;
	--t-scene-delay: 1.25s;
	--t-appear-delay: 2.6s;
	--e-shell-draw: cubic-bezier(0.65, 0, 0.35, 1);
}

@keyframes i4k-appear {
	from {
		opacity: 0;
		transform: translateY(var(--s-appear-rise));
	}
}

/* the frame (i4k-shell.css) draws in first, then the menu rises in */
body > menu > li {
	animation: i4k-appear var(--t-appear) var(--e-appear) both;
}

body > menu > li:nth-child(1) {
	animation-delay: calc(var(--t-appear-delay) + var(--t-appear-step) * 0);
}

body > menu > li:nth-child(2) {
	animation-delay: calc(var(--t-appear-delay) + var(--t-appear-step) * 1);
}

body > menu > li:nth-child(3) {
	animation-delay: calc(var(--t-appear-delay) + var(--t-appear-step) * 2);
}

body > menu > li:nth-child(4) {
	animation-delay: calc(var(--t-appear-delay) + var(--t-appear-step) * 3);
}

body > menu > li:nth-child(n + 5) {
	animation-delay: calc(var(--t-appear-delay) + var(--t-appear-step) * 4);
}

@media (prefers-reduced-motion: reduce) {
	body > menu > li {
		animation: none;
	}
}
