/* BASE */

body {
    margin: 0;
    overflow-x: hidden;
    background-color: #0a0a0a;
}

/* UI SON */

.sound-ui {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999;
}

.sound-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: 0.2s ease;
}

.sound-btn:hover {
    transform: scale(1.1);
}

.disable {
    display: none;
}

/* TEXTES */

.texted,
.texte1,
.texte3,
.texte5 {
    position: fixed;
    top: calc(50% - 42vh);
    left: 50%;
    width: 70vw;
    max-width: 1100px;
    transform: translateX(-50%);
    opacity: 0;
    z-index: 15;
    font-family: "Comic Relief", system-ui;
    text-align: center;
}

.texte2,
.texte4,
.texte8,
.texte9 {
    position: fixed;
    top: calc(50% - 38vh);
    left: 50%;
    width: 70vw;
    max-width: 1100px;
    transform: translateX(-50%);
    opacity: 0;
    z-index: 15;
    text-align: center;
}

.texte6,
.texte7 {
    position: fixed;
    top: calc(50% - 42vh);
    left: 50%;
    width: 90vw;
    max-width: 1400px;
    transform: translateX(-50%);
    opacity: 0;
    z-index: 15;
    font-family: "Comic Relief", system-ui;
    text-align: center;
}

.texted p,
.texte1 p,
.texte2 p,
.texte3 p,
.texte4 p,
.texte5 p,
.texte6 p,
.texte7 p,
.texte8 p,
.texte9 p {
    margin: 0;
    color: rgb(0, 0, 0);
    font-size: 1.5rem;
    line-height: 1.5;
}

.texte2 p,
.texte4 p,
.texte8 p,
.texte9 p {
    font-family: "Comic Relief", system-ui;
}

.texte-flou {
    display: inline-block;
    max-width: 900px;
    padding: 12px 16px;
    border: 2px solid #111;
    border-radius: 12px;
    background: rgba(255, 250, 235, 0.94);
    box-shadow:
        4px 4px 0 rgba(0, 0, 0, 0.75),
        0 8px 20px rgba(0, 0, 0, 0.25);
    text-shadow: none;
}

/* INTRODUCTION */

.intro {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    transform: scale(1.5);
    z-index: 1;
    background-color: #238db9;
    object-fit: contain;
    object-position: center;
}

.papier {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 100vw;
    max-width: 1920px;
    height: 100vh;
    z-index: 1;
    object-fit: cover;
    object-position: center 60%;
}

/* PETIT-DÉJEUNER */

.diner {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 70vw;
    max-width: 1100px;
    height: auto;
    z-index: 2;
}

/* ARRIVÉE DU TSUNAMI */

.vague-fond {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 70vw;
    max-width: 1100px;
    height: auto;
    z-index: 3;
}

.woosh {
    position: fixed;
    top: 30%;
    left: 50%;
    width: 300px;
    height: auto;
    transform: translate(-50%, -50%) rotate(-20deg);
    transform-origin: 50% 100%;
    opacity: 0;
    z-index: 3;
    fill: white;
}

/* RENCONTRE AVEC LE PÊCHEUR */

.rencontre {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 100vw;
    max-width: 1920px;
    transform-origin: center center;
    z-index: 4;
}

.fond-rencontre {
    display: block;
    width: 100%;
    height: auto;
}

.poisson-pleure {
    position: absolute;
    bottom: 12%;
    left: 15%;
    width: 20%;
    height: auto;
    z-index: 6;
}

/* FUITE ET DÉGÂTS */

.splash {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 100vw;
    max-width: none;
    height: 100vh;
    transform-origin: center center;
    z-index: 4;
    object-fit: cover;
    object-position: center;
}

.barque {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 70vw;
    max-width: 1100px;
    height: auto;
    z-index: 5;
}

.barque-suite {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 100vw;
    max-width: 1920px;
    transform-origin: center center;
    z-index: 6;
}

/* DÉCOUVERTE DES CORPS */

.papiercopie {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 100vw;
    max-width: none;
    height: 100vh;
    z-index: 7;
    object-fit: cover;
    object-position: center;
}

.scene-corps {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 70vw;
    max-width: 1100px;
    overflow: hidden;
    z-index: 7;
}

.corps {
    display: block;
    width: 100%;
    height: auto;
}

.pecheur-tremble {
    position: absolute;
    bottom: -27%;
    left: 78%;
    width: 55%;
    transform: translateX(-50%);
    z-index: 8;
    animation: tremble 0.4s infinite;
}

/* CENTRALE DE FUKUSHIMA */

.scene-usine {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 70vw;
    max-width: 1100px;
    z-index: 8;
}

.usine {
    display: block;
    width: 100%;
    height: auto;
}

.fume {
    position: absolute;
    bottom: 66%;
    left: 15%;
    width: 10%;
    transform: translateX(-50%);
    opacity: 0;
    z-index: 9;
}

/* ANIMAUX */

.scene-animaux {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 70vw;
    max-width: 1100px;
    z-index: 9;
}

.animaux {
    display: block;
    width: 100%;
    height: auto;
}

.queue {
    position: absolute;
    bottom: 30.5%;
    left: 27%;
    width: 15%;
    transform: translateX(-50%);
    transform-origin: top right;
    z-index: 10;
    animation: remue 1s ease-in-out infinite alternate;
}

/* RETROUVAILLES */

.retrouve {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 80vw;
    max-width: 1400px;
    height: auto;
    opacity: 0;
    z-index: 10;
}

/* TROIS MOIS PLUS TARD */

.mois {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: black;
    opacity: 0;
    z-index: 11;
}

