/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Tokens ──────────────────────────────────────────────────────────────────── */
:root {
    --bg:          #000000;
    --bg-1:        #080808;
    --bg-2:        #0f0f0f;
    --bg-3:        #1a1a1a;
    --border:      #222222;
    --border-hi:   #3a3a3a;
    --text:        #f0f0f0;
    --text-mid:    #888888;
    --text-dim:    #444444;
    --accent:      #ffffff;
    --green:       #5fff87;
    --cyan:        #7fdbff;
    --mono:        'JetBrains Mono', 'Courier New', monospace;
    --serif:       'Playfair Display', Georgia, serif;
    --sans:        'Inter', system-ui, sans-serif;
    --nav-h:       60px;
    --max-w:       1100px;
    --radius:      3px;
}

/* ── Base ────────────────────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

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

/* ── Scanlines ───────────────────────────────────────────────────────────────── */
.scanlines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.04) 2px,
        rgba(0,0,0,0.04) 4px
    );
}

/* ── Nav ─────────────────────────────────────────────────────────────────────── */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-h);
    z-index: 100;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s, background 0.3s;
}
.nav.scrolled {
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(12px);
    border-color: var(--border);
}
.nav-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    height: 100%;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
}
.nav-logo {
    font-family: var(--mono);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    color: var(--accent);
    margin-right: auto;
}
.nav-links {
    display: flex;
    gap: 2rem;
}
.nav-links a {
    font-size: 0.85rem;
    color: var(--text-mid);
    transition: color 0.2s;
    letter-spacing: 0.02em;
}
.nav-links a:hover { color: var(--accent); }
.nav-cta {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--bg);
    background: var(--accent);
    border: none;
    padding: 0.45rem 1rem;
    cursor: pointer;
    border-radius: var(--radius);
    transition: opacity 0.2s;
    white-space: nowrap;
}
.nav-cta:hover { opacity: 0.85; }

/* ── Hero ────────────────────────────────────────────────────────────────────── */
.hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 4rem;
    padding: calc(var(--nav-h) + 4rem) 2rem 4rem;
    max-width: var(--max-w);
    margin: 0 auto;
    position: relative;
}

/* subtle grid bg */
.hero-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 20%, black, transparent);
}

.hero-inner {
    position: relative;
    z-index: 1;
    animation: fadeUp 0.8s ease both;
}

.hero-badge {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--text-mid);
    border: 1px solid var(--border-hi);
    padding: 0.3rem 0.8rem;
    border-radius: 2px;
    letter-spacing: 0.08em;
    margin-bottom: 2rem;
    text-transform: uppercase;
}

.hero-banner {
    font-family: var(--mono);
    font-size: 0.58rem;
    line-height: 1.2;
    color: var(--accent);
    display: block;
    margin-bottom: 2rem;
    white-space: pre;
    text-shadow: 0 0 30px rgba(255,255,255,0.08);
    overflow-x: auto;
}

.hero-tagline {
    font-family: var(--serif);
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-mid);
    margin-bottom: 1rem;
}

.hero-desc {
    font-size: 1rem;
    color: var(--text-mid);
    max-width: 520px;
    margin-bottom: 2.5rem;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--accent);
    color: var(--bg);
    border: none;
    padding: 0.75rem 1.5rem;
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius);
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(255,255,255,0.12);
}
.btn-icon {
    color: var(--text-dim);
    font-size: 0.9em;
}
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--border-hi);
    color: var(--text-mid);
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    border-radius: var(--radius);
    transition: border-color 0.2s, color 0.2s;
}
.btn-secondary:hover {
    border-color: var(--text-mid);
    color: var(--accent);
}

