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

:root{
    --clr-prebg:#fff;
    --clr-bg:#f0f0f0;
    --clr:#242424;
    --clr2:#181818;
    --clr-accent:#ce2430;
    --ff:'Figtree', sans-serif;
}
/* @media (prefers-color-scheme: dark) {
    :root{
        --clr-prebg:#181818;
        --clr-bg:#242424;
        --clr:#f0f0f0;
        --clr2:#fff;
    }
} */

img, svg, video{
    display: block;
    max-width: 100%;
}

body{
    background-color: var(--clr-prebg);
    color:var(--clr);
    font-size: 1.125rem;
    font-family: var(--ff);
    font-weight: 300;
    padding: 1rem;
    animation: fadeInBg 1s .5s forwards;
}
@keyframes fadeInBg {
    to{background-color:  var(--clr-bg);}
}

body::before{
    content: "";
    position: fixed;
    inset: 0;
    border:1rem solid var(--clr-prebg);
    pointer-events: none;
    background: linear-gradient(345deg, rgba(0,0,0,.075) 0%, rgba(0,0,0,0) 40%);
    z-index: 999;
}

header{
    position: relative;
    display: grid;
    place-items:center;
    padding: 0;
    z-index: 999;
    animation: paddingHeader .75s 4.8s forwards;
}
@keyframes paddingHeader {
    to{
        padding: 3.5rem 0;
    }
}

nav{
    display: flex;
    justify-content: flex-end;
    position: absolute;
    top: 0;
    width: 100%;
    gap:1rem;
    padding: 1rem;
    font-size: .9rem;
    opacity: 0;
    translate: 0 -50%;
    pointer-events: none;
    animation: fadeIn .75s 4.9s forwards;
}

