@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;1,300&display=swap');

html {
    scroll-behavior: auto;
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
}

body {
    overflow-x: hidden;
    /* height imposée dynamiquement par zoom.js */
    width: 100%;
    margin: 0;
    padding: 0;
    background: #000;
    font-family: 'Poppins', sans-serif;
}

#loader {
    z-index: 1000;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: white;
}

#loader-img {
    top: 40%;
    left: 48%;
    position: absolute;
    scale: 10;
    color: rgba(230, 0, 41);
}

#loader-text {
    text-align: center;
    font-size: 150%;
    position: absolute;
    top: 60%;
    width: 100%;
    color: rgba(230, 0, 41);
}

#scene-container {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
}

#scene {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* ── Progression ── */
#progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 2px;
    background: rgba(249, 115, 22, .8);
    z-index: 300;
    width: 0%;
}

/* ── Ciel ── */
#ciel {
    position: absolute;
    object-fit: cover;
    z-index: 0;
    width: 100%;
    height: 100%;
    transform-origin: center top;
}

/* ── Cartes ── */
#map-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#map {
    top: 54%;
    left: 0%;
    position: absolute;
    width: 100%;
    object-fit: cover;
    display: block;
    transform-origin: center bottom;
}

#map2 {
    top: 45%;
    left: 0%;
    position: absolute;
    width: 100%;
    object-fit: cover;
    display: block;
    transform-origin: center bottom;
}

/* ── GIFs ── */
.GIF {
    display: none;
    width: auto;
}

#NuageGIF1 {
    position: absolute;
    top: 0vh;
    left: 0vw;
    width: 100vw;
    z-index: 5;
}

#NuageGIF2 {
    position: absolute;
    top: 60vh;
    left: 0vw;
    width: 80vw;
    z-index: 5;
}

#NuageGIF3 {
    position: absolute;
    top: 45vh;
    right: 0vw;
    width: 80vw;
    z-index: 5;
}

/* ── Texte info ── */
#TxtInfo {
    position: absolute;
    color: black;
    display: block;
    top: 50%;
    left: 50%;
    z-index: 100;
    transform: translateX(-50%);
    opacity: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 2vh;
    text-align: center;
    pointer-events: none;
    width: 80vw;
    height: auto;

}

#TxtInfo p {
    width: 80vw;
}

/* ── Nuages zoom ── */
#nuage1_zoom {
    position: absolute;
    width: auto;
    top: 22%;
    left: 30%;
    z-index: 10;
    transform: translateX(-50%) translateY(-50%) scale(0.4);
}

#nuage2_zoom {
    position: absolute;
    width: auto;
    top: 27%;
    left: 20%;
    z-index: 10;
    transform: translateX(-50%) translateY(-50%) scale(0.07);
}

#nuage3_zoom {
    position: absolute;
    width: auto;
    top: 27%;
    left: 75%;
    z-index: 10;
    transform: translateX(-50%) translateY(-50%) scale(0.45);
}

/* ════════════════════════
   PHASE 3 — MUSÉE
════════════════════════ */
.scene-musee {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    overflow: visible;
}

.calque-ville {
    position: absolute;
    inset: 0;
    overflow: visible;
}

#imgVille {
    position: absolute;
    bottom: -2.36vh;
    left: -50%;
    height: 100%;
    width: auto;
    will-change: left, transform;
    opacity: 0;
}

.musee,
.ruines,
.ecolier {
    opacity: 0;
    z-index: 20;
    transition: opacity .6s ease;
}

.musee.visible,
.ruines.visible,
.ecolier.visible {
    opacity: 1;
}

.musee {
    position: fixed;
    bottom: -55vh;
    right: 0vh;
    width: 300px;
}

.ruines {
    position: fixed;
    bottom: -30vh;
    left: 0vw;
    width: 100vw;
}

.ecolier {
    position: fixed;
    bottom: -30vh;
    left: 8vh;
    width: 260px;
}

