/* ==========================================================
   BASE — shared layout/structure + the default "terminal" theme.
   This file always loads. Theme files (theme-*.css) layer on
   top of it, scoped with [data-theme="..."] selectors, and only
   need to override what's different about that theme.
   ========================================================== */

:root {
    --bg: #0b0d10;
    --surface: #14171d;
    --text: #edeeef;
    --text-muted: #8b929d;
    --rule: #24282f;

    --c-magenta: #ff2e7a;
    --c-cyan: #22e5d0;
    --c-amber: #ffb238;
    --c-violet: #9b6bff;

    --font-display: "Space Grotesk", sans-serif;
    --font-title: "Archivo Black", "Space Grotesk", sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    background-image:
        radial-gradient(circle at 12% 8%, rgba(255,46,122,0.10), transparent 40%),
        radial-gradient(circle at 88% 78%, rgba(34,229,208,0.08), transparent 45%);
    font-family: var(--font-mono);
    line-height: 1.6;
    color: var(--text);
    max-width: 1040px;
    margin: 0 auto;
    padding: clamp(28px, 8vw, 64px) clamp(18px, 5vw, 28px) 80px;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--c-cyan);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ---------- Header ---------- */

h1 {
    font-family: var(--font-title);
    font-weight: 900;
    font-size: clamp(2.1rem, 7vw, 3rem);
    line-height: 1.05;
    letter-spacing: -0.01em;
    margin: 0 0 6px;
    display: inline-block;
    padding: 0.12em 0.28em;
    border-radius: 6px;
    background: linear-gradient(100deg, var(--c-magenta) 0%, var(--c-amber) 38%, var(--c-cyan) 68%, var(--c-violet) 100%);
    color: #0a0a0a;
}

.cursor {
    display: inline-block;
    width: 0.5ch;
    margin-left: 2px;
    background: var(--c-cyan);
    color: transparent;
    animation: blink 1.1s steps(1) infinite;
}
@media (prefers-reduced-motion: reduce) {
    .cursor { animation: none; opacity: 1; }
}
@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
    max-width: none;
    white-space: pre-line;
}

header {
    margin-bottom: 12px;
}

/* ---------- Sections (generated) ---------- */

/* A personal index, not a control panel: each folder is a labeled
   section (category = level 2) that opens onto a flowing line of
   destinations (level 3). Categories carry more visual authority
   than the links inside them; links read as text, not buttons. */
#dynamic-index {
    display: flex;
    flex-direction: column;
}

#dynamic-index .group {
    padding: 14px 0;
    border-bottom: 1px solid var(--rule);
}
#dynamic-index .group:first-child {
    padding-top: 4px;
}
#dynamic-index .group:last-child {
    border-bottom: none;
}

#dynamic-index h2 {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent, var(--c-cyan));
    margin: 14px 0 8px;
    line-height: 1.3;
}
#dynamic-index h2::before {
    content: "// ";
    opacity: 0.55;
}

#dynamic-index ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    row-gap: 6px;
}

#dynamic-index li {
    display: inline-flex;
    align-items: baseline;
}
#dynamic-index li:not(:last-child)::after {
    content: "\00b7";
    color: var(--text-muted);
    opacity: 0.6;
    margin: 0 14px;
}

#dynamic-index a {
    display: inline-block;
    padding: 6px 2px;
    font-family: var(--font-mono);
    font-size: 1.02rem;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

#dynamic-index a:hover,
#dynamic-index a:focus-visible {
    color: var(--accent, var(--c-cyan));
    border-color: var(--accent, var(--c-cyan));
}

footer {
    margin-top: 24px;
    padding-top: 12px;
    border-top: 1px solid var(--rule);
    color: var(--text-muted);
    font-size: 0.78rem;
}

.no-underline {
    text-decoration: none;
}

@media (max-width: 560px) {
    #dynamic-index .group {
        padding: 10px 0;
    }
    #dynamic-index h2 {
        font-size: 1.05rem;
        letter-spacing: 0.1em;
    }
    #dynamic-index ul {
        row-gap: 10px;
    }
    #dynamic-index a {
        font-size: 1.35rem;
        padding: 9px 2px;
    }
    #dynamic-index li:not(:last-child)::after {
        margin: 0 12px;
    }

    /* Compact vertical rhythm on mobile — text sizes unchanged */
    body {
        padding-top: 12px;
        padding-bottom: 28px;
    }
    header {
        margin-bottom: 8px;
    }
    #dynamic-index .group {
        padding: 10px 0;
    }
    #dynamic-index h2 {
        margin-bottom: 6px;
    }
    footer {
        margin-top: 14px;
        padding-top: 8px;
    }
}
