:root {
    --bg-color: #00001a;
    --group-color: #050524;
    --surface-color: #111130;
    --primary-color: #ffc681;
    --accent-color: #e98044;
    --code-color: #ecddcb;
    --highlight-color: #f78d37;
    --line-num-color: #83106e;
    --text-color: #eee;
    --muted-text: #5c5c8d;
    --border-color: #313157;
    --border-width: 1px;
    --border: var(--border-width) solid var(--border-color);
    --radius: 0px;
    --shadow: 4px 4px 0px rgba(0,0,0,0.4);
    --font-main: 'Segoe UI', 'Roboto', Arial, sans-serif;
    --font-mono: 'Fira Mono', 'Consolas', monospace;
    --nav-width: 18rem;
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-main);
    margin: 0;
    min-height: 100vh;
    line-height: 1.6;
}

header, footer {
    /* background: var(--surface-color); */
    padding: 1.5rem 2rem;
    border-bottom: var(--border);
    /* box-shadow: var(--shadow); */
}

header {
    border-radius: 0 0 var(--radius) var(--radius);
}

footer {
    border-top: 1px solid var(--border-color);
    border-radius: var(--radius) var(--radius) 0 0;
    text-align: center;
    font-size: 0.95rem;
    color: var(--muted-text);
    margin-top: 64px;
}

main {
    margin-left: var(--nav-width);
    padding: 20px;
    /*
    max-width: 900px;
    margin: 2rem auto;
    background: var(--surface-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    */
}

nav {
    float: left;
    position: fixed;
    height: 100vh;
    width: var(--nav-width);
    background-color: var(--surface-color);
    border-right: var(--border);
    padding: 0;
    padding-right: 0;
    overflow-y: auto;

    a {
        display: block;
        padding: 4px;
        padding-left: 12px;
        border-top: var(--border);    
        line-height: 1.6;
    }

    a.title {
        font-size: 1.5em;
        font-weight: bold;
        color: var(--primary-color);
        border: none;
    }
    
    a.active {
        color: #fff;
        font-weight: bold;
    }
    
    a.section-link {
        font-size: 0.9em;
        color: var(--primary-color);
        margin-top: 0;
        margin-bottom: 0;
        border: none;
    }

    
    a.subsection-link, a.group-link {
        font-size: 0.75em;
        color: var(--primary-color);
        margin-top: 0;
        margin-bottom: 0;
        margin-left: 1em;
        border: none;
    }
}

h1, h2, h3, h4, h5, h6 {
    color: var(--primary-color);
    margin-top: 2em;
}

h1:first-child, h2:first-child, h3:first-child, h4:first-child, h5:first-child, h6:first-child {
    margin-top: 0;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s;
}

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

button, .button {
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: 0.6em 1.2em;
    font-size: 1em;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: background 0.2s;
}

button:hover, .button:hover {
    background: var(--accent-color);
    color: #232526;
}

input, textarea, select {
    background: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.5em;
    margin-bottom: 1em;
    font-size: 1em;
    transition: border 0.2s;
}

input:focus, textarea:focus, select:focus {
    border-color: var(--primary-color);
    outline: none;
}

.group {
    background-color: var(--group-color);
    display: block;
    border: var(--border);
    padding: 16px;
    margin-top: 32px;
    margin-bottom: 32px;
}

code, pre, code-block {
    background: var(--surface-color);
    color: var(--code-color);
    border-radius: var(--radius);
    font-family: 'Fira Mono', 'Consolas', monospace;
    tab-size: 4;
}

code {
    padding: 0.2em 0.4em;

    a {
        text-decoration: underline;
    }
}

code-block {
    position: relative;
    line-height: 0.75;
    display: block;
    margin: 16px 0 16px;
    border: var(--border);
    white-space: pre-line;
    padding-left: 0em;
    
    counter-reset: linenumber;
    
    span {
        display: block;
        list-style: none;
        counter-increment: linenumber;
        position: relative;
        padding-left: 3em;
        white-space: pre;
        word-wrap: break-word;
        text-wrap: wrap;
        line-height: 1;
        min-height: 1em;
    }
    
    span::before {
        content: counter(linenumber);
        position: absolute;
        left: 0;
        color: var(--line-num-color);
        text-align: right;
        width: 2em;
        padding-right: 0.5em;
        user-select: none;
        height: 200%;
    }
}

code-block::after {
    position: absolute;
    content: "";
    inset: 0;
    right: auto;
    width: 2.2em;
    border-left: 4px solid var(--code-color);
    border-right: var(--border);
}

