/* =========================================================
   KORIUM TECH · v4 · W1 « Le voyage de l’eau »
   Par défaut (sans JS, mouvement réduit, html.calme, sans WebGL) : 4 états fixes lisibles.
   Avec JS et WebGL : scène 3D épinglée, une étape à la fois.
   ========================================================= */

.voy { --voy-ca: #F6EFE1; --voy-mg: #D6C19D; --voy-na: #2B97E3; }
.voy__tete { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 96px); align-items: end; margin-bottom: clamp(36px, 5vw, 72px); }
.voy__tete h2 { max-width: 14ch; }
.voy__intro p { max-width: 46ch; font-size: 1.1rem; }
.voy__leg { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px; font-size: 0.95rem; color: var(--gris); }
.voy__leg li { display: inline-flex; align-items: center; gap: 8px; }
.voy__leg b { font-weight: 600; color: var(--marine); }
.voy__ion { width: 13px; height: 13px; border-radius: 50%; flex: none; box-shadow: inset -2px -3px 4px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 48, 88, 0.16); }
.voy__ion--ca { background: var(--voy-ca); }
.voy__ion--mg { background: var(--voy-mg); }
.voy__ion--na { background: var(--voy-na); }
.voy__ion--eau { background: #DFF3FF; box-shadow: inset 0 0 0 1px rgba(43, 151, 227, 0.45); }
@media (max-width: 860px) { .voy__tete { grid-template-columns: 1fr; align-items: start; } }

/* ---------- étapes (commun) ---------- */
.voy__k { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; font: 500 0.82rem/1.2 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--bleu); }
.voy__k span { display: inline-grid; place-items: center; min-width: 34px; height: 24px; padding: 0 8px; border-radius: 999px; background: var(--aqua); color: var(--marine); letter-spacing: 0.02em; }
.voy__e h3 { margin-bottom: 12px; }
.voy__p { max-width: 40ch; }
.voy__txt .lien { margin-top: 18px; }
.voy__clip { margin-top: 22px; max-width: 380px; }
.voy__clip video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px; background: var(--aqua); box-shadow: var(--ombre); }
.voy__clip figcaption { margin-top: 10px; font-size: 0.85rem; color: var(--gris); }
.voy__fixe { width: 100%; aspect-ratio: 1; border-radius: var(--r); background: radial-gradient(ellipse 70% 62% at 50% 42%, #fff, #EAF3F9 78%); }

/* ---------- 4 états fixes (défaut) ---------- */
.voy__rail, .voy__scene { display: none; }
.voy__etapes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(36px, 4vw, 64px) clamp(24px, 3vw, 48px); }
.voy__e { position: relative; display: grid; align-content: start; gap: 22px; }
.voy__e .voy__clip { position: absolute; right: 14px; top: 14px; width: 42%; margin: 0; }
.voy__e .voy__clip video { border-radius: 10px; }
.voy__e .voy__clip figcaption { margin-top: 6px; font-size: 0.78rem; line-height: 1.3; padding: 4px 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.86); }
.voy__e .voy__clip figcaption .ia { display: flex; margin: 2px 0 0; }
@media (max-width: 760px) { .voy__etapes { grid-template-columns: 1fr; } .voy__e .voy__clip { width: 48%; } }

