@import './reset.css';
@import './parts/keyframes.css';
@import './parts/header.css';
@import './parts/menus.css';
@import './parts/footer.css';
@import './common-front-editor.css';

body{
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: 200;
    line-height: 1.3em;
    background-color: var(--wp--preset--color--white);
    strong{
        font-weight: bold;
    }
}

/* Typography */
p{
    margin-top: 1em;
    margin-bottom: 1em;
}

.helvspaced{
    line-height: 1.3em;
    &.txt-lg{
        letter-spacing: 6px;
        /* Clamp explained : clamp(min size (px), calc(min (px) + (max-min) * ((100vw - min viewport dynamic size (px) / (max viewport dynamic size - min viewport dynamic size))), max size (px))   */
        font-size: clamp(26px, calc(26px + (44 - 26) * ((100vw - 460px) / (1260 - 460))), 44px);
    }
    &.txt-md{
        font-size: clamp(18px, calc(18px + (28 - 18) * ((100vw - 460px) / (1260 - 460))), 26px);
        letter-spacing: 4px;
    }
    &.caps{
        text-transform: uppercase;
    }
}

.azomed{
    font-family: 'Azo Sans Uber', sans-serif;
    font-weight: 100;
    font-size: 36px;
}

.button{
    font-family: 'Azo Sans Uber', sans-serif;
    font-size: clamp(18px, calc(18px + (30 - 18) * ((100vw - 460px) / (1260 - 460))), 30px);
    letter-spacing: 2px;
    padding:20px 25px;
    line-height: 1.3em;
    background-color: var(--wp--preset--color--white);
    color:var(--wp--preset--color--black);
    display: inline-block;
    border:1px solid var(--wp--preset--color--black);
    box-shadow: -5px -5px 0px rgba(0,0,0,0.15);
    margin-top: 40px;
    transition: all 0.1s ease-out;
    overflow: hidden;
    position: relative;

    &::before,
    &::after{
        content: attr(data-text); /* Récupère le texte du bouton */
        position: absolute;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: inherit;
        opacity: 0;
        z-index: 1;
        pointer-events: none;
        animation-timing-function: steps(1, end);
    }

    &::before{
        top:-3px;
        left:-3px;
        color: var(--wp--preset--color--primary);
        mix-blend-mode: color-burn;
    }

    &::after{
        bottom:-3px;
        right:-3px;
        color: var(--wp--preset--color--tertiary);
        mix-blend-mode: color-burn;
    }

    span{
        color:var(--color-black);
        position: color;
        z-index: 2;
    }

    &:hover{
        animation: glitch-translate-base 0.3s infinite alternate;
        box-shadow:
            -5px -5px 0px rgba(234,84,61,0.2), /* Magenta décalé */
            5px 5px 0px rgba(112,192,162,0.2),  /* Cyan décalé */
            -10px 10px 0px rgba(0,0,0,0.15);   /* Ombre noire principale décalée */
        &::before{
            opacity: 1;
            animation: glitch-translate-r 0.3s infinite alternate;
        }
        &::after{
            opacity: 1;
            animation: glitch-translate-g 0.3s infinite alternate;
        }
        span {
            opacity: 0.8;
            filter: blur(0.5px);
            animation: glitch-translate-base 0.3s infinite alternate;
        }
    }
}

/* Header */
.header-logo{
    opacity: 0;
    transition: opacity .3s .3s ease-out;
}

body.main-menu-open{
    .header-logo{
        opacity: 1;
    }
}

