@import url('https://fonts.googleapis.com/css2?family=Cascadia+Code:ital,wght@0,200..700;1,200..700&display=swap');

:root {
    --max-height-image: 90vh;
    --min-height-image: 70vh;
    --text-pas-titre: 16px;
    --taille-navbar: 20px;
    --padding-des-texts: 20px;
    --blur-value: 8px;

    /* Choisis ta couleur de fond ici (ex: black, white, #1e1e1e, #f5f5f5, etc.) : */
    --background-color: rgb(26, 24, 48);

    /* Calcule automatiquement le noir ou blanc selon la couleur de fond : */
    --contrast-color: oklch(from var(--background-color) calc((0.5 - l) * 999999) 0 0);
}

html {
    scroll-behavior: smooth;
}

*, *::before, *::after {
    box-sizing: border-box;
    border-color: var(--contrast-color);
}

body {
    margin: 0;
    font-family: "Cascadia Code", sans-serif;
    font-optical-sizing: auto;
    font-weight: 200;
    font-style: normal;
    background-color: var(--background-color);
    color: var(--contrast-color);
}

a {
    color: inherit;
}

h1,
p,
h3{
    color: var(--contrast-color);
}

    h1 {
    font-size: 30px;
    font-weight: 800;
    padding-bottom: 0px;
    text-transform: uppercase;
    }

    p {
        font-size: var(--text-pas-titre);
        font-weight: 200;
    }

    h3 {
        font-size: 10px;
        font-weight: 200;
        color: color-mix(in srgb, var(--contrast-color) 50%, transparent);
        margin: 0;
        padding-inline: 10px;
    }

nav {
    position: fixed;
    display: grid;
    grid-template-columns: 8fr 4fr;
    width: 100%;
    height: var(--taille-navbar);
    top: 0;
    left: 0;
    border-right: solid 1px;
    z-index: 100;




    &::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(
            to top,
            var(--background-color) 20%,
            color-mix(in srgb, var(--background-color) 40%, transparent) 100%
        );
        backdrop-filter: blur(var(--blur-value));
        -webkit-backdrop-filter: blur(var(--blur-value));
        z-index: -1;
        transition: background 0.6s cubic-bezier(0,0,0,1),
                    backdrop-filter 2s cubic-bezier(0,0,0,1),
                     -webkit-backdrop-filter 2s cubic-bezier(0,0,0,1);
                        
    }

    &.burger-open::before {
        background: var(--background-color);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .moi {
        display: flex;
        align-items: center;
        border: solid 1px;
        border-right: none;
        padding: 0 var(--padding-des-texts);
        text-decoration: none;
        color: inherit;
    }

    .burger,
    .mobile-menu {
        display: none;
        border: solid 1px;
        border-right: none;
        padding: 0 var(--padding-des-texts);
        font-size: 25px;
        background: transparent;
    }

    ul {
        margin: 0;
        padding: 0;
        list-style: none;
        height: var(--taille-navbar);
        display: grid;
        grid-template-columns: 2fr 2fr;

        li {
            padding: 0 var(--padding-des-texts);
            height: 100%;
            margin: 0;
            border: solid 1px;
            border-right: none;
            display: flex;
            align-items: center;

            .clickable {
                display: block;
                transform-origin: left;
            }

            &:hover .clickable {
                transform: scale(1.2);
            }
        }

        .ligne-droite {
            justify-content: flex-end;
            .clickable {
                transform-origin: right center;
            }
        }

        a{
            text-decoration: none;
            color: inherit;
        }
    }
}

.intro {
    margin-top: var(--taille-navbar);
    height: calc(100vh - var(--taille-navbar));
    display: flex;
    justify-content: center;
    align-items: center;
    border: solid 1px;
    border-top: none;
    overflow: hidden;

    .span-container {
        position: absolute;
        right: 20px;
        bottom: 20px;
        width: 170px;

        span {
            color: white;
            font-weight: 700;
            font-size: 25px;
            animation: clignotement 0.8s steps(1, start) infinite;
        }
    }

    img {
        display: block;
        height: 100%;
        width: 100%;
        object-fit: cover;
    }
}

@keyframes clignotement {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

p {
    margin: 0;
    margin-left: 25px;
    padding-right: 10%;
}

#tousproject{
    scroll-margin-top: var(--taille-navbar);
}
.text-container {
    display: flex;
    flex-direction: column;
    height: fit-content;
    top: var(--taille-navbar);
    position: sticky;
    padding-bottom: 40px;
}

