/*
  Architectzone (architectzone.pro) — animations.css
  Partie 1 : SOCLE commun (templates/one-page). Partie 2 : animations propres au site (logo, signature).
  Sans JavaScript, rien n'est masqué : le script de tête pose data-motion="full" avant le premier dessin,
  et les entrées ne jouent qu'avec ce repère. Aucun mode d'animation réduit (décision de l'utilisateur).
*/

@keyframes entree-monter {
  from {
    opacity: 0;
    transform: translateY(var(--depart, 26px));
  }
}

@keyframes entree-descendre {
  from {
    opacity: 0;
    transform: translateY(-26px);
  }
}

@keyframes entree-fondu {
  from {
    opacity: 0;
  }
}

@keyframes entree-echelle {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
}

/* Barre du haut : elle descend au premier affichage */
[data-motion="full"] .barre__inner {
  animation: entree-descendre 0.8s var(--ease-sortie) 0.1s backwards;
}

/* Premier écran : chaque élément [data-entree] monte, décalé par --d (en secondes) */
[data-motion="full"] [data-entree] {
  animation: entree-monter 0.9s var(--ease-sortie) calc(0.15s + var(--d, 0) * 1s) backwards;
}

[data-motion="full"] [data-entree="fondu"] {
  animation-name: entree-fondu;
}

[data-motion="full"] [data-entree="echelle"] {
  animation-name: entree-echelle;
}

/* Titre découpé en mots dans le HTML (<span class="mot" style="--i:n">) */
.mot {
  display: inline-block;
}

[data-motion="full"] [data-entree-titre] .mot {
  --depart: 0.6em;
  animation: entree-monter 0.9s var(--ease-sortie) calc(0.25s + var(--i, 0) * 0.06s) backwards;
}

/* Boucles décoratives arrêtées hors écran */
.hors-ecran .boucle,
.hors-ecran .boucle * {
  animation-play-state: paused !important;
}

/* ============================================================================================
   PARTIE 2 — ANIMATIONS DU SITE (logo en boucle, slogan, signature)
   ============================================================================================ */

/*
  Architectzone : le plan du logo se dessine, s'efface et recommence ; les lettres du slogan se tracent
  comme à l'encre ; au premier écran, l'arche s'ouvre sur la maison ; au-dessus de la coupe bioclimatique,
  le soleil fait sa course d'est en ouest.
*/
[data-motion="full"] .az-plan {
  animation: az-trace 6s ease-in-out infinite backwards;
}

[data-motion="full"] .az-cloison {
  animation: az-trace 6s ease-in-out 0.6s infinite backwards;
}

@keyframes az-trace {
  0% {
    stroke-dashoffset: 100;
  }
  40%,
  70% {
    stroke-dashoffset: 0;
  }
  95%,
  100% {
    stroke-dashoffset: -100;
  }
}

[data-motion="full"] .barre .marque__slogan span {
  animation: az-encre 9s var(--ease-doux) calc(0.8s + var(--i) * 0.045s) infinite both;
}

@keyframes az-encre {
  0% {
    clip-path: inset(0 100% 0 0);
  }
  2.5%,
  84% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
  }
  90%,
  100% {
    opacity: 0;
    clip-path: inset(0 0 0 0);
  }
}

[data-motion="full"] .arche__cadre {
  animation: az-arche 1.8s var(--ease-sortie) 0.35s backwards;
}

@keyframes az-arche {
  from {
    clip-path: inset(48% 36% 0 36% round 9999px 9999px 0 0);
  }
}

/* T50 : l'arc terre cuite se trace autour de la maison, puis la grille de points s'allume rangée par rangée */
[data-motion="full"] .arche .arc-terre circle {
  animation: az-arc 1.9s var(--ease-sortie) 0.7s backwards;
}

@keyframes az-arc {
  from {
    stroke-dasharray: 0 100;
  }
}

[data-motion="full"] .arche .points {
  animation: az-points 1s steps(5) 1.4s backwards;
}

@keyframes az-points {
  from {
    clip-path: inset(0 0 100% 0);
  }
}

[data-motion="full"] .ouverture__cotes span {
  animation: entree-fondu 0.8s ease calc(1.2s + var(--n, 0) * 0.15s) backwards;
}

[data-motion="full"] .soleil__astre {
  animation: az-soleil 9s ease-in-out infinite alternate;
}

@keyframes az-soleil {
  from {
    transform: rotate(-62deg);
  }
  to {
    transform: rotate(62deg);
  }
}

/* ---------- T53-HEROS : entrées de la section héros, indépendantes du socle ---------- */
@keyframes t53-monter {
  from {
    opacity: 0;
    transform: translateY(var(--depart, 26px));
  }
}

@keyframes t53-fondu {
  from {
    opacity: 0;
  }
}

.heros .mot {
  display: inline-block;
}

[data-motion="full"] .heros [data-entree] {
  animation: t53-monter 0.9s cubic-bezier(0.22, 1, 0.36, 1) calc(0.15s + var(--d, 0) * 1s) backwards;
}

[data-motion="full"] .heros [data-entree="fondu"] {
  animation-name: t53-fondu;
}

[data-motion="full"] .heros [data-entree-titre] .mot {
  --depart: 0.6em;
  animation: t53-monter 0.9s cubic-bezier(0.22, 1, 0.36, 1) calc(0.25s + var(--i, 0) * 0.06s) backwards;
}

/* ---------- Nouvelle section héros (T53, 02/11/2026) ----------
   L'appareil et sa photo entrent ensemble (jamais de double image) : ils montent de 32 px et se posent en
   descendant de l'échelle 1,04 à 1, sur une courbe de ressort sans rebond. Le mot géant glisse en sens inverse.
   Le halo respire, la lèvre de la turbine pulse, la molette de l'indicateur descend. */
@keyframes heros-plan {
  from {
    opacity: 0;
    transform: translateY(32px) scale(1.04);
  }
}

@keyframes heros-mot {
  from {
    opacity: 0;
    transform: translateX(6%);
  }
}

@keyframes heros-respire {
  50% {
    opacity: 0.55;
    transform: scale(0.94);
  }
}

@keyframes heros-turbine {
  50% {
    opacity: 0.45;
  }
}

@keyframes heros-molette {
  0% {
    opacity: 0;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(9px);
  }
}

[data-motion="full"] .heros [data-entree="plan"] {
  animation: heros-plan 1.6s cubic-bezier(0.16, 1, 0.3, 1) calc(0.15s + var(--d, 0) * 1s) backwards;
}

[data-motion="full"] .heros .heros__mot > [data-entree] {
  animation: heros-mot 1.9s cubic-bezier(0.16, 1, 0.3, 1) calc(0.15s + var(--d, 0) * 1s) backwards;
}

.heros__halo {
  animation: heros-respire 7s ease-in-out infinite;
}

.heros__lueur {
  animation: heros-turbine 1.8s ease-in-out infinite;
}

.heros__souris::after {
  animation: heros-molette 1.8s ease-in-out infinite;
}

html.a-intro .heros [data-entree],
html.a-intro .heros [data-entree-titre] .mot,
html.a-intro .heros [data-entree="plan"],
html.a-intro .heros .heros__mot > [data-entree] {
  animation-play-state: paused;
}
