@font-face {
    font-family: Jura;
    src: url(../fonts/Jura-VariableFont_wght.ttf);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
}

footer {
    border-top: 1px solid var(--bg-color-light);
    display: flex;
    gap: 2rem;
    justify-content: center;
    padding-block: 2rem;

    img {
        width: 2rem;
    }
}

header {
    padding: 1rem;
    position: relative;
    z-index: 1;

    @media screen and (max-width: 960px) {
        padding-block: 0;
    }
}

h1,
h2,
nav {
    font-family: Jura, sans-serif;
}

h1 {
    --bottom: 8px;
    @media screen and (max-width: 960px) {
        margin-block-start: 1rem;
    }
}

h2 {
    --bottom: 5px;
}

h1,
h2 {
    font-weight: 300;
    padding-block-end: 0;
    padding-inline-end: 2rem;
    position: relative;
    width: fit-content;

    &::after {
        background-color: var(--bg-color-dark);
        bottom: var(--bottom);
        content: '';
        height: 0.25rem;
        left: 0;
        position: absolute;
        right: 0;
        width: 100%;
        z-index: -1;
    }
}

hr {
    border: 0;
    border-top: 1px solid var(--bg-color-light);
    display: inline-block;
    margin: 0;
    width: 65%;
}

nav {
    display: flex;
    font-size: 1.25rem;
    gap: 1rem;
    padding: 1rem;

    @media screen and (max-width: 960px) {
        justify-content: space-between;
        font-size: 1.25rem;
        gap: 0;
        padding-inline: 0;
    }

    .current {
        color: hsl(0 0% 10%);
        pointer-events: none;
        text-decoration: none;
    }

    a,
    a:visited {
        color: hsl(0 0% 10%);
    }

    a {
        padding-inline: 1rem;
        padding-block: 0.25rem;
        transition: all 0.4s;

        &:hover {
            background-color: var(--bg-color-light);
        }
    }
}

main {
    font-family: Helvetica, Arial, sans-serif;
    font-weight: 300;
    line-height: 1.5;
    margin-inline: auto;
    margin-block-end: 8rem;
    margin-block-start: 4rem;
    max-width: 50rem;
    position: relative;

    @media screen and (max-width: 960px) {
        margin-block-start: 0;
        max-width: 90dvi;
    }
}

strong {
    --start: 14%;
    --stop: 96%;
    background-image: linear-gradient(
        hsl(0 0% 100%) var(--start),
        var(--bg-color-light) var(--start) var(--stop),
        hsl(0 0% 100%) var(--stop) 100%
    );
    font-weight: 300;
}

.gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;

    a {
        display: inline;
    }

    .thumbnail {
        aspect-ratio: 1 / 1;
        border: 1px solid var(--bg-color-light);
        border-radius: 3px;
        display: list-item;
        object-fit: cover;
        width: max(min(43dvi, 200px), 135px);
    }
}

.gallery-viewer {
    align-items: center;
    background-color: color-mix(in hsl, var(--text-bg-color), transparent 50%);
    display: flex;
    height: 100dvb;
    justify-content: center;
    left: 0;
    position: fixed;
    top: 0;
    width: 100dvi;
    z-index: 5;

    &.hidden {
        display: none;
    }

    img {
        box-shadow: 0 0 5px 2px var(--bg-color-dark);
        max-height: 90%;
        max-width: 90%;
    }
}

ul {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    list-style-type: none;
    margin: 0;
    padding: 0;

    li {
        background-color: var(--bg-color-light);
        border: 1px solid var(--bg-color-dark);
        border-radius: 3px;
        padding-block: 0.5rem;
        padding-inline: 1rem;
        transition: background-color 0.4s;
        width: calc(50% - 0.5rem);

        @media screen and (max-width: 960px) {
            width: 90dvi;
        }
    }
}

.about,
.project,
.projects {
    p:first-of-type {
        font-size: 1.25rem;
        max-width: 40rem;
    }
}

.contact {
    * {
        font-family: Helvetica, Arial, sans-serif;
        font-weight: 300;
        width: 30rem;

        @media screen and (max-width: 960px) {
            max-width: 90dvi;
        }
    }

    form {
        display: flex;
        flex-direction: column;
        gap: 1rem;

        label {
            display: flex;
            flex-direction: column;
            font-size: 0.8rem;
        }

        button {
            align-self: flex-end;
            background-color: var(--bg-color-light);
            border: 1px solid var(--bg-color-dark);
            border-radius: 0.25rem;
            font-size: 1rem;
            padding-inline: 1rem;
            padding-block: .5rem;

            @media screen and (min-width: 960px) {
                width: 40%;
            }
        }

        input,
        textarea {
            appearance: none;
            border: 1px solid var(--bg-color-dark);
            border-radius: 3px;
            font-family: Helvetica, Arial, sans-serif;
            font-weight: 300;
            font-size: 1rem;
            padding: 0.25rem;
        }

        textarea {
            height: 10rem;
        }
    }

    #response {
        margin-block-end: 2rem;
    }
}

.projects {
    a {
        color: var(--text-color);
        height: 100%;;
        position: absolute;
        text-decoration: none;
        transition: background-color 0.4s;
        width: 100%;

        &:hover {
            span {
                background-color: color-mix(in hsl, var(--bg-color-dark), transparent 5%);
                height: 100%;
            }
        }

        span {
            align-items: center;
            backdrop-filter: blur(2px);
            background-color: color-mix(in hsl, var(--bg-color-light), transparent 15%);
            display: flex;
            height: 3rem;
            padding: 1rem;
            transition: all 0.4s;
            width: 100%;
        }
    }

    li {
        aspect-ratio: 16 / 9;
        background-image: var(--thumbnail);
        background-position: 50% 50%;
        background-size: cover;
        padding: 0;
        position: relative;
    }
}

#p5canvas {
    left: 0;
    position: absolute;
    top: 0;
    z-index: -1;
}

.canvas-overlay {
    backdrop-filter: blur(0.5px);
    height: 150px;
    left: 0;
    position: absolute;
    top: 0;
    width: 100dvi;
    z-index: 0;

    @media screen and (max-width: 960px) {
        height: 80px;
    }
}

#p5canvas,
.canvas-overlay {
    position: absolute;
    top: 40px;

    @media screen and (max-width: 960px) {
        top: 40px;
    }
}