:root {
    --bg: #0a0c10;
    --bg-alt: #0f1117;
    --surface: #161921;
    --surface-hover: #1e2230;
    --border: #252a3a;
    --text: #e1e4ed;
    --text-muted: #7c8299;
    --accent: #5b7fff;
    --accent-hover: #7b9aff;
    --accent-glow: rgba(91, 127, 255, 0.15);
    --danger: #ff6b6b;
    --danger-hover: #ff8787;
    --success: #51cf66;
    --warning: #ffd43b;
    --radius: 8px;
    --radius-lg: 12px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --mono: 'SF Mono', 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

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

.container { max-width: 1000px; margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: 440px; margin: 0 auto; padding: 0 1.5rem; }

/* ── Navbar ── */
.navbar {
    background: rgba(15, 17, 23, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1.5rem;
}
.brand {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.brand-icon { font-size: 1.1rem; }
.nav-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}
.nav-user { color: var(--text-muted); font-size: 0.8125rem; }
.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.15s;
}
.nav-link:hover { color: var(--text); }
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ── Hero ── */
.hero {
    text-align: center;
    padding: 5rem 1.5rem 4rem;
    max-width: 720px;
    margin: 0 auto;
}
.hero-badge {
    display: inline-block;
    background: var(--accent-glow);
    border: 1px solid rgba(91, 127, 255, 0.25);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    margin-bottom: 1.5rem;
}
.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 1.25rem;
}
.hero h1 .accent { color: var(--accent); }
.hero .lead {
    font-size: 1.2rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2.5rem;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}
.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ── Terminal mockup ── */
.terminal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-align: left;
    max-width: 600px;
    margin: 3rem auto 0;
}
.terminal-bar {
    background: rgba(255,255,255,0.03);
    padding: 0.6rem 1rem;
    display: flex;
    gap: 0.4rem;
    border-bottom: 1px solid var(--border);
}
.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
}
.terminal-body {
    padding: 1.25rem 1.5rem;
    font-family: var(--mono);
    font-size: 0.8125rem;
    line-height: 1.9;
    color: var(--text-muted);
}
.terminal-body .cmd { color: var(--success); }
.terminal-body .prompt { color: var(--accent); }
.terminal-body .output { color: var(--text-muted); opacity: 0.7; }

/* ── Features grid ── */
.features {
    padding: 4rem 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}
.features h2 {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}
.features .section-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 3rem;
    font-size: 1.05rem;
}
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}
.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: border-color 0.2s, transform 0.2s;
}
.feature-card:hover {
    border-color: rgba(91, 127, 255, 0.3);
    transform: translateY(-2px);
}
.feature-icon {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}
.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.feature-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ── How it works ── */
.how-it-works {
    padding: 4rem 1.5rem;
    max-width: 700px;
    margin: 0 auto;
    border-top: 1px solid var(--border);
}
.how-it-works h2 {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
}
.step {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 2rem;
    align-items: flex-start;
}
.step-number {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: var(--accent-glow);
    border: 1px solid rgba(91, 127, 255, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--accent);
}
.step h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; }
.step p { font-size: 0.875rem; color: var(--text-muted); }
.step code {
    font-family: var(--mono);
    background: var(--bg);
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.8125rem;
    border: 1px solid var(--border);
}

/* ── CTA section ── */
.cta-section {
    text-align: center;
    padding: 4rem 1.5rem;
    border-top: 1px solid var(--border);
}
.cta-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}
.cta-section p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

/* ── Auth pages (login/register) ── */
.auth-container {
    max-width: 400px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}
.auth-container h1 {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}
.auth-container .subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}
.auth-footer {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ── Docs page ── */
.docs {
    padding: 2rem 0 4rem;
}
.docs h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.docs .lead {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-bottom: 2.5rem;
}
.docs h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 2.5rem 0 0.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    color: var(--text);
}
.docs h2:first-of-type { border-top: none; padding-top: 0; }
.docs h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem;
    color: var(--text);
}
.docs p {
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    font-size: 0.9375rem;
}
.docs ul, .docs ol {
    color: var(--text-muted);
    margin: 0.5rem 0 1rem 1.5rem;
    font-size: 0.9375rem;
}
.docs li { margin-bottom: 0.35rem; }
pre {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin-bottom: 1rem;
    font-family: var(--mono);
    font-size: 0.8125rem;
    line-height: 1.7;
    color: var(--text-muted);
}
.docs code {
    font-family: var(--mono);
    background: var(--surface);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8125rem;
    border: 1px solid var(--border);
}
.docs pre code {
    background: none;
    border: none;
    padding: 0;
}
.docs-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}
.docs-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid var(--border);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.docs-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}
.docs-table td code {
    font-size: 0.8125rem;
}

/* ── Cards ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

/* ── Forms ── */
.form-group { margin-bottom: 1.25rem; }
label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}
input[type="email"],
input[type="password"],
input[type="text"] {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.9375rem;
    font-family: var(--font);
    transition: border-color 0.15s;
}
input:focus { outline: none; border-color: var(--accent); }
.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--text-muted); color: var(--text); }
.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.8rem 2rem; font-size: 1rem; }

/* ── Dashboard ── */
h1.page-title { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; letter-spacing: -0.02em; }
.page-subtitle { color: var(--text-muted); margin-bottom: 2rem; }
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
}
.stat-value { font-size: 2rem; font-weight: 700; color: var(--accent); line-height: 1; }
.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.4rem;
}

/* ── Secrets table ── */
.secrets-table { width: 100%; border-collapse: collapse; }
.secrets-table th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}
.secrets-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9375rem;
}
.secrets-table tr:last-child td { border-bottom: none; }
.secrets-table tr:hover td { background: var(--surface-hover); }
.secrets-id { font-family: var(--mono); font-size: 0.8125rem; }
.version-badge {
    display: inline-block;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.15rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--mono);
}

/* ── Alert ── */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}
.alert-error {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: var(--danger);
}
.alert-success {
    background: rgba(81, 207, 102, 0.1);
    border: 1px solid rgba(81, 207, 102, 0.3);
    color: var(--success);
}

/* ── Empty state ── */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state p { margin-bottom: 0.5rem; }
.empty-state code {
    font-family: var(--mono);
    background: var(--bg);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

/* ── Footer ── */
.site-footer {
    margin-top: 5rem;
    padding: 3rem 0 2rem;
    border-top: 1px solid var(--border);
    background: var(--bg-alt);
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}
.footer-brand {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}
.footer-desc { color: var(--text-muted); font-size: 0.875rem; max-width: 280px; }
.footer-heading {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}
.footer-grid a {
    display: block;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    text-decoration: none;
}
.footer-grid a:hover { color: var(--text); }
.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .hero .lead { font-size: 1rem; }
    .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
    .feature-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .nav-right { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); padding: 1rem 1.5rem; border-bottom: 1px solid var(--border); gap: 0.75rem; }
    .nav-right.open { display: flex; }
    .mobile-toggle { display: block; }
    .secrets-table th:nth-child(3), .secrets-table td:nth-child(3) { display: none; }
}
