:root {
    --background-color: #dad7cd;
    --primary-color: #52796f;
    --secondary-color: #a3b18a;
    --tertiary-color: #5e8766;
    --font-color: #222f29;

    --font-size-small: 1rem;
    --font-size-medium: 1.5rem;
    --font-size-large: 2rem;
}

.navigator {
    background-color: var(--tertiary-color);
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 999;
}

.nav-list {
    background-color: var(--tertiary-color);
    border-right: 1px solid #000;
    height: 100%;
    left: -80%;
    padding: 1.5rem;
    position: fixed;
    top: 0;
    transition: left 0.3s ease-in-out;
    width: 80%;

    & ul {
        border-top: 1px solid #000;
        padding-top: 1.5rem;

        & li {
            margin: 1rem 1rem;

            & a {
                color: var(--font-color);
                font-size: var(--font-size-medium);
                font-weight: 600;
            }

            & a:hover {
                color: var(--primary-color);
                transition: color 0.2s ease;
            }
        }
    }
}

#close-menu {
    position: absolute;
    right: 1.25rem;
    top: 1.25rem;
}

#logo-menu {
    display: block;
    margin: 1rem auto;
}

.active {
    display: block;
    left: 0;
}

.container {
    margin: 0 1.25rem;
}

.button {
    background-color: var(--secondary-color);
    border-radius: 1rem;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.5);
    color: var(--font-color);
    cursor: pointer;
    display: inline-block;
    padding: 0.5rem 1rem;

    &:hover {
        transform: scale(0.9);
        transition: transform 0.2s ease;
    }
}

.heading {
    font-size: var(--font-size-large);
    text-align: center;
    margin-top: 8rem;
    margin-bottom: 1rem;
}

.intro {
    padding-top: 8rem;

    & h1 {
        font-size: var(--font-size-large);
    }

    & h3 {
        font-size: var(--font-size-medium);
        font-weight: 400;
    }

    & #linux {
        margin: 1rem 0;
        height: 3.25rem;

        & #hostUsername {
            color: var(--primary-color);
            font-weight: 500;
        }

        & #typing {
            height: 100%;
            color: var(--font-color);
            position: absolute;
            right: 0;
            top: 0;
            animation: blink 1s infinite steps(2, start);
        }
    }
}

@keyframes blink {
    to {
        visibility: hidden;
    }
}

#about-me {
    display: block;
    margin-top: 10rem;

    & .heading {
        margin-top: 2rem;
    }

    & img {
        box-shadow: 0 0.25rem 0.375rem rgba(0, 0, 0, 0.5);
        height: auto;
        width: 100%;
    }

    p {
        margin: 1rem 0;
    }
}

mark {
    background-color: var(--secondary-color);
    color: var(--font-color);
}

#work-experience {
    display: block;

    & ul {
        font-size: var(--font-size-small);

        & li {
            background-color: var(--secondary-color);
            box-shadow: 0 0.25rem 0.375rem rgba(0, 0, 0, 0.1);
            border-radius: 1rem;
            margin: 1rem 0 1rem 0;
            padding: 1rem;

            & h4 {
                margin-bottom: 1rem;
            }
        }

        & li:hover {
            transform: scale(1.05);
            transition: transform 0.2s ease;
        }
    }
}

.project {
    border: 1px solid #000;
    margin: 1rem 0;
    position: relative;

    & a {
        & img {
            border-bottom: 1px solid #000;
            object-fit: cover;
            width: 100%;
            height: 75%;
            position: relative;
        }
    }

    & p {
        padding: 0.5rem 1rem;
        margin: 0;
    }

    & .project-details {
        border-top: 1px solid #000;
        padding: 1rem;

        & h4 {
            margin-bottom: 0.5rem;
        }

        & .button {
            margin-right: 1rem;
        }
    }
}

.project:hover {
    box-shadow: 0 0.25rem 0.375rem rgba(0, 0, 0, 0.5);
    transition: box-shadow 0.2s ease;

    & img {
        filter: grayscale(1);
        transition: filter 0.2s ease;
    }

    &::before {
        background-image: url(../assets/icons/link_icon.svg);
        background-size: cover;
        content: "";
        cursor: pointer;
        height: 3rem;
        left: 50%;
        opacity: 1;
        position: absolute;
        top: 35%;
        transform: translate(-50%, -50%);
        width: 3rem;
        z-index: 1;
    }
}

