/* ==========================================================================
   Bandeau d'accueil animé : chaque vitre se nettoie (une raclette par vitre),
   reçoit son film solaire, puis la vitrophanie se pose (voir js/hero-vitre.js)
   ========================================================================== */
.hero.hero-vitre {
  --soft: 60px;
  --v: 0px;                       /* progression de la vitrophanie (gauche → droite, en px de l'image) */
  height: clamp(360px, 46vw, 580px);
  padding-top: 0;
  display: flex;
  align-items: flex-end;
  background: #0a1a44;
  overflow: hidden;
}
.hero.hero-vitre::after { display: none; }
.hero-vitre .container { width: 100%; z-index: 10; }

/* Image finale : affichée sans JavaScript, ou une fois l'animation terminée */
.v-final-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 15% 0%;
  max-width: none;
}
@media (max-width: 767px) { .v-final-img { object-position: 5% 40%; } }
.js .v-final-img { visibility: hidden; }
.hero-vitre.is-final .v-final-img { visibility: visible; }
.hero-vitre.is-final .v-canvas { visibility: hidden; }

.v-stage { position: absolute; inset: 0; }

/* « Toile » de la taille de l'image (1352 × 640), mise à l'échelle par le script comme un object-fit: cover */
.v-canvas {
  position: absolute; left: 0; top: 0;
  width: 1352px; height: 640px;
  transform-origin: 0 0;
  z-index: 1;
}
.v-canvas > img { position: absolute; left: 0; top: 0; width: 1352px; height: 640px; max-width: none; display: block; }
.v-panes { position: absolute; inset: 0; }
.js .v-vitro {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(var(--v) - 140px), transparent var(--v));
  mask-image: linear-gradient(90deg, #000 calc(var(--v) - 140px), transparent var(--v));
}

/* --- Une vitre : découpée selon sa forme (perspective), avec sa propre raclette --- */
.v-pane { position: absolute; }
.pc-img, .pf-img {
  position: absolute; inset: 0;
  background-repeat: no-repeat;
  background-size: 1352px 640px;
}
.pf-img {
  --m: 0px;
  -webkit-mask-image: linear-gradient(180deg, #000 calc(var(--m) - 40px), transparent var(--m));
  mask-image: linear-gradient(180deg, #000 calc(var(--m) - 40px), transparent var(--m));
}

/* Raclette de la vitre */
.pc-blade {
  position: absolute; left: 0; top: 0;
  width: 13px; height: 100%;
  opacity: 0; pointer-events: none;
  border-radius: 3px;
  background: linear-gradient(90deg, #0a1a44 0%, #1c2f5a 28%, #d5dcea 46%, #8e9bb8 54%, #0a1a44 66%);
  box-shadow: 8px 0 22px rgba(0, 0, 0, 0.30);
  will-change: transform;
}
.pc-blade::before {                     /* poignée */
  content: ""; position: absolute; top: 50%; left: -60px;
  width: 60px; height: 18px; margin-top: -9px; border-radius: 9px;
  background: linear-gradient(180deg, #16284f, #0a1a44);
  box-shadow: inset 0 -3px 0 #c7ab71, 0 4px 12px rgba(0, 0, 0, 0.35);
}
.v-pane.rtl .pc-blade::before { left: auto; right: -60px; }
.pc-blade::after {                      /* fine trace d'eau derrière la lame */
  content: ""; position: absolute; top: 0; bottom: 0; left: -46px; width: 46px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.32));
}
.v-pane.rtl .pc-blade::after { left: auto; right: -46px; background: linear-gradient(270deg, transparent, rgba(255, 255, 255, 0.32)); }

/* Eau savonneuse devant la lame */
.pc-foam {
  position: absolute; left: 0; top: 0; height: 100%;
  opacity: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.12) 55%, rgba(255, 255, 255, 0));
  will-change: transform;
}
.v-pane.rtl .pc-foam { background: linear-gradient(270deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.12) 55%, rgba(255, 255, 255, 0)); }

/* Gouttes */
.pc-drop {
  position: absolute; left: 0; top: 0;
  width: 6px; height: 8px;
  opacity: 0; pointer-events: none;
  border-radius: 50% 50% 55% 55% / 40% 40% 65% 65%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.95), rgba(214, 232, 245, 0.55) 45%, rgba(120, 150, 175, 0.25));
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  will-change: transform, opacity;
}

/* Film : bord, voile laiteux et outil de marouflage propres à chaque vitre */
.pf-edge {
  position: absolute; left: 0; right: 0; top: 0; height: 3px;
  opacity: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.95) 8%, rgba(255, 255, 255, 0.95) 92%, transparent);
  box-shadow: 0 6px 18px rgba(10, 26, 68, 0.35), 0 0 10px rgba(255, 255, 255, 0.6);
  will-change: transform;
}
.pf-haze {
  position: absolute; left: 0; right: 0; top: 0; height: 90px;
  opacity: 0; pointer-events: none;
  background: linear-gradient(0deg, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0.10) 60%, rgba(255, 255, 255, 0));
  will-change: transform;
}
.pf-card {
  position: absolute; left: 0; top: 0; height: 24px;
  opacity: 0; pointer-events: none;
  border-radius: 6px;
  background: linear-gradient(180deg, #f2f5fa 0%, #b7c2d6 48%, #6f7fa3 100%);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35), inset 0 -3px 0 rgba(10, 26, 68, 0.35);
  will-change: transform;
}

/* --- Soleil : lueur chaude + rayons sur la vitre --- */
.v-sun {
  position: absolute; inset: 0; z-index: 5;
  opacity: 0; pointer-events: none;
  mix-blend-mode: screen;
  background:
    radial-gradient(circle at 80% 6%, rgba(255, 246, 220, 0.95) 0%, rgba(255, 224, 160, 0.45) 18%, transparent 50%),
    repeating-conic-gradient(from 195deg at 80% 6%, rgba(255, 240, 200, 0.18) 0deg 2.5deg, transparent 2.5deg 11deg);
  -webkit-mask-image: radial-gradient(circle at 80% 6%, #000 0%, rgba(0, 0, 0, 0.7) 45%, transparent 85%);
  mask-image: radial-gradient(circle at 80% 6%, #000 0%, rgba(0, 0, 0, 0.7) 45%, transparent 85%);
}
.v-heat {
  position: absolute; inset: 0; z-index: 4;
  opacity: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 176, 70, 0.20), rgba(255, 150, 60, 0.06));
}

/* --- Bouton « Rejouer » --- */
.v-replay {
  position: absolute; top: 16px; right: 16px; z-index: 11;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(10, 26, 68, 0.55);
  color: #fff; display: none; align-items: center; justify-content: center;
  transition: background 0.25s ease;
}
.v-replay:hover { background: rgba(10, 26, 68, 0.85); }
.hero-vitre.is-final .v-replay { display: flex; }
.hero-vitre.is-final .v-sun,
.hero-vitre.is-final .v-heat { display: none; }
.v-replay svg { width: 18px; height: 18px; }
@media (prefers-reduced-motion: reduce) { .v-replay { display: none !important; } }
