/* =========================================================================
   BDV COVER — COUCHE D'AMÉLIORATION VISUELLE (additive, ne remplace rien)
   Chargée après le <style> de chaque page : vient enrichir/surclasser en
   douceur les règles existantes (header, boutons, fade, hero, cartes...).
   ========================================================================= */

/* --- Scrollbar premium --- */
html { scrollbar-width: thin; scrollbar-color: var(--gold1) rgba(0,0,0,0.3); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.25); }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--gold3), var(--gold1)); border-radius: 10px; border: 2px solid rgba(0,0,0,0.25); }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, var(--gold1), var(--gold2)); }

/* --- Grain cinématique sur toute la page (statique : pas d'animation en continu) --- */
body::before {
  content: "";
  position: fixed;
  inset: -200px;
  z-index: 3;
  pointer-events: none;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* --- Aurora statique dans les sections hero (sans toucher au HTML) --- */
.hero::before {
  background:
    radial-gradient(ellipse 60% 50% at 20% 20%, rgba(198,167,94,0.28), transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 75%, rgba(90,140,170,0.2), transparent 65%),
    rgba(0,0,0,0.58);
}
.page-hero::before {
  background-image:
    radial-gradient(ellipse 55% 50% at 15% 25%, rgba(198,167,94,0.16), transparent 60%),
    radial-gradient(ellipse 45% 40% at 85% 70%, rgba(198,167,94,0.12), transparent 65%),
    radial-gradient(rgba(198,167,94,0.07) 1px, transparent 1px);
}

/* --- Révélations au scroll : flou + profondeur (au lieu d'un simple fade) --- */
.fade {
  filter: blur(6px);
  transition: opacity 1s cubic-bezier(.16,1,.3,1), transform 1s cubic-bezier(.16,1,.3,1), filter 1s ease;
}
.fade.visible { filter: blur(0); }
.cascade-item {
  filter: blur(5px);
  transition: opacity 0.7s cubic-bezier(.16,1,.3,1), transform 0.7s cubic-bezier(.16,1,.3,1), filter 0.7s ease;
}
.cascade-item.visible { filter: blur(0); }

/* --- Halo pulsant derrière le bouton WhatsApp flottant --- */
.whatsapp-float { overflow: visible; }
.whatsapp-float::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #25D366;
  z-index: -1;
  animation: pulseRing 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes pulseRing {
  0% { transform: scale(1); opacity: 0.55; }
  100% { transform: scale(1.9); opacity: 0; }
}

/* --- Indice de glissement sur le comparateur avant/après --- */
[data-ba] { position: relative; }
[data-ba]:not(.bda-touched)::after {
  content: "↔ Glissez";
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(12,9,3,0.75);
  backdrop-filter: blur(6px);
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(198,167,94,0.3);
  z-index: 4;
  pointer-events: none;
  animation: hintPulse 1.8s ease-in-out infinite;
}
@keyframes hintPulse {
  0%, 100% { opacity: 0.55; transform: translateX(-50%) translateY(0); }
  50% { opacity: 1; transform: translateX(-50%) translateY(-4px); }
}

/* --- Cartes avec effet de profondeur 3D au survol (JS applique le transform inline) --- */
.cqnf-card, .cover-item, .stat-item, .qui-card, .step-item, .reassurance-item,
.sidebar-card, .badge-item, .contact-item {
  transition: transform 0.25s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* --- Bandeau défilant de réassurance (index) --- */
.trust-ticker {
  position: relative;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(198,167,94,0.08), rgba(198,167,94,0.02));
  border-top: 1px solid rgba(198,167,94,0.15);
  border-bottom: 1px solid rgba(198,167,94,0.15);
  padding: 16px 0;
  z-index: 1;
}
.trust-ticker .ticker-track {
  display: flex;
  width: max-content;
  gap: 48px;
  animation: tickerScroll 30s linear infinite;
}
.trust-ticker:hover .ticker-track { animation-play-state: paused; }
.trust-ticker span {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold2);
  white-space: nowrap;
  opacity: 0.9;
}
.trust-ticker span strong { color: var(--gold1); }
@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@media (max-width: 768px) {
  .trust-ticker { padding: 12px 0; }
  .trust-ticker span { font-size: 0.72rem; }
}

/* =========================================================================
   IMMERSION — hero cinématique, lightbox plein écran, boutons magnétiques
   ========================================================================= */

