/* =============================================================
   Hero Reveal!t : animation à droite (remplace l'image animée).
   Ne touche PAS à style.css : tout ce qui suit ne concerne que le
   hero. Les variables (couleurs, rayons, ombres, thème sombre)
   viennent de la feuille d'origine.
   ============================================================= */

/* ---------- Cartes d'usage : cliquables, l'active garde l'aspect « survol » ---------- */
.usage-card { cursor: pointer; }
.usage-card:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.usage-card.is-active {
  transform: translateY(-3px);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
}
.usage-card.is-active .usage-card-icon {
  background: var(--color-accent-gradient);
  color: var(--text-inverse);
}

/* ---------- Défilement piloté (bureau) : le hero reste en place pendant l'animation ---------- */
.hero-scroller { --hero-top: 58px; }
.hero-scroller.is-pinned::after { content: ""; display: block; height: var(--hero-scroll, 600px); }
.hero-scroller.is-pinned .hero-section {
  position: sticky; top: var(--hero-top);
  min-height: calc(100dvh - var(--hero-top));
  display: flex; align-items: center;
  /* le haut du hero passe sous l'en-tête avant qu'il ne se replie : on garde de la marge */
  padding: 56px 0 28px; box-sizing: border-box;
}
.hero-scroller.is-pinned .hero-container { width: 100%; }

/* ---------- Colonne droite ---------- */
.hero-visual[data-hero-demo] { min-width: 0; }
.demo-canvas {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; justify-items: center;
  padding: 16px; background: var(--color-bg);
}
.demo-paper {
  container-type: inline-size;
  width: min(100%, calc((100dvh - 290px) * 0.8));
  background: #fff; color: #1d1d1f; border-radius: 3px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12), 0 12px 30px -12px rgba(15, 23, 42, 0.28);
}
.demo-sheet {
  padding: clamp(14px, 5cqi, 28px) clamp(14px, 6cqi, 32px) clamp(16px, 5cqi, 26px);
  font-family: 'Times New Roman', Georgia, serif; line-height: 1.5; text-align: left;
}
.demo-text { overflow: hidden; }
.demo-doc-title {
  background: #d9d9d9; text-align: center; padding: 0.3em; margin-bottom: 0.5em;
  font: 700 clamp(18px, 5.6cqi, 30px)/1.25 'Calibri', 'Segoe UI', sans-serif;
}
.demo-q { font-family: 'Calibri', 'Segoe UI', sans-serif; font-size: clamp(12px, 3.1cqi, 16px); margin: 0.55em 0 0.3em; }
.demo-p { padding-left: 3cqi; font-size: clamp(11.5px, 3cqi, 15.5px); margin: 0; }
.demo-fig { position: relative; margin: 0.5em 0 0; }
.demo-fig img { width: 100%; height: auto; border-radius: 2px; display: block; }

/* bloc Reveal!t : un masque couvre le texte ou l'image, puis s'efface */
.rv { position: relative; color: #1565c0; font-weight: 700; padding: 0 3px; white-space: nowrap; }
.rv::after {
  content: ""; position: absolute; inset: -1px -2px; border-radius: 3px;
  background: repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.05) 0 6px, transparent 6px 12px), #d4d7dd;
  /* --b : rognage à droite (0 = masque complet) ; --a : rognage à gauche (1 = révélé) */
  clip-path: inset(0 calc(var(--b, 0) * 100%) 0 calc(var(--a, 0) * 100%));
  box-shadow: inset 0 -2px 0 var(--color-accent);
}
.rv-img { position: absolute; left: var(--l); top: var(--t); width: var(--w); height: var(--h); padding: 0; }
.rv-img::after { inset: 0; }

/* projecteur : icône + faisceau qui éclaire la diapositive */
.demo-projector {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 2;
  opacity: 0; pointer-events: none;
}
.demo-projector-ico {
  position: relative; z-index: 1; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 999px;
  background: var(--color-accent-gradient); color: var(--text-inverse);
  box-shadow: 0 8px 22px -6px rgba(255, 107, 53, 0.65);
}
.demo-projector-ico svg { width: 24px; height: 24px; }
.demo-projector-beam {
  position: absolute; left: 50%; top: 32px; width: min(78vw, 300px); height: 120px; transform: translateX(-50%);
  clip-path: polygon(45% 0, 55% 0, 100% 100%, 0 100%);
  background: linear-gradient(to bottom, rgba(255, 107, 53, 0.32), rgba(255, 107, 53, 0));
}

/* ---------- Commandes : Tout cacher | Précédent | Suivant | Tout révéler ---------- */
.demo-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; }
.demo-controls { flex-wrap: nowrap; }
.demo-controls button { gap: 8px; white-space: nowrap; padding: 10px 16px; }
.demo-controls svg { width: 16px; height: 16px; flex: none; }
@media (max-width: 520px) {
  .demo-controls { gap: 8px; }
  .demo-controls button { padding-left: 14px; padding-right: 14px; }
  .demo-btn-label { display: none; }
}

/* ---------- Badge d'usage collé à l'image (mobile uniquement) ---------- */
.demo-badge-wrap { display: none; }
@media (max-width: 992px) {
  .demo-badge-wrap { display: block; position: sticky; top: 100px; height: 0; z-index: 5; }
  .demo-badge {
    position: absolute; left: 0; top: -40px;
    display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
    padding: 5px 14px 5px 5px; border-radius: 999px;
    background: var(--color-surface); border: 1px solid var(--color-accent); box-shadow: var(--shadow-md);
    font-family: var(--font-heading); font-weight: 700; font-size: 13.5px; color: var(--text-primary);
    opacity: 0; transform: translateY(6px); pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }
  .demo-badge.is-active { opacity: 1; transform: none; }
  .demo-badge-ico {
    display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
    background: var(--color-accent-gradient); color: var(--text-inverse);
  }
  .demo-badge-ico svg { width: 15px; height: 15px; }
}

/* écrans peu hauts : le hero doit tenir sans couper l'animation */
@media (min-width: 993px) and (max-height: 800px) {
  .hero-scroller.is-pinned .hero-section { padding-top: 52px; padding-bottom: 16px; }
  .hero-scroller.is-pinned .hero-title-plain { margin-bottom: 12px; }
  .hero-scroller.is-pinned .hero-subtitle { font-size: 16px; margin-bottom: 20px; }
  .hero-scroller.is-pinned .hero-actions { margin-bottom: 0; }
}

/* ---------- Avant l'exécution du JS : le document est montré complet ---------- */
@media (prefers-reduced-motion: reduce) {
  .usage-card, .demo-paper, .demo-controls button, .demo-badge { transition: none; }
}

/* Schéma du cycle de l'eau : titre et étiquettes en texte (traduits), posés sur l'image */
.diag-txt { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.diag-txt .dg-title { font: 800 25px var(--font-heading, "Outfit", sans-serif); fill: #22303a; }
.diag-txt .dg-lbl rect { fill: #fff; stroke: #71767d; stroke-width: 1; }
.diag-txt .dg-lbl text { font: 700 14.5px Georgia, "Times New Roman", serif; fill: #0a0a55; }