.frontpage-hero{
    height: 100svh;
    display: flex;
    justify-content: center;
    position: relative;

    .content{
        padding:0 30px;
        height: 100svh;
        display: flex;
        flex-direction: column;
        align-items: center;
        @media all and (min-width:768px){
            justify-content: center;
        }
    }

    .main-logo,
    .slogan{
        max-width: 780px;
        margin-inline: auto;
    }

    .main-logo{
        display: block;
        @media all and (max-width:767px){
            padding-top: 125px;
        }

        .ouat .letter {
            fill:transparent;
            stroke: transparent;
            stroke-width: 1px;
            stroke-dasharray: 100;
            stroke-dashoffset: 100;
            transform-origin: center bottom;
            transform: scale(.97);
            animation: drawOuat 2s ease-out forwards;
            &.l1{
                animation-delay: 1.4s;
            }
            &.l2{
                animation-delay: 1.2s;
            }
            &.l3{
                animation-delay: 1.4s;
            }
            &.l4{
                animation-delay: 1.3s;
            }
        }

        .studio .letter{
            fill: transparent;
            animation: fadeInStudio 1.2s ease-in-out forwards;
            &.l1{
                animation-delay: .6s;
            }
            &.l2{
                animation-delay: .55s;
            }
            &.l3{
                animation-delay: .7s;
            }
            &.l4{
                animation-delay: .75s;
            }
            &.l5{
                animation-delay: .8s;
            }
            &.l6{
                animation-delay: .85s;
            }
        }

        .slash {
            fill: var(--wp--preset--color--black);
            opacity: 0;
            transform : translate(-42px, 114px);
            transform-origin: bottom left;

            animation: slashIn .3s ease-out forwards;
            animation-delay: 3.2s;
        }
    }

    .slogan{
        text-align: right;
        opacity: 0;
        transform:translateY(-10px);
        transform-origin: bottom left;
        animation: fadeIn .6s ease-out forwards;
        animation-delay: 3.4s;
        @media all and (max-width : 640px){
            margin-top: 20px;
        }
    }

    h1{
        margin-top: 40px;
        font-weight: 200;
    }

    .scrolldown{
        position: absolute;
        bottom: -360px;
        right: 20px;
        width: 60px;
        height: 130px;
        bottom:0;
        svg{
            max-height: 100%;;
        }

        @media all and (min-width:768px){
        bottom: 0;
        }

        .scroll-svg path {
            stroke: var(--wp--preset--color--black);
            stroke-width: 2;
            stroke-linecap: round;
            stroke-linejoin: round;
            fill: none;
        }

        .shaft {
            stroke-dasharray: 120;
            stroke-dashoffset: 120;
            animation: drawShaft .8s ease-out forwards;
            animation-delay: 3.5s;
        }

        .arrow-left,
        .arrow-right {
            stroke-dasharray: 20;
            stroke-dashoffset: 20;
            animation: drawHead .3s ease-in-out forwards;
            animation-delay: 4s;
        }
    }

    .slashes.purple-green{
        position: absolute;
        top: 60svh;
        right: 31vw;
        width: 812px;
        height: 1125px;
        background: url("../images/purple-green-slashes.svg") no-repeat center center;
        background-size: cover;
        background-position: top right;
        z-index: -1;
        transform: translateX(-100%);
        opacity: 0;
        animation: fadeInBigSlashes .8s ease-out forwards;
        animation-delay: 3.5s;
        @media all and (min-width:640px){
            width: 152%;
            height:calc(152% * 1.385);
            left: -100%;
            top: 40svh;
        }
        @media all and (min-width:1260px){
            top:30svh;
        }
    }
}

.main-menu-toggle{
    transform: translateX(100%);
    opacity: 0;
    transform-origin: top right;
    animation: fadeInBigSlashes .8s ease-out forwards;
    animation-delay: 3.5s;
}

/* Main */
main{
    padding: 0 clamp(30px, calc(30px + (60 - 30) * ((100vw - 460px) / (1260 - 460))), 60px);
    overflow: hidden;
    
    .slashes{
        background-size: cover;
    }
}

