/* HydroRackLab – page d'accueil.
 * Idée : le rack est l'axe de symétrie de la page, comme sur un dessin technique. Un trait d'axe mixte le traverse ;
 * le titre se range à gauche, le détail à droite, les atouts alternent de part et d'autre pendant que le drone tourne.
 * Quand la caméra plonge entre les rails, l'image s'élargit jusqu'au plein écran et le blanc PVC prend le relais. */

html, body { background: #000; }

/* ---------------------------------------------------------------- en-tête transparent sur le vol */
.accueil .entete { position: fixed; left: 0; right: 0; background: linear-gradient(rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0)); border-bottom-color: transparent;
  backdrop-filter: none; transition: background-color 0.3s ease, border-color 0.3s ease; }
.accueil .entete.plein { background: rgba(0, 0, 0, 0.88); backdrop-filter: blur(10px); border-bottom-color: var(--ardoise); }

/* ---------------------------------------------------------------- vol */
.vol { --vid: 56.25vh; --col: min(25rem, calc(50vw - var(--vid) / 2 - 7vw)); position: relative; height: 560vh; }
.scene { position: sticky; top: 0; height: 100vh; height: 100lvh; overflow: hidden; background: #000; }
.scene-video { position: absolute; top: 0; left: 50%; width: var(--vid); height: 100%; translate: -50% 0; scale: var(--zoom, 1); transform-origin: 50% 58%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14%, #000 86%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 14%, #000 86%, transparent 100%); will-change: scale; }
.scene-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scene-voile { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 60% 75% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.55) 100%), linear-gradient(rgba(0, 0, 0, 0.35), transparent 18%, transparent 80%, rgba(0, 0, 0, 0.5)); opacity: var(--voile, 1); }
.axe { position: absolute; left: calc(50% - 1px); top: 0; width: 2px; height: 100%; overflow: visible; opacity: calc(0.55 * var(--axe, 1)); transform-origin: 50% 0; animation: axe 1.4s cubic-bezier(0.6, 0, 0.2, 1) 0.15s both; }
.axe line { stroke: var(--lime); stroke-width: 1.5px; vector-effect: non-scaling-stroke; stroke-dasharray: 26 7 3 7; }
@keyframes axe { from { transform: scaleY(0); } }

.vol-contenu { position: absolute; inset: 0; pointer-events: none; }
.vol-contenu a, .vol-contenu input { pointer-events: auto; }

/* ouverture : titre à gauche de l'axe, détail à droite */
.ouverture { position: relative; height: 100vh; height: 100svh; display: grid; grid-template-columns: 1fr var(--vid) 1fr; align-items: end; padding: 0 4vw 11vh; }
.ouv-titre { grid-column: 1; justify-self: end; text-align: right; margin: 0 2.5vw 0 0; max-width: var(--col);
  font-size: clamp(2.6rem, 4.7vw, 6.4rem); line-height: 0.9; font-weight: 850; font-stretch: 112%; letter-spacing: -0.035em; text-shadow: 0 10px 40px rgba(0, 0, 0, 0.6); }
