/* Sitolis · effets et modules « waouh » : autocollant, cartes animées, étapes empilées.
   Tout s'arrête avec « animations réduites » (voir site.css) ; rien n'est indispensable à la lecture. */

/* ---------- Transitions entre les pages (navigateurs compatibles) ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .entete { view-transition-name: entete; }
  ::view-transition-old(root) { animation: 200ms var(--k-courbe) both page-sortie; }
  ::view-transition-new(root) { animation: 420ms var(--k-courbe) both page-entree; }
}
@keyframes page-sortie { to { opacity: 0; } }
@keyframes page-entree { from { opacity: 0; transform: translateY(16px); } }

/* ---------- Mouvements communs ---------- */
@keyframes tourne { to { rotate: 360deg; } }
@keyframes tourne-svg { to { transform: rotate(360deg); } }
@keyframes pulse-point { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

/* ---------- Logo qui se dessine ---------- */
/* Le logo s'affiche tout de suite (pas d'animation d'ouverture) ; léger mouvement au survol seulement */
.entete-logo .logo { transition: transform var(--k-d-base) var(--k-courbe); }
.entete-logo:hover .logo { transform: translateY(-2px) rotate(-4deg); }
@keyframes trace { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

/* ---------- Barre de progression de la page ---------- */
.progres-page {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: 3px;
  transform: scaleX(var(--p, 0)); transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--k-jaune), var(--k-vert));
  pointer-events: none;
}

/* ---------- Titres : les mots montent un par un ---------- */
.mot { display: inline-block; overflow: hidden; vertical-align: top; padding: .2em .02em .08em; margin: -.2em -.02em -.08em; }
.mot > span { display: inline-block; }
.titre-anime .mot > span { animation: mot-monte 1000ms var(--k-courbe) both; animation-delay: calc(var(--i, 0) * 80ms + 150ms); }
@keyframes mot-monte { from { transform: translateY(112%) rotate(4deg); } }
.js-effets .titre-revele .mot > span { transform: translateY(112%) rotate(4deg); }
.js-effets .titre-revele.visible .mot > span { transform: none; transition: transform 900ms var(--k-courbe) calc(var(--i, 0) * 55ms); }

/* ---------- Premier écran : autocollant qui tourne ---------- */
.autocollant {
  position: absolute; z-index: 4; right: 14px; bottom: 92px;
  width: 84px; aspect-ratio: 1; border-radius: 50%; display: block;
  color: var(--k-noir); rotate: -8deg;
  box-shadow: var(--k-lueur-jaune);
  transition: translate .25s var(--k-courbe), scale var(--k-d-base) var(--k-courbe);
  -webkit-tap-highlight-color: transparent;
}
.autocollant svg { width: 100%; height: 100%; overflow: visible; }
.autocollant-fond { fill: var(--k-jaune); }
.autocollant-tour { transform-origin: 100px 100px; animation: tourne-svg 16s linear infinite; }
.autocollant text { font: 700 15.5px var(--k-police); fill: var(--k-noir); letter-spacing: .06em; }
.autocollant-fleche { fill: none; stroke: var(--k-noir); stroke-width: 11; stroke-linecap: round; stroke-linejoin: round; transform-origin: 100px 100px; transition: transform var(--k-d-base) var(--k-courbe); }
.autocollant:hover { scale: 1.08; }
.autocollant:hover .autocollant-fleche { transform: rotate(45deg); }
@media (min-width: 1200px) { .autocollant { width: 116px; right: calc(var(--k-marge) + 2%); bottom: 13%; } }

/* ---------- Texte qui s'allume mot après mot ---------- */
.manifeste { position: relative; overflow: hidden; padding-top: clamp(48px, 6vw, 88px); text-align: left; }
.manifeste .appel-interieur { align-items: flex-start; gap: var(--k-e7); position: relative; z-index: 1; }
.manifeste-etiquette { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--k-gris); }
.point-vert { width: 10px; height: 10px; border-radius: 50%; background: var(--k-vert); box-shadow: var(--k-lueur-verte); animation: pulse-point 2.4s ease-in-out infinite; }
.manifeste-texte {
  margin: 0; max-width: 24em;
  font-family: var(--k-police-titre); font-weight: 800; line-height: 1.18; letter-spacing: -.03em;
  font-size: clamp(22px, 2.5vw, 34px); text-wrap: balance;
}
.manifeste-texte .m { transition: opacity 420ms var(--k-courbe); }
.js-manifeste .manifeste-texte .m { opacity: .2; }
.js-manifeste .manifeste-texte .m.allume { opacity: 1; }
.manifeste .gros-bouton-zone { align-items: flex-start; }
@media (max-width: 767px) { .manifeste .gros-bouton-zone { align-items: center; } }