/* Sections */
.section{
    padding-top:120px;
    position: relative;
    > p{
        max-width: 1200px;
    }
    .chapter{
        margin: 0;
        letter-spacing: 4px;
        font-size: clamp(15px, calc(15px + (36 - 15) * ((100vw - 460px) / (1260 - 460))), 36px);
    }
    >.title{
        font-family: 'Azo Sans Uber', sans-serif;
        text-transform: uppercase;
        letter-spacing: 2px;
        font-weight: 100;
        line-height: .9em;
        font-size: clamp(68px, calc(68px + (200 - 68) * ((100vw - 460px) / (1260 - 460))), 200px); 
        margin-bottom: clamp(.53em, calc(.53em + (.83 - .53) * ((100vw - 460px) / (1260 - 460))), .83em);
    }
}

.mission{
    .colored{
        position: relative;
        .slashes{
            position: absolute;
            top: -40px;
            left: -538px;
            width: 1150px;
            height: 1700px;
            background-image: url("../images/yellow-slashes.svg");
            background-position: top right;
            z-index: -1;

            @media all and (min-width:640px){
                width: 170%;
                height:calc(170% * 1.385);
                left: -125%;
                top: -90px;
            }
        }
    }

    .mission-swiper{
        padding:60px 40px 20px 0 !important;
        margin-right: clamp(-60px, calc(-30px + (-60 + 30) * ((100vw - 460px) / (1260 - 460))), -30px) !important;
        @media all and (min-width:1360px){
            margin-right: 0 !important;
            padding:60px 0 20px 0 !important;
        }

        .swiper-nav{
            svg path{
                fill: var(--wp--preset--color--white);
                @media all and (min-width:640px){
                    fill: var(--wp--preset--color--black);
                }
            }
        }
    }
}



.project{

    .project-swiper{
        padding:60px 0 40px 30px !important;
    }

    .swiper-slide{
        overflow: visible;

        &:nth-of-type(1) .number,
        &:nth-of-type(4) .number{
            color: var(--wp--preset--color--tertiary);
        }
        &:nth-of-type(2) .number,
        &:nth-of-type(5) .number{
            color: var(--wp--preset--color--secondary);
        }
        &:nth-of-type(3) .number{
            color: var(--wp--preset--color--quartary);
        }
    }

    .swiper-nav{
        svg path{
            fill: var(--wp--preset--color--black);
        }
    }

    .number{
        font-size: 320px;
        line-height: .8em;
        font-family: 'Azo Sans Uber', sans-serif;
        position: absolute;
        left: -40px;
        top: -40px;
        opacity: .4;
    }

    .title,
    .slgn{
        position: relative;
        z-index: 2;
    }

    .slashes{
        position: absolute;
        bottom: -520px;
        left: -400px;
        width: 805px;
        height: 1450px;
        background-image: url("../images/red-slashes.svg");
        background-position: top right;
        z-index: -1;

        @media all and (min-width:640px){
            width: 170%;
            height:calc(170% * 1.385);
            left: -100%;
            top: 60px;
        }

        @media all and (min-width:1360px){
            left: -120%;
        }
    }
}

.theend{
    padding-bottom: 120px;
    margin-top: 120px;
    color: var(--wp--preset--color--white);
    a{
        color:var(--wp--preset--color--white);
    }
    .button{
        color: var(--wp--preset--color--black);
        margin-bottom: 60px;
    }
    .slashes{
        position: absolute;
        top: 0;
        right: -200px;
        width: 2200px;
        height: 2250px;
        background-image: url("../images/purple-slashes.svg");
        z-index: -1;
        @media all and (min-width:1024px){
            width: 300%;
            height:calc(300% * 1.385);
            left: auto;
            right:-240px;
            top: 0;
        }
    }
}


/* Swipers */
.swiper{
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 60px;

    .swiper-nav{
        position: absolute;
        top:10px;
        right: 40px;
        display: flex;
        gap:12px;
        .swiper-button-next,
        .swiper-button-prev{
        position: initial;
        background: transparent;
        padding: 0;
        }
    }
}