.bloc-texte-musee {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    opacity: 0;
    transition: opacity .8s ease;
    max-width: 66vh;
    padding: 0 2.84vh;
    z-index: 100;
    pointer-events: none;
}

.bloc-texte-musee.visible {
    opacity: 1;
    pointer-events: all;
}

/* ════════════════════════
   PHASE 4 — CHANTIER
════════════════════════ */
.scene-chantier {
    position: absolute;
    top: 0;
    left: 100%;
    width: 100%;
    height: 100%;
    will-change: left, transform;
    z-index: 30;
    background-image: url('../img/chantier/collines_new.png');
    background-repeat: no-repeat;
    background-size: 100% auto;
    background-position: left bottom;
}

.avant {
    position: absolute;
    inset: 0;
    background-image: url('../img/chantier/Plan-av.png');
    background-repeat: no-repeat;
    background-size: 100% auto;
    background-position: left bottom;
    z-index: 1;
}

.apres {
    position: absolute;
    inset: 0;
    background-image: url('../img/chantier/Plan-ap.png');
    background-repeat: no-repeat;
    background-size: 100% auto;
    background-position: left bottom;
    clip-path: inset(0 100% 0 0);
    will-change: clip-path;
    z-index: 2;
}

.colline {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    z-index: 0;
    pointer-events: none;
}

.separateur {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 0.35vh;
    background: white;
    box-shadow: 0 0 1.42vh rgba(255, 255, 255, 0.8);
    left: 0%;
    will-change: left;
    pointer-events: none;
    opacity: 0;
    transition: opacity .6s ease;
    z-index: 2;
}

.separateur.visible {
    opacity: 1;
}

.separateur::after {
    content: '◀ ▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.89vh;
    letter-spacing: 0.24vh;
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.71vh 0.95vh;
    border-radius: 2.36vh;
}

.label {
    position: absolute;
    top: 2.84vh;
    font-family: 'Poppins', sans-serif;
    font-size: 1.18vh;
    letter-spacing: .15em;
    text-transform: uppercase;
    padding: 0.71vh 1.65vh;
    border-radius: 0.47vh;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    pointer-events: none;
    opacity: 0;
    transition: opacity .6s ease;
    z-index: 2;
}

.label.visible {
    opacity: 1;
}

.label-avant {
    left: 2.84vh;
}

.label-apres {
    right: 2.84vh;
}

.scene2-contenu {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    font-family: 'Poppins', sans-serif;
    opacity: 0;
    transition: opacity 1.2s ease;
    padding: 2.84vh;
    max-width: 70vh;
    z-index: 10;
    pointer-events: none;
}

.scene2-contenu.visible {
    opacity: 1;
    pointer-events: all;
}

/* ── Arbre ── */
.arbre {
    position: absolute;
    bottom: -10%;
    height: 95%;
    width: auto;
    z-index: 60;
    pointer-events: none;
    transform-origin: right bottom;
    will-change: left, transform, opacity;
    display: none;
}

/* ════════════════════════
   PHASE 5 — MAISON
   z-index 40 : s'affiche par-dessus le chantier (30)
   overflow hidden : clips les éléments qui entrent
   display none par défaut : JS active avec display:block
════════════════════════ */
.scene-maison {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 40;
    overflow: hidden;
    display: none;
    background: transparent;
    /* laisse voir le chantier zoomé en dessous */
}

/* Ciel et colline masqués : le chantier zoomé sert de fond */
.m-ciel,
.m-colline {
    display: none;
}

/* ── Éléments animés ─────────────────────────────────
   opacity:0 par défaut, transform piloté par JS.
   PAS de transition CSS : tout est frame par frame.   */

/* Route : 3x plus grande, collée en bas de l'écran */
.m-route {
    position: absolute;
    z-index: 2;
    bottom: 0;
    left: 50%;
    width: 195%;
    height: auto;
    /* ~3× la largeur originale */
    opacity: 0;
    /* JS compose : translateX(-50%) translateY(entrée) */
}