nav a{
    color: var(--clr-accent);
    text-decoration: none;
}
.closeLink{display: none;}
body:has( section:target) .closeLink{display: block;}
body:has( section#services:target) a[href="#services"], body:has( section#outils:target) a[href="#outils"]{display: none;}

nav a:hover{
    text-decoration: underline;
    text-underline-offset: .25rem;
    text-decoration-thickness: .1rem;
    text-decoration-color: var(--clr);
    
}

.logo{
    --unit:1rem;
    --w:calc(15 * var(--unit));
    --h:calc(8 * var(--unit));
    background-color: var(--clr-accent);
    display: grid;
    place-items: center;
    transform-origin: center;
    width: var(--w);
    height: 0rem;
    scale:1.25 1;
    overflow: hidden;
    position: relative;
    animation: logoBox 2.5s .8s forwards, endLogo .75s 4.8s forwards;
}
@keyframes logoBox {
    40%{
        scale:.75 1;
        height: 50dvh;
        translate: 0 0;
        border-radius: 0;
        pointer-events: none;
    }
    70%{
        translate: 0 50dvh;
        scale:1.25 1;
        border-radius: .15rem;
        height: var(--h);
        translate: 0 calc(50dvh - var(--h));
    }
    90%{
        border-radius: 0rem;
        translate: 0 calc(50dvh - var(--h));
        scale:1;
        height: var(--h);
        box-shadow: inset 0 0 0px rgba(0,0,0,0);
    }
    95%{
        transform: skewX(0);
        translate: 0 calc(50dvh - var(--h));
        pointer-events: none;
    }
    100%{
        translate: 0 calc(50dvh - var(--h));
        scale:1;
        height: var(--h);
        transform: skewX(-15deg);
        box-shadow: inset 0 0 1.25rem rgba(0,0,0,.15);
        pointer-events: all;
    }
}
@keyframes endLogo {
    to{
        width: calc(var(--w) * .75);
        height: calc(var(--h) * .75);
        translate: 0 0;
    }
}
body:has( section:target) .logo:hover{
    filter: drop-shadow(0 0 .5rem var(--clr2));
    transition: filter .4s;
}

.logo video{
    position: absolute;
    width: 100%;
    height: 100%;
    mix-blend-mode: lighten;
    object-fit: cover;
    transform: scale(1.25) skewX(15deg);
    opacity: 0;
    animation: logoVideo 2.5s .8s forwards;
}
@keyframes logoVideo {
    0%,95%{
        opacity: 0;
    }
    100%{
        opacity: 0.3;
    }
}

.logo .logotxt{
    width: 65%;
    position: relative;
    z-index: 2;
    transform: skewX(15deg) translateX(-5%);
}

.logo svg{
    width: 100%;
    position: relative;
    fill: var(--clr-bg);
    z-index: 3;
    scale:1.25;
    animation: svgLogoScale 1s 3.6s forwards;
    transition: all .5s;
}
@keyframes svgLogoScale {
    0%,50%{
        scale:1.25;
    }
    100%{
        scale:1;
    }
}

.logo:hover svg{
    fill: var(--clr-prebg);
    transform: scale(.95);
    filter: drop-shadow(0 0 0.75rem var(--clr-accent)) drop-shadow(0 0 0.25rem var(--clr-accent));
}

.logo svg g{
    opacity: 0;
    transform-origin: center;
    scale:.9;
    animation: svgGScale 1s 3.6s forwards;
}
.logo svg g.i{
    animation: svgGScale 1s 3.65s forwards;
}
.logo svg g.m{
    animation: svgGScale 1s 3.7s forwards;
}
@keyframes svgGScale {
    0%{
        opacity: 0;
        scale:.9;
    }
    15%{
        scale:1;
        opacity: 1;
    }
    50%{
        opacity: 1;
        scale:.75;
    }
    100%{
        opacity: 1;
        scale:1;
    }
}

.signature{
    position: fixed;
    bottom: 2rem;
    right: 2.5rem;
    width: 5rem;
    transform-origin: center;
    rotate: 3deg;
    z-index: 99999;
}

.signature path{
    fill:none;
    stroke:var(--clr-prebg);
    stroke-width:36;
    stroke-linecap:round;
    stroke-linejoin:round;
    stroke-miterlimit:10;
    stroke-dasharray: 5500;
    stroke-dashoffset: 5500;
    animation: signature 2.5s 5.5s forwards;
}
@keyframes signature{
    to {
      stroke-dashoffset: 0;
    }
  }

main{
    text-align: center;
    padding: 2rem .5rem;
    position: absolute;
    top: 0;
    opacity: 1;
    translate: 0 0;
    animation:showMain 0s 5.5s forwards;
    transition: all .6s 0s, opacity .8s;
}
@keyframes showMain {
    to{
        position: relative;
    }
}

body:has( section:target) main{
    opacity: 0;
    translate: 0 -5rem;
    pointer-events: none;
}

main > *{
    margin: 0 auto 1rem;
    opacity: 0;
    translate: 0 2rem;
    animation: fadeIn 1s forwards;
}
@keyframes fadeIn {
    to{
        opacity: 1;
        translate:0;
        pointer-events: all;
    }
}
@keyframes fadeInP {
    to{
        opacity: 0.75;
        translate:0;
    }
}

main p{
    max-width: 60ch;
    opacity: 0;
    margin-bottom: 1rem;
    animation: fadeInP 1s forwards;
}

main > *:nth-child(2){animation-delay: 8.6s;}
main > *:nth-child(3){animation-delay: 9.3s;}
main > *:nth-child(4){animation-delay: 9.6s;}
main > *:nth-child(5){animation-delay: 9.9s;}
main > *:nth-child(6){animation-delay: 10.2s;}
main > *:nth-child(7){animation-delay: 10.5s;}
main > *:nth-child(8){animation-delay: 10.8s;}
main > *:nth-child(9){animation-delay: 11.1s;}

main p.intro{
    --maxw:0;
    max-width: var(--maxw);
    opacity: 0;
    font-weight: 600;
    translate: 0 3rem;
    overflow: hidden;
    white-space: nowrap;
    font-size: 1.25rem;
    scale:1.5;
    animation: introFade 3.4s 5.7s forwards;
}
@keyframes introFade {
    30%,35%{
        opacity: 0.9;
        translate: 0;
    }
    45%,50%{scale:1;max-width: var(--maxw);}
    100%{
        scale:1;
        opacity: 0.9;
        translate: 0;
        max-width: 25rem;
    }
}

main p.intro span{
    display: inline-block;
}

main h1{
    max-width: 30ch;
    font-size: 2rem;
    margin-bottom: 4rem;
    font-weight: 600;
    color: var(--clr-accent);
}

main h2{
    font-weight: 600;
    font-size: 1.5rem;
    color: var(--clr-accent);
    margin-bottom: 1.5rem;
    margin-top: 2rem;
}

a.mailto{
    display: inline-block;
    color: var(--clr-accent);
    text-decoration: none;
    font-size: 1.25rem;
}

a.mailto:hover, a.mailto:focus{
    text-decoration: underline;
    text-decoration-thickness: .15rem;
    text-underline-offset: .4rem;
    text-decoration-color: var(--clr);
}

section{
    --startSize:6rem;
    background-color: var(--clr);
    color: var(--clr-bg);
    position: fixed;
    left: 50%;
    top: 4.5rem;
    translate: -50% 0;
    transform: skewX(-15deg);
    transform-origin: center;
    opacity: 0;
    pointer-events: none;
    width: var(--startSize);
    height: var(--startSize);
    z-index: 99;
    
}
body:has( section:target) section:not(:target){
    opacity: 0;
    width: 100%;
    height: 100%;
    transform: skewX(0deg);
    top: 0;
    transition: all 0s 1s, opacity 1s 0s;
}

section:target{
    opacity: 1;
    pointer-events: all;
    animation: openAnimation 2s .25s forwards;
}
@keyframes openAnimation {
    0%{
        width: var(--startSize);
        height: var(--startSize);
    }
    40%{
        width: 100%;
        transform: skewX(-15deg);
    }
    50%, 60%{
        transform: skewX(0);
        height: var(--startSize);
        top: 4.5rem;
    }
    100%{
        top: 0rem;
        height: 100%;
        transform: skewX(0);
        width: 100%;
    }
}

@media screen and (max-width:42rem) {
    body{font-size: 1rem;}
    main{padding-top: 0;}
    main h1, main h2{
        margin-bottom: 1.5rem;
        font-size: 1.25rem;
    }
    nav{
        gap:1.25rem;
        font-size: .85rem;
    }
}
@media screen and (max-width:24rem) {
    @keyframes paddingHeader {
        to{
            padding: 2.5rem 0;
        }
    }
    nav{
        padding: 0.75rem;
    }
}
@media screen and (max-height:44rem) {
    .signature{
        bottom: 1.25rem;
        right: 1.5rem;
        width: 3rem;
    }
}