/* ====================================================================
 * blackCurrent demo site — base styles
 * Self-contained, no external fonts, no external images.
 * ==================================================================== */

:root {
    --bg:        #0a0e1a;
    --panel:     #131a2c;
    --panel-2:   #1a2238;
    --text:      #e6e9ef;
    --muted:     #8892a8;
    --accent:    #d946ef;
    --accent-2:  #06b6d4;
    --good:      #34d399;
    --bad:       #f87171;
    --border:    #1f2937;
    --max-w:     980px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: radial-gradient(ellipse at top, rgba(217, 70, 239, 0.06), transparent 50%), var(--bg);
    color: var(--text);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
    background: var(--panel);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.88em;
    color: var(--accent);
    font-family: "SF Mono", Menlo, Consolas, monospace;
}
pre code { background: none; padding: 0; color: var(--text); }
strong { color: var(--text); }

/* ── Header ──────────────────────────────────────────────────────────── */
.site-header, .admin-header {
    background: rgba(19, 26, 44, 0.8);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 10;
}
.admin-header { background: rgba(45, 26, 60, 0.85); border-bottom-color: var(--accent); }

.site-header .container, .admin-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.logo { font-weight: 800; font-size: 1.25rem; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo span { color: var(--accent); }

.nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.nav a {
    color: var(--muted);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.nav a:hover, .nav a.is-active {
    color: var(--text);
    border-bottom-color: var(--accent);
    text-decoration: none;
}

/* ── Layout ──────────────────────────────────────────────────────────── */
.main {
    flex: 1;
    padding: 3rem 0 4rem;
}
.main > .container > section { margin-bottom: 3rem; }
.main > .container > section:last-child { margin-bottom: 0; }

/* ── Typography ──────────────────────────────────────────────────────── */
h1 { font-size: 2.5rem; margin-bottom: 1rem; font-weight: 800; letter-spacing: -0.02em; }
h1 strong { color: var(--accent); }
h2 { font-size: 1.5rem; margin: 2rem 0 1rem; font-weight: 700; }
p  { margin-bottom: 1rem; color: var(--muted); }
.lead { font-size: 1.125rem; color: var(--text); max-width: 65ch; }
.note { font-size: 0.92rem; opacity: 0.9; }

.badge {
    display: inline-block;
    background: rgba(6, 182, 212, 0.15);
    color: var(--accent-2);
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 1rem;
    letter-spacing: 0.04em;
}

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero { padding: 1rem 0 1.5rem; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 0.65rem 1.4rem;
    background: var(--accent);
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.15s, transform 0.05s;
    text-decoration: none;
}
.btn:hover  { background: #b91dd0; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--panel); }
.btn + .btn { margin-left: 0.5rem; }

/* ── Feature list ────────────────────────────────────────────────────── */
.feature-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.75rem;
}
.feature-list li {
    background: var(--panel);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--accent-2);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.feature-label { color: var(--text); font-weight: 500; }
.feature-source { font-size: 0.78rem; color: var(--muted); background: transparent; padding: 0; }

/* ── Anatomy grid ────────────────────────────────────────────────────── */
.anatomy-grid {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 0.5rem;
    margin: 1.25rem 0;
}
.block {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    border: 1px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.block-header { background: rgba(217, 70, 239, 0.08); }
.block-body   { background: rgba(6, 182, 212, 0.08);  padding: 2.5rem 1.25rem; }
.block-footer { background: rgba(136, 146, 168, 0.05); }
.block-tag {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--muted);
}
.block-header .block-tag { color: var(--accent); }
.block-body   .block-tag { color: var(--accent-2); }

/* ── Flow / cascade lists ────────────────────────────────────────────── */
.flow, .cascade { padding-left: 1.5rem; color: var(--muted); }
.flow li, .cascade li { margin-bottom: 0.4rem; }

/* ── File map ────────────────────────────────────────────────────────── */
.filemap pre {
    background: var(--panel);
    padding: 1rem 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--text);
    border: 1px solid var(--border);
}

/* ── Forms ───────────────────────────────────────────────────────────── */
.form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 480px;
    margin-top: 1rem;
}
.form label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: var(--text);
    font-weight: 500;
}
.form label span { font-size: 0.95rem; }
.form input, .form textarea {
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.65rem 0.8rem;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form input:focus, .form textarea:focus {
    outline: none;
    border-color: var(--accent-2);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.18);
}
.error { color: var(--bad); font-size: 0.85rem; font-weight: 400; }

.alert {
    padding: 0.85rem 1rem;
    border-radius: 6px;
    margin-bottom: 1.25rem;
    font-size: 0.95rem;
}
.alert-error { background: rgba(248, 113, 113, 0.12); color: var(--bad); border: 1px solid rgba(248, 113, 113, 0.3); }

/* ── Admin ───────────────────────────────────────────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}
.stat-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    text-align: left;
}
.stat-value { font-size: 2rem; font-weight: 800; color: var(--accent); margin-bottom: 0.25rem; }
.stat-label { color: var(--muted); font-size: 0.9rem; }

/* ── Footer ──────────────────────────────────────────────────────────── */
.site-footer {
    background: var(--panel);
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    color: var(--muted);
    font-size: 0.9rem;
}
.site-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.site-footer .meta { color: var(--muted); margin: 0; }

@media (max-width: 600px) {
    h1 { font-size: 1.85rem; }
    .nav { gap: 0.85rem; }
    .nav a { font-size: 0.88rem; }
}

/* ── Reference page (/features) ─────────────────────────────────────── */
.ref-toc {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: baseline;
    font-size: 0.9rem;
    position: sticky;
    top: 4rem;
    z-index: 5;
}
.ref-toc strong { color: var(--text); margin-right: 0.5rem; }
.ref-toc a { color: var(--muted); border-bottom: 1px dashed transparent; }
.ref-toc a:hover { color: var(--accent-2); border-bottom-color: var(--accent-2); text-decoration: none; }

.ref { margin-bottom: 2.5rem; scroll-margin-top: 6rem; }
.ref h2 {
    color: var(--accent);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}
.ref pre {
    background: #0e1424;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #d8dde8;
    margin-bottom: 1rem;
}
.ref pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.ref-note {
    background: rgba(6, 182, 212, 0.06);
    border-left: 3px solid var(--accent-2);
    padding: 0.6rem 0.9rem;
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text);
}
.ref-cheat table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}
.ref-cheat th, .ref-cheat td {
    text-align: left;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    font-size: 0.92rem;
}
.ref-cheat th { color: var(--muted); font-weight: 600; }
.ref-cheat code { font-size: 0.82rem; }