.mois-text {
    transform: scale(1.3);
    opacity: 0;
    color: white;
    font-family: "Shippori Mincho", serif;
    font-size: clamp(3rem, 8vw, 8rem);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* CONCLUSION */

.accouche {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 80vw;
    max-width: 1400px;
    height: auto;
    opacity: 0;
    z-index: 12;
}

/* DATASTORYTELLING */

.datastorytelling {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    opacity: 0;
    pointer-events: none;
    z-index: 20;
}

#person1 {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 80vw;
    max-width: 1000px;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.arriere-fond {
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.taille-grap {
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
}

.taille-grap h3 {
    margin-bottom: 15px;
    color: #e9e6e6;
    font-size: 20px;
    text-align: center;
}

canvas {
    max-width: 100%;
    height: auto !important;
}

.ocean {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 500px;
    z-index: 15;
}

.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 300px;
    background-image: url("../assets/wave.png");
    background-repeat: repeat-x;
    background-size: 1500px 300px;
}

#wave1 {
    opacity: 1;
    z-index: 5;
    animation: move_wave 3s ease-in-out infinite;
}

#wave2 {
    bottom: 10px;
    opacity: 0.5;
    z-index: 4;
    animation: move_wave 5s ease-in-out infinite;
}

#wave3 {
    bottom: 15px;
    opacity: 0.3;
    z-index: 3;
    animation: move_wave 7s ease-in-out infinite;
}

#wave4 {
    bottom: 20px;
    opacity: 0.2;
    z-index: 2;
    animation: move_wave 10s ease-in-out infinite;
}

#wave5 {
    bottom: 25px;
    opacity: 0.1;
    z-index: 1;
    animation: move_wave 13s ease-in-out infinite;
}

.bloc {
    height: 300vh;
}

/* ANIMATIONS */

@keyframes tremble {
    0% {
        transform: translateX(-50%) translate(0, 0) rotate(0deg);
    }

    20% {
        transform: translateX(-50%) translate(-2px, 1px) rotate(-0.3deg);
    }

    40% {
        transform: translateX(-50%) translate(2px, -1px) rotate(0.3deg);
    }

    60% {
        transform: translateX(-50%) translate(-1px, 2px) rotate(-0.2deg);
    }

    80% {
        transform: translateX(-50%) translate(1px, -2px) rotate(0.2deg);
    }

    100% {
        transform: translateX(-50%) translate(0, 0) rotate(0deg);
    }
}

@keyframes remue {
    from {
        transform: translateX(-50%) rotate(-5deg);
    }

    to {
        transform: translateX(-50%) rotate(5deg);
    }
}

@keyframes move_wave {
    0% {
        transform: translateY(10px);
        background-position-x: 0;
    }

    50% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(10px);
        background-position-x: 1500px;
    }
}

/* MEDIA QUERIES */

@media (min-width: 901px) {
    .texted {
        top: 8%;
        left: 6%;
        width: 42vw;
        transform: none;
        text-align: left;
    }

    .texte1 {
        top: 8%;
        right: 6%;
        left: auto;
        width: 40vw;
        transform: none;
        text-align: left;
    }

    .texte2 {
        top: 10%;
        right: auto;
        left: 5%;
        width: 42vw;
        transform: none;
        text-align: left;
    }

    .texte3 {
        top: 9%;
        left: 5%;
        width: 42vw;
        transform: none;
        text-align: left;
    }

    .texte4 {
        top: 8%;
        right: auto;
        left: 50%;
        width: 70vw;
        max-width: 1100px;
        transform: translateX(-50%);
        text-align: center;
    }

    .texte5 {
        top: 8%;
        left: 5%;
        width: 40vw;
        transform: none;
        text-align: left;
    }

    .texte6 {
        top: 7%;
        right: 4%;
        left: auto;
        width: 46vw;
        transform: none;
        text-align: left;
    }

    .texte7 {
        top: 8%;
        right: 4%;
        width: 44vw;
        transform: none;
        text-align: left;
    }

    .texte8 {
        top: 10%;
        right: 5%;
        left: auto;
        width: 40vw;
        transform: none;
        text-align: left;
    }

    .texte9 {
        top: auto;
        bottom: 6%;
        left: 50%;
        width: 70vw;
        transform: translateX(-50%);
        text-align: center;
    }
}

@media (max-width: 768px) {
    .woosh {
        top: 35%;
        width: 180px;
    }
}

@media (max-width: 600px) {
    .texted,
    .texte1,
    .texte2,
    .texte3,
    .texte4,
    .texte5,
    .texte6,
    .texte7,
    .texte8,
    .texte9 {
        top: 7%;
        right: auto;
        bottom: auto;
        left: 50%;
        width: 86vw;
        max-width: none;
        transform: translateX(-50%);
        text-align: left;
    }

    .texted p,
    .texte1 p,
    .texte2 p,
    .texte3 p,
    .texte4 p,
    .texte5 p,
    .texte6 p,
    .texte7 p,
    .texte8 p,
    .texte9 p {
        margin: 0;
        font-size: clamp(0.82rem, 3.8vw, 0.98rem);
        line-height: 1.35;
    }

    .texte-flou {
        display: block;
        box-sizing: border-box;
        width: 100%;
        max-width: none;
        padding: 12px 16px;
        border-width: 2px;
        border-radius: 10px;
        box-shadow:
            4px 4px 0 rgba(0, 0, 0, 0.75),
            0 8px 20px rgba(0, 0, 0, 0.25);
    }

    .sound-ui {
        top: 12px;
        right: 12px;
    }

    .sound-btn {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .mois-text {
        width: 90vw;
        max-width: 90vw;
        font-size: clamp(2rem, 12vw, 3rem);
        line-height: 1.15;
        letter-spacing: 0.05em;
        text-align: center;
        white-space: normal;
    }
}
