

:root {
    --bg: #280f12;
    --dark-bg: #18080a;
    --fg: #f4d3d0;
    --dim-fg: #a68888;
    --accent: #cd1921;
    --dark-accent: #7e2125;
    --content-width: 1200px;
    
    --hero-content-width: 800px;
    
    --font-main: Gelasio, serif;
    --font-headings: Cormorant, Gelasio, serif;
    --font-monospace: "Victor Mono", monospace;
}

body {
    padding: 0;
    margin: 0;
    background-color: var(--bg);
    color: var(--fg);
    font-family: var(--font-main);
    font-size: 1.3em;
}

h1, h2, h3 {
    font-family: var(--font-headings);
}

a {
    &, &:visited {
        color: var(--accent);
    }
    transition: color .15s ease-in-out;
    &:hover, &:active, &:focus {
        color: var(--fg);
    }
}

.content {
    max-width: var(--content-width);
    width: 100%;
    margin: auto;
}

header {
    h1, h2, h3, h4, h5, h6, p {
        margin: 0;
    }
    width: 100%;
    padding: 12px;
    height: 64px;
    box-sizing: border-box;
    background-color: var(--dark-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    .inner {
        max-width: var(--content-width);
        width: 100%;
        display: flex;
        flex-direction: row;
        align-items: center;
        .title {
            align-items: center;
            text-decoration: none;
            display: flex;
            flex-direction: row;
            h1 {
                font-size: 1.7em;
            }
            .logo {
                height: 48px;
            }
        }
        .spacer {
            display: block;
            flex-grow: 1;
        }
        .iconlinks {
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 18px;
            margin: 0 18px;
            .iconlink {
                color: unset;
                svg {
                    width: 32px;
                    height: 32px;
                    transition: fill .15s ease-in-out;
                    fill: var(--fg);
                }
                &:hover, &:active, &:focus {
                    svg {
                        fill: var(--accent);
                    }
                }
            }
        }
    }
    .separator {
        position: absolute;
        left: 0;
        right: 0;
        top: 64px; /* header height */
        height: 3px;
        background-image: linear-gradient(to right, rgba(0, 0, 0, 0), var(--accent), rgba(0, 0, 0, 0));
    }
}

footer {
    background-color: var(--dark-bg);
    margin-top: 92px;
    padding: 12px;
    text-align: center;
}

main {
    padding: 12px;
}

.hero {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 60vh;
    
    background-image: url("/hero.svg");
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    

    gap: 48px;
    h1, h2 {
        max-width: var(--hero-content-width);
        display: block;
        margin: 0;
    }

    h1 {
        font-size: 4em;
    }
    h2 {
        font-size: 2.3em;
    }
}

.buttonbox {
    max-width: min(var(--hero-content-width), 95%);
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, max-content));
    justify-content: center;
    gap: 12px;
    .button {
        display: block;
        color: currentcolor;
        font-weight: 800;
        font-size: 1.1em;
        font-variant: small-caps;
        text-transform: capitalize;
        text-decoration: none;
        padding: 12px;
        border-radius: 12px;
        border: 2px solid;
        transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out;
        border-color: rgba(0, 0, 0, .3);
        background-color: rgba(0, 0, 0, .3);
        &.suggested {
            border-color: var(--dark-accent);
            background-color: var(--dark-accent);
        }
        &:hover, &:active, &:focus {
            background-color: var(--dark-accent);
            border-color: var(--dark-accent);
            &.suggested {
                border-color: var(--accent);
                background-color: var(--accent);
            }
        }
    }
}

.copy-codebox {
    border: 2px solid var(--dark-accent);
    background-color: rgba(0, 0, 0, .3);
    border-radius: 12px;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    padding: 12px;
    align-items: center;
    gap: 12px;
    max-width: min(var(--hero-content-width), 95%);
    code {
        text-overflow: clip;
        white-space: nowrap;
        overflow-x: auto;
        color: currentcolor;
        border: none;
        background: none;
        width: 100%;
    }
    button.copy {
        cursor: pointer;
        border: none;
        background-color: transparent;
        display: flex;
        align-items: center;
        svg {
            fill: var(--fg);
            width: 16px;
            height: 16px;
            transition: fill .15s ease-in-out;
        }
        &:hover, &:active, &:focus {
            svg {
                fill: var(--accent);
            }
        }
    }
}

code {
    font-family: var(--font-monospace);
}

main article, .content {
    code, pre {
        background-color: rgba(0, 0, 0, .4);
        border-radius: 3px;
        border: 1px solid rgba(255, 255, 255, .4);
    }

    code {
        padding: 0 4px;
    }

    pre {
        display: flex; /* fixes float issues */
        padding: 12px;
        overflow-x: auto;
        code {
            background-color: unset;
            padding: unset;
            border-radius: unset;
            border: unset;
        }
    }

    .contentbox {
        margin: 1em 0;
        background-color: var(--dark-bg);
        border: 1px solid rgba(255, 255, 255, .4);
        display: flex; /* fixes float */
        flex-direction: column;
        > * {
            padding: 0 12px;
        }
        &.info, &.note, &.warn, &.danger {
            &::before {
                padding: 12px;
                display: block;
                font-style: italic;
                border-bottom: 1px solid rgba(255, 255, 255, .4);
            }
        }
        &.info::before {
            content: "Information";
            background-color: #2e3220;
        }
        &.note::before {
            content: "Note";
            background-color: #202832;
        }
        &.warn::before {
            content: "Warning";
            background-color: #3e3a22;
        }
        &.danger::before {
            content: "Danger";
            background-color: #3e2222;
        }
    }
}

main article {
    padding: 12px;
    max-width: var(--content-width);
    width: auto;
    margin: auto;

    h1, h2, h3, h4, h5, h6 {
        a.anchor {
            text-decoration: none;
            margin-right: 6px;
            &::before {
                content: "\00b6"; /* pilcrow paragraph marker */
            }
        }
    }
}

article.docs {
    .docs-sidebar {
        width: 256px;
        background-color: var(--dark-bg);
        float: left;
        margin: 1.5em 24px 24px 0;
        ul {
            list-style-type: none;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        > ul, > h3 {
            padding: 24px;
            margin: 0;
        }
        > h3  {
            color: var(--dim-fg);
        }
        hr {
            border: none;
            height: 1px;
            background-color: var(--dim-fg);
            margin: 0;
        }
    }
    .clearfix {
        visibility: hidden;
        display: block;
        height: 0;
        width: 0;
        clear: both;
    }
    @media only screen and (max-width: 650px) {
        .docs-sidebar {
            float: unset;
            width: 100%;
            margin: auto;
        }
    }
}

code {
    font-size: .8em;
}

