:root {
    font-size: 16px;
    font-family: grotesk, arial;
    background-color: #000;
    color: #bbb;
    line-height: 1.8;
    color-scheme: dark;
    --theme-1: #111;
    --theme-2: #222;
    --theme-3: #333;
    --theme-4: #444;
    --hue-1: 50;
    --hue-2: 210
}

html {
    scroll-behavior: smooth;

    &.static {
        overflow: hidden;
        height: 100%;

        body {
            height: 100%
        }

        nav {
            background-color: #000;
            height: 3rem
        }
    }
}

body {
    margin: 0 auto;
    max-width: 150rem;
    background-color: var(--theme-1)
}

h1, h2, h3 {
    font-weight: bold;
    font-family: redhat;
    color: #fff;
    line-height: normal
}

a {
    text-decoration: none
}

* {
    box-sizing: border-box
}

nav {
    position: fixed;
    user-select: none;
    z-index: 2;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    height: 4rem;
    transition: background-color .4s, height .4s cubic-bezier(.5, .5, 0, 1);

    &.solid, &.open {
        background-color: #000a;
        height: 3rem;
        backdrop-filter: blur(3px)
    }

    .main {
        display: flex;
        width: 100%;
        height: 100%;

        > i {
            display: none;
            font-size: 1.5rem;
            color: #888;
            align-items: center
        }

        > a {
            font: 900 2rem redhat;
            color: #fff9;
            display: flex;
            align-items: center;

            span {
                display: inline-block;
                transform: scale(0);
                animation: squish .2s cubic-bezier(.5, 0, .1, 1.5) forwards
            }
        }
    }

    section {
        flex: 1 1 0;
        font-size: 1.2rem;

        div {
            height: 100%;
            display: flex;
            justify-content: flex-end
        }

        a {
            display: flex;
            align-items: center;
            font-weight: bold;
            transition: color .2s;
            color: inherit;
            height: 100%;
            padding: 0 1rem;
            transition: color .2s, background-color .2s;

            &:hover {
                color: #fff;
                background-color: var(--theme-2)
            }
        }
    }
}

footer {
    padding: 2rem;
    font-size: .8rem;
    background-color: #000;
    display: flex;
    justify-content: center;
    flex-direction: column;
    height: 30rem;
    
    ul {
        list-style-type: none;
        padding-left: .5rem
    }

    span {
        font: 900 1rem redhat
    }

    i {
        width: 1rem;
        display: flex;
        text-align: center;
        margin-right: .5rem
    }

    a {
        position: relative;
        transition: color .2s;
        color: hsl(250, 80%, 70%);

        &::after {
            position: absolute;
            bottom: 0;
            height: 2px;
            background-color: hsl(250, 90%, 80%);
            content: '';
            width: 0;
            left: auto;
            right: 0;
            transition: width .4s cubic-bezier(.5, .5, 0, 1)
        }

        &:hover {
            color: hsl(250, 90%, 80%);

            &::after {
                width: 100%;
                left: 0;
                right: auto
            }
        }
    }
}

.link {
    border: 2px solid hsl(var(--hue), 80%, 70%);
    position: relative;
    overflow: hidden;
    color: #fff;
    padding: .5rem 1rem;
    margin-top: 1rem;
    border-radius: 1.6rem;
    display: inline-block;
    box-shadow: 0 0 5px #000;
    transition: background-color .2s;

    &:hover {
        background-color: var(--theme-2)
    }
}

.main {
    max-width: 90rem;
    margin: 0 auto;
    padding-right: 4rem;
    padding-left: 4rem
}

.cm-editor {
    outline: none !important;
    height: 100%
}

.string {
    color: #8c5
}

.keyword {
    color: #c7f
}

.number {
    color: #d92
}

.builtin, .operator {
    color: #2cc
}

.def {
    color: #6af
}

.variable, .error {
    color: #f66
}

.class {
    color: #fc5
}

.comment {
    color: #888
}

@font-face {
    font-family: redhat;
    src: url(rhd-regular.woff2)
}

@font-face {
    font-family: redhat;
    font-weight: bold;
    src: url(rhd-bold.woff2)
}

@font-face {
    font-family: redhat;
    font-weight: 900;
    src: url(rhd-black.woff2)
}

@font-face {
    font-family: grotesk;
    src: url(sg-regular.woff2)
}

@font-face {
    font-family: grotesk;
    font-weight: bold;
    src: url(sg-bold.woff2)
}

@font-face {
    font-family: mono;
    src: url(um-regular.woff2)
}

@keyframes squish {
    from {
        transform: scale(0)
    }

    to {
        transform: none
    }
}

@media screen and (max-width: 60rem) {
    .main {
        padding-left: 2rem;
        padding-right: 2rem
    }
}

@media screen and (max-width: 40rem) {
    .main {
        padding-left: 1rem;
        padding-right: 1rem
    }

    nav {
        section {
            position: absolute;
            top: 100%;
            left: 0;
            width: 100%;
            border-bottom-left-radius: 2rem;
            border-bottom-right-radius: 2rem;
            transition: background-color .4s, grid-template-rows .4s cubic-bezier(.8, .2, 0, 1), padding .4s cubic-bezier(.8, .2, 0, 1);
            padding: 0 1rem;
            gap: 1rem;
            display: grid;
            overflow: hidden;
            grid-template-rows: 0fr;
            background-color: #000;

            div {
                display: flex;
                min-height: 0;
                gap: 1rem
            }

            a {
                flex: 1 1 auto;
                text-align: center;
                background-color: #5558;
                border-radius: 1rem;
                padding: .5rem;
                transition: color .2s, background-color .2s;
                display: block;

                &:hover {
                    background-color: #555a
                }
            }
        }

        &.open section {
            grid-template-rows: 1fr;
            padding: 1rem
        }

        i.fa-bars {
            display: flex;
            flex: 1 1 0;
            justify-content: end;
        }
    }
}