/* ============================================================
   INTRO — film d'accueil plein écran
   S'affiche par-dessus tout au chargement. Skip : bouton,
   molette (scroll), clic, touche, ou fin de la vidéo.
   ============================================================ */

/* Verrou du scroll pendant que l'intro est visible */
html.intro-lock, html.intro-lock body { overflow: hidden !important; height: 100%; }

.intro {
  position: fixed;
  inset: 0;
  z-index: 2147483000;          /* au-dessus de la nav et de tout le reste */
  background: #04060c;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 1;
  transition: opacity .7s ease;
  cursor: pointer;
}
/* état « on ferme » : fondu + on laisse passer les clics une fois fini */
.intro.intro--hide { opacity: 0; }
.intro.intro--gone { display: none; }

/* La vidéo remplit tout l'écran (recadrage propre, jamais déformée) */
.intro-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;   /* paysage (desktop) : remplit l'écran */
  background: #04060c;
}

/* On remplit toujours l'écran (« cover »). Sur téléphone en portrait, on
   n'étire pas la vidéo paysage : on invite plutôt à tourner l'écran. */

/* ---- Invite « Tournez votre téléphone » ---- */
.intro-rotate {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;                 /* visible seulement via .intro.is-portrait */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  padding: 2rem;
  text-align: center;
  /* voile LÉGER : on voit le film jouer derrière, l'invite reste lisible */
  background: linear-gradient(rgba(4,6,12,.28), rgba(4,6,12,.55));
}
.intro.is-portrait .rotate-text,
.intro.is-portrait .rotate-sub { text-shadow: 0 2px 14px rgba(0,0,0,.7); }
.intro.is-portrait .rotate-phone { box-shadow: 0 0 22px rgba(0,0,0,.6), 0 0 22px rgba(120,165,255,.35); }
.intro.is-portrait .intro-rotate { display: flex; }
/* pendant l'invite, on masque l'indice « glissez… » (le bouton Passer reste) */
.intro.is-portrait .intro-hint { display: none; }

/* le téléphone qui bascule de la verticale vers l'horizontale */
.rotate-phone {
  width: 58px;
  height: 104px;
  border: 3px solid #dfe9ff;
  border-radius: 13px;
  position: relative;
  margin-bottom: .6rem;
  box-shadow: 0 0 22px rgba(120,165,255,.35);
  transform-origin: 50% 50%;
  animation: rotate-tip 2.6s cubic-bezier(.7,0,.3,1) infinite;
}
.rotate-phone .rp-cam {           /* la petite caméra */
  position: absolute;
  top: 7px; left: 50%;
  width: 6px; height: 6px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: #dfe9ff;
}
.rotate-phone .rp-bar {           /* la barre du bas */
  position: absolute;
  bottom: 7px; left: 50%;
  width: 22px; height: 3px;
  transform: translateX(-50%);
  border-radius: 3px;
  background: #dfe9ff;
}
@keyframes rotate-tip {
  0%, 22%   { transform: rotate(0deg); }
  45%, 78%  { transform: rotate(-90deg); }
  100%      { transform: rotate(0deg); }
}

.rotate-text {
  font-family: "Clash Display", "Satoshi", system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.35rem;
  color: #eaf1ff;
  margin: 0;
}
.rotate-sub {
  font-family: "Satoshi", system-ui, sans-serif;
  font-size: .92rem;
  color: rgba(210,224,255,.72);
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .rotate-phone { animation: none; transform: rotate(-90deg); }
}

/* léger dégradé bas pour lisibilité des boutons */
.intro-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to top, rgba(4,6,12,.55) 0%, rgba(4,6,12,0) 26%),
    radial-gradient(120% 80% at 50% 120%, rgba(4,6,12,.4) 0%, rgba(4,6,12,0) 60%);
}

/* ---- Boutons ---- */
.intro-skip, .intro-sound {
  position: absolute;
  z-index: 2;
  font-family: "Satoshi", system-ui, sans-serif;
  font-weight: 600;
  font-size: .92rem;
  letter-spacing: .01em;
  color: #eaf1ff;
  background: rgba(10,16,30,.5);
  border: 1px solid rgba(140,175,255,.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 999px;
  padding: .6rem 1.15rem;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .2s ease, opacity .2s ease;
}
.intro-skip:hover, .intro-sound:hover {
  background: rgba(30,45,80,.7);
  border-color: rgba(140,175,255,.65);
  transform: translateY(-1px);
}

/* « Passer l'intro » en bas à droite */
.intro-skip {
  right: max(1.4rem, env(safe-area-inset-right));
  bottom: max(1.4rem, env(safe-area-inset-bottom));
}

/* Son en haut à droite */
.intro-sound {
  right: max(1.4rem, env(safe-area-inset-right));
  top: max(1.4rem, env(safe-area-inset-top));
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}
/* on n'affiche que l'icône correspondant à l'état */
.intro-sound .is-on  { display: none; }
.intro-sound .is-off { display: inline; }
.intro.is-muted .intro-sound .is-on  { display: none; }
.intro.is-muted .intro-sound .is-off { display: inline; }
.intro:not(.is-muted) .intro-sound .is-on  { display: inline; }
.intro:not(.is-muted) .intro-sound .is-off { display: none; }

/* Indice « scrollez pour entrer », bas centre, qui respire */
.intro-hint {
  position: absolute;
  left: 50%;
  bottom: max(1.7rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 2;
  font-family: "Satoshi", system-ui, sans-serif;
  font-size: .8rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(220,232,255,.72);
  pointer-events: none;
  animation: intro-breathe 2.4s ease-in-out infinite;
  white-space: nowrap;
}
@keyframes intro-breathe {
  0%, 100% { opacity: .45; transform: translate(-50%, 0); }
  50%      { opacity: 1;   transform: translate(-50%, -4px); }
}

/* on affiche le bon libellé selon l'appareil */
.hint-mobile { display: none; }
@media (pointer: coarse), (orientation: portrait) {
  .hint-desktop { display: none; }
  .hint-mobile  { display: inline; }
}

@media (max-width: 560px) {
  .intro-skip, .intro-sound { font-size: .82rem; padding: .5rem .95rem; }
  .intro-hint { font-size: .7rem; letter-spacing: .14em; }
}

/* En portrait, l'indice remonte au-dessus des boutons pour ne pas les chevaucher */
@media (orientation: portrait) {
  .intro-hint { bottom: max(4.9rem, calc(env(safe-area-inset-bottom) + 4.4rem)); }
}

/* accessibilité : si l'utilisateur refuse les animations, pas de respiration */
@media (prefers-reduced-motion: reduce) {
  .intro-hint { animation: none; }
}