/* ---------- « Dans votre site » : cartes animées ---------- */
.bento-tete { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--k-e5); }
.bento { list-style: none; margin: var(--k-e7) 0 0; padding: 0; display: grid; gap: var(--k-e4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bento-photos { grid-column: 1 / -1; } }
@media (min-width: 1100px) {
  .bento { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .bento-photos { grid-column: span 4; }
  .bento-zone, .bento-avis, .bento-formulaire, .bento-3d { grid-column: span 2; }
}
.js-apparition .bento-carte:nth-child(2) { transition-delay: 90ms; }
.js-apparition .bento-carte:nth-child(3) { transition-delay: 180ms; }
.js-apparition .bento-carte:nth-child(4) { transition-delay: 270ms; }
.js-apparition .bento-carte:nth-child(5) { transition-delay: 360ms; }
.bento-carte { display: flex; }
.bento-boite {
  position: relative; display: flex; flex-direction: column; width: 100%; min-height: 290px; overflow: hidden;
  padding: clamp(22px, 2.6vw, 34px); border-radius: var(--k-r-panneau);
  background: var(--k-carte); box-shadow: inset 0 0 0 1px var(--k-bord-carte);
}
.bento-photos .bento-boite { min-height: 320px; }
.bento-visuel { position: relative; flex: 1; display: grid; place-items: center; min-height: 140px; margin-bottom: var(--k-e4); }
.bento-titre { margin: 0 0 var(--k-e2); font-weight: 800; font-size: clamp(20px, 1.7vw, 24px); line-height: 1.2; }
.bento-phrase { margin: 0; color: var(--k-gris); font-size: var(--k-t-petit); line-height: 1.5; }
.bento-note, .bento-section .note-bas { margin-top: var(--k-e5); }

/* Relief et lumière qui suivent la souris */
.incline {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .35s var(--k-courbe), box-shadow var(--k-d-base);
}
.incline::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity var(--k-d-base);
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 0%), rgba(255,255,255,.09), rgba(255,255,255,0) 62%);
}
.incline:hover::before { opacity: 1; }
.incline:hover { box-shadow: inset 0 0 0 1px rgba(255,233,51,.35); }
.incline > * { position: relative; z-index: 1; }

/* Carte 1 : photos en éventail */
.eventail { position: relative; width: min(66%, 300px); aspect-ratio: 3 / 2; }
.eventail img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 20px; box-shadow: var(--k-ombre-pastille), inset 0 0 0 1px var(--k-filet-sombre); transition: transform 700ms var(--k-courbe); }
.eventail img:nth-child(1) { transform: translateX(-28%) rotate(-10deg) scale(.92); }
.eventail img:nth-child(2) { transform: translateY(-4%); z-index: 2; }
.eventail img:nth-child(3) { transform: translateX(28%) rotate(10deg) scale(.92); }
.bento-boite:hover .eventail img:nth-child(1) { transform: translateX(-42%) rotate(-14deg) scale(.94); }
.bento-boite:hover .eventail img:nth-child(2) { transform: translateY(-9%) scale(1.05); }
.bento-boite:hover .eventail img:nth-child(3) { transform: translateX(42%) rotate(14deg) scale(.94); }

