/* Critical AI Potluck — customize here */

:root {
    --bg: #fff;
    --fg: #111;
    --border: #ddd;
    --bg-subtle: #f6f6f6;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1a1a1a;
        --fg: #e8e8e8;
        --border: #444;
        --bg-subtle: #252525;
    }

    a {
        color: #7eb8f7;
    }
}

body {
    display: flex;
    min-height: 100vh;
    margin: 0;
    font-family: sans-serif;
    line-height: 1.65;
    background: var(--bg);
    color: var(--fg);
}

nav {
    width: 180px;
    flex-shrink: 0;
    padding: 2em 1em;
    border-right: 1px solid var(--border);
    font-family: monospace;
    font-size: 0.85em;
    line-height: 1.8;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

nav li {
    position: relative;
    padding-left: 1.6em;
    white-space: nowrap;
}

nav li::before {
    content: '\251C\2500\2500\00A0';
    position: absolute;
    left: 0;
    opacity: 0.4;
}

nav li:last-child::before {
    content: '\2514\2500\2500\00A0';
}

/* nested folder indentation */
nav ul ul {
    margin-top: 0;
    padding-left: 1em;
}

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

nav a:hover {
    text-decoration: underline;
}

nav a[aria-current] {
    font-weight: bold;
    text-decoration: underline;
}

main {
    padding: 0em 2em;
}

h1,
h2,
h3,
h4 {
    line-height: 1.2;
    text-wrap: balance;
}

img,
.p5-sketch canvas {
    max-width: 100%;
}

table {
    border-collapse: collapse;
    width: 100%;
}

td,
th {
    border: 1px solid var(--border);
    padding: 0.3em 0.6em;
}

pre {
    position: relative;
    background: var(--bg-subtle);
    padding: 1em;
    overflow-x: auto;
}

.copy-btn {
    position: absolute;
    top: 0.4em;
    right: 0.5em;
    font-size: 0.75em;
    cursor: pointer;
}

pre:hover .copy-btn {
    opacity: 1;
}

@media (max-width: 600px) {
    body {
        flex-direction: column;
    }

    nav {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 1em;
    }

    main {
        padding: 1em;
    }
}