/* --- CONFIGURATION DU SCROLL --- */
html {
    margin: 0; padding: 0;
    width: 100%;
    height: auto; /* Permet au contenu de définir la hauteur */
    overflow-y: auto !important; /* Force l'apparition de la barre de scroll */
}

body {
    margin: 0; padding: 0;
    width: 100%;
    min-height: 100%;
    background: #8194AA; /* Couleur ciel */
    font-family: 'Oranienbaum', serif;
}

#scroll-spacer {
    height: 2000vh; /* Profondeur du scroll pour ralentir la vidéo */
    position: relative;
    z-index: 1;
    pointer-events: none;
}

/* --- WRAPPER VIDÉO --- */
#video-wrapper {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 5;
    pointer-events: none; /* Laisse passer le scroll à travers */
    transition: transform 0.8s cubic-bezier(0.45, 0, 0.55, 1), filter 0.8s, opacity 0.8s;
}

video {
    width: 100%; height: 100%;
    object-fit: cover;
}

.is-snapping #video-wrapper {
    filter: blur(50px) brightness(1.2);
    transform: translateY(100%); /* Ascension : la vidéo chute */
    opacity: 0;
}

/* --- ÉCRAN FINAL ET CONTENU --- */
#final-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #8194AA;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20%);
    transition: all 1s cubic-bezier(0.22, 1, 0.36, 1);
}

#final-screen.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.main-bg {
    position: absolute;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 1;
}

.content-stack {
    position: relative;
    display: flex;
    flex-direction: column; /* Cercle au-dessus du texte */
    align-items: center;
    gap: 100px;
    z-index: 20;
    width: 90%;
    max-width: 1000px;
}

.circle-container {
    width: 350px; height: 350px;
    border-radius: 50%;
    overflow: hidden;
    background: rgb(218, 183, 45); /* Jaune/Ocre */
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.balsamine-img {
    width: 60%; height: 80%;
    object-fit: cover; /* Centrage automatique */
    object-position: center;
}

/* --- TEXTES ET BOUTON --- */
.text-frame, .text-frame-balsamine {
    position: absolute !important;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 200px;
    text-align: center;
    z-index: 100;
    /* AJOUT ICI : Permet de cliquer sur ce qui est derrière */
    pointer-events: none; 
}

.story-text, .balsamine-text {
    font-family: "Oranienbaum", serif;
    font-size: 2.2rem;
    line-height: 1.5;
    color: white;
    opacity: 0;
    filter: blur(10px);
    /* Position de départ légèrement plus basse */
    transform: translate(0, -30%) translateY(20px); 
    transition: all 0.8s ease-out;
    position: absolute;
    width: 100%;
    left: 0;
    top: 50%;
    text-shadow: 0 4px 15px rgba(0,0,0,0.6);
    pointer-events: none;
}

.text-frame, .text-frame-balsamine {
    position: absolute !important; /* Force l'absolute pour rester sur la vidéo */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 200px; /* Un peu plus de hauteur pour la sécurité */
    text-align: center;
    z-index: 100;
}

.story-text.active, .balsamine-text.active {
    opacity: 1 !important;
    filter: blur(0px) !important;
    transform: translate(0, -50%) !important; /* Centrage Y propre */
    visibility: visible !important;
}

.active { opacity: 1 !important; filter: blur(0px) !important; }

.button-frame {
    position: relative;
    z-index: 110; /* Doit être supérieur au z-index du texte */
    opacity: 0;
    visibility: hidden;
    transition: 1s;
    pointer-events: all; /* Force la réactivation des clics */
}

.button-frame.visible {
    opacity: 1;
    visibility: visible;
}

#dialogue-lierre {
    z-index: 100;
}

.next-button {
    display: inline-block;
    padding: 12px 35px;
    border: 1px solid white;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: 0.4s;
    backdrop-filter: blur(5px); /* Style automne.html */
}

.next-button:hover {
    background: white;
    color: #8194AA;
}