/* ==========================================================================
   Entrance animations. Reveal targets + stagger order are listed below; see inc/animation.php.
   The section carries data-ffp-anim="<style>"; assets/js/animate.js adds .is-visible once it is on screen.
   Without JS (no .ffp-js on <html>) nothing is hidden. Speed/distance/stagger come from Theme Options.
   ========================================================================== */
[data-ffp-anim] {
	--ffp-dur: var(--wp--custom--animation--duration, 700ms);
	--ffp-dist: var(--wp--custom--animation--distance, 28px);
	--ffp-stagger: var(--wp--custom--animation--stagger, 80ms);
	--ffp-from-x: 0px;
	--ffp-from-y: 0px;
	--ffp-from-s: 1;
}
[data-ffp-anim="fade-up"] { --ffp-from-y: var(--ffp-dist); }
[data-ffp-anim="fade-down"] { --ffp-from-y: calc(var(--ffp-dist) * -1); }
[data-ffp-anim="slide-left"] { --ffp-from-x: calc(var(--ffp-dist) * -2); }
[data-ffp-anim="slide-right"] { --ffp-from-x: calc(var(--ffp-dist) * 2); }
[data-ffp-anim="zoom-in"] { --ffp-from-s: 0.94; }

@keyframes ffp-reveal {
	from { opacity: 0; translate: var(--ffp-from-x) var(--ffp-from-y); scale: var(--ffp-from-s); }
	to { opacity: 1; translate: 0 0; scale: 1; }
}

/* hidden until the section is visible (only when JS is running) */
html.ffp-js [data-ffp-anim] :is(
	.ffp-hero__content,
	.ffp-hero__stats,
	.ffp-honest__head,
	.ffp-honest__media,
	.ffp-honest__content,
	.ffp-built__title,
	.ffp-built__lead,
	.ffp-built__photo,
	.ffp-built__intro,
	.ffp-built__box,
	.ffp-power__head,
	.ffp-power__word,
	.ffp-power__tagline,
	.ffp-power__cta,
	.ffp-steps-section__head,
	.ffp-meet__content,
	.ffp-testimonials__head,
	.ffp-testimonials__track,
	.ffp-testimonials__actions,
	.ffp-social > .ffp-heading,
	.ffp-social > .ffp-lead,
	.ffp-newsletter__image,
	.ffp-newsletter__content,
	.ffp-closing__back,
	.ffp-closing__front,
	.ffp-closing__content,
	.ffp-power-step,
	.ffp-card,
	.ffp-social__item,
	.ffp-about-hero__content,
	.ffp-story__head,
	.ffp-mv__block,
	.ffp-principles__head,
	.ffp-pcard,
	.ffp-native__media,
	.ffp-native__content,
	.ffp-cta__content
) { opacity: 0; }

/* play */
html.ffp-js [data-ffp-anim].is-visible :is(
	.ffp-hero__content,
	.ffp-hero__stats,
	.ffp-honest__head,
	.ffp-honest__media,
	.ffp-honest__content,
	.ffp-built__title,
	.ffp-built__lead,
	.ffp-built__photo,
	.ffp-built__intro,
	.ffp-built__box,
	.ffp-power__head,
	.ffp-power__word,
	.ffp-power__tagline,
	.ffp-power__cta,
	.ffp-steps-section__head,
	.ffp-meet__content,
	.ffp-testimonials__head,
	.ffp-testimonials__track,
	.ffp-testimonials__actions,
	.ffp-social > .ffp-heading,
	.ffp-social > .ffp-lead,
	.ffp-newsletter__image,
	.ffp-newsletter__content,
	.ffp-closing__back,
	.ffp-closing__front,
	.ffp-closing__content,
	.ffp-power-step,
	.ffp-card,
	.ffp-social__item,
	.ffp-about-hero__content,
	.ffp-story__head,
	.ffp-mv__block,
	.ffp-principles__head,
	.ffp-pcard,
	.ffp-native__media,
	.ffp-native__content,
	.ffp-cta__content
) {
	animation: ffp-reveal var(--ffp-dur) cubic-bezier(0.2, 0.7, 0.2, 1) both;
	animation-delay: calc(var(--ffp-delay, 0ms) + var(--ffp-i, 0) * var(--ffp-stagger));
}