.big-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.container {
    display: flex;
    flex-direction: column;

    > a {
        text-decoration: none;
        color: inherit;
        display: block;
    }

    .image-item {
        display: grid;
        grid-template-columns: 4fr 8fr;
        border-bottom: solid 1px;
        border-top: none;
        max-height: var(--max-height-image);
        min-height: var(--min-height-image);
        ::after{
            border-bottom: solid 1px;
        }

        .mother-text-container {
            display: flex;
            flex-direction: column;
            height: 100%;
            justify-content: space-between;
            /* border: solid 1px;
            border-top: none;
            border-bottom: none;
             */

            /* h1 {
                font-size: 30px;
                font-weight: 200;
                padding-bottom: 10px;
                border-bottom: solid 1px;
            }

            p {
                font-size: var(--text-pas-titre);
                font-weight: 200;
            }

            h3 {
                font-size: var(--text-pas-titre);
                font-weight: 200;
                color: rgba(0, 0, 0, 0.5);
                margin: 0;
                padding: 10px;
            } */

            .info-text {
                display: flex;
                flex-direction: row;
                justify-content: space-between;
            }
        }

        .image-gradient {
            position: relative;
            width: 100%;
            height: fit-content;
            min-height: var(--min-height-image);
            max-height: var(--max-height-image);
            -webkit-mask-image: linear-gradient(
                to left,
                black 70%,
                transparent 100%
            );
            mask-image: linear-gradient(
                to left,
                black 70%,
                transparent 100%
            );
            overflow: hidden;
            
            &:hover {
                mask-image: linear-gradient(
                to left,
                black 80%,
                transparent 100%
            );
            }

            img {
                width: 100%;
                height: 100%;
                min-height: var(--min-height-image);
                object-fit: cover;
                display: block;
            }
        }
    }
}

/******************************PROJECT1**********************/
body.pages{
    padding-top: var(--taille-navbar);
}
.project-layout{
    display: grid;
    grid-template-columns: 8fr 4fr;
    border-inline: solid  1px;

    .project-left{
        position: relative;
        display: flex;
        flex-direction: column;

        width: 100%;
            .top-gradient{
                position: sticky;
                top: var(--taille-navbar);
                height: 50px;
                margin-bottom: -50px;
                width: 100%;
                background: linear-gradient(to bottom, var(--background-color), transparent);
                backdrop-filter: blur(8px);
                -webkit-backdrop-filter: blur(8px);
                mask-image: linear-gradient(black 15%, transparent);
                -webkit-mask-image: linear-gradient(black 15%, transparent);
                /* border: solid;
                border-color: aquamarine; */
                z-index: 10;
                /* pointer-events: none; */
            }
            .bottom-gradient{
                position: sticky;
                bottom: 0;
                height: 50px;
                margin-top: -50px;
                width: 100%;
                background: linear-gradient(to top, var(--background-color), transparent);
                backdrop-filter: blur(8px);
                -webkit-backdrop-filter: blur(8px);
                mask-image: linear-gradient(to top, black 15%, transparent);
                -webkit-mask-image: linear-gradient(to top, black 15%, transparent);
                z-index: 10;
                /* pointer-events: none; */
            }
            img{
                display: block;
                width: 100%;
                border-bottom: solid 1px;
                
            }        
    }
        aside.project-right{
            position: sticky;
            top: var(--taille-navbar);
            height: calc(100vh - var(--taille-navbar));
            border-left: solid 1px;

            display: flex;
            flex-direction: column;
            position: sticky;
            min-width: 0;
            overflow: hidden;
                .text-container{
                    position: static;
                    /* padding-bottom: 0; */
                    p{
                        margin-top: 7px;
                    }
                    .titre-infos{
                        container-type: inline-size;
                        border-bottom: solid 1px;
                        padding-bottom: 7px;
                    
                        .title-marquee {
                            width: 100%;
                            overflow: hidden;
                            display: flex;
                            white-space: nowrap;
                            position: relative;

                            h1 {
                                padding: 0;
                                margin: 0;
                                font-size: clamp(24px, 16cqi, 50px);
                                text-transform: uppercase;
                                white-space: nowrap;
                                letter-spacing: -0.05em;
                                word-spacing: -0.25em;
                                flex-shrink: 0;
                                
                            }

                            &.is-overflowing {
                                gap: 30px;
                                mask-image: linear-gradient(to right, black 85%, transparent 100%);
                                -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);

                                h1 {
                                    animation: scroll-title 10s linear infinite;
                                }
                            }
                        }
                        
                        .info-text-marquee {
                            overflow: hidden;
                            white-space: nowrap;
                            width: 100%;
                            display: flex;

                            .marquee-track {
                                display: flex;
                                width: max-content;

                                .marquee-group {
                                    display: flex;
                                    gap: 20px;
                                    padding-right: 20px;
                                }

                                h3 {
                                    display: inline-block;
                                    margin: 0;
                                    white-space: nowrap;
                                }
                            }

                            &.is-overflowing {
                                mask-image: linear-gradient(to right, black 85%, transparent 100%);
                                -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);

                                .marquee-track {
                                    animation: scroll-text 12s linear infinite;
                                }
                            }
                        }

                    }
                }

        }

}

