/* Camada 6 — Movimento: efeitos de entrada e detalhes. Tudo respeita "reduzir movimento". */

@media (prefers-reduced-motion: no-preference) {
	/* ---------- Variações da entrada ao rolar (padrão: sobe e aparece, ver components.css) ---------- */
	.js [data-reveal="left"] {
		transform: translateX(-2.5rem);
	}

	.js [data-reveal="right"] {
		transform: translateX(2.5rem);
	}

	.js [data-reveal="zoom"] {
		transform: scale(0.92);
	}

	/* ---------- Hero: a ilustração aparece devagar ao carregar ---------- */
	.hero__art,
	.hero__stars {
		animation: hero-art-in 2.4s var(--ease-out) both;
	}

	@keyframes hero-art-in {
		from {
			opacity: 0;
		}
	}

	/* ---------- Faixa de autoridade: ícones "pulam" ao entrar ---------- */
	.authority__icon {
		transition: transform 0.5s var(--ease-out);
	}

	.js .authority__item.is-visible .authority__icon {
		animation: icon-pop 1.1s var(--ease-out) calc(var(--reveal-delay, 0s) + 0.15s) both;
	}

	@keyframes icon-pop {
		from {
			opacity: 0;
			scale: 0.4;
			rotate: -12deg;
		}
	}

	.authority__item:hover .authority__icon {
		transform: translateY(-0.2rem) rotate(-4deg) scale(1.06);
	}

	/* ---------- Adesivos (astronautas, foguetes, planetas) flutuam de leve ---------- */
	.cambridge__sticker,
	.exchange__sticker,
	.cta-card__sticker {
		animation: sticker-float 6s ease-in-out infinite;
	}

	.cambridge__sticker--a,
	.cta-card__sticker--right {
		animation-duration: 7.5s;
		animation-delay: -2s;
	}

	.cambridge__sticker--b,
	.cta-card__sticker--left {
		animation-duration: 5.2s;
		animation-delay: -3.5s;
	}

	@keyframes sticker-float {
		50% {
			translate: 0 -0.55rem;
		}
	}

	/* ---------- Mapa: a estrela respira e a fachada surge depois do mapa ---------- */
	.history__star {
		animation: star-breathe 5s ease-in-out infinite;
	}

	@keyframes star-breathe {
		50% {
			scale: 1.025;
			opacity: 0.92;
		}
	}

	.js .history__map .history__facade {
		opacity: 0;
		scale: 0.9;
		transition: opacity 1.4s var(--ease-out) 0.6s, scale 1.4s var(--ease-out) 0.6s;
	}

	.js .history__map.is-visible .history__facade {
		opacity: 1;
		scale: 1;
	}

	/* ---------- Botão de WhatsApp entra depois que a página carrega ---------- */
	.whatsapp-float {
		animation: whatsapp-in 0.6s var(--ease-out) 1.6s both;
	}

	@keyframes whatsapp-in {
		from {
			opacity: 0;
			scale: 0.4;
		}
	}

	/* ---------- Letras "A" de fundo: deslocamento suave ao rolar (valor vem do motion.js) ---------- */
	[data-parallax] {
		translate: 0 var(--py, 0px);
	}
}

/* ---------- Barra de progresso de leitura (sob o cabeçalho) ---------- */
.scroll-progress {
	position: absolute;
	inset: auto 0 0;
	height: 3px;
	background: var(--color-yellow-400);
	transform: scaleX(var(--progress, 0));
	transform-origin: left;
	pointer-events: none;
}

/* ---------- Hero: a ilustração flutua em "8 deitado" (infinito), bem devagar ---------- */
@media (prefers-reduced-motion: no-preference) {
	/* Horizontal (translate) e vertical (transform) são animados em separado: o vertical tem metade do
	   período do horizontal e está defasado em 1/4 de ciclo, o que desenha a curva em forma de 8. */
	.hero__scene {
		animation:
			hero-drift-x 11s ease-in-out infinite alternate,
			hero-drift-y 5.5s ease-in-out -2.75s infinite alternate;
	}

	@keyframes hero-drift-x {
		from {
			translate: -0.9rem 0;
		}

		to {
			translate: 0.9rem 0;
		}
	}

	@keyframes hero-drift-y {
		from {
			transform: translateY(-0.55rem);
		}

		to {
			transform: translateY(0.55rem);
		}
	}
}