/* stagger order */
.ffp-hero__content { --ffp-i: 0; }
.ffp-hero__stats { --ffp-i: 2; }
.ffp-honest__head { --ffp-i: 0; }
.ffp-honest__media { --ffp-i: 1; }
.ffp-honest__content { --ffp-i: 2; }
.ffp-built__title { --ffp-i: 0; }
.ffp-built__lead { --ffp-i: 1; }
.ffp-built__photo { --ffp-i: 2; }
.ffp-built__intro { --ffp-i: 3; }
.ffp-built__box { --ffp-i: 4; }
.ffp-power__head { --ffp-i: 0; }
.ffp-power__word { --ffp-i: 1; }
.ffp-power__tagline { --ffp-i: 7; }
.ffp-power__cta { --ffp-i: 8; }
.ffp-steps-section__head { --ffp-i: 0; }
.ffp-meet__content { --ffp-i: 0; }
.ffp-testimonials__head { --ffp-i: 0; }
.ffp-testimonials__track { --ffp-i: 1; }
.ffp-testimonials__actions { --ffp-i: 2; }
.ffp-social > .ffp-heading { --ffp-i: 0; }
.ffp-social > .ffp-lead { --ffp-i: 1; }
.ffp-newsletter__image { --ffp-i: 0; }
.ffp-newsletter__content { --ffp-i: 1; }
.ffp-closing__back { --ffp-i: 0; }
.ffp-closing__front { --ffp-i: 0; }
.ffp-closing__content { --ffp-i: 1; }
.ffp-power-step:nth-child(1) { --ffp-i: 2; }
.ffp-power-step:nth-child(2) { --ffp-i: 3; }
.ffp-power-step:nth-child(3) { --ffp-i: 4; }
.ffp-power-step:nth-child(4) { --ffp-i: 5; }
.ffp-power-step:nth-child(5) { --ffp-i: 6; }
.ffp-card:nth-child(1) { --ffp-i: 1; }
.ffp-card:nth-child(2) { --ffp-i: 2; }
.ffp-card:nth-child(3) { --ffp-i: 3; }
.ffp-card:nth-child(4) { --ffp-i: 4; }
.ffp-card:nth-child(5) { --ffp-i: 5; }
.ffp-card:nth-child(6) { --ffp-i: 6; }
.ffp-social__item:nth-child(1) { --ffp-i: 2; }
.ffp-social__item:nth-child(2) { --ffp-i: 3; }
.ffp-social__item:nth-child(3) { --ffp-i: 4; }
.ffp-social__item:nth-child(4) { --ffp-i: 5; }
.ffp-social__item:nth-child(5) { --ffp-i: 6; }
.ffp-about-hero__content { --ffp-i: 0; }
.ffp-story__head { --ffp-i: 0; }
.ffp-mv__block--mission { --ffp-i: 0; }
.ffp-mv__block--vision { --ffp-i: 1; }
.ffp-principles__head { --ffp-i: 0; }
.ffp-pcard:nth-child(4n+1) { --ffp-i: 1; }
.ffp-pcard:nth-child(4n+2) { --ffp-i: 2; }
.ffp-pcard:nth-child(4n+3) { --ffp-i: 3; }
.ffp-pcard:nth-child(4n+4) { --ffp-i: 4; }
.ffp-native__media { --ffp-i: 0; }
.ffp-native__content { --ffp-i: 1; }
.ffp-cta__content { --ffp-i: 0; }

@media (prefers-reduced-motion: reduce) {
	html.ffp-js [data-ffp-anim] :is(
		.ffp-hero__content,
	.ffp-hero__stats,
	.ffp-honest__head,
	.ffp-honest__media,
	.ffp-honest__content,
	.ffp-built__title,
	.ffp-built__lead,
	.ffp-built__photo,
	.ffp-built__intro,
	.ffp-built__box,
	.ffp-power__head,
	.ffp-power__word,
	.ffp-power__tagline,
	.ffp-power__cta,
	.ffp-steps-section__head,
	.ffp-meet__content,
	.ffp-testimonials__head,
	.ffp-testimonials__track,
	.ffp-testimonials__actions,
	.ffp-social > .ffp-heading,
	.ffp-social > .ffp-lead,
	.ffp-newsletter__image,
	.ffp-newsletter__content,
	.ffp-closing__back,
	.ffp-closing__front,
	.ffp-closing__content,
	.ffp-power-step,
	.ffp-card,
	.ffp-social__item,
	.ffp-about-hero__content,
	.ffp-story__head,
	.ffp-mv__block,
	.ffp-principles__head,
	.ffp-pcard,
	.ffp-native__media,
	.ffp-native__content,
	.ffp-cta__content
	) { opacity: 1; animation: none; }
}
