@font-face {
    font-family: "Uiua386";
    src: url("./Uiua386.ttf") format("truetype");
}

:root {
    --gray: #1F1F1F;
    --dark-gray: #181818;
    --light-gray: #2B2B2B;
    --mauve: #5c162e;
    --red: #e4496d;
    --white: #c1c1c1;

    --color-background: var(--gray);
    --color-sidebar-background: var(--dark-gray);
    --color-separator: var(--light-gray);

    --color-highlight: var(--red);
    --color-panel: var(--dark-gray);

    --color-text: var(--white);
    --color-text-link: var(--red);
    --color-badge: var(--mauve);
    --color-summary: #9B9B9B;

    --sidebar-width: 250px;
    --binding-color: white;
}

* {
    box-sizing: border-box;
    scroll-behavior: smooth !important;
    scroll-margin-top: 1em;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: "Roboto", sans-serif;
    height: 100vh;
    line-height: 1.5em;
    background-color: var(--color-background);
    color: var(--color-text);
}

h3 {
    margin-bottom: 0.5em;;
}

a {
    color: var(--color-text-link);
    text-decoration: underline;
}

.mono {
    font-family: Uiua386, monospace;
}

.container {
    width: 100%;
    height: 100%;
    display: flex;
    overflow: auto;
}

.sidebar {
    width: 250px;
    border-right: 1px solid var(--color-separator);
    padding: 1em;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 2em;
    overflow: auto;
    background-color: var(--color-sidebar-background);
}

.content {
    display: flex;
    flex: 1;
    overflow: auto;
}

.content-wrapper {
    margin: auto;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 900px;
    padding: 1em;
}

.panel {
    background-color: var(--color-panel);
    padding: 1em;
    margin-bottom: 1em;

    & > *:first-child {
        margin-top: 0;
    }

    & > *:last-child {
        margin-bottom: 0;
    }

    h2 {
        border-bottom: 1px solid var(--color-separator);
        padding-bottom: 0.5em;
    }
}

.panel .panel {
    border: 1px solid var(--color-separator);
    border-left: inherit;
}

.section-name {
    font-size: 1.25em;
    font-weight: bold;
    margin-bottom: 0.5em;
}

.sidebar-section, li {
    & > *:first-child {
        margin-top: 0;
    }

    & > *:last-child {
        margin-bottom: 0;
    }
}

.feature {
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    border-left: 3px solid var(--binding-color) !important;
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;

    & > * {
        margin-top: 0;
        margin-bottom: 0;
    }
}

.feature + .feature {
    margin-top: 1em;
}

.feature-documentation {
    & > *:first-child {
        margin-top: 0;
    }

    & > *:last-child {
        margin-bottom: 0;
    }
}

.sidebar ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.badge {
    background-color: #ff00571f;
    color: #ff76b0;
    padding: 0.25em 0.5em;
    border-radius: 50px;
    font-size: 0.65em;
    position: relative;
    top: -0.15em;
}

code {
    font-family: Uiua386, monospace;
    background-color: var(--color-separator);
    padding: 0 0.5em;
    border-radius: 5px;
}

.literal-value, .source-code, pre > code {
    display: flex;
    padding: 0.5em 1em;
    background-color: var(--color-separator);
    font-family: Uiua386, monospace;
    overflow: auto;
    white-space: pre;
}

.function-summary {
    display: flex;
    flex-wrap: wrap;
    gap: .5em;
    font-family: Uiua386, monospace;

    .summary-badge {
        color: var(--text-color);
        padding: 0 0.25em;
        border-radius: 4px;
        /* border: 1px solid var(--badge-color); */
        background-color: rgb(from var(--badge-color) r g b / 20%);
    }

    .signature {
        --badge-color: #cacaca;
        --text-color: #f1f1f1;
    }

    .output {
        --badge-color: #569cd6;
        --text-color: #6fbeff;
    }

    .input {
        --badge-color: #ce9178;
        --text-color: #ffb89c;
    }

    .optional {
        --badge-color: #95d16a;
        --text-color: #b8ff97;
    }

    .inferred {
        font-style: italic;
    }
}

