/**
 * Author: hans k melaa
 * Date: 02.04.2019
 * Web: melaa.net
 */
/*------- font loading -------*/
@import url('https://fonts.googleapis.com/css?family=Rubik|Poppins');


/*------- variables -------*/
:root{
    --f1: 'Rubik', sans-serif;
    --f2: 'Poppins', sans-serif;

    --c1: #3d444e;
    --c2: #df4848;
    --c3: #f3fdff;


    /* SWEDISH IKEA EDITION */
    /*! --c3: #43b4ff; */ /*! --c1: #14155c; */ /*! --c2: #ffe551; */
}

/*------- resets -------*/
html,body{
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}
h1,p{
    margin: 0;
}

article { width: 100%; }


/*------- defaults -------*/

*{
    /* it just makes more sense */
    box-sizing: border-box;
}

a{
    color: var(--c1);   
}
a:visited{
    color: var(--c2);
}
body{
    background-color: var(--c3);
    color: var(--c1);

    /* smooth scroll'y feel */
    scroll-behavior: smooth;
}

h1{
    font-family: var(--f2);
}
p,a{
    font-family: var(--f1);
}

footer p{
    text-align: center;
    margin: 15px 0;
}

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

.logo > span{
    color: var(--c1);
}
.logo > span:nth-child(2){
    color: var(--c2);
}

/*------- main layout -------*/
.page{
    height: 90vh;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 0 20px;
}
header.page{
    /* .page owerwrite */
    height: 100vh;
}

@media only screen and (max-width: 600px) {
    .page{
        height: auto;
    }
    main .page{
        margin: 20vh 0;
        font-size: .8em;
    }
}


main > .page > *{
    /* make sure all elements are treated the same */
    /* content width */
    max-width: 960px;
    /* centering */
    margin: 0 auto;

    font-size: 2em;
}

footer{
    min-height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--c2);
    color: var(--c3);
}

/* lsvg svg */
#lsvg{
    fill-opacity: 0;
    stroke: var(--c3);
    stroke-width: .4;    
    
    stroke-miterlimit: 10;
    stroke-linejoin: round;
    stroke-dasharray: 190;
    animation: linemov 20s alternate-reverse ease-in-out infinite;
}

@keyframes linemov{
    50%{
        stroke-dasharray: 30;
        stroke-dashoffset: 50;
    }
}


/*------------- blockwise -------*/
header .logo{
    font-size: calc(1em + 7vw);

    -webkit-user-select: none;       
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}


header{
    position: relative;
    z-index: 10;
    background-color: inherit;
}
header h1{
    margin: 10px 0;
}
header nav{
    position: relative;
    z-index: 9;
}
header nav a{
    display: block;
    padding: 10px;
    font-size: calc(1em + 1vw);
}
header nav a:hover{
    color: var(--c3);
}
header nav a::before{
    content: "";
    z-index: -1;
    position: absolute;
    left: -5px;
    width: 5px;
    height: 70%;
    background-color: var(--c1);

    transition: width .2s ease-in-out;
}
header nav a:hover::before{
    width: 110%;
    transition: width .2s ease-in-out;
}



#stickyNav{
    position: fixed;
    width: 100%;
}
#stickyNav > div:first-child{
    display: grid;
    padding: 5px 15px;
    gap: 10px 20px;
    grid-template: 
                "n a a a" auto
                "n b c d" auto / 1fr auto auto auto;
}

#stickyNav a:first-child{
    /* logo <a> */
    grid-area: a / a / a;
}
#stickyNav a:nth-child(2){
    /* about <a>*/
    grid-area: b;
}
#stickyNav a:nth-child(3){
    /* projects <a>*/
    grid-area: c;
}
#stickyNav a:nth-child(4){
    /* contact <a>*/
    grid-area: d;
}

#stickyNav a:nth-child(n+2):hover{
    text-decoration: underline;
}

@media only screen and (min-width: 600px) {
    #stickyNav > div:first-child{
        display: grid;
        padding: 5px 15px;
        gap: 10px 20px;
        grid-template: 
                    "a b c d n" auto / 1fr auto auto auto;
    }
    #stickyNav a:nth-child(n+2){
        display: inline-flex;
        align-items: center;
    }
}
@media only screen and (max-width: 1430px) {
    #stickyNav{
        background-color: var(--c3);
        box-shadow: 0 0 2px 0 var(--c1);
    }
}




#projects a img{
    float: left;
    height: 120px;
    margin: 10px 15px;
}
#projects a{
    text-decoration: none;
}
#projects article:hover{
    border: 2px solid var(--c1);
    transition: border .3s ease-in-out;
}

#projects article{
    border: 2px solid rgba(255, 255, 255, 0);
    transition: border .2s ease-in-out;
    
    margin: 10px;
}
@media only screen and (max-width: 700px) {
    /* this fixes the img (logo) overflow if the screen is too narrow */
    #projects a img{
        float: left;
        height: 34px;
    }
}

#contact{
    text-align: center;
}
#contact > *{
    margin-bottom: 10px;
}
#contact > a{
    color: var(--c2);
}


/*------------- animation -------*/
header nav a,
header nav a::before,
header h1{
    opacity: 0;
}



header h1{
    animation: fadein .2s ease-in .4s forwards;
}

header nav a:nth-child(1){
    animation: fadein .3s ease-in .6s forwards;
}
header nav a:nth-child(2){
    animation: fadein .3s ease-in .8s forwards;
}
header nav a:nth-child(3){
    animation: fadein .3s ease-in 1s forwards;
}

header nav a:nth-child(1)::before{
    animation: fadein .3s ease-in .7s forwards;
}
header nav a:nth-child(2)::before{
    animation: fadein .3s ease-in .9s forwards;
}
header nav a:nth-child(3)::before{
    animation: fadein .3s ease-in 1.1s forwards;
}

@keyframes fadein{
    0%{
        transform: translateY(100px);
        opacity: 0;
    }
    80%{
        filter: hue-rotate(360deg) opacity(.5);
    }
    100%{
        transform: unset;
        opacity: 1;
    }
}