.hero-providers {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.provider-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.providers {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.provider {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--text-mid);
}
.provider-sep {
    color: var(--text-dim);
}

/* ── Terminal Demo ───────────────────────────────────────────────────────────── */
.hero-terminal {
    position: relative;
    z-index: 1;
    border: 1px solid var(--border-hi);
    border-radius: 6px;
    background: var(--bg-1);
    overflow: hidden;
    animation: fadeUp 0.8s 0.15s ease both;
    box-shadow: 0 0 60px rgba(255,255,255,0.03), inset 0 1px 0 rgba(255,255,255,0.04);
}
.terminal-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
}
.t-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
}
.t-red    { background: #ff5f57; }
.t-yellow { background: #febc2e; }
.t-green  { background: #28c840; }
.t-title {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--text-dim);
    margin: 0 auto;
}
.terminal-body {
    padding: 1.25rem 1.5rem;
    font-family: var(--mono);
    font-size: 0.78rem;
    line-height: 1.8;
    min-height: 320px;
    color: var(--text-mid);
}
.t-line { display: block; margin-bottom: 2px; }
.t-prompt { color: var(--green); }
.t-cmd    { color: var(--accent); }
.t-agent  { color: var(--cyan); }
.t-tool   { color: var(--text-dim); }
.t-dim    { color: var(--text-dim); }
.t-cursor {
    display: inline-block;
    width: 7px;
    height: 1em;
    background: var(--accent);
    vertical-align: text-bottom;
    animation: blink 1.1s step-end infinite;
}

/* ── Sections ────────────────────────────────────────────────────────────────── */
.section { padding: 6rem 2rem; }
.section-alt { background: var(--bg-1); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-inner { max-width: var(--max-w); margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 4rem; }
.section-header h2 {
    font-family: var(--serif);
    font-size: 2.25rem;
    font-weight: 400;
    margin-bottom: 0.75rem;
    color: var(--accent);
}
.section-header p { color: var(--text-mid); font-size: 1rem; }

/* ── Features Grid ───────────────────────────────────────────────────────────── */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.feature {
    background: var(--bg-1);
    padding: 2.5rem 2rem;
    border: 1px solid var(--border);
    transition: background 0.25s;
    position: relative;
}
.feature:hover { background: var(--bg-2); }
.feature-icon {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 1.25rem;
    letter-spacing: 0.05em;
}
.feature h3 {
    font-family: var(--serif);
    font-size: 1.15rem;
    font-weight: 400;
    margin-bottom: 0.75rem;
    color: var(--accent);
}
.feature p { font-size: 0.9rem; color: var(--text-mid); line-height: 1.8; }

/* ── Commands Table ──────────────────────────────────────────────────────────── */
.commands-table-wrap {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.commands-table {
    width: 100%;
    border-collapse: collapse;
}
.commands-table thead th {
    background: var(--bg-2);
    padding: 0.9rem 1.5rem;
    text-align: left;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-mid);
    border-bottom: 1px solid var(--border);
}
.commands-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}
.commands-table tbody tr:last-child { border-bottom: none; }
.commands-table tbody tr:hover { background: var(--bg-2); }
.commands-table td {
    padding: 0.85rem 1.5rem;
    font-size: 0.875rem;
    color: var(--text-mid);
}
.commands-table td:first-child { width: 220px; }
.commands-table code {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--accent);
    background: var(--bg-3);
    padding: 0.2rem 0.55rem;
    border-radius: 2px;
    border: 1px solid var(--border);
}

/* ── Install Steps ───────────────────────────────────────────────────────────── */
.install-steps {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    max-width: 700px;
    margin: 0 auto;
}
.install-step {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 2rem;
    align-start: start;
}
.step-num {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--text-dim);
    letter-spacing: 0.1em;
    padding-top: 0.25rem;
}
.step-body h3 {
    font-family: var(--serif);
    font-size: 1.15rem;
    font-weight: 400;
    color: var(--accent);
    margin-bottom: 0.4rem;
}
.step-body > p {
    font-size: 0.875rem;
    color: var(--text-mid);
    margin-bottom: 1rem;
}
.code-block {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-2);
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.72rem;
    color: var(--text-dim);
    letter-spacing: 0.08em;
}
.copy-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-family: var(--mono);
    font-size: 0.68rem;
    padding: 0.2rem 0.5rem;
    cursor: pointer;
    border-radius: 2px;
    transition: color 0.2s, border-color 0.2s;
}
.copy-btn:hover { color: var(--accent); border-color: var(--text-mid); }
.code-block pre {
    padding: 1rem 1.25rem;
    background: var(--bg-1);
}
.code-block code {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--accent);
}

/* ── CTA ─────────────────────────────────────────────────────────────────────── */
.cta-section {
    padding: 6rem 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
}
.cta-inner { max-width: 600px; margin: 0 auto; }
.cta-inner h2 {
    font-family: var(--serif);
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 0.75rem;
    color: var(--accent);
}
.cta-inner p {
    color: var(--text-mid);
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* ── Footer ──────────────────────────────────────────────────────────────────── */
.footer {
    border-top: 1px solid var(--border);
    padding: 2.5rem 2rem;
}
.footer-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}
.footer-logo {
    font-family: var(--mono);
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    color: var(--text-mid);
    margin-right: auto;
}
.footer-tag {
    font-family: var(--serif);
    font-style: italic;
    font-size: 0.85rem;
    color: var(--text-dim);
}
.footer-links {
    display: flex;
    gap: 1.5rem;
}
.footer-links a {
    font-size: 0.8rem;
    color: var(--text-dim);
    transition: color 0.2s;
}
.footer-links a:hover { color: var(--text-mid); }

