/* =============================================
   INTRO VIDÉO – plein écran, une fois par session
   Activée par la classe html.intro-on (posée dans le <head> de index.html)
   ============================================= */
#intro { display: none; }
html.intro-on #intro { display: block; }
html.intro-on,
html.intro-on body { overflow: hidden; }

#intro {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: #0d0c0b;
  opacity: 1;
  transition: opacity 0.9s cubic-bezier(0.4, 0, 0.2, 1);
}
#intro.is-leaving { opacity: 0; pointer-events: none; }

#intro-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0d0c0b;
}
/* écrans 16:10 à 21:10 : la vidéo remplit l'écran sans rogner les textes ; au-delà (ultra-large) ou en portrait : cadre complet */
@media (min-aspect-ratio: 31/20) and (max-aspect-ratio: 39/20) {
  #intro-video { object-fit: cover; }
}

/* filet d'attente pendant le chargement */
.intro-loading {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 120px;
  height: 1px;
  margin: -0.5px 0 0 -60px;
  background: linear-gradient(90deg, transparent, #c8a97e, transparent);
  animation: introPulse 1.4s ease-in-out infinite;
}
#intro.is-playing .intro-loading { display: none; }
@keyframes introPulse {
  0%, 100% { opacity: 0.25; transform: scaleX(0.5); }
  50% { opacity: 1; transform: scaleX(1); }
}

/* boutons */
.intro-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(26px, env(safe-area-inset-bottom));
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 0 16px;
  pointer-events: none;
}
.intro-btn {
  display: inline-flex;
  pointer-events: auto;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  font-family: var(--font-sans, 'Montserrat', Arial, sans-serif);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(242, 235, 223, 0.88);
  background: rgba(13, 12, 11, 0.5);
  border: 1px solid rgba(200, 169, 126, 0.5);
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, opacity 0.6s ease;
}
.intro-btn:hover,
.intro-btn:focus-visible {
  background: rgba(200, 169, 126, 0.92);
  border-color: #c8a97e;
  color: #0d0c0b;
  outline: none;
}
#intro-sound { display: none; }
#intro.is-playing #intro-sound { display: inline-flex; }
#intro-sound svg { flex: none; }
#intro-sound .waves { display: none; }
#intro-sound[aria-pressed="true"] .waves { display: inline; }
#intro-sound[aria-pressed="true"] .mute { display: none; }
/* invite discrète à activer le son tant qu'il est coupé */
#intro.is-playing #intro-sound[aria-pressed="false"] { animation: introNudge 2.6s ease-in-out 1.2s 3; }
@keyframes introNudge {
  0%, 100% { border-color: rgba(200, 169, 126, 0.5); }
  50% { border-color: rgba(234, 215, 174, 1); box-shadow: 0 0 18px rgba(200, 169, 126, 0.35); }
}

/* progression */
#intro-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: #c8a97e;
  transform-origin: 0 50%;
  transform: scaleX(0);
}

@media (max-width: 600px) {
  .intro-btn { padding: 10px 14px; font-size: 10px; letter-spacing: 0.18em; }
}
@media (prefers-reduced-motion: reduce) {
  #intro { transition-duration: 0.01ms; }
  .intro-loading, #intro.is-playing #intro-sound[aria-pressed="false"] { animation: none; }
}
