/* ==========================================================================
   Base de animações — leves, com propósito e respeitando prefers-reduced-motion.
   O JS (assets/js/animacoes.js) só adiciona classes; o movimento fica aqui.
   ========================================================================== */

/* ---- Revelação no scroll ------------------------------------------------
   Uso: <div data-revelar> … </div>   (variações: data-revelar="esquerda|direita|zoom")
   Atraso em cascata: style="--atraso: 2" (multiplica 80ms)
   Só esconde quando o JS está ativo (classe .js no <html>), para nunca sumir conteúdo. */

.js [data-revelar] {
	opacity: 0;
	transform: translateY(28px);
	transition:
		opacity var(--lp-dur-lenta) var(--lp-ease),
		transform var(--lp-dur-lenta) var(--lp-ease);
	transition-delay: calc(var(--atraso, 0) * 80ms);
}

.js [data-revelar="esquerda"] { transform: translateX(-36px); }
.js [data-revelar="direita"]  { transform: translateX(36px); }
.js [data-revelar="zoom"]     { transform: scale(0.94); }

.js [data-revelar].is-visivel {
	opacity: 1;
	transform: none;
}

/* ---- Título do topo entrando em camadas -------------------------------- */

.lp-camada {
	display: inline-block;
	opacity: 0;
	transform: translateY(0.6em);
	animation: lp-entrar var(--lp-dur-lenta) var(--lp-ease) forwards;
	animation-delay: calc(150ms + var(--i, 0) * 70ms);
}

@keyframes lp-entrar {
	to {
		opacity: 1;
		transform: none;
	}
}

/* ---- Bolinha vermelha quicando (nariz do palhaço) ---------------------- */

.lp-bolinha {
	animation: lp-quicar 2.4s var(--lp-ease) infinite;
	transform-origin: 50% 100%;
}

@keyframes lp-quicar {
	0%, 55%, 100% { transform: translateY(0) scale(1, 1); }
	12%           { transform: translateY(-14px) scale(0.95, 1.05); }
	24%           { transform: translateY(0) scale(1.15, 0.85); }
	32%           { transform: translateY(-6px) scale(1, 1); }
	40%           { transform: translateY(0) scale(1.06, 0.94); }
}

.lp-botao:hover .lp-bolinha {
	animation-duration: 1.2s;
}

/* ---- Estrelas piscando em sequência ---------------------------------- */

.lp-estrelas--animadas span {
	animation: lp-brilhar 3.2s ease-in-out infinite;
}

.lp-estrelas--animadas span:nth-child(2) { animation-delay: 0.25s; }
.lp-estrelas--animadas span:nth-child(3) { animation-delay: 0.5s; }

@keyframes lp-brilhar {
	0%, 70%, 100% { transform: scale(1) rotate(0); opacity: 1; }
	80%           { transform: scale(1.35) rotate(18deg); opacity: 0.85; }
}

/* ---- Pulso discreto do WhatsApp ---------------------------------------- */

.lp-whatsapp-flutuante::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: #1faa53;
	z-index: -1;
	animation: lp-pulso 2.6s ease-out infinite;
}

@keyframes lp-pulso {
	0%   { transform: scale(1);   opacity: 0.55; }
	70%  { transform: scale(1.6); opacity: 0; }
	100% { transform: scale(1.6); opacity: 0; }
}

/* ---- Faixa infinita (parceiros) --------------------------------------- */

.lp-faixa {
	overflow: hidden;
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
	mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.lp-faixa__trilho {
	display: flex;
	width: max-content;
	animation: lp-rolar var(--duracao, 30s) linear infinite;
}

.lp-faixa:hover .lp-faixa__trilho,
.lp-faixa:focus-within .lp-faixa__trilho {
	animation-play-state: paused;
}

@keyframes lp-rolar {
	to { transform: translateX(-50%); }
}

/* ---- Leve zoom da foto do topo (Ken Burns) ---------------------------- */

.lp-zoom-lento {
	animation: lp-zoom 18s ease-out both;
}

@keyframes lp-zoom {
	from { transform: scale(1.08); }
	to   { transform: scale(1); }
}

/* ---- Card com inclinação (tilt) ---------------------------------------
   O JS atualiza --rx / --ry conforme o mouse (só em telas com hover). */

[data-tilt] {
	transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0));
	transition: transform var(--lp-dur) var(--lp-ease), box-shadow var(--lp-dur) var(--lp-ease);
	will-change: transform;
}

/* ==========================================================================
   Movimento reduzido: tudo aparece de imediato, sem loops.
   ========================================================================== */

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

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}

	.js [data-revelar],
	.lp-camada {
		opacity: 1;
		transform: none;
	}

	.lp-faixa__trilho {
		animation: none;
		flex-wrap: wrap;
		justify-content: center;
		width: auto;
	}

	.lp-faixa__trilho [aria-hidden="true"] {
		display: none;
	}

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

/* ---- Cinema: barra de leitura e camadas com parallax ------------------- */
.lp-progresso {
	position: fixed;
	inset: 0 0 auto;
	z-index: calc(var(--lp-z-header) + 1);
	height: 3px;
	background: linear-gradient(90deg, var(--lp-vermelho), #ff5a00);
	transform: scaleX(0);
	transform-origin: 0 50%;
	pointer-events: none;
}
[data-parallax], .lp-topo__midia { will-change: transform; }
.lp-botao--grande, [data-magnetico], .lp-header__cta { transition: transform 0.35s var(--lp-ease), background-color var(--lp-dur-rapida) ease, box-shadow var(--lp-dur) var(--lp-ease), color var(--lp-dur-rapida) ease; }
@media (prefers-reduced-motion: reduce) { .lp-progresso { display: none; } }
