/**
 * Scroll reveal animations (inc/motion.php). The hidden states are added
 * inline from nook_motion_targets(); this file holds the movement.
 * Timing and ease follow kononenkogroup.com: 1.1s, cubic-bezier(0.17, 0.84, 0.44, 1).
 */

html.nook-motion {
	--nook-motion-ease: cubic-bezier(0.17, 0.84, 0.44, 1);
	--nook-motion-time: 1.1s;
}

/* Fade up: text, buttons, cards. */
html.nook-motion .is-in {
	transition:
		opacity var(--nook-motion-time) var(--nook-motion-ease) var(--nook-delay, 0s),
		transform var(--nook-motion-time) var(--nook-motion-ease) var(--nook-delay, 0s),
		clip-path 1.4s var(--nook-motion-ease) var(--nook-delay, 0s);
}

/* Photos: wipe up from the bottom while settling from the zoom. */
html.nook-motion .is-in[data-nook-motion="image"] {
	transition:
		clip-path 1.4s var(--nook-motion-ease) var(--nook-delay, 0s),
		transform 1.4s var(--nook-motion-ease) var(--nook-delay, 0s);
}

/* Headings: each line slides up from behind its own mask. */
.nook-motion-line {
	display: block;
	overflow: hidden;
	padding-block-end: 0.08em;
	margin-block-end: -0.08em;
}

.nook-motion-line__inner {
	display: block;
	transform: translateY(105%);
	transition: transform var(--nook-motion-time) var(--nook-motion-ease);
	transition-delay: calc(var(--nook-delay, 0s) + var(--nook-line, 0) * 0.09s);

	.is-in & {
		transform: none;
	}
}

/* The hero photo settles in slowly once the page has loaded. */
html.nook-motion .nook-hero__image {
	animation: nook-hero-settle 2s var(--nook-motion-ease) both;
}

@keyframes nook-hero-settle {
	from {
		transform: scale(1.08);
	}
}

/* Keep the wide photo inside its frame while it settles from the zoom. */
html.nook-motion .nook-wide-photo picture {
	display: block;
	overflow: clip;
}

/* Scatter gallery conveyor (motion.js): every photo shows, placed by the script. */
html.nook-motion .nook-scatter.is-conveyor .nook-scatter__photos li {
	display: block;
}
