/* ================= GLOBAL ================= */
body,
html {
    margin: 0;
    padding: 0;
    font-family: sans-serif;
    background-color: rgba(252, 250, 212, 1);
    /* Crème par défaut pour la suite */
    max-width: 100%;
}

img,
video,
canvas {
    max-width: 100%;
    height: auto;
}

/* ================= L'EN-TÊTE FIXE ================= */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5vh 2vw;
    border-bottom: 0.1rem solid #eee;
}

.logo {
    font-size: 1.1rem;
    font-weight: 800;
    color: #000;
    border-bottom: 0.15rem solid #000;
    padding-bottom: 0.15rem;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.search-text {
    font-size: 1rem;
    color: #444;
    border-bottom: 0.1rem solid #444;
    padding-bottom: 0.15rem;
}

.search-icon {
    width: 1.6rem;
    height: 1.6rem;
    color: #000;
}

/* ================= LA ZONE BLANCHE AVEC TITRE ET DÉGRADÉ ================= */
.hero {
    background: linear-gradient(to bottom,
            #ffffff 0%,
            #ffffff 40%,
            rgba(252, 250, 212, 0) 100%);
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 15vh 2vw 0 2vw;
    position: relative;
    z-index: 10;
}

.main-title {
    font-size: clamp(1rem, 7vw, 3rem);
    font-weight: 800;
    line-height: 1.1;
    color: #000;
    margin: 0 0 1.5vh 0;
    letter-spacing: -0.05rem;
}

.sub-title {
    font-size: clamp(1rem, 3.5vw, 1.3rem);
    font-weight: 700;
    color: #111;
    margin: 0 0 3vh 0;
}

.tags {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.tag {
    border: 0.1rem solid #000;
    padding: 0.6rem 1rem;
    display: inline-block;
}

.tag-text {
    font-size: 1rem;
    font-weight: 600;
    color: #000;
    text-underline-offset: 0.2rem;
}

.scroll-indicator {
    position: absolute;
    bottom: 15vh;
    left: 50%;
    transform: translateX(-50%);
    color: #666;
    font-size: 0.9rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0) translateX(-50%);
    }

    40% {
        transform: translateY(-1vh) translateX(-50%);
    }

    60% {
        transform: translateY(-0.5vh) translateX(-50%);
    }
}

/* ================= SCROLLYTELLING ================= */
#scrolly {
    position: relative;
}

.scene {
    position: relative;
}

.bg-container {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    z-index: 0;
    overflow: hidden;
    background-color: rgba(252, 250, 212, 1);
}

.bg-media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: transparent;
    filter: brightness(0.6);
}

/* ================= TEXTES QUI DÉFILENT ================= */

article {
    position: relative;
    z-index: 1;
    margin-top: -100dvh;
}

.step {
    height: 100dvh;
    font-size: 1.25rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: rgb(0, 0, 0);
    font-family: "Lab Grotesque", sans-serif;
    padding: 0 5%;
}

.step-content {
    width: 100%;
    margin: 0 auto;
}

.step h1 {
    font-size: 2.5rem;
    margin: 0 0 1vh 0;
}

.step p {
    font-size: clamp(1rem, 3.5vw, 1.2rem);
    line-height: 1.5;
    background: rgb(255, 255, 255);
    text-align: left;
    padding: clamp(12px, 3vw, 15px);
    transition: border-color 0.3s;
}

/* ================= SPHÈRES ANIMÉES ================= */
/* Modifie la classe existante pour la cacher par défaut et ajouter une transition */
.spheres-container {
    position: relative;
    width: 100%;
    max-width: 20rem;
    height: 50dvh;
    margin: 0 auto;
    opacity: 0;
    /* Ajout : Caché par défaut */
    transition: opacity 0.5s ease-in-out;
    /* Ajout : Transition douce */
}

/* Ajoute cette nouvelle classe pour contrôler l'affichage depuis le JS */
.spheres-container.is-visible {
    opacity: 1;
}

.spheres-container img {
    position: absolute;
    left: 50%;
    width: 100%;
    height: auto;
    transition: opacity 1s ease-in-out, transform 1s ease-in-out;
    pointer-events: none;
    mix-blend-mode: multiply;
}

.images-container {
    position: relative;
    width: 100%;
    height: 20rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-center img {
    height: auto;
    z-index: 2;
}

.img-caf {
    top: 20%;
    transform: translate(-50%, 0) scale(1.1);
    opacity: 1;
}

.img-meres {
    top: 25%;
    transform: translate(-50%, 3vh) scale(0.5);
    opacity: 0;
}

#spheres-animation.is-transformed .img-caf {
    opacity: 1;
    transform: translate(-50%, -15vh) scale(0.2);
}

