:root {
    color-scheme: dark;
    font-family: "Average Sans",Times,serif;

    --fg-core: #D3FAFF;
    --fg-primary: #96FFA0;
    --fg-secondary: #FF77B7;

    --header-fg-primary: #22211c;

    --header-bg-primary: #c0ac8d;
    --header-bg-secondary: #9b7160;
    --header-bg-tertiary: #fffcf6;

    --code-bg: #161c2c;
    --syntax-special-color: hsl(275, 24%, 60%);
    --syntax-element-color: var(--syntax-special-color);
    --syntax-symbol-color: #e0ceed;
    --syntax-string-color: #95e454;
    --syntax-keyword-color: #e5786d;
    --syntax-attribute-color: var(--syntax-keyword-color);
    --syntax-comment-color: #999;
    --syntax-block-color: hsl(189, 35%, 50%);
}

body {
    margin: 0;
    background-color: #0D0F15;
    color: var(--fg-core);
}

p, li {
    font-size: 1.15em;
}

a {
    text-decoration: none;
    color: var(--fg-secondary);

    &:hover, &:active, &:focus {
        text-decoration: underline;
        color: var(--fg-primary);
    }
}

article p img, main p img {
    max-width: 40rem;
    max-height: 40rem;
    margin: 2rem auto;
    display: block;
    border-radius: 1rem;
}

code {
    text-wrap: wrap;
}

blockquote {
    font-style: italic;
}

@font-face {
    font-family: 'Bitcount';
    src: url('/static/fonts/Bitcount.ttf');
}

@font-face {
    font-family: 'Tektur';
    src: url('/static/fonts/Tektur.ttf');
}

@font-face {
    font-family: 'Average Sans';
    src: url('/static/fonts/AverageSans.ttf');
}

.content-wrapper {
    max-width: 60rem;
    margin: 0 auto;
}

main {
    margin: 1.5em;
    min-height: calc(100vh - 20rem);
}

.content-box {
    article {
        > h1 {
            font-size: 2rem;
            margin-top: 1.5em;
            margin-bottom: 0;
        }

        &.summary > h1 {
            font-size: 1.5rem;
        }
    }
}

.logo {
    font-family: 'Bitcount','Courier',monospace;
    font-weight: normal;
    /*background: no-repeat url("/static/images/display.svg");*/
    background-size: 12rem;
    line-height: 4rem;
    padding: 0 1.5rem;
}

h1, h2, h3 {
    font-family: 'Tektur','verdana',sans-serif;
    font-weight: normal;

    margin: 1.5em 0 0.75em 0;
    color: var(--fg-primary);
}

address {
    color: var(--fg-primary);
}

@media (max-width: 750px) {
    header nav div.logo {
        padding-right: 13.8rem;
    }
}

header nav {
    display: flex;
    align-items: flex-end;

    a {
        text-decoration: none;
    }

    .logo {
        font-size: 3rem;

        padding: 1.17rem .25rem .35rem 0;

        background-color: var(--header-bg-primary);

        border-left: 0.1rem solid var(--header-bg-tertiary);
        border-bottom: 0.4rem solid var(--header-bg-tertiary);

        border-radius: 0 0 0 1rem;
        border-right: .1rem solid var(--header-bg-secondary);

        a {
            display: block;
            color: #b6ffff54;
            text-shadow: 0 0 2px #b6ffff, 0 0 3px #1d54ff, 0 0 10px #282cff, 0 0 20px #1515ff;

            border-radius: .25em;
            padding: 0.5em .5em 0 0.4em;
            margin-left: .25rem;
            background-image: url("/static/images/display.svg");
            background-size: 100%;

            &:hover, &:active, &:focus {
                text-decoration: none;
            }

            &:after {
                content: "_";
            }
        }
    }

    > menu {
        display: none;

        list-style-type: none;
        text-transform: uppercase;
        margin: 0;
        margin-left: -2.5rem;

        li {
            border-top: 0;
            border-right: 0;
            width: 7rem;
            text-align: center;
            font-weight: bold;

            &:before {
                content: "";
                height: 4rem;
                background-color: var(--header-bg-primary);
                position: relative;
                bottom: 0;
                left: 0;
                display: block;
                border-left: .1rem solid var(--header-bg-tertiary);
                border-right: .1rem solid var(--header-bg-secondary);
                transform: skewX(35deg);
                transform-origin: bottom left;
            }

            &:last-child:before {
                border-right: .1rem solid white;
            }

            &:last-child > a {
                border-end-end-radius: 2rem;
                border-right: .1rem solid white;
            }

            > a {
                padding: .75rem;
                display: block;

                background-color: var(--header-bg-primary);
                color: var(--header-fg-primary);
                text-shadow: .05em .05em 0 var(--header-bg-tertiary);
                text-underline-offset: .3em;

                border-left: .1rem solid var(--header-bg-tertiary);
                border-right: .1rem solid var(--header-bg-secondary);
                border-bottom: .4rem solid var(--header-bg-tertiary);

                &:hover, &:active, &:focus {
                    color: var(--header-fg-primary);
                }
            }
        }
    }
}