#skills {
    display: flex;
    flex-direction: column;
    margin: auto;
}

.skill {
    background-color: var(--secondary-color);
    padding: 1rem;
    margin: 1rem 0;
    width: 100%;

    & .icons {
        display: flex;
        flex-wrap: wrap;

        & .icon {
            display: flex;
            flex-direction: column;

            & img {
                width: 3rem;
                height: 3rem;
                margin: 1rem 2rem 0.5rem 2rem;
            }

            & span {
                text-align: center;
                font-weight: 500;
            }
        }
    }
}

#contact {
    margin-bottom: 5rem;

    & article {
        border: 1px solid #000;
        border-radius: 1rem;
        padding: 1rem;

        & p {
            margin: 1rem 0;
        }

        & nav {
            border-top: 1px solid #000;
            display: flex;
            margin-top: 1.25rem;
            padding-top: 1rem;
            justify-content: space-around;
        }
    }
}

#work-experience,
#projects,
#skills,
#contact {
    padding-top: 1rem;
}

#about-me {
    padding-top: 4rem;
}

@keyframes appear {
    from {
        opacity: 0;
        translate: -100vw 0;
    }

    to {
        opacity: 1;
        translate: 0 0;
    }
}

#about-me,
#contact,
#projects,
#skills,
#work-experience {
    animation: appear 5ms ease-in-out;
    animation-timeline: view();
    animation-range: cover 0% cover 35%;
}

/* Tablet */
@media screen and (min-width: 768px) {
    .nav-list {
        width: 40%;
    }

    .intro {
        & #linux {
            height: 2rem;
        }
    }

    #about-me {
        display: flex;
        flex-direction: column;
        align-items: center;

        & img {
            width: 60%;
            margin-bottom: 1rem;
        }
    }

    #work-experience {
        & ul {
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        & li {
            display: flex;
            flex-direction: column;
        }
    }

    .container {
        margin: 0 auto;
        padding: 0 10rem;
    }
}

/* Desktop */
@media screen and (min-width: 1024px) {
    .container {
        margin: 0 auto;
        padding: 0 15rem;
    }

    .navigator {
        align-items: center;
        background-color: var(--background-color);
        display: flex;
        justify-content: space-between;
        margin-top: 2rem;
        padding: 0.5rem 15rem;
    }

    .nav-list {
        display: flex;
        background-color: var(--background-color);
        border-right: none;
        left: 0;
        margin-top: 2rem;
        padding: 0;
        position: relative;
        justify-content: space-between;
        width: 100%;

        & #logo-menu {
            margin-right: 2rem;
        }

        & ul {
            align-items: center;
            border-top: none;
            display: flex;
            padding: 0;

            & li {
                margin: 0 2rem;

                & a {
                    font-size: var(--font-size-small);
                }
            }
        }
    }

    .intro {
        padding-top: 20rem;

        & #linux {
            height: auto;
        }
    }

    #about-me {
        display: flex;
        flex-direction: row;
        justify-content: space-evenly;
        margin-top: 18rem;

        & img {
            width: 20rem;
        }

        & .content {
            align-items: center;
            display: flex;
            flex-direction: column;

            & .heading {
                padding: 0;
            }
        }

        & .description {
            align-items: center;
            display: flex;
            flex-direction: column;
            margin-left: 2rem;
            max-width: 40rem;
            min-width: 20rem;
        }
    }

    #work-experience {
        display: flex;
        flex-direction: column;
        align-items: center;

        & ul {
            display: flex;
            flex-direction: column;
            max-width: 60rem;
        }
    }

    #projects {
        & .heading {
            margin-bottom: 2rem;
        }

        & article {
            align-items: start;
            display: grid;
            gap: 1rem;
            grid-template-columns: repeat(auto-fit, minmax(25rem, 1fr));

            & img {
                height: 20rem;
                object-fit: cover;
                width: 100%;
            }
        }
    }

    .project {
        margin: 0;
    }

    #contact {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    #logo,
    #close-menu,
    #menu {
        display: none;
    }
}