/* Pro/Active — intro « trois mots » de l'accueil.
   Rideau en deux moitiés repris de l'intro Nemelec V3. Les animations ne
   masquent jamais la page elle-même et le rideau expire seul à 3 s.
   Rythme (QA 19/10/2026) : chaque mot reste net ~280 ms (avant : ~190 ms,
   « RÉCUPÉRER » passait trop vite pour être lu au téléphone). */

:root {
  --pa-intro-fond: #012647;
  --pa-intro-accent: #FF6C02;
  --pa-intro-sortie: cubic-bezier(0.7, 0, 0.2, 1);
}

.pa-intro {
  position: fixed;
  inset: 0;
  z-index: 99999;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--pa-intro-fond);
  cursor: pointer;
  touch-action: none;
  contain: strict;
  animation: paIntroGardeFou 0.01s linear 3s forwards;
}

.pa-intro--ouverte {
  background: transparent;
  pointer-events: none;
}

.pa-intro__volet {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  overflow: hidden;
  background: var(--pa-intro-fond);
  transition: transform 420ms var(--pa-intro-sortie);
  will-change: transform;
}

.pa-intro__volet--haut {
  top: 0;
}

.pa-intro__volet--bas {
  bottom: 0;
}

.pa-intro--ouverte .pa-intro__volet--haut {
  transform: translateY(-101%);
}

.pa-intro--ouverte .pa-intro__volet--bas {
  transform: translateY(101%);
}

.pa-intro--rapide .pa-intro__volet {
  transition-duration: 220ms;
}

/* Chaque volet contient la scène entière, haute de deux volets : le texte se
   coupe exactement à la jointure pendant l'ouverture, comme chez Nemelec. */
.pa-intro__scene {
  position: absolute;
  left: 0;
  right: 0;
  height: 200%;
  background: var(--pa-intro-fond);
}

.pa-intro__volet--haut .pa-intro__scene {
  top: 0;
}

.pa-intro__volet--bas .pa-intro__scene {
  bottom: 0;
}

.pa-intro__sequence {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 16px;
  box-sizing: border-box;
}

.pa-intro__mot,
.pa-intro__logo {
  grid-area: 1 / 1;
  max-width: calc(100vw - 32px);
  white-space: nowrap;
  will-change: transform, opacity, filter;
}

.pa-intro__mot {
  color: #ffffff;
  font-family: var(--pa-police-titre, 'Archivo Black', 'Arial Black', Impact, sans-serif);
  font-size: clamp(2rem, min(12.5vw, 18vh), 7.5rem);
  font-weight: 400;
  line-height: 0.86;
  letter-spacing: -0.045em;
  text-transform: uppercase;
  opacity: 0;
}

.pa-intro--animee .pa-intro__mot {
  animation: paIntroMot 500ms cubic-bezier(0.18, 0.82, 0.24, 1.2) both;
}

/* Les délais DOIVENT suivre le raccourci `animation` avec la même
   spécificité : sinon il les remet à 0 et les trois mots se superposent
   (vu au rendu du 19/10/2026). */
.pa-intro--animee .pa-intro__mot--1 {
  animation-delay: 80ms;
}

.pa-intro--animee .pa-intro__mot--2 {
  animation-delay: 580ms;
}

.pa-intro--animee .pa-intro__mot--3 {
  animation-delay: 1080ms;
}

.pa-intro__logo {
  font-size: clamp(2.25rem, min(10vw, 16vh), 6.5rem);
  letter-spacing: -0.045em;
  opacity: 0;
}

.pa-intro--animee .pa-intro__logo {
  animation: paIntroLogo 320ms cubic-bezier(0.18, 0.82, 0.24, 1.12) 1580ms both;
}

/* Liseré bref à la jointure : il souligne le mouvement sans arrondir le
   rideau ni ajouter de reflet sur les images de l'accueil. */
.pa-intro__volet::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--pa-intro-accent);
  opacity: 0;
  transition: opacity 120ms linear;
}

.pa-intro__volet--haut::after {
  bottom: 0;
}

.pa-intro__volet--bas::after {
  top: 0;
}

.pa-intro--ouverte .pa-intro__volet::after {
  opacity: 1;
}

@keyframes paIntroMot {
  0% {
    opacity: 0;
    transform: scale(0.72);
    filter: blur(12px);
  }
  24% {
    opacity: 1;
    transform: scale(1.08);
    filter: blur(0);
  }
  42% {
    opacity: 1;
    transform: scale(0.96);
    filter: blur(0);
  }
  62%, 80% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: scale(1.02);
    filter: blur(2px);
  }
}

@keyframes paIntroLogo {
  0% {
    opacity: 0;
    transform: scale(0.82);
    filter: blur(10px);
  }
  58% {
    opacity: 1;
    transform: scale(1.05);
    filter: blur(0);
  }
  78% {
    opacity: 1;
    transform: scale(0.98);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

@keyframes paIntroGardeFou {
  to {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

/* Sans script, le visiteur ne voit jamais un rideau qu'il ne peut passer. */
@media (scripting: none) {
  .pa-intro {
    display: none !important;
  }
}

/* Le mouvement réduit court-circuite aussi l'intro avant le premier rendu. */
@media (prefers-reduced-motion: reduce) {
  .pa-intro {
    display: none !important;
    animation: none !important;
  }
}