footer nav {
    margin: 4em 0 2em 0;
    font-size: 0.9em;

    menu {
        display: flex;
        list-style-type: none;
        text-transform: uppercase;
        justify-content: center;

        a {
            text-decoration: none;
            color: white;
        }

        li:after {
            content: "•";
            margin: 0 1em;
        }

        li:last-child::after {
            content: "";
        }
    }
}

.read-more-button {
    a::after {
        content: " »";
    }
}

.mobile {
    display: block;
    position: absolute;
    top: 0.5rem;
    right: 0;

    menu {
        display: block;
        margin-top: 7rem;
        background: #1c1b22;
        width: calc(100vw - 2rem);
        box-shadow: 0px 9px 9px 1px #0008;
        padding: 1em;

        li {
            list-style-type: none;
            text-transform: uppercase;
            font-size: 1.25em;

            a {
                padding: 2em;
                display: block;
            }
        }
    }

    .hamburger {
        position: absolute;
        top: 0;
        right: 1.5rem;
        display: block;
        background-size: 2rem;
        width: 2rem;
        height: 2rem;
    }
}

@media (min-width: 750px) {
    .mobile {
        display: none;
    }

    header nav > menu {
        display: flex;
    }
}

.line {
    fill: none;
    stroke: var(--header-fg-primary);
    stroke-width: 6;
    transition: stroke-dasharray 400ms cubic-bezier(0.4, 0, 0.2, 1),
                stroke-dashoffset 400ms cubic-bezier(0.4, 0, 0.2, 1);
}
.line1 {
    stroke-dasharray: 60 207;
    stroke-width: 6;
}
.line2 {
    stroke-dasharray: 60 60;
    stroke-width: 6;
}
.line3 {
    stroke-dasharray: 60 207;
    stroke-width: 6;
}
.mobile > details:open {
    .line1 {
        stroke-dasharray: 90 207;
        stroke-dashoffset: -134;
        stroke-width: 6;
    }
    .line2 {
        stroke-dasharray: 1 60;
        stroke-dashoffset: -30;
        stroke-width: 6;
    }
    .line3 {
        stroke-dasharray: 90 207;
        stroke-dashoffset: -134;
        stroke-width: 6;
    }
}

.taglist {
    ul {
        display: inline;
        padding-left: 0.5em;

        li {
            display: inline;

            &:after {
                content: ", ";
            }
        }

        :last-child {
            &:after {
                content: "";
            }
        }
    }
}

pre {
    background-color: var(--code-bg);
    padding: 1em;
}

/* Syntax highlighting */
.syntax-special {
    color: var(--syntax-special-color);
    font-weight: bold;
}

.syntax-element {
    color: var(--syntax-element-color);
    font-weight: bold;
}

.syntax-symbol {
    color: var(--syntax-symbol-color);
}

.syntax-string {
    color: var(--syntax-string-color);
}

.syntax-keyword {
    color: var(--syntax-keyword-color);
}

syntax-attribute {
    color: var(--syntax-attribute-color);
}

.syntax-comment {
    color: var(--syntax-comment-color);
}

.syntax-open, .syntax-close {
    color: var(--syntax-block-color);
}

ul.social-icons {
    list-style-type: none;
    padding: 0;
    display: flex;
    margin: 3em;
    gap: 1.5em;
    justify-content: center;
    flex-wrap: wrap;

    li a {
        display: block;
        position: relative;
    }

    img {
        width: 2em;
        height: 2em;
    }
}

[data-tooltip]:hover::after {
    display: block;
    position: absolute;
    content: attr(data-tooltip);
    background: var(--code-bg);
    padding: .25em;
    left: 50%;
    transform: translateX(-50%);
    color: var(--fg-core)
}