#spheres-animation.is-transformed .img-meres {
    opacity: 1;
    transform: translate(-50%, 0) scale(1.1);
}

.image-side {
    position: absolute;
    width: 10rem;
    top: 3%;
}

.image-side.left {
    left: 0;
    transform: scaleX(-1);
    opacity: 0;
}

.image-side.right {
    right: 0;
    opacity: 0;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-150px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(150px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.image-side.left.animated {
    animation: slideInLeft 2s ease-out forwards;
}

.image-side.right.animated {
    animation: slideInRight 2s ease-out forwards;
}

.quiz-superposition-container {
    position: relative;
    width: 100%;
    max-width: 31rem;
    margin: 0 auto;
    text-align: center;
}

/* Image de fond (la femme) */
.quiz-superposition-femme {
    width: 100%;
    height: auto;
    display: block;
}

/* Image superposée (la fléchette) */
.quiz-superposition-flechette {
    position: absolute;
    top: 90%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: auto;
    z-index: 2;
}

/* Texte superposé */
.quiz-superposition-texte {
    position: absolute;
    bottom: 2vh;
    left: 2vw;
    right: 2vw;
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem;
    border-radius: 0.5rem;
    z-index: 3;
    font-size: 1.2rem;
    color: #000;
    box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.2);
}

/* ================= QUIZ INLINE ================= */
/* ================= QUIZ (CONDENSE) ================= */
/* Conteneur principal du quiz */
.quiz-container {
    width: min(80%, 700px);
    margin: auto;
    padding: 10px 20px 2px;
    background: rgba(255, 255, 255, 0.9);
    font-family: Arial, sans-serif;
    text-align: center;
    color: #333;
    position: relative;
    opacity: 1;
    box-shadow: 0px 4px 5px rgba(0, 0, 0, 0.07);
}

.quiz-badge {

    background-color: rgb(0, 0, 0);
    color: #ffffff;
    padding: clamp(8px, 2vw, 10px) clamp(12px, 3vw, 16px);
    border-radius: 40px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    font-weight: bold;
    font-size: clamp(0.95rem, 3vw, 1.2rem);

}

.quiz-header {
    margin-top: -30px;
}

.quiz-container h2 {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.3;
    text-shadow: none;
}

.quiz-container .question {
    font-size: 1.2rem;
    line-height: 1.1;
    margin-bottom: 10px;
    background: transparent;
    padding: 0;
}

.quiz-container .options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.quiz-container .option-btn {
    padding: clamp(12px, 3vw, 15px) clamp(14px, 4vw, 20px);
    font-size: clamp(0.95rem, 2.8vw, 1rem);
    background: #ffffff;
    color: #000;
    border: 1px solid #000;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: background 0.3s;
    box-shadow: 0px 4px 5px rgba(0, 0, 0, 0.07);
}

.quiz-container .option-btn:hover {
    background: #eee;
}

.quiz-container .validate-btn {
    padding: clamp(10px, 2.5vw, 12px) clamp(16px, 4vw, 20px);
    background: #000000;
    font-size: clamp(0.95rem, 2.8vw, 1rem);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 0px auto 20px;
    display: block;
    box-shadow: 0px 4px 5px rgba(0, 0, 0, 0.07);
}



.quiz-container .feedback {
    display: none;
    margin-bottom: 10px;
}

.quiz-container .feedback.visible {
    display: block;
}

.quiz-answer {
    display: none;
    margin-top: 20px;
}

.quiz-answer.active {
    display: block;
}

.option-btn.selected {
    border: 1px solid #000;
}

.flip-btn {
    position: relative;
    perspective: 1000px;
    background: transparent;
    border: none;
    padding: 0;
    width: 100%;
    cursor: pointer;
}

.option-inner {
    position: relative;
    width: 100%;
    min-height: 180px;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-btn.is-flipped .option-inner {
    transform: rotateY(180deg);
}

.option-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 28px 30px;
    box-sizing: border-box;

    border: 1px solid #222;
    background: #f7f7f2;
    color: #000;
    text-align: left;
    font-size: 1.1rem;
    line-height: 1.4;
}

.option-front {
    z-index: 2;
}

.option-back {
    transform: rotateY(180deg);
    font-weight: 700;
    text-align: center;
    justify-content: center;
}

.option-btn {
    background-color: #fafafa;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.option-btn.is-correct {
    background-color: #D9EDD7;
    color: #000;
}

.option-btn.is-wrong {
    background-color: #EDD7D7;
    color: #000;
}

.quiz-container .option-btn {
    padding: 15px 20px;
    font-size: 1rem;
    background: #ffffff;
    color: #000;
    border: 1px solid #000;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.quiz-container .option-btn:hover {
    background: #f3f3f3;
}

.quiz-container .option-btn.selected {
    background: rgba(252, 250, 212, 1);
}

.quiz-container .option-btn.is-correct {
    background: #D9EDD7;
}

.quiz-container .option-btn.is-wrong {
    background: #EDD7D7;
}

.quiz-container .option-btn:disabled {
    cursor: default;
    opacity: 1;
}

.quiz-container .feedback {
    min-height: 20px;
    font-weight: bold;
    margin-bottom: 10px;
}

.quiz-container .feedback.is-success {
    color: #000000;
}

.quiz-container .feedback.is-error {
    color: #c62828;
}

/* ================= SOURCES / FOOTER ================= */
.credits {
    padding: 6vh 2vw;
    background: #111;
    color: white;
    text-align: center;
}

.credits h2 {
    margin-top: 4vh;
    font-size: 2rem;
}

.credits p {
    max-width: 44rem;
    margin: 1vh auto;
    line-height: 1.6;
}

.credits a {
    color: #ffcc00;
    text-decoration: none;
}

.logos {
    margin-top: 3vh;
    display: flex;
    justify-content: center;
    gap: 3vw;
    flex-wrap: wrap;
}

.logos img {
    height: 4rem;
    background: white;
    padding: 0.6rem;
    border-radius: 0.4rem;
}

.credits-names {
    margin-top: 3vh;
    font-size: 1rem;
    opacity: 0.8;
}

/* ================= ANIMATION HACKER ================= */
.hacker-container {
    position: relative;
    width: 100%;
    max-width: 31rem;
    height: 60dvh;
    margin: 0 auto;
    transition: transform 1s ease-in-out;
    transform: translateY(0);
}

.hacker-container img {
    position: absolute;
    top: 50%;
    left: 50%;
    height: auto;
    pointer-events: none;
    /* J'ai retiré le mix-blend-mode ici pour le gérer image par image */
}

.img-mere_hack {
    width: 100%;
    transform: translate(-50%, -50%);
    opacity: 1;
    z-index: 1;
    /* Reste en dessous */
    mix-blend-mode: multiply;
    /* Gardé uniquement pour la photo du fond */
}

.img-anonymous {
    width: 55%;
    z-index: 10;
    /* Un z-index très fort pour s'assurer qu'il passe au-dessus */
    transform: translate(-50%, 200%);
    opacity: 0;
    transition: transform 0.8s ease-out, opacity 0.5s ease-in;
    /*mix-blend-mode: normal;  FORCE LE MASQUE À ÊTRE TOTALEMENT OPAQUE */
}

#hacker-animation.is-hacked .img-anonymous {
    transform: translate(-45%, -100%);
    opacity: 1;
}

