/* =============================================
   DESIGN TOKENS
   ============================================= */
:root {
    --bg: #ffffff;
    --bg-alt: #f7f8fa;
    --surface: #ffffff;
    --border: #e8eaed;

    --text: #1a1a2e;
    --text-muted: #5f6368;
    --text-light: #9aa0a6;

    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-light: #eef2ff;

    --success: #0d9488;
    --warning: #d97706;

    --font: 'Inter', system-ui, sans-serif;
    --mono: 'JetBrains Mono', monospace;

    --radius: 10px;
    --radius-lg: 16px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.05);
}

/* Dark Mode */
body.dark {
    --bg: #0f1117;
    --bg-alt: #161b27;
    --surface: #1c2333;
    --border: rgba(255,255,255,0.08);

    --text: #e8eaed;
    --text-muted: #9aa0a6;
    --text-light: #5f6368;

    --accent: #818cf8;
    --accent-hover: #6366f1;
    --accent-light: rgba(79,70,229,0.12);

    --shadow: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.4);
}

/* =============================================
   RESET & BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background .3s, color .3s;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* =============================================
   NAV
   ============================================= */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: background .3s;
}

body.dark .nav {
    background: rgba(15,17,23,0.85);
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}

.dot { color: var(--accent); }

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

.nav-links a {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: color .2s;
}

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

/* =============================================
   BUTTONS
   ============================================= */
.btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius);
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background .2s, transform .1s;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius);
    font-family: var(--font);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all .2s;
}

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

.btn-nav {
    background: var(--accent);
    color: #fff !important;
    padding: 0.45rem 1.1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
}

.btn-nav:hover { background: var(--accent-hover) !important; }

.btn-sm {
    padding: 0.5rem 1.1rem;
    font-size: 0.875rem;
    border-radius: 8px;
    align-self: flex-start;
}

.full-width { width: 100%; }

.text-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font);
    transition: color .2s;
}

.text-btn:hover { color: var(--text); }

.link-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.95rem;
    cursor: pointer;
    font-family: var(--font);
    font-weight: 500;
}

/* =============================================
   PAGE SECTIONS
   ============================================= */
.page { padding-top: 60px; }

.section {
    padding: 6rem 2rem;
}

.section.alt-bg { background: var(--bg-alt); }

.section-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.section-inner.narrow {
    max-width: 700px;
}

.section h2 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.section-sub {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 3rem;
}

/* =============================================
   HERO
   ============================================= */
.hero {
    padding: 6rem 2rem 5rem;
    background: var(--bg);
}

.hero-inner {
    max-width: 780px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    padding: 0.3rem 0.85rem;
    border-radius: 9999px;
    width: fit-content;
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.25rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.2;
    color: var(--text);
}

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