/* Cards */
.card{
    &.inactive{
        transition-property: width, transform, opacity !important;
        transition-duration: .5s !important;
        transform-origin: left center;
        width: 0 !important;
        margin:0 !important;
        opacity: 0;
        img{
            width: 0;
            opacity: 0;
            transition: transform .2s, opacity .3s;
        }
        .txt-container{
            opacity: 0;
        }
    }

    .txt-container{
        position: relative;
    }

    .title{
        margin-bottom: 0;
        padding-left: 15px;
        line-height: 1.1em;
        margin-top: -110px;
        color: var(--wp--preset--color--white);
        text-shadow: -5px -5px 0px var(--wp--preset--color--black);
    }

    .slgn{
        padding-left: 15px;
        margin-top: 5px;
    }

    .txt-container{
        position: relative;
        z-index: 2;
    }

    img,
    .txt-container{
        transition:transform .3s ease-in-out;
    }

    &:hover{
        .txt-container{
            transform: translateY(-12px);
        }
        .glitch-container{
            animation: glitch-translate-base 0.3s infinite alternate;
        }
        
        img{
            transform: scale(1.2);
        }
    }
}

/* Glitch Effects */
.glitch-container{
    position: relative;
    display: inline-block;
    overflow: hidden;
    width: 100%;
}

.glitch-container.glitch-active:not(.clicked) {
    &::before,
    &::after{
        display: block;
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-size: cover;
        background-repeat: no-repeat;
        z-index: 1;
        pointer-events: none;
        animation-timing-function: steps(1, end); /* Assure une transition "coupée" et non douce */
    }

    &.brand{
        &::before,
        &::after{
            background-image: url('../images/identite-de-marque-v2.webp');
        }
    }

    &.digit{
        &::before,
        &::after{
            background-image: url('../images/conception-numerique-v2.webp');
        }
    }

    &.prod{
        &::before,
        &::after{
            background-image: url('../images/production-image-v2.webp');
        }
    }

    &.formation{
        &::before,
        &::after{
            background-image: url('../images/formation-v2.webp');
        }
    }

    /* Couche Rouge/Magenta */
    &::before {
        filter: hue-rotate(270deg) saturate(150%);
        mix-blend-mode: saturation;
        animation: glitch-translate 0.3s infinite alternate;
    }

    &::after {
        filter: hue-rotate(90deg) saturate(150%);
        mix-blend-mode:soft-light;
        animation: glitch-translate-skew 0.3s infinite alternate;
    }

    img {
        filter: blur(5px);
        animation: glitch-translate 0.3s infinite alternate;
    }
}

/* Profiles */
.profiles{
    display: flex;
    padding: clamp(10px, calc(10px + (80 - 10) * ((100vw - 460px) / (1260 - 460))), 80px);
    gap: clamp(40px, calc(40px + (80 - 40) * ((100vw - 460px) / (1260 - 460))), 80px);
    margin-top: 40px;
    margin-bottom: 40px;
    .profile{
        flex: 1;
        max-width: 280px;
        img{
        border-radius: 50%;
        background-color: var(--wp--preset--color--white);
        transition: transform .3s ease-out;
        }
        .title{
        font-family: 'Azo Sans Uber', sans-serif;
        position: absolute;
        left:-5px;
        font-size: clamp(20px, calc(20px + (32 - 20) * ((100vw - 460px) / (1260 - 460))), 32px);
        margin: 0;
        text-shadow: -3px -3px 0 var(--wp--preset--color--white);
        color: var(--wp--preset--color--primary);
        transition: transform .3s ease-out;
        }
    }
}

.profile{
    position: relative;
    a:hover{
        .title{
        transform: translateX(-10px);
        }
        img{
        transform: scale(1.05);
        }
    }
}

.profile.mel .title{
    top:5px;
    color: var(--wp--preset--color--secondary);
}

.profile.ben .title{
    bottom:15px;
}