/* ==========================================================
   Born'up Elec - transitions entre les pages + bouton son flottant
   Feuille autonome : chargée par toutes les pages (V3 et anciennes).
   Le rideau est fait de deux moitiés animées en « transform »
   (calcul confié à la carte graphique : fluide même pendant le
   chargement de la page suivante).
   ========================================================== */

/* Couverture immédiate à l'arrivée, avant le premier affichage.
   Même rendu que le rideau fermé (fond, ligne, logo) : aucun saut. */
html.bu-entering::after {
  content: ""; position: fixed; inset: 0; z-index: 2147483000;
  background:
    url("../../logo-b.png") center / 46px auto no-repeat,
    linear-gradient(90deg, rgba(47,128,255,0) 0%, rgba(92,157,255,.35) 20%, rgba(190,222,255,.35) 50%, rgba(92,157,255,.35) 80%, rgba(47,128,255,0) 100%) center / 100% 2px no-repeat,
    radial-gradient(90% 70% at 50% 50%, #131c29 0%, #0a0d12 60%, #07090d 100%);
}

.bu-veil { position: fixed; inset: 0; z-index: 2147483001; pointer-events: none; contain: strict; }
.bu-veil.is-active { pointer-events: all; }
.bu-veil-half {
  position: absolute; left: 0; right: 0; height: 50.5%;
  background: radial-gradient(90% 70% at 50% 50%, #131c29 0%, #0a0d12 60%, #07090d 100%);
  background-size: 100% 198%;
  transform: scaleY(0); will-change: transform;
  transition: transform .46s cubic-bezier(.7, 0, .3, 1);
}
.bu-veil-top { top: 0; transform-origin: 50% 100%; background-position: 50% 0; }
.bu-veil-bot { bottom: 0; transform-origin: 50% 0; background-position: 50% 100%; }
.bu-veil-line {
  position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px;
  background: linear-gradient(90deg, rgba(47,128,255,0) 0%, #5c9dff 20%, #bedeff 50%, #5c9dff 80%, rgba(47,128,255,0) 100%);
  box-shadow: 0 0 14px 2px rgba(47,128,255,.7), 0 0 40px 6px rgba(47,128,255,.25);
  transform: scaleX(0); transform-origin: 0 50%; will-change: transform, opacity;
  transition: transform .3s cubic-bezier(.6, 0, .2, 1), opacity .3s;
}
.bu-veil-logo {
  position: absolute; left: 50%; top: 50%; width: 46px; height: auto; transform: translate(-50%, -50%) scale(.85);
  opacity: 0; will-change: transform, opacity;
  filter: drop-shadow(0 0 14px rgba(47,128,255,.75)) drop-shadow(0 0 2px rgba(190,222,255,.9));
  transition: opacity .3s, transform .45s cubic-bezier(.16, 1, .3, 1);
}
.bu-veil.is-line .bu-veil-line { transform: scaleX(1); }
.bu-veil.is-cover .bu-veil-half { transform: scaleY(1); }
.bu-veil.is-cover .bu-veil-logo { opacity: 1; transform: translate(-50%, -50%); transition-delay: .15s; }
.bu-veil.is-cover .bu-veil-line { opacity: .35; }
/* état posé sans animation (arrivée) */
.bu-veil.no-anim, .bu-veil.no-anim * { transition: none !important; }
/* fin de l'arrivée : la ligne file vers la droite */
.bu-veil.is-leaving .bu-veil-line { transform-origin: 100% 50%; transform: scaleX(0); opacity: 1; transition-duration: .38s; }
.bu-veil.is-leaving .bu-veil-logo { transition-delay: 0s; }

@media (prefers-reduced-motion: reduce) {
  .bu-veil-half, .bu-veil-line, .bu-veil-logo { transition: none !important; }
}

/* Bouton son flottant (pages sans bouton dans l'en-tête) */
.sound-fab {
  position: fixed; left: 18px; bottom: 18px; z-index: 60;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(150,175,210,.24);
  background: rgba(14,19,26,.86); color: #8b98a9; cursor: pointer;
  display: inline-grid; place-items: center;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px -12px rgba(0,0,0,.6);
}
.sound-fab:hover { color: #eef3f9; border-color: #2f80ff; }
.sound-fab:focus-visible { outline: 2px solid #5c9dff; outline-offset: 3px; }
.sound-fab .bars { display: flex; align-items: flex-end; gap: 2.5px; height: 16px; }
.sound-fab .bars i { display: block; width: 3px; height: 4px; border-radius: 2px; background: currentColor; }
.sound-fab.is-on { color: #5c9dff; }
.sound-fab.is-on .bars i { animation: buEq 1.1s ease-in-out infinite; }
.sound-fab.is-on .bars i:nth-child(2) { animation-delay: -.35s; }
.sound-fab.is-on .bars i:nth-child(3) { animation-delay: -.7s; }
.sound-fab.is-on .bars i:nth-child(4) { animation-delay: -.15s; }
@keyframes buEq { 0%, 100% { height: 4px; } 50% { height: 16px; } }
@media (prefers-reduced-motion: reduce) { .sound-fab.is-on .bars i { animation: none; height: 12px; } }