.data-summary {
    display: flex;
    flex-direction: column;
    gap: 0.75em;
    font-family: Uiua386, monospace;

    &.variant {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.75em;
    }

    .data-badge {
        color: var(--color-text);
        padding: 0.25em 0.5em;
        font-weight: bold;
    }

    .badge-row > .data-badge:first-child {
        border-top-left-radius: 0.3em;
        border-bottom-left-radius: 0.3em;
    }

    .badge-row > .data-badge:last-child {
        border-top-right-radius: 0.3em;
        border-bottom-right-radius: 0.3em;
    }

    .type {
        background-color: #95d16a29;
        color: #b8ff97;
    }

    .input {
        background-color: #ce917829;
        color: #ffb89c;
    }
}

.variant-summary {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;

    gap: 0.75em;
    margin-bottom: 1em;
    font-family: Uiua386, monospace;

    .data-badge {
        color: black;
        padding: 0 0.5em;
        border-radius: 0.3em;
    }

    .input {
        background-color: #ce9178;
    }
}

.mobile-nav {
    display: none;
}

@media (max-width: 800px) {
    .mobile-nav {
        position: fixed;
        display: flex;
        width: 100vw;
        justify-content: flex-start;
        align-items: center;
        padding: 1em;
        background-color: var(--color-sidebar-background);
        gap: 1em;

        h1 {
            margin: 0;
            font-size: 1.25em;
            text-wrap: nowrap;
            text-overflow: ellipsis;
        }
    }

    .container {
        padding-top: 3.5em;
    }

    .sidebar {
        display: none;
        position: fixed;
        height: calc(100vh - 56px);
        z-index: 1;
    }

    .sidebar.open {
        display: block;
    }

    .content {
        width: 100%;
    }

    .mobile-hidden {
        display: none;
    }

    .hamburger {
        display: flex;
        flex-direction: column;
        cursor: pointer;
        gap: 0.25em;
    }

    .hamburger div {
        display: block;
        width: 25px;
        height: 3px;
        background-color: var(--color-text);
    }
}

table {
    box-sizing: border-box;
    width: 100%;
    margin: 30px 0;
    border: 1px solid #999;
    border-collapse: collapse;
    border-spacing: 0;
}

table th, table td {
    padding: 10px;
    vertical-align: middle;
    border: 1px solid var(--color-separator);
    font-size: 90%;
}

table th {
    font-weight: bold;
}

table td.focus {
    font-size: 20px;
}

table td code {
    word-break: break-all;
}

.hidden {
    display: none;
}

.italics {
    font-style: italic;
}

summary {
    color: var(--color-summary);
    cursor: pointer;
}

.source-code, .language-uiua {
    display: flex;
    flex-direction: column;
}

.constant {
    --binding-color: #d1daec;
}

.module {
    --binding-color: #d7be8c;
}

.noadic-function {
    --binding-color: #ed5e6a;
}

.monadic-function {
    --binding-color: #95d16a;
}

.dyadic-function {
    --binding-color: #54b0fc;
}

.triadic-function {
    --binding-color: #8078f1;
}

.tetradic-function {
    --binding-color: #f576d8;
}

.variadic-function {
    background-image: linear-gradient(170deg,
    #ed5e6a 34%,
    #95d16a 34%,
    #95d16a 45%,
    #54b0fc 45%,
    #54b0fc 56%,
    #8078f1 56%,
    #8078f1 67%,
    #f576d8 67%);
}

.monadic-modifier {
    --binding-color: #f0c36f;
}

.dyadic-modifier {
    --binding-color: #cc6be9;
}

.triadic-modifier {
    --binding-color: #F5A9B8
}

.binding {
    color: var(--binding-color);
}

.space-character {
    border-width: 2px;
    border-radius: 0.3em;
    border-style: dashed;
    margin: 0 -2px;
}

.number-literal {
    color: #f85;
}

.comment-span {
    color: #888;
}

.string-literal-span {
    color: #20f9fc;
}

.space-character {
    border-color: #20f9fc80;
}

.strand-span {
    color: #fff8;
}

.output-error {
    color: #f44;
}

.signature-separator {
    scale: 1.2;
    font-weight: bold;
    padding: 0 0.25em;
}