#hacker-animation.is-scrolling-up {
    transform: translateY(-150vh);
}

/* ================= PHOTOS DE MARION (DLA-1) ================= */
.marion-photos {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.marion-photos img {
    width: 100%;
    max-width: 25rem;
    border-radius: 0.6rem;
}

@media (min-width: 768px) {
    .marion-photos {
        flex-direction: row;
        justify-content: center;
    }

    .marion-photos img {
        width: 48%;
    }
}

.images-stack {
    position: relative;
    width: 100%;
    height: 60vh;
}

/* image du haut */
.img-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 80%;
    z-index: 3;
}

/* image du bas qui remonte */
.img-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 80%;
    transform: translateY(-10%);
    z-index: 2;
}

/* image à droite */
.img-right {
    position: absolute;
    right: 0;
    top: -25%;
    width: 80%;
    z-index: 1;
}

/* ================= ANIMATION CIBLE & FLÉCHETTE ================= */
.target-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 31rem;
    height: 60dvh;
    z-index: 2;
    pointer-events: none;
}

.target-container img {
    position: absolute;
    top: 50%;
    left: 50%;
    height: auto;
    mix-blend-mode: multiply;
}

.img-femme {
    width: 100%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    z-index: 1;
}

.img-flechette {
    width: 30%;
    z-index: 2;
    transform: translate(-50%, 200%);
    opacity: 0;
    transition: transform 0.8s ease-out, opacity 0.5s ease-in;
}

#target-animation.is-visible .img-femme {
    opacity: 1;
}

