/* =========================================================
   SCIE SUR MESURE — Effets « kit premium »
   Effets de mouvement inspirés des modèles de page builders :
   titres animés mot par mot, rideaux sur les images, parallaxe,
   boutons à balayage, compteurs, bandeau défilant, en-tête
   escamotable, barre de progression et retour en haut.
   Tout est désactivé si le visiteur préfère réduire les animations.
   ========================================================= */

/* Entrée de page en douceur */
@keyframes fxEntree { from { opacity: 0; } to { opacity: 1; } }
.wp-site-blocks { animation: fxEntree .7s var(--ease) both; }

/* ---------- Barre de progression de lecture ---------- */
.fx-progression {
	position: fixed; top: 0; left: 0; right: 0; z-index: 1000; height: 3px;
	background: var(--taupe); transform-origin: 0 50%; transform: scaleX(0);
	pointer-events: none;
}
.admin-bar .fx-progression { top: 32px; }
@media (max-width: 782px) { .admin-bar .fx-progression { top: 46px; } }

/* ---------- En-tête : verre dépoli + escamotable ---------- */
.header { transition: transform .45s var(--ease), box-shadow .3s, border-color .3s, background-color .3s; will-change: transform; }
.header.is-scrolled { background: rgba(255, 255, 255, .82); -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px); }
.header.fx-cache { transform: translateY(-110%); box-shadow: none; }
.menu-open .header.fx-cache { transform: none; }

/* ---------- Titres animés mot par mot ---------- */
.fx-mot { display: inline-block; overflow: hidden; vertical-align: bottom; padding: .06em .02em .14em; margin: -.06em -.02em -.14em; }
.fx-mot__in { display: inline-block; transform: translateY(110%); animation: fxMot 1s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 80ms + .2s); }
@keyframes fxMot { to { transform: none; } }
.fx-texte-apres { opacity: 0; transform: translateY(24px); animation: fxMonte .9s var(--ease) forwards; animation-delay: var(--d, .7s); }
@keyframes fxMonte { to { opacity: 1; transform: none; } }

/* Trait de pinceau qui se dessine sous les mots « brush » */
.hero .brush, .cta .brush, .page-hero .brush { position: relative; display: inline-block; }
.hero .brush::after, .cta .brush::after, .page-hero .brush::after {
	content: ""; position: absolute; left: -3%; right: -3%; bottom: -.14em; height: .26em;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 14' preserveAspectRatio='none'%3E%3Cpath d='M3 9c38-6 83-8 129-6 22 1 43 3 65 6' fill='none' stroke='%23b9ad9e' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
	transform: scaleX(0); transform-origin: 0 50%; transition: transform 1.1s var(--ease) .9s;
}
.fx-vu .brush::after, .is-visible .brush::after { transform: scaleX(1); }

/* ---------- Surtitres : le trait s'allonge ---------- */
.reveal .eyebrow::before, .reveal.eyebrow::before { width: 0; transition: width .9s var(--ease) .35s; }
.reveal.is-visible .eyebrow::before, .reveal.is-visible.eyebrow::before { width: 38px; }

/* ---------- Images : rideau à l'apparition ---------- */
.fx-rideau { clip-path: inset(0 0 0 100%); transition: clip-path 1.3s cubic-bezier(.77, 0, .18, 1); }
.fx-rideau > .media__img { transform: scale(1.18); transition: transform 1.8s var(--ease); }
.fx-rideau.fx-ouvert { clip-path: inset(0 0 0 0); }
.fx-rideau.fx-ouvert > .media__img { transform: none; }
.project:hover .fx-rideau.fx-ouvert > .media__img { transform: scale(1.05); }

/* ---------- Parallaxe des grands visuels ---------- */
.fx-parallaxe { will-change: transform; }
.hero > .media.fx-parallaxe, .page-hero > .media.fx-parallaxe, .cta > .media.fx-parallaxe { inset: -12% 0; }

/* Zoom lent façon « Ken Burns » sur le visuel d'accueil */
.hero > .media > .media__img { animation: fxKenBurns 18s ease-in-out infinite alternate; }
@keyframes fxKenBurns { from { transform: scale(1); } to { transform: scale(1.1); } }

