* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: 'Euphorigenic', sans-serif;
    background-image: url("../img/background.webp");
    background-repeat: repeat;
    background-size: cover;
    background-position: center;
}

nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;

    width: fit-content;
    max-width: 900px;
    margin: 0 auto 0;

    padding: 4px 14px;
    background-color: rgba(255, 238, 250, 0.546);
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    backdrop-filter: blur(8px);
}

nav a {
    text-decoration: none;
}

nav a:hover {
    color: #ffd700;
}

.nav {
    width: clamp(46px, 6vw, 90px);
    height: auto;
    margin: 0;
}
.logo {
    position: relative;
    width: clamp(46px, 6vw, 90px);
    height: auto;
    margin: 0;
    
}
.scene_accueil {
    position: relative;
    width: 100%;
    min-height: 100vh;
    aspect-ratio: 16 / 9;
}

.accueil_layer_back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.accueil_layer_1 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.accueil_layer_2 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.accueil_layer_3 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    object-fit: contain;
}
.bienvenue {
    position: relative;
    width: 100%;
    min-height: 100vh;
    aspect-ratio: auto;
}
.bienvenue_back {
    position: absolute;
    left: 0;
    width: 100%;
    object-fit: contain;
}
.bienvenue_layer_1 {
    position: absolute;
    left: 0;
    width: 100%;
    height: 100vh;
    object-fit: contain;
}

.portfolio-section {
    position: relative;
    width: 100%;
    padding: 0px 0px;
}

.portfolio-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2rem;
}

.portfolio-layout {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.portfolio-row {
    display: grid;
    gap: 24px;
}

.row-top {
    grid-template-columns: repeat(3, 1fr);
}

.row-middle {
    grid-template-columns: 1fr 1.4fr 1fr;
    align-items: start;
}

.row-bottom {
    grid-template-columns: 1fr;
}
.row-center {
    grid-template-columns: repeat(2, 1fr);
}

.portfolio-card {
    overflow: hidden;
    border-radius: 20px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.04);
}

.portfolio-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.portfolio-card:hover .portfolio-image {
    transform: scale(1.03);
}

/* Hauteurs visuelles pour donner du rythme */
.card-small {
    min-height: 280px;
}

.card-vertical {
    min-height: 420px;
}

.card-large {
    min-height: 420px;
}

.card-wide {
    min-height: 500px;
}

.portfolio-composition {
    position: relative;
    width: 100%;
    height: 100vh;
    margin: 0;
    aspect-ratio: 16 / 9;
    background-image: url("/asset/img/background_adv_sucr.webp");
    background-size:contain;
    background-position: center;
    background-repeat: no-repeat;
}

.composition-text {
    position: relative;
    width: 100%;
    height: auto;
    margin: 0 auto;
    height: auto;
}
.text-adv-sucr {
    position: absolute;
    top: 30%;
    right: 5%;
    width: 15%;
    z-index: 4;
}
.text-titre {
    position: absolute;
    width: 100%;
    height: auto;
    z-index: 1;
}
.text-titre_enfance {
    position: absolute;
    width: 100%;
    height: auto;
    z-index: 0;
}
.composition-card {
    position: absolute;
    z-index: 3;
    cursor: pointer;
}

.composition-card img {
    display: block;
    width: 100%;
    height: auto;
}

/* gauche plus grande */
.composition-card-left {
    top: 7%;
    right: 25%;
    width: 25%;
    border: 1vb solid #ffeefaFF;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* droite plus petite */
.composition-card-right {
    top: 5%;
    right: 7%;
    width: 22%;
    border: 1vb solid #ffeefaFF;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}
@media (max-width: 956px) {
    .composition-card-left,
    .composition-card-right,
    .right-page,
    .left-page {
        border: 5px solid #ffeefaFF
    }
}

.tilt-left {
    transform: rotate(-11deg);
    transform-origin: center center;
}

.tilt-right {
    transform: rotate(8deg);
    transform-origin: center center;
}

/* bloc du bas = double page */
.composition-book {
    position: absolute;
    bottom: 0;
    z-index: 3;
    left: 10%;
    display: flex;
    align-items: stretch;
    gap: 0;
    overflow: hidden;
}

.composition-book-page {
    width: 35%;
    cursor: pointer;
    overflow: hidden;
}

.composition-book-page img {
    display: block;
    width: 100%;
    height: auto;
}

/* pour donner un effet "livre ouvert" un peu plus propre */
.left-page {
    transform-origin: right center;
    border: 1vb solid #ffeefaFF;
    border-right: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.right-page {
    transform-origin: left center;
    border: 1vb solid #ffeefaFF;
    border-left: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* décor */
.composition-decor {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 35%;
    z-index: 3;
    pointer-events: none;
}

.composition-decor img {
    width: 100%;
    height: auto;
}
.papillion {
    position: absolute;
    left: 15%;
    bottom: 54%;
    width: 3%;
    height: auto;
    z-index: 4;
    pointer-events: none;
}

@media (max-width: 950px) {
    .scene_accueil {
        min-height: 30vh;
    }
    .bienvenue {
        min-height: 30vh;
    }
    .bienvenue_layer_1 {
        height: auto;
    }
    .row-top,
    .row-middle {
        grid-template-columns: 1fr 1fr;
    }

    .card-large {
        grid-column: span 2;
    }
    .portfolio-composition {
        height: auto;
        min-height: 28vh;
        aspect-ratio: auto;
    }
}

@media (max-width: 640px) {
    
    .row-top,
    .row-middle,
    .row-bottom {
        grid-template-columns: 1fr;
    }

    .card-large {
        grid-column: span 1;
    }

    .card-small,
    .card-vertical,
    .card-large,
    .card-wide {
        min-height: auto;
    }

    .portfolio-image {
        height: auto;
    }
    .image-modal {
        padding: 12px;
    }

    .image-modal-content {
        padding: 18px 14px;
        border-radius: 18px;
    }

    #modalImage {
        max-height: 50vh;
        margin-bottom: 16px;
    }

    #modalTitle {
        font-size: 1.4rem;
    }

    #modalDescription {
        font-size: 0.95rem;
    }

    .image-modal-close {
        top: 10px;
        right: 12px;
        font-size: 1.8rem;
    }
    .image-modal-content {
        grid-template-columns: 1fr;
    }

    #modalImage {
        grid-column: 1;
        grid-row: auto;
    }

    #modalTitle,
    #modalDescription {
        grid-column: 1;
        text-align: center;
    }
}
.image-modal {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(6px);
}

.image-modal.active {
    display: flex;
}

.image-modal-content {
    position: relative;
    width: min(100%, 1000px);
    max-height: 90vh;
    overflow-y: auto;
    padding: 24px;
    border-radius: 24px;
    background: #ffffff2d;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);

    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
    align-items: start;
}

#modalImage {
    display: block;
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    margin: 0;
    border-radius: 16px;

    grid-column: 1;
    grid-row: 1 / span 2;
}

#modalTitle {
    margin-bottom: 12px;
    font-size: 1.8rem;
    color: #ffeefaFF;
    text-align: center;
    grid-column: 2;
}

#modalDescription {
    font-size: 1rem;
    color: #ffeefaFF;
    line-height: 1.6;
    text-align: center;
    grid-column: 2;
}

.image-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    border: none;
    background: transparent;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: #ffeefaFF;
}

.image-modal-close:hover {
    transform: scale(1.08);
}

.image-modal-close:focus-visible {
    outline: 2px solid #111;
    outline-offset: 4px;
}

footer {
    background-color: #ffeefaFF;
    color: black;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
}