/* Carte 2 : zone d'intervention, ondes qui partent du centre */
.zone { position: relative; width: min(100%, 190px); aspect-ratio: 1; }
.zone-cercle, .zone-onde { position: absolute; inset: 0; margin: auto; border-radius: 50%; }
.zone-cercle { border: 1px solid rgba(255,255,255,.16); }
.zone-cercle:nth-child(1) { width: 100%; height: 100%; }
.zone-cercle:nth-child(2) { width: 66%; height: 66%; }
.zone-cercle:nth-child(3) { width: 33%; height: 33%; }
.zone-onde { width: 100%; height: 100%; border: 2px solid var(--k-vert); opacity: 0; animation: onde 3.6s var(--k-courbe) infinite; }
.zone-onde:nth-child(5) { animation-delay: 1.8s; }
@keyframes onde { from { transform: scale(.1); opacity: .9; } to { transform: scale(1); opacity: 0; } }
.zone-point { position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; border-radius: 50%; background: var(--k-vert); box-shadow: var(--k-lueur-verte); }
.puce {
  position: absolute; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px;
  border-radius: var(--k-r-pilule); background: var(--k-blanc); color: var(--k-noir);
  font-weight: 700; font-size: 14px; line-height: 1; white-space: nowrap; box-shadow: var(--k-ombre-pastille);
  animation: flotte-puce 5s ease-in-out infinite alternate;
}
.puce-1 { left: -2%; top: 14%; }
.puce-2 { right: -4%; top: 46%; animation-delay: -2s; }
.puce-3 { left: 6%; bottom: 8%; animation-delay: -3.5s; }
.puce-ok { width: 18px; height: 18px; border-radius: 50%; background: var(--k-vert); display: grid; place-items: center; }
.puce-ok svg { width: 12px; height: 12px; fill: none; stroke: var(--k-noir); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
@keyframes flotte-puce { from { translate: 0 0; } to { translate: 0 -8px; } }

/* Carte 3 : avis, étoiles qui s'allument */
.avis { display: grid; gap: var(--k-e4); justify-items: center; width: min(100%, 260px); }
.avis-etoiles { display: flex; gap: 6px; }
.avis-etoiles svg { width: 30px; height: 30px; fill: var(--k-vert); opacity: .22; animation: etoile 4.8s ease-in-out infinite; }
.avis-etoiles svg:nth-child(2) { animation-delay: .25s; }
.avis-etoiles svg:nth-child(3) { animation-delay: .5s; }
.avis-etoiles svg:nth-child(4) { animation-delay: .75s; }
.avis-etoiles svg:nth-child(5) { animation-delay: 1s; }
@keyframes etoile {
  0%, 8% { opacity: .22; transform: scale(.8); }
  18%, 70% { opacity: 1; transform: scale(1); filter: drop-shadow(0 0 8px rgba(180,240,0,.7)); }
  90%, 100% { opacity: .22; transform: scale(.8); }
}
.avis-bulle { width: 100%; display: grid; gap: 9px; padding: 18px; border-radius: 22px 22px 22px 6px; background: var(--k-blanc); box-shadow: var(--k-ombre-pastille); }
.avis-bulle span { display: block; height: 9px; border-radius: 5px; background: #D9D9D9; }
.avis-bulle span:nth-child(1) { width: 92%; }
.avis-bulle span:nth-child(3) { width: 58%; }

/* Carte 4 : formulaire qui se remplit tout seul */
.mini-form { position: relative; width: min(100%, 240px); display: grid; gap: 9px; padding: 18px; border-radius: 22px; background: var(--k-blanc); color: var(--k-noir); box-shadow: var(--k-ombre-pastille); }
.mini-label { display: block; width: 38%; height: 8px; border-radius: 4px; background: #CFCFCF; }
.mini-champ { height: 30px; padding: 0 10px; display: flex; align-items: center; border-radius: 10px; background: #F3F3F3; box-shadow: inset 0 0 0 1px #E2E2E2; }
.mini-champ-haut { height: 54px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 7px; }
.mini-saisie { display: block; height: 8px; border-radius: 4px; background: var(--k-noir); width: 0; animation: saisie 6s steps(14) infinite; }
.mini-ligne { display: block; height: 7px; border-radius: 4px; background: #BDBDBD; }
.mini-ligne:nth-child(1) { width: 90%; }
.mini-ligne:nth-child(2) { width: 55%; }
.mini-bouton { display: grid; place-items: center; height: 36px; border-radius: var(--k-r-pilule); background: var(--k-jaune); font-weight: 800; font-size: 14px; animation: bouton 6s ease infinite; }
.mini-ok { position: absolute; right: -10px; bottom: -10px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--k-vert); box-shadow: var(--k-lueur-verte); opacity: 0; scale: .4; animation: ok 6s var(--k-courbe) infinite; }
.mini-ok svg { width: 20px; height: 20px; fill: none; stroke: var(--k-noir); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
@keyframes saisie { 0% { width: 0; } 45%, 100% { width: 62%; } }
@keyframes bouton { 0%, 62% { scale: 1; } 68% { scale: .94; } 74%, 100% { scale: 1; } }
@keyframes ok { 0%, 70% { opacity: 0; scale: .4; } 78%, 94% { opacity: 1; scale: 1; } 100% { opacity: 0; scale: .4; } }

/* Carte 5 : cube en 3D */
.cube-scene { position: relative; width: 150px; height: 150px; perspective: 700px; margin-bottom: 18px; }
.cube { position: absolute; inset: 0; transform-style: preserve-3d; animation: cube 16s linear infinite; }
.face { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 22px; border: 1.5px solid rgba(255,255,255,.4); background: rgba(255,255,255,.05); }
.face-1 { transform: translateZ(75px); background: var(--k-noir); border-color: rgba(255,233,51,.7); }
.face-2 { transform: rotateY(90deg) translateZ(75px); background: rgba(180,240,0,.18); border-color: rgba(180,240,0,.7); }
.face-3 { transform: rotateY(180deg) translateZ(75px); background: var(--k-jaune); border-color: var(--k-jaune); }
.face-4 { transform: rotateY(-90deg) translateZ(75px); }
.face-5 { transform: rotateX(90deg) translateZ(75px); background: rgba(180,240,0,.12); }
.face-6 { transform: rotateX(-90deg) translateZ(75px); }
.cube-logo { width: 38%; height: auto; color: var(--k-jaune); }
.cube-ombre { position: absolute; left: 50%; bottom: -34px; width: 120px; height: 20px; margin-left: -60px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.65), rgba(0,0,0,0)); }
@keyframes cube { from { transform: rotateX(-22deg) rotateY(0deg); } to { transform: rotateX(-22deg) rotateY(360deg); } }

/* ---------- Les 3 étapes : trois petites cartes côte à côte ---------- */
.pile { list-style: none; margin: var(--k-e5) 0 0; padding: 0; display: grid; gap: var(--k-e3); }
@media (min-width: 860px) { .pile { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pile-carte { display: grid; align-content: start; gap: var(--k-e3); padding: clamp(20px, 2vw, 26px); border-radius: 20px; background: var(--k-carte); color: var(--k-blanc); box-shadow: inset 0 0 0 1px var(--k-bord-carte); }
.pile-num { font: 800 clamp(22px, 2vw, 26px)/1 var(--k-police-titre); letter-spacing: -.03em; color: var(--k-vert); }
.pile-titre { margin: 0; font-family: var(--k-police-titre); font-weight: 800; letter-spacing: -.02em; font-size: clamp(18px, 1.5vw, 21px); line-height: 1.25; }
.pile-phrase { margin: var(--k-e2) 0 0; color: var(--k-gris); font-size: 15px; line-height: 1.45; }
.pile-suite { margin: var(--k-e5) 0 0; }

/* ---------- Le grand nom : les lettres arrivent une par une et réagissent au survol ---------- */
.lettre { display: inline-block; transition: transform 900ms var(--k-courbe) calc(var(--i, 0) * 70ms), color var(--k-d-base); }
.js-apparition .pied-nom:not(.visible) .lettre { transform: translateY(55%); }
.pied-nom .lettre:hover { transform: translateY(-5%); color: var(--k-jaune); transition-delay: 0s; }

/* ---------- Petits plus ---------- */
.chiffre { font-variant-numeric: tabular-nums; }
.gros-bouton.aimant { transition: translate .25s var(--k-courbe), background-color var(--k-d-micro), transform var(--k-d-micro) var(--k-courbe); }
.tuile img, .carte-metier-image img { transition: transform 600ms var(--k-courbe); }
.tuile:hover img { transform: scale(1.06) rotate(-1.5deg); }
.carte-metier:hover .carte-metier-image img { transform: scale(1.05); }

/* Pause quand le bloc n'est pas à l'écran (batterie) ; images fixes sur appareil modeste */
.hors-ecran * { animation-play-state: paused !important; }
.anim-legeres .cube, .anim-legeres .zone-onde, .anim-legeres .autocollant-tour, .anim-legeres .mini-saisie, .anim-legeres .avis-etoiles svg { animation: none; }
.anim-legeres .avis-etoiles svg { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .avis-etoiles svg { opacity: 1; }
  .mini-saisie { width: 62%; }
  .mini-ok { opacity: 1; scale: 1; }
}
