/* css/legacy-hero.css — Scène d'ouverture illustrée parallaxe 1:1 native (ancien Hero Zarbix, 8 calques WebP) */

.legacy-hero {
    --hero-scale: 0.6;
    --hero-float-y: -11px;
    --hero-top-offset: calc(var(--nav-height) + var(--topbar-height) + 4px + env(safe-area-inset-top, 0px));
    position: relative;
    z-index: 1;
    width: 100%;
    margin-top: calc(var(--hero-top-offset) * -1);
    padding-top: var(--hero-top-offset);
    height: clamp(640px, 100dvh, 980px);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background-color: #03091b;
    color: var(--brand-paper);
    border-bottom: 1px solid rgba(247, 248, 250, 0.14);
    scroll-margin-top: 0;
    contain: layout paint;
}

.legacy-hero::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 92px;
    background: linear-gradient(180deg, rgba(9, 10, 13, 0) 0%, rgba(9, 10, 13, 0.7) 100%);
    pointer-events: none;
    z-index: 12;
}

/* Canvas 2D sous-pixel natif (fluidité absolue Firefox/Chrome sans pixel-snapping) */
.legacy-hero__canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
    z-index: 2;
}

.legacy-hero.is-canvas-ready .legacy-hero__scene {
    display: none;
}

/* Zéro transform: scale() sur le conteneur -> repli sans JS fidèle en 1:1 */
.legacy-hero__scene {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 1920px;
    margin: 0 auto;
}

.legacy-hero__layer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    max-width: none;
}

.legacy-hero__layer img {
    display: block;
    max-width: none;
    height: auto;
}

/* Flottement organique fluide à l'échelle 1:1 (pure translation GPU, zéro rotate) */
@keyframes legacyHeroFloat {

    0%,
    100% {
        transform: translate3d(0, 0, 0);
    }

    50% {
        transform: translate3d(0, var(--hero-float-y), 0);
    }
}

.legacy-hero__float {
    animation: legacyHeroFloat 4.6s ease-in-out infinite;
    will-change: transform;
}

.legacy-hero__layer--0 .legacy-hero__float {
    animation-duration: 6.4s;
    animation-delay: 0s;
}

.legacy-hero__layer--1 .legacy-hero__float {
    animation-duration: 4.4s;
    animation-delay: -0.4s;
}

.legacy-hero__layer--2 .legacy-hero__float {
    animation-duration: 4.8s;
    animation-delay: -1.8s;
}

.legacy-hero__layer--3 .legacy-hero__float {
    animation-duration: 5.2s;
    animation-delay: -0.9s;
}

.legacy-hero__layer--4 .legacy-hero__float {
    animation-duration: 4.9s;
    animation-delay: -2.4s;
}

.legacy-hero__layer--5 .legacy-hero__float {
    animation-duration: 4.6s;
    animation-delay: -1.3s;
}

.legacy-hero__layer--6 .legacy-hero__float {
    animation-duration: 4.3s;
    animation-delay: -3.1s;
}

.legacy-hero__layer--7 .legacy-hero__float {
    animation-duration: 5s;
    animation-delay: -2s;
}

/* Positionnement & dimensions 1:1 calculés par --hero-scale (fidèle à la composition d'origine) */
.legacy-hero__layer--0 {
    z-index: 0;
    opacity: 0.82;
    margin-top: calc(-220px * var(--hero-scale));
    margin-left: 0;
}

.legacy-hero__layer--0 img {
    width: calc(1024px * var(--hero-scale));
}

.legacy-hero__layer--1 {
    z-index: 1;
    margin-left: calc(-350px * var(--hero-scale));
    margin-top: calc(-200px * var(--hero-scale));
}

.legacy-hero__layer--1 img {
    width: calc(490px * var(--hero-scale));
}

.legacy-hero__layer--2 {
    z-index: 2;
    margin-left: calc(360px * var(--hero-scale));
    margin-top: calc(-170px * var(--hero-scale));
}

.legacy-hero__layer--2 img {
    width: calc(390px * var(--hero-scale));
}

.legacy-hero__layer--3 {
    z-index: 10;
}

.legacy-hero__layer--3 img {
    width: calc(1261px * var(--hero-scale));
}

.legacy-hero__layer--4 {
    z-index: 3;
    margin-top: calc(300px * var(--hero-scale));
    margin-left: calc(-160px * var(--hero-scale));
}

.legacy-hero__layer--4 img {
    width: calc(980px * var(--hero-scale));
}

.legacy-hero__layer--5 {
    z-index: 2;
    margin-top: calc(300px * var(--hero-scale));
    margin-left: calc(320px * var(--hero-scale));
}

.legacy-hero__layer--5 img {
    width: calc(640px * var(--hero-scale));
}

.legacy-hero__layer--6 {
    z-index: 11;
    margin-top: calc(260px * var(--hero-scale));
}

.legacy-hero__layer--6 img {
    width: calc(400px * var(--hero-scale));
}

.legacy-hero__layer--7 {
    z-index: 4;
    margin-top: calc(370px * var(--hero-scale));
}

.legacy-hero__layer--7 img {
    width: calc(900px * var(--hero-scale));
}

/* Repère discret d'invitation au défilement vers le Hero B2B */
.legacy-hero__cue {
    position: absolute;
    left: 50%;
    bottom: 1.25rem;
    transform: translateX(-50%);
    z-index: 15;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background-color: rgba(9, 10, 13, 0.88);
    border: 1.5px solid rgba(247, 248, 250, 0.34);
    color: var(--brand-paper);
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.legacy-hero__cue:hover {
    background-color: rgba(26, 95, 208, 0.88);
    border-color: var(--brand-paper);
    transform: translateX(-50%) translateY(2px);
}

.legacy-hero__cue:focus-visible {
    outline: 2px solid var(--brand-paper);
    outline-offset: 3px;
}

/* Mode calme : désactive le flottement */
html[data-motion="reduced"] .legacy-hero__float {
    animation: none;
}

/* Échelle responsive 1:1 fidèle à l'ancien Hero */
@media (min-width: 2000px) {
    .legacy-hero {
        --hero-scale: 0.8;
        --hero-float-y: -14px;
        height: 1000px;
    }
}

@media (max-width: 1400px) {
    .legacy-hero {
        --hero-scale: 0.5;
        --hero-float-y: -10px;
        height: clamp(600px, 90dvh, 860px);
    }
}

@media (max-width: 768px) {
    .legacy-hero {
        --hero-scale: 0.38;
        --hero-float-y: -8px;
        height: clamp(480px, 72dvh, 620px);
    }
}

@media (max-width: 480px) {
    .legacy-hero {
        --hero-scale: 0.28;
        --hero-float-y: -6px;
        height: clamp(410px, 60dvh, 510px);
    }

    .legacy-hero__cue {
        font-size: 0.68rem;
        padding: 0.42rem 0.85rem;
    }
}