/* Arbres maison : x3, bas aligné sur le haut de la route, par-dessus route */
.m-arbres {
    position: absolute;
    z-index: 5;
    /* au-dessus de la route (z:2) */
    left: 50%;
    bottom: 0;
    width: 210%;
    /* ~3× la taille originale */
    opacity: 0;
    /* JS compose : translateX(-50%) translateY(offset_route + entrée) */
}

/* Femme : centrée horizontalement sur les arbres */
.m-femme {
    position: absolute;
    z-index: 6;
    left: 50%;
    bottom: 0;
    /* JS synchronise avec arbres */
    width: 13%;
    opacity: 0;
    /* JS pilote translateX(-50%) translateY(offset) */
}

/* ════════════════════════
   TYPOGRAPHIE
════════════════════════ */
.titre {
    font-family: 'Poppins', sans-serif;
    font-size: 3vh;
    font-weight: 300;
    color: #f97316;
    letter-spacing: .1em;
    margin-bottom: 1.89vh;
    text-shadow: 0 0.24vh 1.89vh rgba(0, 0, 0, .8);
}

.description {
    font-family: 'Poppins', sans-serif;
    font-size: 1.36vh;
    font-style: italic;
    color: rgba(255, 255, 255, .92);
    line-height: 1.75;
    text-shadow: 0 0.24vh 1.18vh rgba(0, 0, 0, .9);
}

.button {
    display: inline-block;
    margin-top: 1.42vh;
    padding: 0.47vh 1.65vh;
    border: 0.12vh outset;
    border-radius: 0.35vh;
    color: orange;
    background: white;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
    font-size: 1.2vh;
}

/* ════════════════════════════════════
   FLÈCHE SCROLL
════════════════════════════════════ */
#scroll-fleche {
    position: fixed;
    bottom: 4vh;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8vh;
    z-index: 500;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s ease;
    width: 400%;
}

#scroll-fleche.visible {
    opacity: 1;
}

#scroll-fleche span {
    font-family: 'Poppins', sans-serif;
    font-style: italic;
    font-size: 3vh;
    letter-spacing: 0.2em;
    color: rgba(255, 0, 0, 0.6);
    text-transform: lowercase;
}

#scroll-fleche svg {
    width: 4.8vh;
    height: 4.8vh;
    animation: rebond 1.4s ease-in-out infinite;
}

/* ════════════════════════
   LOGOS ACCUEIL
════════════════════════ */
#logos-accueil {
    position: fixed;
    inset: 0;
    z-index: 200;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.6s ease;
}

#logos-accueil.cache {
    opacity: 0;
}

#logo-metropole {
    position: absolute;
    bottom: 3vh;
    left: 50%;
    transform: translateX(-50%);
    height: 5vh;
    width: auto;
    background-color: white;
}

#logo-teteaupied {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    height: 13vh;
    width: auto;
}

@keyframes rebond {

    0%,
    100% {
        transform: translateY(0);
        opacity: 1;
    }

    50% {
        transform: translateY(6px);
        opacity: 0.5;
    }
}

/*Phase biodiversité*/

#fond {
    position: fixed;
    left: 0vw;
    top: 0vh;
    height: 100vh;
}

#mec {
    position: fixed;
    left: 35vw;
    bottom: 3vh;
    width: 50vw;
}

#arbre1 {
    position: fixed;
    left: -80vw;
    bottom: 0vh;
    width: 200vw;
}

#arbre2 {
    position: fixed;
    right: -60vw;
    bottom: 0vh;
    width: 150vw;
}

#arbreDessin {
    position: fixed;
    right: -100vw;
    bottom: 23vh;
    width: 100vw;
}

#arbre3 {
    position: fixed;
    right: -210vw;
    bottom: 10vh;
    width: 100vw;
}

#planter {
    position: fixed;
    right: -195vw;
    bottom: 0vh;
    width: 100vw;
}

