/*
 * animations.css
 * Keyframes, animations de révélation au scroll, effet machine à écrire.
 * Toutes les animations sont désactivées si l'utilisateur préfère
 * un mouvement réduit (prefers-reduced-motion).
 */

@keyframes scroll-wheel {
	0%   { opacity: 1; transform: translateY(0); }
	70%  { opacity: 0; transform: translateY(12px); }
	100% { opacity: 0; transform: translateY(0); }
}

@keyframes preloader-pulse {
	0%, 100% { transform: scale(1); opacity: 1; }
	50%      { transform: scale(1.12); opacity: 0.7; }
}

@keyframes caret-blink {
	0%, 45%  { opacity: 1; }
	50%, 95% { opacity: 0; }
	100%     { opacity: 1; }
}

/* Révélation au scroll : l'état initial est décalé et transparent,
   la classe .is-visible est posée par l'IntersectionObserver. */
.reveal {
	opacity: 0;
	transform: translateY(32px);
	transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.reveal.is-visible {
	opacity: 1;
	transform: translateY(0);
}

/* Décalage en cascade pour les grilles de cartes */
.skills__grid .reveal:nth-child(2),
.projects__grid .reveal:nth-child(2),
.about__stats .reveal:nth-child(2) { transition-delay: 0.1s; }

.skills__grid .reveal:nth-child(3),
.projects__grid .reveal:nth-child(3),
.about__stats .reveal:nth-child(3) { transition-delay: 0.2s; }

.skills__grid .reveal:nth-child(4),
.projects__grid .reveal:nth-child(4),
.about__stats .reveal:nth-child(4) { transition-delay: 0.3s; }

.skills__grid .reveal:nth-child(5),
.projects__grid .reveal:nth-child(5) { transition-delay: 0.4s; }

.skills__grid .reveal:nth-child(6),
.projects__grid .reveal:nth-child(6) { transition-delay: 0.5s; }

.typing-caret {
	display: inline-block;
	width: 3px;
	height: 1.1em;
	margin-left: 4px;
	vertical-align: text-bottom;
	background: var(--accent);
	animation: caret-blink 1s step-end infinite;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}

	.reveal {
		opacity: 1;
		transform: none;
	}
}
