/* ===== AMBIANCE GÉNÉRALE ===== */

body {
    margin: 0;
    min-height: 100vh;

    background: radial-gradient(
        ellipse at center,
        #30233f 0%,
        #171321 60%,
        #090711 100%
    );

    color: #f0e2c5;
    font-family: Georgia, serif;
    text-align: center;
}

/* ===== TITRE ===== */

header {
    padding: 25px 15px 15px;
}

h1 {
    color: #d4af70;
    font-size: clamp(24px, 3vw, 38px);
    margin-bottom: 12px;
}

header p {
    font-size: clamp(14px, 1.8vw, 19px);
    font-style: italic;
}

/* ===== GALERIE ===== */

.galerie-portes {
    position: relative;

    width: 95%;
    max-width: 1400px;
    aspect-ratio: 16 / 9;

    margin: 20px auto;

    background-image: url("../images/coulisses.png");
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
}

/* ===== ZONES DES PORTES ===== */

.porte {
    position: absolute;

    top: 16%;
    height: 65%;
    width: 18%;

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

    text-decoration: none;
    cursor: pointer;

    border-radius: 45% 45% 4% 4% / 12% 12% 2% 2%;

    transition: box-shadow 0.4s ease,
                background 0.4s ease;
}

/* Porte bleue */

.porte-bleue {
    left: 12%;
}

/* Porte dorée */

.porte-doree {
    left: 41%;
}

/* Porte verte */

.porte-verte {
    left: 72%;
}

/* ===== TITRES DES PORTES ===== */

.porte span {
    font-family: Georgia, serif;
    font-style: italic;
    font-weight: bold;

    font-size: clamp(12px, 1.6vw, 23px);
    white-space: nowrap;

    padding: 8px 12px;
    border-radius: 8px;

    background: rgba(15, 10, 25, 0.55);

    margin-bottom: 35%;

    transition: transform 0.4s ease,
                text-shadow 0.4s ease;
}

/* Porte bleue */

.porte-bleue span {
    color: #c6dcff;
    text-shadow: 0 0 12px #4c9dff;
}

/* Porte dorée */

.porte-doree span {
    color: #ffe2a0;
    text-shadow: 0 0 12px #ffb52b;
}

/* Porte verte */

.porte-verte span {
    color: #d4ffd0;
    text-shadow: 0 0 12px #67d979;
}

/* Petit effet magique au survol */

.porte:hover span,
.porte:focus-visible span {
    transform: scale(1.08);
}

/* ===== EFFETS AU SURVOL ===== */

.porte-bleue:hover,
.porte-bleue:focus-visible {
    box-shadow: inset 0 0 35px rgba(80, 160, 255, 0.55);
}

.porte-doree:hover,
.porte-doree:focus-visible {
    box-shadow: inset 0 0 35px rgba(255, 190, 70, 0.55);
}

.porte-verte:hover,
.porte-verte:focus-visible {
    box-shadow: inset 0 0 35px rgba(90, 255, 120, 0.45);
}



/* ===== MOBILE ===== */

@media (max-width: 700px) {

    .galerie-portes {
        width: 100%;
        margin: 20px auto;
    }

    .porte span {
        font-size: 9px;
        padding: 4px;
        margin-bottom: 5%;
    }

    header {
        padding: 20px 10px 10px;
    }
}
/* ===== ESSAI D'OUVERTURE DE LA PORTE BLEUE ===== */

/* Décor des pièces ouvertes */

.decor-ouvert {
    position: absolute;
    inset: 0;

    background: url("../images/portes.png")
                center / 100% 100% no-repeat;

    opacity: 0;
    pointer-events: none;

    transition: opacity 1.5s ease;
}

/* Porte bleue animée */

.battant-bleu {
    position: absolute;

    width: 100%;
    height: 90%;

    object-fit: fill;

    left: 3px;
    top: 6px;

    transform-origin: left center;
    backface-visibility: hidden;

    opacity: 0;

    transition:
        transform 2.2s ease-in-out,
        opacity 0.5s ease;
}

/* La porte bleue passe devant le décor */

.porte-bleue {
    z-index: 2;
    perspective: 900px;
}

/* Le titre reste au-dessus de la porte */

.porte-bleue span {
    position: relative;
    z-index: 3;
}

/* Au moment de l'ouverture */

.galerie-portes.ouverture-bleue .decor-ouvert {
    opacity: 1;

    clip-path: polygon(
        8% 12%,
        34% 12%,
        34% 85%,
        8% 85%
    );
}

.galerie-portes.ouverture-bleue .battant-bleu {
    opacity: 1;
    transform: rotateY(-75deg);
}

.galerie-portes.ouverture-bleue .porte-bleue span {
    opacity: 0;
    transition: opacity 0.4s ease;
}
/* Masquer le titre pendant l'animation de la porte bleue */

.galerie-portes.ouverture-bleue .porte-bleue span {
    opacity: 0;
}
/* Animation de la porte dorée */

.battant-dore {
    position: absolute;
    width: 85%;
    height: 92%;
    object-fit: fill;
    left: 0;
    top: 0;
    transform-origin: left center;
    backface-visibility: hidden;
    opacity: 0;
    transition: transform 2.2s ease-in-out, opacity 0.5s ease;
}

.porte-doree {
    z-index: 2;
    perspective: 900px;
}

.porte-doree span {
    position: relative;
    z-index: 3;
}

.galerie-portes.ouverture-doree .decor-ouvert {
    opacity: 1;
    clip-path: polygon(
        37% 12%,
        65% 12%,
        65% 85%,
        37% 85%
    );
}

.galerie-portes.ouverture-doree .battant-dore {
    opacity: 1;
    transform: rotateY(-75deg);
}

.galerie-portes.ouverture-doree .porte-doree span {
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* Animation de la porte verte */

.battant-vert {
    position: absolute;
    width: 90%;
    height: 90%;
    object-fit: fill;
    left: 0;
    top: 0;
    transform-origin: left center;
    backface-visibility: hidden;
    opacity: 0;
    transition: transform 2.2s ease-in-out, opacity 0.5s ease;
}

.porte-verte {
    z-index: 2;
    perspective: 900px;
}

.porte-verte span {
    position: relative;
    z-index: 3;
}

.galerie-portes.ouverture-verte .decor-ouvert {
    opacity: 1;
    clip-path: polygon(
        68% 12%,
        96% 12%,
        96% 85%,
        68% 85%
    );
}

.galerie-portes.ouverture-verte .battant-vert {
    opacity: 1;
	    transform: rotateY(-75deg);

}

.galerie-portes.ouverture-verte .porte-verte span {
    opacity: 0;
    transition: opacity 0.4s ease;
}


/* ===== RETOUR AU GLOBE ===== */

.retour-haut,
.retour-haut:visited {
    display: block;
    width: fit-content;
    margin: 15px 0 15px 30px;

    color: #eac37a;
    font-family: Georgia, serif;
    font-size: 16px;
    font-weight: normal;
    text-align: left;
    text-decoration: none;

    text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.retour-haut:hover,
.retour-haut:focus-visible {
    color: white;
    text-decoration: none;
    text-shadow: 0 0 12px #ffd36e;
}

@media (max-width: 720px) {
    .retour-haut {
        margin-left: 18px;
        font-size: 15px;
    }
}
