:root {
    --nav-height: 56px;
    --max-width: 960px;
    --bg: #0f1117;
    --bg-nav: #161922;
    --bg-footer: #161922;
    --text: #e1e4ea;
    --text-muted: #6b7280;
    --accent: #3b82f6;
    --border: #1e2330;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    --font-mono: "SF Mono", SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Nav ── */

.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border);
    height: var(--nav-height);
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: color 0.15s;
}

.nav-links a:hover {
    color: var(--text);
}

/* Hamburger */

.nav-toggle-checkbox {
    display: none;
}

.nav-toggle-label {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    width: 24px;
    height: 24px;
}

.nav-toggle-label span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-muted);
    border-radius: 1px;
    transition: transform 0.2s, opacity 0.2s;
}

/* ── Content ── */

.content {
    flex: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1rem;
    width: 100%;
}

.content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.content p {
    color: var(--text-muted);
    font-size: 1.125rem;
}

/* ── Hero ── */

.hero {
    text-align: center;
    padding: 4rem 0 3rem;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
}

.hero-sub {
    color: var(--text-muted);
    font-size: 1.125rem;
    max-width: 540px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.hero-sub code {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 0.95em;
}

.hero-cta {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 0.75rem 2rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.15s;
}

.hero-cta:hover {
    background: #2563eb;
}

/* ── Terminal ── */

.terminal {
    max-width: 640px;
    margin: 0 auto 3rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: #0a0c10;
}

.terminal-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: #161922;
    border-bottom: 1px solid var(--border);
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-bar-title {
    margin-left: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.terminal-body {
    padding: 1rem 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.7;
    min-height: 280px;
}

.terminal-line {
    white-space: pre-wrap;
    word-break: break-all;
}

.terminal-cursor::after {
    content: "▋";
    animation: blink 0.8s step-end infinite;
    color: var(--accent);
}

@keyframes blink {
    50% { opacity: 0; }
}

.terminal-success {
    color: #28c840;
}

.terminal-progress {
    color: var(--accent);
}

/* ── Features ── */

.features {
    display: flex;
    gap: 2rem;
    padding: 1rem 0 3rem;
}

.feature {
    flex: 1;
}

.feature-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.feature-desc {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.5;
}

.feature-desc code {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 0.9em;
}

/* ── Forms ── */

.form-page {
    max-width: 420px;
    margin: 2rem auto;
}

.form-page h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.form-intro {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-field label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-field input {
    background: #0a0c10;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.625rem 0.75rem;
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s;
}

.form-field input:focus {
    border-color: var(--accent);
}

.form-error {
    color: #ef4444;
    font-size: 0.8125rem;
}

.form-error-top {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.form-submit {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.75rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 0.5rem;
}

.form-submit:hover {
    background: #2563eb;
}

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.form-footer a {
    color: var(--accent);
}

.form-footer a:hover {
    text-decoration: underline;
}

/* ── Message pages ── */

.message-page {
    max-width: 480px;
    margin: 3rem auto;
    text-align: center;
}

.message-page h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.message-page p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.message-muted {
    font-size: 0.8125rem !important;
    margin-top: 1.5rem !important;
}

.api-key-box {
    background: #0a0c10;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
    margin: 1.25rem 0;
    word-break: break-all;
}

.api-key-box code {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 0.9rem;
}

.terminal-inline {
    background: #0a0c10;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text);
    text-align: left;
    margin: 1rem 0;
}

/* ── Dashboard ── */

.dashboard {
    max-width: 640px;
    margin: 2rem auto;
}

.dashboard h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

.dashboard-section {
    margin-bottom: 2rem;
}

.dashboard-section h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ── Footer ── */

.footer {
    background: var(--bg-footer);
    border-top: 1px solid var(--border);
    padding: 1.5rem 1rem;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
}

.footer p {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* ── Mobile ── */

@media (max-width: 768px) {
    .nav-toggle-label {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--bg-nav);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 1rem;
        gap: 0;
    }

    .nav-links a {
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border);
        font-size: 1rem;
    }

    .nav-links a:last-child {
        border-bottom: none;
    }

    .nav-toggle-checkbox:checked ~ .nav-links {
        display: flex;
    }

    /* Animate hamburger to X */
    .nav-toggle-checkbox:checked ~ .nav-toggle-label span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .nav-toggle-checkbox:checked ~ .nav-toggle-label span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle-checkbox:checked ~ .nav-toggle-label span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .hero {
        padding: 2.5rem 0 2rem;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-sub {
        font-size: 1rem;
    }

    .terminal-body {
        font-size: 0.75rem;
        min-height: 240px;
    }

    .features {
        flex-direction: column;
        gap: 1.5rem;
    }
}