/* ---------- scène 3D épinglée ---------- */
@media (prefers-reduced-motion: no-preference) {
  html.js:not(.calme) .voy:not(.voy--calme) .voy__pin { height: 100vh; height: 100svh; display: flex; align-items: center; padding-top: clamp(72px, 9vh, 104px); padding-bottom: clamp(16px, 3vh, 32px); }
  html.js:not(.calme) .voy:not(.voy--calme) .voy__grid {
    position: relative; height: 100%; display: grid; grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.35fr); grid-template-rows: auto 1fr;
    column-gap: clamp(28px, 4vw, 72px); align-items: center;
  }
  html.js:not(.calme) .voy:not(.voy--calme) .voy__rail { display: flex; gap: 6px; grid-column: 1; grid-row: 1; align-self: end; margin-bottom: 26px; width: min(220px, 100%); }
  .voy__rail i { flex: 1; height: 3px; border-radius: 3px; background: rgba(0, 48, 88, 0.12); overflow: hidden; position: relative; }
  .voy__rail i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--bleu-2), var(--bleu)); transform: scaleX(0); transform-origin: left; transition: transform 0.6s var(--ease); }
  .voy__rail i.on::after { transform: scaleX(1); }
  html.js:not(.calme) .voy:not(.voy--calme) .voy__etapes { display: grid; grid-column: 1; grid-row: 2; align-self: start; grid-template-columns: 1fr; gap: 0; }
  html.js:not(.calme) .voy:not(.voy--calme) .voy__e {
    grid-area: 1 / 1; display: block; opacity: 0; visibility: hidden; transform: translate3d(0, 24px, 0);
    transition: opacity 0.55s var(--ease), transform 0.8s var(--ease), visibility 0s linear 0.55s;
  }
  html.js:not(.calme) .voy:not(.voy--calme) .voy__e.is-vu { transform: translate3d(0, -18px, 0); }
  html.js:not(.calme) .voy:not(.voy--calme) .voy__e.is-on { opacity: 1; visibility: visible; transform: none; transition: opacity 0.7s var(--ease) 0.12s, transform 0.9s var(--ease) 0.12s, visibility 0s; }
  html.js:not(.calme) .voy:not(.voy--calme) .voy__fixe { display: none; }
  html.js:not(.calme) .voy:not(.voy--calme) .voy__e .voy__clip { position: static; width: auto; margin-top: 26px; }
  html.js:not(.calme) .voy:not(.voy--calme) .voy__e .voy__clip figcaption { padding: 0; background: none; font-size: 0.85rem; }
  html.js:not(.calme) .voy:not(.voy--calme) .voy__e .voy__clip figcaption .ia { display: inline-flex; margin-left: 8px; }
  html.js:not(.calme) .voy:not(.voy--calme) .voy__scene {
    display: block; position: relative; grid-column: 2; grid-row: 1 / 3; width: 100%; height: 100%; max-height: 980px; overflow: hidden;
    border-radius: 24px; background: radial-gradient(ellipse 72% 64% at 50% 44%, #FFFFFF 0%, #F1F7FB 62%, #E6F0F7 100%);
    box-shadow: inset 0 0 0 1px rgba(0, 48, 88, 0.06);
  }
  .voy__still, .voy__cv { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .voy__cv { opacity: 0; transition: opacity 0.5s var(--ease); }
  .voy__cv.on { opacity: 1; }
  .voy--3d-pret .voy__still { opacity: 0; transition: opacity 0.4s linear 0.5s; }
  .voy__note { position: absolute; left: 14px; bottom: 12px; margin: 0; max-width: calc(100% - 28px); padding: 5px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.82); font-size: 0.78rem; line-height: 1.3; color: var(--gris); }
  .voy__labs { position: absolute; inset: 0; pointer-events: none; }
  .voy__lab {
    position: absolute; left: 0; top: 0; opacity: 0; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
    padding: 6px 12px 6px 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.9); box-shadow: 0 6px 18px -8px rgba(0, 48, 88, 0.35), inset 0 0 0 1px rgba(0, 48, 88, 0.08);
    font: 500 0.82rem/1 var(--sans); color: var(--marine); margin: -14px 0 0 -11px; will-change: transform, opacity;
  }
  .voy__lab i { width: 10px; height: 10px; border-radius: 50%; background: var(--bleu-2); box-shadow: 0 0 0 4px rgba(48, 168, 240, 0.22); }
  .voy__lab.a-gauche { flex-direction: row-reverse; padding: 6px 6px 6px 12px; margin-left: 11px; }
  .voy__note { transition: opacity 0.4s; }
}

/* téléphone et tablette : texte au-dessus, scène dessous, vidéo posée sur la scène ; place gardée pour la barre d’action (v4.css, ≤ 860 px) */
@media (prefers-reduced-motion: no-preference) and (max-width: 899px) {
  html.js:not(.calme) .voy:not(.voy--calme) .voy__pin { padding-top: 64px; padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .voy[data-etape="1"] .voy__note { opacity: 0; }
  html.js:not(.calme) .voy:not(.voy--calme) .voy__grid { display: flex; flex-direction: column; gap: 0; }
  html.js:not(.calme) .voy:not(.voy--calme) .voy__rail { margin: 0 0 14px; align-self: stretch; width: auto; }
  html.js:not(.calme) .voy:not(.voy--calme) .voy__etapes { flex: none; min-height: 13.5em; align-self: stretch; }
  html.js:not(.calme) .voy:not(.voy--calme) .voy__e, html.js:not(.calme) .voy:not(.voy--calme) .voy__e.is-vu { transform: none; }
  html.js:not(.calme) .voy:not(.voy--calme) .voy__e h3 { font-size: 1.32rem; margin-bottom: 8px; }
  html.js:not(.calme) .voy:not(.voy--calme) .voy__k { margin-bottom: 8px; }
  html.js:not(.calme) .voy:not(.voy--calme) .voy__p { font-size: 1rem; line-height: 1.55; }
  html.js:not(.calme) .voy:not(.voy--calme) .voy__txt .lien { margin-top: 10px; }
  html.js:not(.calme) .voy:not(.voy--calme) .voy__scene { flex: 1; min-height: 0; border-radius: 18px; }
  /* la vignette se pose dans le coin de la scène (repère : .voy__grid), plus sur le texte de l’étape */
  html.js:not(.calme) .voy:not(.voy--calme) .voy__e { position: static; }
  html.js:not(.calme) .voy:not(.voy--calme) .voy__e .voy__clip { position: absolute; z-index: 2; top: auto; right: 10px; bottom: 10px; width: 40%; max-width: 220px; margin: 0; }
  html.js:not(.calme) .voy:not(.voy--calme) .voy__e .voy__clip video { border-radius: 10px; box-shadow: 0 14px 30px -14px rgba(0, 48, 88, 0.55); }
  html.js:not(.calme) .voy:not(.voy--calme) .voy__e .voy__clip figcaption { margin-top: 5px; font-size: 0.72rem; line-height: 1.25; padding: 4px 7px; border-radius: 7px; background: rgba(255, 255, 255, 0.9); }
  html.js:not(.calme) .voy:not(.voy--calme) .voy__e .voy__clip figcaption .ia { display: flex; margin: 2px 0 0; font-size: 0.7rem; }
  .voy__lab { font-size: 0.74rem; padding: 5px 10px 5px 5px; }
  .voy__lab--ecran, .voy__lab--vanne { display: none; }
  .voy__note { left: 12px; bottom: 10px; font-size: 0.7rem; max-width: 52%; }
}