/*Déchets*/
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
}

.scroll-space {
    height: 5000vh;
}

:root {
    --bg-h: 100vh;
    --road-h: clamp(24px, 5vh, 80px);
    --truck-h: 50vh;
    --scene-width: 70vh;
    --bg-h2: 200vh;
}

.sceneDechets {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--scene-width);
    height: 100vh;
    overflow: hidden;
}


@media (min-aspect-ratio: 1/1) {
    :root {
        --bg-h: 100vh;
        --road-h: clamp(64px, 12vh, 200px);
        --truck-h: 42vh;
        --bg-h2: 200vh;

    }
}

.panorama-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 140vh;
    height: var(--bg-h);
    overflow: hidden;
}

.panorama {
    position: absolute;
    top: 0;
    left: 0;
    width: 280vh;
    height: var(--bg-h);
    display: flex;
    will-change: transform;
}

.panorama img {
    width: auto;
    height: var(--bg-h);
    object-fit: cover;
    object-position: center top;
    display: block;
    flex-shrink: 0;
}

.panorama-track2 {
    position: absolute;
    top: 0;
    left: 0;
    width: 300vh;
    height: var(--bg-h2);
    overflow: hidden;
}

.panorama2 {
    position: absolute;
    top: 0;
    left: 0;
    width: 370vh;
    height: var(--bg-h2);
    display: flex;
    will-change: transform;
}

#fond_eau {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: left top;
    z-index: 10;
    transform-origin: top left;
    will-change: transform;
    opacity: 0;
    pointer-events: none;
}

.road-strip {
    position: absolute;
    left: 0;
    width: var(--scene-width);
    top: var(--bg-h);
    height: var(--road-h);
    z-index: 10;
}

#route {
    height: var(--road-h);
}

.truck {
    position: absolute;
    bottom: 10vh;
    left: 0;
    height: var(--truck-h);
    width: auto;
    will-change: transform;
    z-index: 20;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.4));
    transform-origin: bottom left;
}

.worker {
    position: absolute;
    bottom: 10vh;
    right: 5vh;
    transform: translateX(-50%) translateY(100%);
    height: calc(var(--truck-h) * 0.75);
    width: auto;
    z-index: 30;
    opacity: 0;
    will-change: transform, opacity;
    transition: none;
}

#velo {
    position: absolute;
    bottom: 50vh;
    left: 0;
    height: calc(var(--truck-h)* 0.7);
    width: auto;
    will-change: transform;
    z-index: 20;
}

#metro {
    position: absolute;
    bottom: 7vh;
    left: -80vh;
    height: calc(var(--truck-h)* 0.5);
    width: auto;
    will-change: transform;
    z-index: 20;
}

#fin-ciel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(60, 180, 255);
    z-index: -4;
}

#fin-scene {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.el {
    position: absolute;
    opacity: 1;
    pointer-events: none;
}

/*FIN*/

.interactive {
    display: none;
    position: fixed;
    width: 10vw;
    cursor: pointer;
    z-index: 100;

}

#ciel_fin {
    position: fixed;
    height: 100vh;
}

#nuage_fin {
    position: fixed;
    top: 0.5vh;
    width: 90vw;
}

#ville_fin {
    position: fixed;
    top: 4vh;
    width: 110vw;
}

#arbre_fin {
    position: fixed;
    width: 80vw;
    right: 0vw;
    top: 10vh;
}

#musee_fin {
    position: fixed;
    width: 40vw;
    left: 32vw;
    top: 55vh;
}

#eau_fin {
    position: fixed;
    top: 53vh;
    left: 0vw;
    width: 110vw;
}

#metro_fin {
    position: fixed;
    width: 35vw;
    top: 25vh;
    left: 0vw;
}

#travaux_fin {
    position: fixed;
    width: 24vw;
    top: 68vh;
    left: 25vw;

}