.hero-sub {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

/* CODE BLOCK */
.hero-code-block {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 1rem;
}

.code-label {
    padding: 0.7rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #8b949e;
    border-bottom: 1px solid #21262d;
    font-family: var(--font);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.code-snippet {
    padding: 1.5rem 1.25rem;
    font-family: var(--mono);
    font-size: 0.875rem;
    color: #c9d1d9;
    line-height: 1.8;
    white-space: pre;
    overflow-x: auto;
}

.code-snippet .kw { color: #ff7b72; }
.code-snippet .str { color: #a5d6ff; }
.code-snippet .cmt { color: #8b949e; font-style: italic; }

/* =============================================
   HOW IT WORKS — STEPS
   ============================================= */
.steps {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-top: 3rem;
}

@media (max-width: 700px) {
    .steps { flex-direction: column; }
    .step-arrow { display: none; }
}

.step {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.step-num {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.1em;
    font-family: var(--mono);
}

.step h3 {
    font-size: 1.05rem;
    font-weight: 600;
}

.step p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.step-arrow {
    padding-top: 2.5rem;
    color: var(--text-light);
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* =============================================
   VALUE CARDS
   ============================================= */
.value-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.value-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: box-shadow .2s;
}

.value-card:hover {
    box-shadow: var(--shadow-lg);
}

.value-icon {
    font-size: 1.75rem;
}

.value-card h3 {
    font-size: 1rem;
    font-weight: 600;
}

.value-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* =============================================
   PRICING
   ============================================= */
.pricing-grid {
    display: flex;
    gap: 1.5rem;
    margin-top: 3rem;
    justify-content: center;
    flex-wrap: wrap;
}

.pricing-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 340px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: relative;
    transition: box-shadow .2s, border-color .2s;
}

.pricing-card:hover {
    box-shadow: var(--shadow-lg);
}

.pricing-card.featured {
    border-color: var(--accent);
}

.featured-tag {
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.9rem;
    border-radius: 9999px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
}

.plan-name {
    font-size: 1.1rem;
    font-weight: 700;
}

.plan-price {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.per {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
}

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

.plan-perks {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.plan-perks li { display: flex; align-items: center; gap: 0.5rem; }

.pricing-btn { margin-top: auto; }

.pricing-note {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* =============================================
   FAQ
   ============================================= */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 2.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface);
}

.faq-item {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.faq-item:last-child { border-bottom: none; }

.faq-q {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.faq-a {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
    border-top: 1px solid var(--border);
    padding: 2.5rem 2rem;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-logo {
    font-weight: 700;
    font-size: 1rem;
}

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

/* =============================================
   OVERLAY / DASHBOARD MODAL
   ============================================= */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.overlay-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.close-btn {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    transition: background .2s;
}

.close-btn:hover { background: var(--bg-alt); }

#email-gate h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.35rem;
}

.gate-sub {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.form-group input {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.95rem;
    color: var(--text);
    font-family: var(--font);
    outline: none;
    transition: border-color .2s;
}

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

.plan-radios {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.plan-radio {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.9rem;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    font-size: 0.9rem;
    font-weight: 500;
}

.plan-radio input { accent-color: var(--accent); width: 16px; height: 16px; }

.plan-radio.active {
    border-color: var(--accent);
    background: var(--accent-light);
}

.radio-desc {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    margin-top: 0.1rem;
}

.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-light);
    font-size: 0.8rem;
    margin: 1rem 0;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* DASHBOARD CONTENT */
.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.dash-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.dash-plan-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--success);
    background: rgba(13,148,136,0.1);
    border: 1px solid rgba(13,148,136,0.2);
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
    margin-top: 0.3rem;
}

.key-box {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.key-box input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.75rem;
    font-family: var(--mono);
    font-size: 0.875rem;
    color: var(--text);
    outline: none;
}

.copy-btn {
    background: none;
    border: none;
    border-left: 1px solid var(--border);
    padding: 0 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    font-family: var(--font);
    transition: background .2s;
}

.copy-btn:hover { background: var(--accent-light); }

.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-box {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stat-val {
    font-size: 1.1rem;
    font-weight: 700;
}

.stat-val.accent { color: var(--accent); }

.stat-bar {
    height: 4px;
    background: var(--border);
    border-radius: 9999px;
    overflow: hidden;
    margin-top: 0.25rem;
}

#stat-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 9999px;
    transition: width .3s;
}

/* PLAYGROUND */
.playground {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.playground-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.playground-top select {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    color: var(--text);
    font-family: var(--font);
    outline: none;
    cursor: pointer;
}

.playground textarea {
    resize: none;
    height: 80px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem;
    font-family: var(--font);
    font-size: 0.9rem;
    color: var(--text);
    background: var(--bg);
    outline: none;
    transition: border-color .2s;
}

.playground textarea:focus { border-color: var(--accent); }

.terminal {
    background: #0d1117;
    border: 1px solid #21262d;
    border-radius: 8px;
    overflow: hidden;
    font-family: var(--mono);
}

.terminal-bar {
    padding: 0.5rem 0.85rem;
    border-bottom: 1px solid #21262d;
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #8b949e;
}

.pg-status::before {
    content: '●  ';
}

.pg-status.loading { color: #e3b341; }
.pg-status.success { color: #3fb950; }
.pg-status.error { color: #f85149; }

.terminal-out {
    padding: 1rem;
    font-size: 0.82rem;
    color: #c9d1d9;
    min-height: 100px;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.think-block {
    color: #8b5cf6;
    font-style: italic;
    border-left: 2px solid #8b5cf6;
    padding-left: 8px;
    margin-bottom: 8px;
}

/* =============================================
   TOAST
   ============================================= */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--text);
    color: var(--bg);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.65rem 1.25rem;
    border-radius: 8px;
    z-index: 999;
    box-shadow: var(--shadow-lg);
}

/* =============================================
   UTILITIES
   ============================================= */
.hidden { display: none !important; }

@media (max-width: 600px) {
    .hero { padding: 4rem 1.5rem 3rem; }
    .section { padding: 4rem 1.5rem; }
    .stats-row { grid-template-columns: 1fr; }
    .hero-actions { flex-direction: column; width: 100%; }
    .btn-primary, .btn-ghost { width: 100%; text-align: center; }
}
