:root {
    --bg: #050505;
    --fg: #ffffff;
    --dim: #a0a0a0;
    --border: #1f1f1f;
    --surface: #0f0f0f;
    --green: #10b981;
    --red: #ef4444;
    --font: 'Inter', -apple-system, sans-serif;
    --radius: 10px;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--fg);
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.view {
    display: none;
    min-height: 100vh;
}

.view.active {
    display: block;
}

.hidden {
    display: none !important;
}

/* Nav */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.bar-inner {
    max-width: 960px;
    margin: 0 auto;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.wordmark {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--fg);
    text-decoration: none;
}

.bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--dim);
    text-decoration: none;
    transition: color 0.15s;
}

.nav-link:hover {
    color: var(--fg);
}

/* Buttons */
.btn-fill {
    padding: 8px 18px;
    background: var(--fg);
    color: var(--bg);
    border: none;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s;
}

.btn-fill:hover {
    opacity: 0.85;
}

.btn-fill:active {
    opacity: 0.7;
}

.btn-ghost {
    padding: 8px 18px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    color: var(--dim);
    transition: all 0.15s;
}

.btn-ghost:hover {
    border-color: var(--fg);
    color: var(--fg);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
    padding: 12px;
}

/* Hero */
.hero {
    padding: 100px 24px 80px;
    text-align: center;
}

.hero-inner {
    max-width: 600px;
    margin: 0 auto;
}

.tag {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.15em;
    color: var(--dim);
    margin-bottom: 20px;
}

h1 {
    font-size: 56px;
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: 20px;
}

.lead {
    font-size: 17px;
    color: var(--dim);
    line-height: 1.6;
    margin-bottom: 36px;
}

.hero-cta {
    display: flex;
    justify-content: center;
}

/* Feature Grid */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px 100px;
}

.card {
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: border-color 0.2s;
}

.card:hover {
    border-color: var(--fg);
}

.card-icon {
    font-size: 12px;
    font-weight: 800;
    color: var(--dim);
    margin-bottom: 20px;
    letter-spacing: 0.05em;
}

.card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.card p {
    font-size: 14px;
    color: var(--dim);
    line-height: 1.5;
}

/* Guide */
.guide-section {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px 100px;
}

.guide-section h2 {
    font-size: 36px;
    font-weight: 900;
    letter-spacing: -0.04em;
    margin-bottom: 40px;
}

.guide-section .tag {
    margin-bottom: 12px;
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 48px;
}

.step {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.step-num {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--fg);
    color: #000000;
    font-size: 14px;
    font-weight: 800;
}

.step-body h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.step-body p {
    font-size: 14px;
    color: var(--dim);
    line-height: 1.5;
}

.code-preview {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.code-preview-head {
    padding: 10px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    color: var(--dim);
}

.code-preview pre {
    padding: 20px;
    margin: 0;
    font-size: 13px;
    line-height: 1.7;
    overflow-x: auto;
}

/* Dashboard */
.content {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 24px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.content-header h2 {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.sub {
    font-size: 14px;
    color: var(--dim);
    margin-top: 4px;
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.proj-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: border-color 0.15s;
}

.proj-row:hover {
    border-color: var(--dim);
}

.proj-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.proj-name {
    font-size: 15px;
    font-weight: 700;
}

.proj-meta {
    font-size: 12px;
    color: var(--dim);
    font-family: 'JetBrains Mono', monospace;
}

.proj-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
}

.username-label {
    font-size: 13px;
    font-weight: 600;
}

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
}

/* Overlay / Dialogs */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.overlay.active {
    display: flex;
}

.dialog {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    padding: 28px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dialog-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dialog-head h3 {
    font-size: 16px;
    font-weight: 700;
}

.close-dlg {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--dim);
    line-height: 1;
}

.dialog-desc {
    font-size: 14px;
    color: var(--dim);
    margin-bottom: 16px;
}

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--dim);
    margin-bottom: 6px;
}

.field input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--fg);
}

.field input:focus {
    outline: none;
    border-color: var(--fg);
}

.code-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 16px;
    border-radius: 10px;
    position: relative;
}

pre {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 12px;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
    margin-bottom: 12px;
    color: var(--fg);
}

.copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
}

/* Toasts */
#toasts {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 10px 20px;
    background: var(--fg);
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    animation: fadeIn 0.2s ease-out;
}

.toast.err {
    background: var(--red);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--dim);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 36px;
    }

    .grid-3 {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 60px 24px 40px;
    }

    .proj-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .proj-right {
        width: 100%;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Public Stats */
.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
}

.stats-header h2 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.stats-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--green);
    color: #fff;
}

.stats-badge.inactive {
    background: var(--dim);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 40px;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.stat-num {
    font-size: 36px;
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stats-footer {
    font-size: 13px;
    color: var(--dim);
}