
:root{
    --body-backG-color1: #eafbff;
    --body-backG-color2: #5290f9;
    --navi-backG-color: #fffdfd;
}

@import url('https://fonts.googleapis.com/css?family=Muli&display=swap');

* {
    box-sizing: border-box; /*if we add border or padding, it doesn't affect the width of it. */
}
body {
    background-color: var(--body-backG-color1);
    background-image: linear-gradient(
        to bottom, 
        var(--body-backG-color1) 0%, 
        var(--body-backG-color1) 50%, 
        var(--body-backG-color2) 50%, 
        var(--body-backG-color2) 100%
    );
    font-family: 'Muli', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    overflow: hidden; /*don't want scroll bar to appear.*/
    margin: 0px;
}

nav {
    background-color: var(--navi-backG-color);
    padding: 20px;
    width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.3);
    transition: width 0.6s linear;
}

nav.active {
    width: 350px;
}

/* list */
nav ul {
    display: flex;
    list-style-type: none;
    padding: 0px;
    margin: 0px;
    width: 0px;
    transition: width 0.6s linear;
}

nav.active ul {
    width: 100%;
}

nav ul li {
    transform: rotateY(0deg);
    opacity: 0;
    transition: transform 0.6s linear, opacity 0.6s linear;
}

nav.active ul li {
    opacity: 1;
    transform: rotateY(360deg);
}

nav ul a {
    position: relative;
    color: #000000;
    text-decoration: none;
    margin: 0px 10px;
}

/* icons */
.icon {
    background-color: var(--navi-backG-color);
    border: 0px;
    cursor: pointer;
    padding: 0px;
    position: relative;
    height: 30px;
    width: 30px;
}

.icon:focus {
    outline: 0px;
}

.icon .line {
    background-color: var(--body-backG-color2);
    height: 2px;
    width: 20px;
    position: absolute;
    top: 10px;
    left: 5px;
    transition: transform 0.6s linear;
}

.icon .line2 {
    top: auto;
    bottom: 10px;
}

nav.active .icon .line1 {
    transform: rotate(-45deg) translateY(5.5px);
}

nav.active .icon .line2 {
    transform: rotate(45deg) translateY(-5.5px);
}