#poubelle_fin {
    position: fixed;
    width: 50vw;
    bottom: 0vh;
    left: -5vw;
}

#velo_fin {
    position: fixed;
    width: 60vw;
    bottom: 0vh;
    right: -5vw;
}

#ciel_int {
    right: 2vw;
    top: 2vh;
}

#nuage_int {
    left: 15vw;
    top: 2vh;
}

#ville_int {
    left: 30vw;
    bottom: 20vh;
}

#arbre_int {
    right: 5vw;
    top: 20vh;
}

#musee_int {
    left: 60vw;
    top: 55vh;
}

#eau_int {
    right: 5vw;
    top: 57vh;
}

#metro_int {
    left: 5vw;
    top: 30vh;
}

#velo_int {
    right: 9vw;
    bottom: 15vh;
}

#poubelle_int {
    left: 20vw;
    bottom: 12vh;
}

#credit {
    left: 45vw;
    bottom: 0vh;
}


/*Pop-up*/
.PopUp {
    display: none;
    position: fixed;
    z-index: 500;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    overflow: auto;
    justify-content: center;
    align-items: center;
    font-family: 'Poppins', sans-serif;
}

.PopUpBloc {
    /*Bloc blanc du Pop-Up*/
    background-color: rgba(230, 0, 41, 0.7);
    margin: 15% auto;
    padding: 5vw;
    border-radius: 30px;
    width: 80vw;
    height: 80vh;
    position: relative
}

#PopUpTxt {
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    display: block;
    padding: 5vw;
    color: white;
    white-space: pre-line;
    max-height: 60vh;
    overflow-y: auto;
}

#PopUpTitre {
    font-size: 25px;
    display: block;
    color: white;
    white-space: pre-line;
    max-width: 70vh;
    overflow-y: auto;
}

#voir-plus {
    display: block;
    max-height: 10vh;
}

.close {
    position: relative;
    top: 0px;
    right: 2px;
    font-size: 17px;
    margin-top: 3vh;
    font-weight: bold;
    color: #333;
    cursor: pointer;
}

/* ════════════════════════════════════
   SCÈNE BIO — à ajouter à la fin de style.css

   La scène bio est TOUJOURS derrière (z-index 25),
   sous le chantier (30) et la maison (40).
   Elle devient visible par transparence quand
   chantier+maison s'effacent via opacity.
════════════════════════════════════ */

.scene-bio {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 25;
    /* SOUS chantier(30) et maison(40) */
    overflow: hidden;
    display: none;
}

/* ── Tous les enfants en position:absolute
   pour rester dans le stacking context de .scene-bio
   et ne PAS percer au-dessus des scènes précédentes ── */

.scene-bio #fond {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: auto;
    will-change: transform;
    z-index: 1;
}

.scene-bio #mec {
    position: absolute;
    left: 35vw;
    bottom: 3vh;
    width: 50vw;
    will-change: transform;
    z-index: 2;
}

/* Arbre gauche — au-dessus de l'écolier */
.scene-bio #arbre1 {
    position: absolute;
    left: -80vw;
    bottom: 0;
    width: 200vw;
    will-change: transform, opacity;
    z-index: 3;
}

/* Arbre droit — au-dessus de l'arbre gauche */
.scene-bio #arbre2 {
    position: absolute;
    right: -60vw;
    bottom: 0;
    width: 150vw;
    will-change: transform, opacity;
    z-index: 4;
}

.scene-bio #arbreDessin {
    position: absolute;
    right: -100vw;
    bottom: 23vh;
    width: 100vw;
    will-change: transform;
    z-index: 2;
}

.scene-bio #arbre3 {
    position: absolute;
    right: -210vw;
    bottom: 10vh;
    width: 100vw;
    will-change: transform;
    z-index: 2;
}

.scene-bio #planter {
    position: absolute;
    right: -195vw;
    bottom: 0;
    width: 100vw;
    will-change: transform;
    z-index: 2;
}