/*
 * Secureland : couche d'animation (même règles que edu.secureland.fr).
 * Fichier séparé pour pouvoir la retirer d'un coup (functions.php, handle « secureland-motion »).
 * - seulement transform, opacity, clip-path et filter : aucun décalage de mise en page ;
 * - tout est sous prefers-reduced-motion: no-preference ;
 * - les apparitions au défilement n'existent que si theme.js a posé la classe .sl-motion sur <html>.
 *   Sans JavaScript, la page s'affiche directement dans son état final.
 */

@media (prefers-reduced-motion: no-preference) {

	/* ---------- Hero : entrée en cascade ---------- */
	@keyframes sl-rise { from { opacity: 0; transform: translateY(26px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
	@keyframes sl-pop { from { opacity: 0; transform: scale(.86) rotate(-6deg); } to { opacity: 1; transform: none; } }
	@keyframes sl-drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(18%, 10%) scale(1.15); } 100% { transform: translate(-6%, 22%) scale(.95); } }
	@keyframes sl-sheen { from { background-position: 180% 0; } to { background-position: -80% 0; } }
	@keyframes sl-spin { to { transform: rotate(360deg); } }
	@keyframes sl-spin-r { to { transform: rotate(-360deg); } }
	@keyframes sl-scan { 0% { transform: translateY(0); } 100% { transform: translateY(270px); } }
	@keyframes sl-draw { from { stroke-dashoffset: 140; } to { stroke-dashoffset: 0; } }
	@keyframes sl-float { 50% { transform: translateY(-8px); } }
	@keyframes sl-shield-in { from { opacity: 0; transform: translateY(30px) scale(.94); } to { opacity: 1; transform: none; } }

	.sl-hero > .sl-in > div:first-child > * { animation: sl-rise .9s cubic-bezier(.2, .7, .2, 1) both; }
	.sl-hero > .sl-in > div:first-child > :nth-child(1) { animation-delay: .05s; }
	.sl-hero > .sl-in > div:first-child > :nth-child(2) { animation-delay: .14s; }
	.sl-hero > .sl-in > div:first-child > :nth-child(3) { animation-delay: .28s; }
	.sl-hero > .sl-in > div:first-child > :nth-child(4) { animation-delay: .4s; }
	.sl-hero::before { animation: sl-drift 22s ease-in-out infinite alternate; }

	/* Bouclier : anneaux qui tournent, balayage, coche tracée, étiquettes qui flottent */
	.sl-shield { animation: sl-shield-in 1.3s cubic-bezier(.16, .8, .24, 1) .25s both; }
	.sl-shield .r1 { animation: sl-spin 40s linear infinite; }
	.sl-shield .r2 { animation: sl-spin-r 60s linear infinite; }
	.sl-shield .r3 { animation: sl-spin 9s linear infinite; }
	.sl-shield .scan { animation: sl-scan 3.6s cubic-bezier(.45, 0, .55, 1) infinite alternate; }
	.sl-shield .check { stroke-dasharray: 140; animation: sl-draw 1s cubic-bezier(.6, 0, .2, 1) 1.1s both; }
	.sl-shield .tag { animation: sl-pop .7s cubic-bezier(.3, 1.4, .5, 1) both, sl-float 6s ease-in-out infinite; }
	.sl-shield .t1 { animation-delay: 1.3s, 2s; }
	.sl-shield .t2 { animation-delay: 1.45s, 3s; }
	.sl-shield .t3 { animation-delay: 1.6s, 4s; }
	.sl-shield svg { transition: transform .6s cubic-bezier(.2, .7, .2, 1); }

	/* Les trois métiers montent après le titre */
	.sl-pillars .sl-card { animation: sl-rise .9s cubic-bezier(.2, .7, .2, 1) both; }
	.sl-pillars li:nth-child(1) { animation-delay: .55s; }
	.sl-pillars li:nth-child(2) { animation-delay: .68s; }
	.sl-pillars li:nth-child(3) { animation-delay: .81s; }

	/* Mot qui change dans le titre (theme.js) : sortie vers le haut, entrée par le bas */
	.sl-rotate em { transition: opacity .45s ease, transform .55s cubic-bezier(.2, .7, .2, 1), filter .45s; }
	.sl-rotate.is-out em { opacity: 0; transform: translateY(-40%); filter: blur(6px); }
	.sl-rotate.is-pre em { opacity: 0; transform: translateY(40%); filter: blur(6px); transition: none; }

	/* Reflet qui balaie les mots en italique lumineux */
	.sl-hero h1 .sl-glow, .sl-h2 .sl-glow {
		background: linear-gradient(100deg, var(--sl-brand-2) 0%, var(--sl-brand-2) 40%, #E9FFFB 50%, var(--sl-brand-2) 60%, var(--sl-brand-2) 100%);
		background-size: 250% 100%;
		-webkit-background-clip: text; background-clip: text;
		-webkit-text-fill-color: transparent;
		animation: sl-sheen 1.6s ease-in-out 1.1s both, sl-sheen 1.6s ease-in-out 10s infinite;
	}

	/* ---------- Apparitions au défilement (classes posées par theme.js) ---------- */
	.sl-motion .sl-rv { opacity: 0; transform: translateY(28px); transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--sl-i, 0) * 90ms); }
	.sl-motion .sl-rv.is-in { opacity: 1; transform: none; }
	.sl-motion .sl-rv.sl-card.is-in { transition: opacity .8s cubic-bezier(.2, .7, .2, 1) calc(var(--sl-i, 0) * 90ms), transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s, border-color .35s; }

	.sl-motion .sl-rv.sl-card.is-in:hover { transform: translateY(-4px); }
	.sl-motion .sl-band li.sl-rv.is-in:hover { transform: translateX(-4px); }

	/* Images : dévoilement par le bas avec léger dézoom */
	.sl-motion .sl-rv-img { overflow: hidden; }
	.sl-motion .sl-rv-img img { clip-path: inset(0 0 100% 0); transform: scale(1.15); transition: clip-path 1.2s cubic-bezier(.7, 0, .2, 1), transform 1.6s cubic-bezier(.2, .7, .2, 1); }
	.sl-motion .sl-rv-img.is-in img { clip-path: inset(0 0 0 0); transform: scale(1); }

	/* Surtitres : filet turquoise qui se trace */
	.sl-motion .sl-eyebrow.sl-rv { position: relative; }
	.sl-motion .sl-eyebrow.sl-rv::after { content: ""; position: absolute; left: 0; bottom: -6px; height: 1px; width: 56px; background: linear-gradient(90deg, var(--sl-brand), transparent); transform: scaleX(0); transform-origin: left; transition: transform 1s cubic-bezier(.2, .7, .2, 1) .3s; }
	.sl-motion .is-center .sl-eyebrow.sl-rv::after { left: calc(50% - 28px); transform-origin: center; }
	.sl-motion .sl-eyebrow.sl-rv.is-in::after { transform: scaleX(1); }

	/* ---------- En-tête : se resserre au défilement, barre de progression ---------- */
	.sl-hdr > .sl-in { transition: min-height .35s ease; }
	.sl-hdr { transition: background-color .35s ease, box-shadow .35s ease; }
	.sl-hdr.is-scrolled > .sl-in { min-height: 62px; }
	.sl-hdr.is-scrolled { background-color: rgba(4, 11, 24, .95); box-shadow: 0 12px 40px -24px #000; }
	.sl-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--sl-brand), var(--sl-brand-2)); transform: scaleX(0); transform-origin: left; pointer-events: none; opacity: .9; }

	/* ---------- Logos : défilement continu, pause au survol ---------- */
	@keyframes sl-marquee { to { transform: translateX(-50%); } }
	.sl-refs.is-marquee .sl-in { flex-wrap: nowrap; overflow: hidden; }
	.sl-refs.is-marquee .sl-marquee { flex: 1; min-width: 0; width: 100%; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
	.sl-refs.is-marquee ul { flex-wrap: nowrap; width: max-content; gap: 0; animation: sl-marquee 36s linear infinite; }
	.sl-refs.is-marquee li { padding-inline: 30px; flex: none; }
	.sl-refs.is-marquee:hover ul { animation-play-state: paused; }

	/* ---------- Halo qui suit le pointeur ---------- */
	.sl-spot { isolation: isolate; }
	.sl-spot::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit; opacity: 0; transition: opacity .35s; background: radial-gradient(420px circle at var(--sx, 50%) var(--sy, 50%), rgba(17, 201, 172, .14), transparent 45%); }
	.sl-spot:hover::before { opacity: 1; }

	/* ---------- Boutons principaux : reflet au survol ---------- */
	.sl-btn-primary, .wp-block-button:not(.is-style-lien):not(.is-style-fantome) .wp-block-button__link { overflow: hidden; }
	.sl-btn-primary::after, .wp-block-button:not(.is-style-lien):not(.is-style-fantome) .wp-block-button__link::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%); transform: translateX(-120%); pointer-events: none; }
	.sl-btn-primary:hover::after, .wp-block-button:not(.is-style-lien):not(.is-style-fantome) .wp-block-button__link:hover::after { transform: translateX(120%); transition: transform .8s ease; }

	/* ---------- Chiffres : barre lumineuse sous chaque compteur une fois compté ---------- */
	.sl-stats li { position: relative; }
	.sl-stats .n::after { content: ""; display: block; height: 2px; width: 40px; margin-left: 10px; align-self: center; background: linear-gradient(90deg, var(--sl-brand), transparent); transform: scaleX(0); transform-origin: left; transition: transform 1s cubic-bezier(.2, .7, .2, 1) .2s; }
	.sl-stats .is-counted .n::after { transform: scaleX(1); }

	/* ---------- Parallaxe douce des grandes images ---------- */
	.sl-motion .sl-band > img, .sl-motion .sl-pagehead > img { will-change: transform; }

	/* ---------- Transitions entre pages (navigateurs récents) ---------- */
	@view-transition { navigation: auto; }
	::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }
}