@keyframes scroll-title {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-100% - 30px));
    }
}

@keyframes scroll-text {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-50%);
    }
}

/********************MOBILE**************************/
@media screen and (max-width:700px  ) {

:root {
    --taille-navbar: 40px;
}
    nav {
        grid-template-columns: 10fr 2fr;

        .moi, 
        .burger{

            font-size: 25px;
        }

        ul {
            display: none;
        }

        .burger {
            display: flex;
            align-items: center;
            justify-content: center;
            border: solid 1px;
            background: transparent;
            appearance: none;
            color: inherit;
            -webkit-appearance: none;
        }

        .mobile-menu-wrapper {
            position: absolute;
            top: 100%;
            left: 0;
            width: 100%;
            height: calc(100vh - var(--taille-navbar));
            overflow: hidden;
            pointer-events: none;
        }

        .mobile-menu {
            display: flex;
            flex-direction: column;
            position: relative;
            top: 0;
            width: 100%;
            align-items: center;
            padding: 0;
            height: fit-content;
            border: none;
            border-right: solid 1px;
            pointer-events: auto;

            background: linear-gradient(
                to bottom,
                var(--background-color) 10%,
                color-mix(in srgb, var(--background-color) 5%, transparent) 100%
            );

            backdrop-filter: blur(var(--blur-value));
            -webkit-backdrop-filter: blur(var(--blur-value));

            opacity: 0;
            transform: translateY(-100%);
            transition:
                transform 0.3s cubic-bezier(0, 0, 0.1, 1),
                opacity 0.3s cubic-bezier(0, 0, 0.5, 1);

            a {
                display: flex;
                margin: 0;
                padding: var(--padding-des-texts) 0;
                border-bottom: solid 1px;
                border-left: solid 1px;
                width: 100%;
                align-items: center;
                justify-content: center;
                color: inherit;
                text-decoration: none;
            }
        }

        .mobile-menu.open {
            transform: translateY(0);
            opacity: 1;
        }
    }

    .container {
        .image-item {
            display: flex;
            flex-direction: column;
            max-height: none;
            min-height: 0;
            min-width: 0;

            p {
                max-width: 100%;
            }

            .image-gradient {
                -webkit-mask-image: linear-gradient(
                    to top,
                    black 70%,
                    transparent 100%
                );
                mask-image: linear-gradient(
                    to top,
                    black 70%,
                    transparent 100%
                );
                max-height: none;
                min-height: 0;

                &:hover{
                    mask-image: linear-gradient(
                    to top,
                    black 70%,
                    transparent 100%
                );
                }

                img {
                    width: 100%;
                    height: auto;
                    min-height: 0;
                    object-fit: initial;
                }
            }

            .mother-text-container {
                display: flex;
                flex-direction: column;
                justify-content: space-between;

                .info-text {
                    display: flex;
                    flex-direction: row;
                    justify-content: flex-end;
                }
            }
        }
    }

    .text-container {
        display: flex;
        flex-direction: column;
        height: fit-content;
        top: var(--taille-navbar);
        position: static;
        padding-bottom: 30px;
    }

    .project-layout{
        display: flex;
        flex-direction: column;

        .project-left {
            order: 1;
            z-index: 1;

            .top-gradient {
                top: calc(var(--taille-navbar) + var(--project-right-h, 0px));
            }
        }

        aside.project-right {
            border: none;
            order: -1;
            position: sticky;
            top: var(--taille-navbar);
            height: fit-content;
            padding-bottom: -50px;
            /* overflow: clip; */
            z-index: 20;
            background-color: var(--background-color);

        }


        /* p caché par défaut, visible au clic sur titre-infos */
        .text-container p {
            display: none;
        }

        .titre-infos.open ~ p,
        .titre-infos.open + p {
            display: block;
        }
    }
}