/*
 * NeuralMind benchmark dashboard.
 * Design system shared with docs/index.html — dark navy surfaces,
 * Inter + JetBrains Mono, #8b7cf8 accent. Keep tokens in sync with
 * the :root block in index.html when the brand palette changes.
 */

:root {
    --bg: #070b15;
    --bg-raised: #0c1322;
    --bg-card: #0e1626;
    --border: #1b2740;
    --border-strong: #28395c;
    --text: #e7ecf5;
    --text-dim: #97a3ba;
    --text-faint: #67748f;
    --accent: #8b7cf8;
    --accent-bright: #a99cff;
    --accent-deep: #6d5ae6;
    --green: #4ade80;
    --red: #f87171;
    --amber: #fbbf24;
    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-bright); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
    font-family: var(--mono); font-size: 0.875em;
    background: rgba(139, 124, 248, 0.1); border: 1px solid rgba(139, 124, 248, 0.18);
    padding: 0.1em 0.35em; border-radius: 4px; color: var(--accent-bright);
}
.container { max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }

/* ───── Nav ───── */
nav {
    position: sticky; top: 0; z-index: 50;
    background: rgba(7, 11, 21, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 4rem; }
.nav-logo { display: flex; align-items: center; gap: 0.55rem; font-weight: 700; font-size: 1.05rem; color: var(--text); }
.nav-logo:hover { text-decoration: none; }
.nav-logo svg { width: 22px; height: 22px; }
.nav-links { display: flex; align-items: center; gap: 1.75rem; }
.nav-links a { color: var(--text-dim); font-size: 0.9rem; font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--text); }
.nav-gh {
    display: inline-flex; align-items: center; gap: 0.4rem;
    border: 1px solid var(--border-strong); border-radius: 8px;
    padding: 0.4rem 0.9rem; color: var(--text) !important; font-size: 0.875rem;
}
.nav-gh:hover { border-color: var(--accent); background: rgba(139, 124, 248, 0.08); }
.nav-toggle { display: none; background: none; border: 1px solid var(--border-strong); border-radius: 8px; color: var(--text); padding: 0.35rem 0.6rem; font-size: 1.1rem; cursor: pointer; }

/* ───── Hero ───── */
.hero { position: relative; overflow: hidden; padding: 4.5rem 0 3.5rem; }
.hero-glow {
    position: absolute; top: -30%; left: 50%; transform: translateX(-50%);
    width: 900px; height: 520px; pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(109, 90, 230, 0.2) 0%, transparent 65%);
}
.hero .container { position: relative; }
.badge {
    display: inline-flex; align-items: center; gap: 0.5rem;
    background: rgba(139, 124, 248, 0.1); border: 1px solid rgba(139, 124, 248, 0.3);
    border-radius: 999px; padding: 0.3rem 0.9rem; font-size: 0.8rem; font-weight: 500;
    color: var(--accent-bright); margin-bottom: 1.5rem;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
h1 { font-size: 2.9rem; line-height: 1.12; font-weight: 800; letter-spacing: -0.025em; margin-bottom: 1.25rem; max-width: 46rem; }
.grad { background: linear-gradient(100deg, #a99cff 10%, #7c8cf8 50%, #5eead4 95%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-sub { color: var(--text-dim); font-size: 1.08rem; max-width: 44rem; margin-bottom: 2rem; }
.hero-sub strong { color: var(--text); font-weight: 600; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.9rem; }

.btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    border-radius: 10px; padding: 0.75rem 1.5rem;
    font-weight: 600; font-size: 0.95rem; cursor: pointer; border: 1px solid transparent;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
    background: linear-gradient(135deg, var(--accent-deep), var(--accent));
    color: #fff; box-shadow: 0 4px 24px rgba(109, 90, 230, 0.35);
}
.btn-primary:hover { box-shadow: 0 6px 32px rgba(109, 90, 230, 0.5); }
.btn-ghost { border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); background: rgba(139, 124, 248, 0.08); }

/* ───── Static stats band (public benchmark headlines) ───── */
.stats-band { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-raised); }
.band-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.band-stat { padding: 2rem 1.5rem; text-align: center; }
.band-stat + .band-stat { border-left: 1px solid var(--border); }
.band-stat b {
    display: block; font-size: 2.1rem; font-weight: 800; letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--accent-bright), #5eead4);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.band-stat span { font-size: 0.85rem; color: var(--text-dim); }

/* ───── Sections ───── */
section { padding: 5rem 0; }
section + section { border-top: 1px solid var(--border); }
.eyebrow { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 0.8rem; }
h2 { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 1rem; }
h3 { font-size: 1.05rem; font-weight: 700; }
.lede { color: var(--text-dim); font-size: 1.05rem; max-width: 46rem; margin-bottom: 2.5rem; }
.lede strong, .lede b { color: var(--text); }
.note { font-size: 0.85rem; color: var(--text-faint); margin-top: 1.4rem; max-width: 52rem; }
.note b, .note strong { color: var(--text-dim); }