.ouv-titre span { display: block; animation: monte 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.ouv-titre span:nth-child(2) { animation-delay: 0.08s; } .ouv-titre span:nth-child(3) { animation-delay: 0.16s; } .ouv-titre span:nth-child(4) { animation-delay: 0.24s; color: var(--lime); }
@keyframes monte { from { opacity: 0; transform: translateY(0.6em); } }
.ouv-texte { grid-column: 3; justify-self: start; margin-left: 2.5vw; max-width: var(--col); animation: fondu 0.8s ease-out 0.45s both; }
.ouv-texte p { color: #d5d9d3; font-size: 1.04rem; margin-bottom: 1.4rem; text-shadow: 0 2px 16px rgba(0, 0, 0, 0.8); }
.ouv-texte .actions { margin: 0 0 1.8rem; }
@keyframes fondu { from { opacity: 0; } }
.ouv-cotes { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 0; margin: 0; border-top: 1px solid rgba(126, 217, 87, 0.5); }
.ouv-cotes div { padding: 0.6rem 1.4rem 0 0; position: relative; }
.ouv-cotes div + div { padding-left: 1.2rem; border-left: 1px solid rgba(126, 217, 87, 0.35); }
.ouv-cotes dt { font-size: 0.78rem; color: var(--brume); }
.ouv-cotes dd { margin: 0; font-weight: 750; font-stretch: 112%; color: var(--lime); font-variant-numeric: tabular-nums; white-space: nowrap; }
.defiler { position: absolute; left: 50%; bottom: 3.2vh; translate: -50% 0; margin: 0; font-size: 0.8rem; color: var(--brume); display: flex; align-items: center; gap: 0.7rem; white-space: nowrap; animation: fondu 1s ease-out 1.2s both; }
.defiler span { width: 1px; height: 28px; background: linear-gradient(var(--lime), transparent); animation: goutte 1.8s ease-in-out infinite; }
@keyframes goutte { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* atouts en miroir de part et d'autre de l'axe */
.atout { position: absolute; width: var(--col); text-shadow: 0 2px 18px rgba(0, 0, 0, 0.85); }
.atout.g { right: calc(50% + var(--vid) / 2 + 2.5vw); text-align: right; }
.atout.d { left: calc(50% + var(--vid) / 2 + 2.5vw); }
.atout svg { width: 42px; height: 42px; fill: var(--pvc); stroke: var(--pvc); margin-bottom: 1.1rem; display: inline-block; }
.atout svg .vif { fill: var(--lime); stroke: none; } .atout svg .trait-vif { stroke: var(--lime); }
.atout svg path:not(.trait-vif) { fill: none; }
.atout h2 { font-size: clamp(1.45rem, 2.1vw, 2.2rem); line-height: 1.05; font-weight: 780; font-stretch: 110%; letter-spacing: -0.015em; margin: 0 0 0.7rem; }
.atout p { color: #cfd4ce; font-size: 1rem; margin: 0; }
.a1 { top: 128vh; } .a2 { top: 178vh; } .a3 { top: 228vh; } .a4 { top: 278vh; }
.bascule { position: absolute; top: 350vh; left: 0; right: 0; margin: 0; text-align: center; font-size: clamp(2.6rem, 6.4vw, 7.4rem); line-height: 0.92; font-weight: 850;
  font-stretch: 116%; letter-spacing: -0.035em; text-shadow: 0 12px 50px rgba(0, 0, 0, 0.7); padding: 0 4vw; }
.bascule span { display: block; }
.bascule span:last-child { color: var(--lime); }

/* ---------------------------------------------------------------- clair : calcul en direct */
.clair { --encre: #141615; position: relative; z-index: 2; margin-top: -42vh; padding: 46vh 0 7rem;
  background: linear-gradient(rgba(236, 238, 232, 0), rgba(236, 238, 232, 0.85) 26vh, #eceee8 42vh); color: var(--encre); }
.clair-tete { display: grid; grid-template-columns: 1.35fr 1fr; gap: 3rem; align-items: end; margin-bottom: 3rem; }
.clair-tete h2 { font-size: clamp(2.6rem, 6.2vw, 6.6rem); line-height: 0.92; font-weight: 850; font-stretch: 116%; letter-spacing: -0.035em; margin: 0; color: var(--encre); }
.clair-tete p { color: #3c413e; margin: 0; max-width: 30rem; font-size: 1.06rem; }
.calcul { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(18rem, 1fr); background: #050605; color: var(--pvc); border-radius: 26px; overflow: hidden;
  box-shadow: 0 40px 80px -30px rgba(20, 22, 21, 0.55); }
.calcul-plan { padding: 1.5rem; display: grid; place-items: center; min-height: 26rem; }
.calcul-plan svg { width: 100%; height: auto; max-height: 30rem; }
.calcul-reglages { padding: 2.2rem 2.2rem 2rem; border-left: 1px solid #1f2321; display: flex; flex-direction: column; gap: 1.4rem; }
.curseur { display: grid; gap: 0.6rem; }
.curseur span { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
.curseur output { color: var(--lime); font-weight: 800; font-stretch: 112%; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.calcul-chiffres { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0.4rem 0 0; border-top: 1px solid #2b2f2d; border-bottom: 1px solid #2b2f2d; }
.calcul-chiffres div { padding: 1rem 0.8rem 0.9rem; display: flex; flex-direction: column-reverse; }
.calcul-chiffres div + div { border-left: 1px solid #2b2f2d; }
.calcul-chiffres div:first-child { padding-left: 0; }
.calcul-chiffres dd { margin: 0; font-size: clamp(1.9rem, 2.8vw, 2.8rem); line-height: 1; font-weight: 850; font-stretch: 118%; font-variant-numeric: tabular-nums; }
.calcul-chiffres dt { font-size: 0.82rem; color: var(--brume); margin-top: 0.35rem; }
.calcul-note { color: var(--brume); font-size: 0.86rem; margin: 0; }
.calcul-reglages .btn { align-self: start; margin-top: auto; }

.parcours { list-style: none; padding: 0; margin: 4.5rem 0 0; display: grid; grid-template-columns: repeat(3, 1fr); counter-reset: p; position: relative; }
.parcours::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 14px; border-left: 1.5px solid var(--encre); border-right: 1.5px solid var(--encre);
  background: linear-gradient(var(--encre), var(--encre)) center / 100% 1.5px no-repeat; }
.parcours li { counter-increment: p; padding: 2.2rem 2rem 0 0; position: relative; }
.parcours li + li::before { content: ""; position: absolute; left: 0; top: 0; height: 14px; border-left: 1.5px solid var(--encre); }
.parcours li + li { padding-left: 1.4rem; }
.parcours b { display: block; font-size: 1.4rem; font-weight: 780; font-stretch: 110%; margin-bottom: 0.35rem; }
.parcours b::before { content: counter(p) "  "; color: #3f8a22; white-space: pre; }
.parcours span { color: #4a504c; }

/* ---------------------------------------------------------------- le raccord annoté */
.piece { position: relative; background: #000; }
.piece-image { margin: 0; position: relative; height: min(92vh, 62vw); min-height: 30rem; overflow: hidden; }
.piece-image img { width: 100%; height: 100%; object-fit: cover; }
.piece-cotes { position: absolute; inset: 0; width: 100%; height: 100%; }
.piece-cotes .rep circle { fill: var(--lime); }
.piece-cotes .rep polyline { fill: none; stroke: var(--lime); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.piece-cotes text { fill: var(--pvc); font-family: var(--ff); font-size: 30px; font-weight: 600; text-anchor: start; }
.piece-texte { position: absolute; left: 0; right: 0; bottom: 0; padding-bottom: 7vh; pointer-events: none; }
.piece-texte > * { pointer-events: auto; max-width: 31rem; }
.piece-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 45%, rgba(0, 0, 0, 0.88)); pointer-events: none; }
.piece-texte h2 { font-size: clamp(2.4rem, 5vw, 5.2rem); line-height: 0.92; font-weight: 850; font-stretch: 116%; letter-spacing: -0.035em; margin: 0 0 1rem; max-width: 12ch; }
.piece-texte p { color: #d5d9d3; }

/* ---------------------------------------------------------------- prix */
.final { padding: 8rem 0 7rem; background: radial-gradient(ellipse 50% 60% at 85% 100%, rgba(126, 217, 87, 0.12), transparent 70%), #000; }
.final .page { display: grid; grid-template-columns: 1.3fr 1fr; gap: 3rem; align-items: end; }
.final h2 { font-size: clamp(2.6rem, 6.4vw, 7rem); line-height: 0.9; font-weight: 850; font-stretch: 116%; letter-spacing: -0.035em; margin: 0; }
.final h2 span { display: block; }
.final h2 span:last-child { color: #6d736e; }
.final-texte p { color: #cfd4ce; }
.final-texte .actions { margin: 1.6rem 0; }
.final-note { font-size: 0.86rem; color: var(--brume) !important; border-left: 2px solid var(--ambre); padding-left: 0.9rem; }

/* ---------------------------------------------------------------- écrans étroits ou en portrait */
@media (max-width: 960px), (max-aspect-ratio: 1/1) {
  .vol { --col: auto; height: 520vh; }
  .scene-video { left: 0; width: 100%; translate: none; -webkit-mask-image: none; mask-image: none; }
  .scene-voile { background: linear-gradient(rgba(0, 0, 0, 0.45), transparent 22%, transparent 45%, rgba(0, 0, 0, 0.82)); }
  .axe { display: none; }
  .ouverture { grid-template-columns: 1fr; padding: 0 1.25rem 9vh; align-content: end; gap: 1.2rem; }
  .ouv-titre { grid-column: 1; justify-self: start; text-align: left; margin: 0; max-width: none; font-size: clamp(2.6rem, 11vw, 4.6rem); }
  .ouv-titre span { display: inline; }
  .ouv-texte { grid-column: 1; margin: 0; max-width: 34rem; }
  .defiler { display: none; }
  .atout, .atout.g, .atout.d { left: 1.25rem; right: 1.25rem; width: auto; text-align: left; padding: 1.3rem 1.3rem 1.2rem; border-radius: 16px;
    background: rgba(0, 0, 0, 0.58); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, 0.08); }
  .atout svg { width: 34px; height: 34px; margin-bottom: 0.7rem; }
  .a1 { top: 120vh; } .a2 { top: 165vh; } .a3 { top: 210vh; } .a4 { top: 255vh; } .bascule { top: 320vh; }
  .clair-tete, .calcul, .final .page { grid-template-columns: 1fr; }
  .calcul-reglages { border-left: 0; border-top: 1px solid #1f2321; padding: 1.5rem; }
  .calcul-plan { min-height: 0; padding: 1rem; }
  .parcours { grid-template-columns: 1fr; gap: 1.4rem; }
  .parcours::before, .parcours li + li::before { display: none; }
  .parcours li, .parcours li + li { padding: 0 0 0 1rem; border-left: 1.5px solid var(--encre); }
  .piece-cotes text { font-size: 44px; }
  .piece-image { height: 72vh; }
  .piece-cotes { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ouv-titre span, .ouv-texte, .defiler, .axe { animation: none; }
  .defiler span { animation: none; }
}

/* mobile : le rack remonte, le texte d'ouverture se pose sur un fond sombre */
@media (max-width: 960px), (max-aspect-ratio: 1/1) {
  .scene-video { translate: 0 calc(-15vh * var(--monte, 1)); }
  .scene-voile { background: linear-gradient(rgba(0, 0, 0, 0.45), transparent 20%, transparent 38%, rgba(0, 0, 0, calc(0.94 * var(--voile, 1))) 66%); opacity: 1; }
  .ouv-texte p { font-size: 0.98rem; margin-bottom: 1.1rem; }
  .ouv-texte .actions { margin-bottom: 1.2rem; }
}
.piece-cotes { z-index: 1; }
.piece-texte { z-index: 2; }
.piece-texte h2 { font-size: clamp(2.2rem, 4vw, 4.4rem); max-width: 9ch; }
.piece-texte p { max-width: 26rem; }