/* ---------- Boutons : balayage de couleur ---------- */
.btn { --fx-fond: var(--ink); --fx-balai: var(--taupe); --fx-texte-survol: var(--white); position: relative; overflow: hidden; isolation: isolate; background: var(--fx-fond); }
.btn::before { content: ""; position: absolute; inset: -2px; z-index: -1; background: var(--fx-balai); transform: scaleX(0); transform-origin: 100% 50%; transition: transform .55s cubic-bezier(.77, 0, .18, 1); }
.btn:hover::before, .btn:focus-visible::before { transform: scaleX(1); transform-origin: 0 50%; }
.btn:hover { background: var(--fx-fond); color: var(--fx-texte-survol); }
.btn--light { --fx-fond: var(--white); --fx-balai: var(--taupe); }
.btn--outline { --fx-fond: transparent; --fx-balai: var(--ink); }
.btn--outline-light { --fx-fond: transparent; --fx-balai: var(--white); --fx-texte-survol: var(--ink); }
.btn--light:hover, .btn--outline:hover, .btn--outline-light:hover { background: var(--fx-fond); }

/* ---------- Cartes : élévation au survol ---------- */
.gamme-carte, ul.products li.product, .boutique-accueil li.product {
	transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.gamme-carte:hover, ul.products li.product:hover {
	transform: translateY(-8px);
	box-shadow: 0 26px 50px -18px rgba(23, 25, 38, .22);
}
.gamme-carte > .media > .media__img { transition: transform 1.2s var(--ease); }
.gamme-carte:hover > .media > .media__img { transform: scale(1.06); }

/* ---------- Apparitions en cascade (grilles) ---------- */
.fx-cascade { opacity: 0; transform: translateY(46px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: var(--fx-delai, 0s); }
.fx-cascade.is-visible { opacity: 1; transform: none; }
.fx-cascade.is-visible:hover { transition-delay: 0s; }
ul.products li.product.fx-cascade.is-visible:hover, .gamme-carte.is-visible:hover { transform: translateY(-8px); }

/* ---------- Bandeau défilant ---------- */
.fx-defilant { overflow: hidden; background: var(--ink); color: var(--white); padding: 26px 0; border-block: 1px solid rgba(255, 255, 255, .08); }
.fx-defilant__piste { display: flex; width: max-content; animation: fxDefile 38s linear infinite; }
.fx-defilant:hover .fx-defilant__piste { animation-play-state: paused; }
.fx-defilant__groupe { display: flex; align-items: center; flex: none; }
.fx-defilant__item { display: inline-flex; align-items: center; gap: 38px; padding-right: 38px; font-family: var(--f-title); font-weight: 800; font-size: clamp(1.4rem, 3vw, 2.4rem); text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; }
.fx-defilant__item:nth-child(even) { color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, .65); }
.fx-defilant__item::after { content: "✦"; font-size: .55em; color: var(--taupe); -webkit-text-stroke: 0; }
@keyframes fxDefile { to { transform: translateX(-50%); } }

/* ---------- Bouton retour en haut avec anneau de progression ---------- */
.fx-haut {
	position: fixed; right: 28px; bottom: 112px; z-index: 440;
	width: 54px; height: 54px; border: 0; border-radius: 50%; padding: 0;
	background: var(--white); color: var(--ink); cursor: pointer;
	box-shadow: 0 10px 30px rgba(23, 25, 38, .18);
	opacity: 0; visibility: hidden; transform: translateY(16px);
	transition: opacity .35s, transform .35s var(--ease), visibility .35s, background .3s, color .3s;
}
.fx-haut.fx-sans-fab { bottom: 28px; }
.fx-haut.is-visible { opacity: 1; visibility: visible; transform: none; }
.fx-haut:hover { background: var(--ink); color: var(--white); }
.fx-haut:focus-visible { outline: 2px solid var(--taupe); outline-offset: 3px; }
.fx-haut svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.fx-haut__anneau { fill: none; stroke: var(--taupe); stroke-width: 2.5; stroke-dasharray: 150.8; stroke-dashoffset: 150.8; }
.fx-haut__fleche { position: relative; font-size: 1.1rem; line-height: 1; }
@media (max-width: 960px) { .fx-haut { right: 18px; bottom: 96px; width: 48px; height: 48px; } .fx-haut.fx-sans-fab { bottom: 18px; } }

/* ---------- Respect des préférences d'accessibilité ---------- */
@media (prefers-reduced-motion: reduce) {
	.wp-site-blocks, .fx-mot__in, .fx-texte-apres, .hero > .media > .media__img, .fx-defilant__piste { animation: none !important; }
	.fx-mot__in, .fx-texte-apres { transform: none; opacity: 1; }
	.fx-rideau, .fx-rideau > .media__img { clip-path: none; transform: none; transition: none; }
	.fx-cascade { opacity: 1; transform: none; transition: none; }
	.btn::before { transition: none; }
	.header.fx-cache { transform: none; }
	.hero .brush::after, .cta .brush::after, .page-hero .brush::after { transform: scaleX(1); transition: none; }
}
