/**
 * RiseSelf — system animacji scroll-reveal (02_DESIGN.odt §20-23).
 *
 * Ruch służy dopracowaniu doświadczenia i nigdy nie jest głównym punktem
 * uwagi. Elementy [data-animate] odsłaniają się poprzez IntersectionObserver
 * (assets/js/animations.js) dodający klasę .is-visible.
 *
 * @package RiseSelf
 */

@keyframes riseself-fade-up {
	from {
		opacity: 0;
		transform: translateY(22px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

[data-animate] {
	opacity: 0;
	transform: translateY(22px);
	transition: opacity var(--rs-duration-reveal) var(--rs-ease),
		transform var(--rs-duration-reveal) var(--rs-ease);
	transition-delay: calc((var(--rs-animate-order, 0) - 1) * 90ms);
}

[data-animate].is-visible {
	opacity: 1;
	transform: translateY(0);
}

[data-animate-order="1"] { --rs-animate-order: 1; }
[data-animate-order="2"] { --rs-animate-order: 2; }
[data-animate-order="3"] { --rs-animate-order: 3; }
[data-animate-order="4"] { --rs-animate-order: 4; }

/* Wariant reveal z delikatną skalą — zarezerwowany dla najważniejszych,
   pojedynczych elementów (np. karta „Dlaczego RiseSelf", Filary), aby
   nie stał się powtarzalnym efektem na każdym elemencie strony. */
[data-animate-scale] {
	transform: translateY(18px) scale(0.965);
}

[data-animate-scale].is-visible {
	transform: translateY(0) scale(1);
}

/* Delikatny hover unoszący się dla kart — spójny w całej witrynie.
   will-change ograniczone do elementów faktycznie animowanych na hover,
   aby nie obciążać niepotrzebnie kompozytora GPU. */
.rs-card,
.section-build__item,
.section-pillars__item,
.section-reviews__card,
.section-hero__media-frame,
.section-products__media,
.section-products__image {
	will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	[data-animate],
	[data-animate].is-visible {
		opacity: 1;
		transform: none;
		transition: none;
	}

	.section-products__image,
	.section-products__media,
	.section-hero__main-image,
	.section-hero__media-frame,
	.btn,
	.btn::before,
	.section-faq__icon,
	.section-faq__icon::before,
	.section-faq__icon::after,
	.section-faq__trigger,
	.rs-card,
	.section-build__item,
	.section-pillars__item,
	.section-pillars__numeral,
	.section-reviews__card,
	.section-why__card,
	.site-footer__social-link {
		transition: none !important;
	}

	.section-faq__answer,
	.section-faq__answer.is-open {
		transition: grid-template-rows 1ms linear, visibility 0s linear !important;
	}

	.section-transformation__step.is-visible .section-transformation__step-marker {
		animation: none;
	}

	.section-hero__scroll-cue span {
		animation: none;
	}

	.site-header__cart-count.is-pulsing {
		animation: none;
	}

	[data-parallax] {
		transform: none !important;
	}
}
