/* ==========================================================================
   S9 - Animazioni di comparsa
   Solo opacity e transform. Lo stato nascosto esiste solo con html.js-reveal
   (classe messa da uno script inline in <head>, e solo se l'utente non ha
   chiesto di ridurre il movimento); senza JS tutto resta visibile.
   - Hero: CSS puro, parte al caricamento, nessun JS necessario.
   - Resto della pagina: ui.js aggiunge .cc-r agli elementi sotto la piega
     e .is-in quando entrano nel viewport; a fine animazione toglie
     entrambe le classi (gli hover dei componenti tornano quelli propri).
   ========================================================================== */
:root {
	--cc-r-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
	--cc-r-dist: 20px;
	--cc-r-dur: 640ms;
	--cc-hero-dist: 16px;
	--cc-hero-dur: 560ms;
}

@keyframes cc-rise {
	from {
		opacity: 0;
		transform: translate3d(0, var(--cc-hero-dist), 0);
	}
}

@keyframes cc-fade {
	from {
		opacity: 0;
	}
}

@media (prefers-reduced-motion: no-preference) {
	/* Hero: testo e CTA, poi immagine. Fill "backwards": a fine corsa l'elemento torna ai suoi stili. */
	.js-reveal .cc-homehero__head,
	.js-reveal .cc-hero__head,
	.js-reveal .cc-testata__inner {
		animation: cc-rise var(--cc-hero-dur) var(--cc-r-ease) backwards;
	}

	.js-reveal .cc-homehero__copy,
	.js-reveal .cc-hero__copy {
		animation: cc-rise var(--cc-hero-dur) var(--cc-r-ease) 70ms backwards;
	}

	.js-reveal .cc-homehero__cta {
		animation: cc-rise var(--cc-hero-dur) var(--cc-r-ease) 140ms backwards;
	}

	.js-reveal .cc-homehero__photo,
	.js-reveal .cc-hero__photo,
	.js-reveal .cc-lhero__photo {
		animation: cc-rise var(--cc-hero-dur) var(--cc-r-ease) 140ms backwards;
	}

	.js-reveal .cc-hero__circle,
	.js-reveal .cc-hero__deco {
		animation: cc-fade var(--cc-hero-dur) var(--cc-r-ease) 140ms backwards;
	}

	/* Resto della pagina. */
	.js-reveal .cc-r {
		opacity: 0;
		transform: translate3d(0, var(--cc-r-dist), 0);
	}

	.js-reveal .cc-r.is-in {
		opacity: 1;
		transform: none;
		transition:
			opacity var(--cc-r-dur) var(--cc-r-ease) var(--cc-r-delay, 0ms),
			transform var(--cc-r-dur) var(--cc-r-ease) var(--cc-r-delay, 0ms);
	}
}

/* Stampa: tutto visibile. */
@media print {
	.js-reveal .cc-r {
		opacity: 1;
		transform: none;
	}
}
