/* Atelier Latitude — Animation d’ouverture (logo) et apparition du header
   Thème enfant Divi : assets/al-intro.css (chargé par functions.php)
   L’écran d’intro ne s’affiche que lorsque le script du <head> ajoute la classe « al-intro » sur <html>. */

/* 1. Écran d’intro : tracé du logo, nom, puis l’écran remonte (2,5 s au total) */
.al-intro-screen { display: none; }
html.al-intro .al-intro-screen {
  position: fixed; inset: 0;
  z-index: 1000000; /* au-dessus du header Divi et de la barre d’admin */
  display: grid; place-items: center;
  background: #342E29;
  color: #F5F1EA;
  animation: al-intro-out 1.05s cubic-bezier(.76,0,.24,1) 1.45s forwards;
}
.al-intro-screen__inner {
  display: flex; flex-direction: column; align-items: center; gap: 28px;
  animation: al-intro-fade .75s cubic-bezier(.76,0,.24,1) 1.4s forwards;
}
.al-intro-screen__mark {
  display: block; width: 78px; height: auto;
  fill: none;
  stroke: #AAB1A0; /* sauge ; variante sable : #DDD2C3 */
  stroke-width: 3; stroke-linecap: round;
}
.al-intro-screen__mark path {
  stroke-dasharray: var(--len) var(--len);
  stroke-dashoffset: var(--len);
  animation: al-intro-draw .95s cubic-bezier(.45,0,.2,1) both;
  animation-delay: calc(60ms + var(--i) * 90ms);
}
.al-intro-screen__name {
  display: flex; flex-direction: column; align-items: center;
  font-family: 'Cormorant Garamond', serif; font-weight: 500; line-height: 1;
}
.al-intro-screen__word {
  display: block;
  animation: al-intro-word .9s cubic-bezier(.2,.7,.2,1) backwards;
  animation-delay: calc(380ms + var(--i) * 120ms);
}
.al-intro-screen__word--small { font-size: 13px; letter-spacing: .5em; margin-right: -.5em; }
.al-intro-screen__word--big { font-size: 42px; letter-spacing: .1em; margin-right: -.1em; margin-top: 6px; }

@keyframes al-intro-draw { to { stroke-dashoffset: 0; } }
@keyframes al-intro-word { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes al-intro-fade { to { opacity: 0; transform: translateY(-48px); } }
@keyframes al-intro-out  { to { transform: translateY(-100%); visibility: hidden; } }

/* 2. Pendant l’intro, les animations du hero sont décalées de 1,53 s */
html.al-intro:has(.al-intro-screen) .al-hero__media  { animation-delay: 1.4s; }
html.al-intro:has(.al-intro-screen) .al-hero__word   { animation-delay: calc(1.73s + var(--i, 0) * 60ms); }
html.al-intro:has(.al-intro-screen) .al-hero__line   { animation-delay: 2.1s; }
html.al-intro:has(.al-intro-screen) .al-hero__pop    { animation-delay: 2.55s; }
html.al-intro:has(.al-intro-screen) .al-hero__reveal { animation-delay: calc(2.35s + var(--i, 0) * 140ms); }

/* 3. Header Divi (classique ou Theme Builder) : apparition en fondu sur les pages qui contiennent le hero */
@keyframes al-header-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  body:has(.al-hero) :is(#top-header, #main-header, .et-l--header) {
    animation: al-header-in 1s cubic-bezier(.2,.7,.2,1) .37s backwards;
  }
  html.al-intro:has(.al-intro-screen) :is(#top-header, #main-header, .et-l--header) { animation-delay: 1.9s; }
}