/* method cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: 1.2rem; margin-bottom: 2.5rem; }
.card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
    padding: 1.6rem; transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.card h3 { margin-bottom: 0.5rem; }
.card p { font-size: 0.88rem; color: var(--text-dim); }

/* result tables */
.results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-bottom: 1rem; }
.result-block h3 { margin-bottom: 0.3rem; }
.result-block h3 code { font-size: 0.85em; }
.result-meta { font-size: 0.82rem; color: var(--text-faint); margin-bottom: 0.9rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-card); }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td { padding: 0.8rem 1.1rem; text-align: left; white-space: nowrap; }
thead th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); border-bottom: 1px solid var(--border-strong); font-weight: 600; }
tbody tr + tr td { border-top: 1px solid var(--border); }
td { color: var(--text-dim); }
td:first-child { color: var(--text); font-weight: 600; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.nm td { color: var(--text); background: rgba(139, 124, 248, 0.07); }
tr.nm td:first-child { color: var(--accent-bright); }
.win { color: var(--green); font-weight: 600; }

/* ───── Community stats (filled by dashboard.js) ───── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.2rem; margin-bottom: 1rem; }
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
    padding: 1.5rem; text-align: center;
}
.stat-card.placeholder { opacity: 0.55; }
.stat-number {
    font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15;
    background: linear-gradient(135deg, var(--accent-bright), #5eead4);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-label { font-size: 0.78rem; font-weight: 600; color: var(--text-dim); margin-top: 0.5rem; text-transform: uppercase; letter-spacing: 0.06em; }
.stat-sub { font-size: 0.8rem; color: var(--text-faint); margin-top: 0.3rem; }
.sample-note { font-size: 0.88rem; color: var(--text-faint); margin-bottom: 2.5rem; max-width: 52rem; }

/* chart cards */
.chart-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
    padding: 1.6rem; margin-bottom: 1.6rem;
}
.chart-card h3 { margin-bottom: 0.35rem; }
.chart-card > p { font-size: 0.88rem; color: var(--text-dim); margin-bottom: 1.2rem; max-width: 52rem; }
.chart-wrap { height: 400px; position: relative; }
.chart-note { font-size: 0.8rem; color: var(--text-faint); margin-top: 0.9rem; }

/* community submissions table */
#submissions-table th { cursor: pointer; user-select: none; }
#submissions-table th:hover { color: var(--text-dim); }
#submissions-table th[aria-sort]::after { content: " ↕"; opacity: 0.45; }
#submissions-table th[aria-sort="ascending"]::after { content: " ↑"; opacity: 1; color: var(--accent-bright); }
#submissions-table th[aria-sort="descending"]::after { content: " ↓"; opacity: 1; color: var(--accent-bright); }
#submissions-table td.notes { white-space: normal; min-width: 220px; max-width: 320px; color: var(--text-faint); font-size: 0.84rem; }
td.placeholder { text-align: center; color: var(--text-faint); padding: 2rem; white-space: normal; }
.table-hint { font-size: 0.8rem; color: var(--text-faint); margin-top: 0.9rem; }

/* ───── Code blocks ───── */
.codeblock { position: relative; background: #0a101d; border: 1px solid var(--border-strong); border-radius: 12px; margin-bottom: 1.2rem; max-width: 52rem; }
.codeblock pre { padding: 1.3rem 1.4rem; overflow-x: auto; font-family: var(--mono); font-size: 0.83rem; line-height: 1.75; color: #c4cfe4; }
.codeblock .cmt { color: var(--text-faint); }
.codeblock .kw { color: var(--accent-bright); }
.copy-btn {
    position: absolute; top: 0.7rem; right: 0.7rem;
    background: rgba(139, 124, 248, 0.1); border: 1px solid var(--border-strong); border-radius: 7px;
    color: var(--text-dim); font-family: var(--sans); font-size: 0.72rem; font-weight: 600;
    padding: 0.3rem 0.7rem; cursor: pointer;
}
.copy-btn:hover { color: var(--text); border-color: var(--accent); }

.center-cta { margin-top: 2rem; }

/* ───── Footer ───── */
footer { border-top: 1px solid var(--border); background: var(--bg-raised); padding: 3rem 0; }
.foot-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 1.4rem; font-size: 0.875rem; }
.foot-links a { color: var(--text-dim); }
.foot-links a:hover { color: var(--text); }
.foot-meta { width: 100%; margin-top: 1.2rem; font-size: 0.8rem; color: var(--text-faint); }

/* ───── Responsive ───── */
@media (max-width: 960px) {
    h1 { font-size: 2.3rem; }
    .band-grid { grid-template-columns: repeat(2, 1fr); }
    .band-stat:nth-child(3) { border-left: none; }
    .band-stat:nth-child(n+3) { border-top: 1px solid var(--border); }
    .results-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .nav-links {
        display: none; position: absolute; top: 4rem; left: 0; right: 0;
        flex-direction: column; align-items: flex-start; gap: 0;
        background: var(--bg-raised); border-bottom: 1px solid var(--border); padding: 0.5rem 1.5rem 1rem;
    }
    .nav-links.open { display: flex; }
    .nav-links a { padding: 0.6rem 0; width: 100%; }
    .nav-toggle { display: block; }
    h1 { font-size: 1.9rem; }
    section { padding: 3.5rem 0; }
    h2 { font-size: 1.6rem; }
    .band-grid { grid-template-columns: 1fr 1fr; }
    .band-stat b { font-size: 1.6rem; }
    .chart-wrap { height: 320px; }
}