/* ── Toast ───────────────────────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--bg-3);
    border: 1px solid var(--border-hi);
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.78rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius);
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
    z-index: 999;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Animations ──────────────────────────────────────────────────────────────── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}
@keyframes typeIn {
    from { width: 0; }
    to   { width: 100%; }
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 3rem;
        min-height: auto;
        padding-top: calc(var(--nav-h) + 3rem);
    }
    .hero-terminal { display: none; }
    .features-grid { grid-template-columns: 1fr; }
    .hero-banner { font-size: 0.42rem; }
}

@media (max-width: 600px) {
    .nav-links { display: none; }
    .section { padding: 4rem 1.25rem; }
    .install-step { grid-template-columns: 1fr; gap: 0.75rem; }
    .step-num { display: none; }
}


/* ── Live Connect ────────────────────────────────────────────────────────────── */
.live-section { border-top: 1px solid var(--border); }

.live-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.live-header h2 {
    font-family: var(--serif);
    font-size: 2.25rem;
    font-weight: 400;
    color: var(--accent);
}
.live-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--text-dim);
    flex-shrink: 0;
    transition: background 0.4s;
}
.live-dot.connected { background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulse 2s infinite; }
.live-dot.error     { background: #ff5f57; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.live-badge {
    font-family: var(--mono); font-size: 0.7rem; color: var(--text-dim);
    border: 1px solid var(--border); padding: 0.2rem 0.6rem;
    border-radius: 2px; letter-spacing: 0.08em; text-transform: uppercase; transition: color 0.3s, border-color 0.3s;
}
.live-badge.connected { color: var(--green); border-color: var(--green); }
.live-badge.error     { color: #ff5f57; border-color: #ff5f57; }
.live-desc { color: var(--text-mid); font-size: 0.95rem; margin-bottom: 2rem; max-width: 680px; }
.live-desc code { font-family: var(--mono); font-size: 0.85em; color: var(--accent); background: var(--bg-3); padding: 0.1rem 0.4rem; border-radius: 2px; border: 1px solid var(--border); }
.live-panel { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg-1); }
.live-info { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 1rem; background: var(--bg-2); border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: 0.7rem; }
.live-info-item { color: var(--text-dim); }
.live-info-sep  { color: var(--border-hi); }
.live-messages { min-height: 260px; max-height: 400px; overflow-y: auto; padding: 1.25rem 1.5rem; display: flex; flex-direction: column; gap: 1rem; scroll-behavior: smooth; }
.live-placeholder { color: var(--text-dim); font-family: var(--mono); font-size: 0.78rem; margin: auto; text-align: center; padding: 2rem; }
.live-msg { display: flex; flex-direction: column; gap: 0.25rem; animation: fadeUp 0.3s ease; }
.live-msg-label { font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); }
.live-msg.user  .live-msg-label { color: var(--cyan); }
.live-msg.agent .live-msg-label { color: var(--green); }
.live-msg-text { font-size: 0.875rem; color: var(--text-mid); line-height: 1.7; white-space: pre-wrap; }
.live-msg.agent .live-msg-text { color: var(--text); }
.live-status-msg { font-family: var(--mono); font-size: 0.72rem; color: var(--text-dim); padding-left: 0.5rem; border-left: 2px solid var(--border-hi); animation: fadeUp 0.2s ease; }
.live-input-row { display: flex; border-top: 1px solid var(--border); }
.live-input { flex: 1; background: transparent; border: none; outline: none; color: var(--text); font-family: var(--mono); font-size: 0.85rem; padding: 0.85rem 1.25rem; }
.live-input::placeholder { color: var(--text-dim); }
.live-input:disabled { opacity: 0.4; cursor: not-allowed; }
.live-send { background: none; border: none; border-left: 1px solid var(--border); color: var(--text-mid); font-family: var(--mono); font-size: 0.8rem; padding: 0.85rem 1.25rem; cursor: pointer; transition: color 0.2s, background 0.2s; }
.live-send:hover:not(:disabled) { color: var(--accent); background: var(--bg-3); }
.live-send:disabled { opacity: 0.3; cursor: not-allowed; }