/* --- Hero cinématique : la photo vit dans sa propre couche zoomée --- */
.hero, .page-hero { overflow: hidden; }
.hero-bg {
  position: absolute;
  inset: -6%;
  z-index: -1;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(1.14);
  animation: heroZoomIn 2.6s cubic-bezier(.16,1,.3,1) forwards;
  will-change: transform;
}
@keyframes heroZoomIn {
  from { transform: scale(1.14); filter: brightness(0.72) saturate(0.85); }
  to   { transform: scale(1.04); filter: brightness(1) saturate(1); }
}
.hero-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --- Boutons magnétiques : le survol "attire" le bouton vers le curseur --- */
.btn, .btn-ghost { --mx: 0px; --my: 0px; }
.btn:hover, .btn:focus-visible { transform: translateY(-3px) scale(1.03) translate(var(--mx), var(--my)); }
.btn-ghost:hover, .btn-ghost:focus-visible { transform: translateY(-3px) translate(var(--mx), var(--my)); }

/* --- Lightbox plein écran pour les galeries (injecté en JS) --- */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(8,6,2,0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
#lightbox.active { opacity: 1; pointer-events: auto; }
#lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 12px;
  box-shadow: 0 30px 90px rgba(0,0,0,0.6), 0 0 0 1px rgba(198,167,94,0.25);
  transform: scale(0.92);
  transition: transform 0.4s cubic-bezier(.16,1,.3,1);
  cursor: zoom-out;
}
#lightbox.active img { transform: scale(1); }
#lightbox .lightbox-close {
  position: absolute;
  top: 22px;
  right: 26px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(198,167,94,0.12);
  border: 1px solid rgba(198,167,94,0.35);
  color: var(--gold2);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
}
#lightbox .lightbox-close:hover { background: rgba(198,167,94,0.25); transform: rotate(90deg); }

/* --- Zoom doux à l'entrée pour les photos de galerie (au scroll) --- */
.cover-item-img, .carousel-track img, .img-label-wrap img {
  transform: scale(1.1);
  filter: saturate(0.85);
  transition: transform 1.1s cubic-bezier(.16,1,.3,1), filter 1.1s ease;
}
.fade.visible .cover-item-img, .cascade-item.visible .cover-item-img,
.fade.visible .img-label-wrap img, .cascade-item.visible .img-label-wrap img {
  transform: scale(1);
  filter: saturate(1);
}
.carousel-track img { transform: none; filter: saturate(0.92); }
.carousel-track:hover img { filter: saturate(1); }

/* --- Section "En vidéo" : cartes façon téléphone, muettes, lecture au scroll --- */
#en-video {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: #1e1e1e;
  position: relative;
  z-index: 1;
}
.video-head h2 { font-size: 2.4rem; margin-bottom: 16px; }
.video-head p { max-width: 640px; color: var(--text); font-size: 1.05rem; margin: 0 auto; }
.video-grid {
  display: flex;
  justify-content: center;
  gap: 36px;
  flex-wrap: wrap;
  margin: 50px 0 10px;
}
.video-card { margin: 0; width: 280px; max-width: 100%; }
.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid rgba(198,167,94,0.25);
  box-shadow: 0 25px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(198,167,94,0.06) inset;
  background: #000;
  cursor: pointer;
}
.video-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-card figcaption {
  margin-top: 16px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold2);
}
.video-muted-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 20px;
  background: rgba(12,9,3,0.7);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(198,167,94,0.3);
  color: #fff;
  pointer-events: none;
}
.video-toggle {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(12,9,3,0.55);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(198,167,94,0.4);
  color: var(--gold2);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  opacity: 1;
  transition: opacity 0.3s ease, background 0.3s ease, transform 0.2s ease;
}
.video-toggle:hover { background: rgba(198,167,94,0.25); transform: scale(1.06); }
.video-toggle .icon-play { margin-left: 3px; }
.video-toggle .icon-pause { display: none; font-size: 0.9rem; letter-spacing: 2px; }
.video-frame.playing .video-toggle .icon-play { display: none; }
.video-frame.playing .video-toggle .icon-pause { display: inline; }
.video-frame.playing .video-toggle { opacity: 0; }
.video-frame.playing:hover .video-toggle,
.video-frame .video-toggle:focus-visible { opacity: 1; }
@media (max-width: 768px) {
  .video-grid { gap: 22px; margin: 30px 0 6px; }
  .video-card { width: 200px; }
}

/* --- Confort mobile : zones tactiles & sans surbrillance disgracieuse --- */
.btn, .btn-ghost, a, button { -webkit-tap-highlight-color: transparent; }
@supports (padding: max(0px)) {
  .sticky-cta-mobile { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}
@media (hover: none) {
  .cqnf-card:active, .cover-item:active, .qui-card:active, .step-item:active,
  .reassurance-item:active, .sidebar-card:active, .badge-item:active, .contact-item:active {
    transform: scale(0.97);
    transition: transform 0.15s ease;
  }
}

/* --- Respect du mode mouvement réduit pour les nouveaux effets --- */
@media (prefers-reduced-motion: reduce) {
  .whatsapp-float::after, [data-ba]:not(.bda-touched)::after, .trust-ticker .ticker-track {
    animation: none !important;
  }
}