code-block i {
    font-style: italic;
    opacity: 0.6;
    font-size: 80%;
    background-color: #383838;
}

code-block em {
    font-weight: bold;
    font-style: normal;
    position: relative;
}

code-block em::after {
    content: "";
    position: absolute;
    inset: -2px;
    border: 1px solid var(--primary-color);
    opacity: 0.3;
}

output-window {
    display: block;
    background-color: black;
    border: 2px solid var(--border-color);
    padding: 1em;
    font-family: 'Fira Mono', 'Consolas', monospace;
    line-height: 1.5;
    margin-top: 32px;
    margin-bottom: 32px;
    max-width: 60em;

    prompt {
        display: block;
        opacity: 0.5;
    }

    prompt::before {
        content: "> ";
    }
}

output-window::before {
    display: block;
    color: var(--text-color);
    background-color: var(--border-color);
    transform: translate(-1em, -1em);
    width: calc(100% + 1em);
    content: "Output";
    font-family: var(--font-main);
    font-weight: bold;
    white-space: pre;
    padding: 0px 8px 4px;
}

.output-inline {
    background-color: black;
    border: 1px solid var(--border-color);
    color: #ccc;
}

.remark {
    position: relative;
    border: var(--border);
    padding: 16px 24px 16px;
    font-weight: bold;
    background: var(--surface-color);
    margin: 1em 0 1em;
}

.remark::before {
    content: "i";
    font-family: var(--font-mono);
    display: inline-block;
    width: 1.8em;
    height: 1.8em;
    text-align: center;
    border: var(--border);
    margin-right: 10px;
}

.remark::after {
    content: "";
    position: absolute;
    inset: 0;
    border-left: 4px solid var(--primary-color);
    pointer-events: none;
}

pre {
    padding: 1em;
    overflow-x: auto;
}

hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}

::-webkit-scrollbar {
    width: 10px;
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--surface-color);
    border-radius: var(--radius);
}

.ascii {
    font-size: 100%;
    font-family: 'Fira Mono', 'Consolas', monospace;
    font-weight: bold;
    white-space: pre;
    line-height: 1;
    margin-bottom: 3em;
    letter-spacing: 0em;
    user-select: none;
}

h1.ascii {
    --shadow-color: rgba(255, 255, 255, 0.25);
    text-shadow: 0.2em 0.2em var(--shadow-color);
}

.ascii-grid>div {
    line-height: 1.1;
}

.ascii-grid>div>span {
    display: inline-block;
    
    width: 0.55em;
    font-family: 'Fira Mono', 'Consolas', monospace;
    font-weight: bold;
    margin-bottom: 0em;
    letter-spacing: 0em;
}

.effect {
    font-family: 'Fira Mono', 'Consolas', monospace;
}

.file-structure {
    border: var(--border);
    padding-top: 1em;
    padding-bottom: 1em;

    div {
        padding-left: 1.5em;
        position: relative;
    }

    /*
    div::after {
        position: absolute;
        content: "";
        inset: 0;
        left: 0.5em;
        right: auto;
        bottom: 0.7em;
        width: 0.7em;
        background-color: rgba(200, 200, 200, 0.0);
        border: 1px solid blue;
        border-right: none;
        border-top: none;
    }
    */

    margin: 1em 0 1em;
}

.file-structure>div {
    padding-left: 1em;
}

.folder::before {
    content: "📁";
    margin-right: 0.5em;
}

.file::before {
    content: "📄";
    margin-right: 0.5em;
}

.file em, .folder em {
    font-style: normal;
    font-weight: bold;
}

table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;

    th, td {
        border: 1px solid var(--border-color);
        padding: 0.3em 0.3em;
        text-align: left;
    }

    th {
        background-color: var(--group-color);
        font-weight: bold;
    }
}

.member-list {
    padding-left: 1em;
}

.member-list>li {
    position: relative;
    border: 1px solid var(--border-color);
    background-color: var(--group-color);
    margin: 16px 0 16px;
    padding: 8px 16px 8px;
    list-style-type: none;
}

.member-list>li::before {
    content: "";
    position: absolute;
    top: -1px;
    left: -4px;
    bottom: -1px;
    width: 4px;
    background-color: var(--accent-color);
}

.member-list>li>code {
    background: none;
    color: var(--primary-color);
    padding: 0;
}

.member-list>li>p {
    margin-bottom: 0;
}