#target-animation.is-hit .img-flechette {
    transform: translate(-70%, 10%);
    opacity: 1;
}

/* ================= ANIMATION ARGENT ================= */
#animation-argent {
    position: relative;
    width: 100%;
    height: 60vh;
}

#marion-argent {
    position: absolute;
    bottom: 0;
    width: 100%;
}

#argent {
    position: absolute;
    bottom: 15vh;
    left: 5%;
    width: 100%;
    opacity: 0;
}

#animation-argent.visible #argent {
    animation: argentFly 5s ease forwards;
}

@keyframes argentFly {
    10% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    40% {
        opacity: 0.5;
    }

    60% {
        transform: translateY(-30vh);
        opacity: 0;
    }
}


/* ================= LOUPE ================= */
#box-loupe {
    position: relative;
    width: 100%;
    height: 100%;
}

#fraude-sociale {
    position: absolute;
    width: 80%;
    height: auto;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    /* centré horizontalement */
    right: auto;
    bottom: auto;
}

#fraude-fiscale {
    position: absolute;
    width: 80%;
    height: auto;
    bottom: -10%;
    left: 50%;
    transform: translateX(-50%);
    /* centré horizontalement */
    top: auto;
    right: auto;
}

#loupe {
    position: absolute;
    width: 100%;
    height: auto;
    top: 15%;
    left: 40%;
    transform: translateX(-20%);
    right: auto;
    bottom: auto;
    transition: top 1.5s ease-in-out;
}

#loupe.loupe-moved {
    top: 70%;
    /* remplace bottom: 8% par une valeur top équivalente */
}

#bandeau {
    width: 100%;
    bottom: 0;
    background-color: white;
    font-size: 20%;
    z-index: 999;
}

#bandeau li {
    list-style-type: none;
    display: inline-block;
    vertical-align: middle;
    margin: 0 0.5em;
    height: 25em;
}

#bandeau img {
    height: 25em;
}

#bandeau #hyblab {
    margin: 1em auto;
    display: block;
}

#bandeau #cc,
#bandeau #opensource {
    height: 20em;
}

#bandeau .stacked {
    display: block;
}

#bandeau ul {
    text-align: center;
    padding: 0 0;
    margin: 1.5em auto;
}

#bandeau .institutionnel {
    height: 20em;
}

/* État initial de Bulle3 (cachée et réduite) */
.img-bulle3 {
    top: 25%;
    transform: translate(-50%, 3vh) scale(0.5);
    opacity: 0;
}

/* Nouvel état de l'animation : Étape 3 */
#spheres-animation.is-step3 .img-caf {
    opacity: 0;
    /* L'image CAF disparait ou devient minuscule */
    transform: translate(-50%, -30vh) scale(0);
}

#spheres-animation.is-step3 .img-meres {
    opacity: 1;
    transform: translate(-50%, -15vh) scale(0.2);
    /* Les mères prennent la place de la CAF */
}

#spheres-animation.is-step3 .img-bulle3 {
    opacity: 1;
    transform: translate(-50%, 0) scale(1.1);
    /* Bulle 3 prend la place centrale */
}

/* ================= ANIMATION FRAUDES / INDUS ================= */
.fraude-indu-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 31rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    /* Derrière le hacker s'il est encore là, mais l'opacité gèrera le reste */
    pointer-events: none;
}

.fraude-indu-container img {
    position: absolute;
    width: 90%;
    /* Ajustez le % si l'image est trop grande/petite par rapport au texte */
    height: auto;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    mix-blend-mode: multiply;
    /* Permet de bien incruster les images dans le fond crème */
}

/* ÉTATS DÉCLENCHÉS PAR LE JS */

/* État 1 : Seul le mot FRAUDES apparait */
#fraude-indu-animation.state-fraudes .img-fraudes {
    opacity: 1;
}

/* État 2 : La Ligne apparait sur le mot FRAUDES */
#fraude-indu-animation.state-ligne .img-fraudes,
#fraude-indu-animation.state-ligne .img-ligne {
    opacity: 1;
}

/* État 3 : On efface Fraudes+Ligne, on affiche INDUS */
#fraude-indu-animation.state-indus .img-indus {
    opacity: 1;
}

.step-aides-sociales {
    position: relative;
    /* contexte de positionnement pour les enfants */
}

.step-compact {
    height: 30dvh;
}

.step-moyen {
    height: 50dvh;
}

#box-fraude {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#batiment {
    position: absolute;
    width: 70%;
    height: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#fraude-logo {
    position: absolute;
    width: 90%;
    height: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
}