:root {
    --ink: #0c0d1f;
    --muted: #5a5e7a;
    --bg: #f7f7fb;
    --surface: #ffffff;
    --surface-2: #f1f1f6;
    --border: rgba(12, 13, 31, 0.08);
    --border-2: rgba(12, 13, 31, 0.14);
    --brand: #5E63FF;
    --brand-2: #3437C9;
    --brand-soft: rgba(94, 99, 255, 0.08);
    --brand-soft-2: rgba(94, 99, 255, 0.16);
    --code-bg: #0f1228;
    --code-ink: #e6e8ff;
    --code-muted: #8a8fc7;
    --code-keyword: #c891ff;
    --code-string: #a5e887;
    --code-comment: #6b7299;
    --shadow-sm: 0 1px 2px rgba(12,13,31,0.05), 0 1px 1px rgba(12,13,31,0.04);
    --shadow-md: 0 8px 32px rgba(12,13,31,0.10), 0 2px 6px rgba(12,13,31,0.06);
    --shadow-lg: 0 24px 60px rgba(12,13,31,0.18), 0 4px 12px rgba(12,13,31,0.08);
    --radius: 14px;
    --radius-sm: 8px;
    --radius-lg: 22px;
    --max: 1180px;
    --hero-grad: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(94,99,255,0.18), transparent 60%),
                 radial-gradient(ellipse 60% 50% at 90% 30%, rgba(123,97,255,0.14), transparent 60%);
}

@media (prefers-color-scheme: dark) {
    :root {
        --ink: #e7e8f4;
        --muted: #9498b3;
        --bg: #0a0c1f;
        --surface: #14172e;
        --surface-2: #1c1f3a;
        --border: rgba(231, 232, 244, 0.08);
        --border-2: rgba(231, 232, 244, 0.14);
        --brand-soft: rgba(94, 99, 255, 0.12);
        --brand-soft-2: rgba(94, 99, 255, 0.22);
        --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
        --shadow-md: 0 8px 32px rgba(0,0,0,0.4), 0 2px 6px rgba(0,0,0,0.3);
        --shadow-lg: 0 24px 60px rgba(0,0,0,0.55), 0 4px 12px rgba(0,0,0,0.35);
        --hero-grad: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(94,99,255,0.30), transparent 60%),
                     radial-gradient(ellipse 60% 50% at 90% 30%, rgba(123,97,255,0.22), transparent 60%);
    }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
                 "Inter", "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, kbd { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
kbd {
    display: inline-block;
    padding: 1px 7px;
    font-size: 0.85em;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 5px;
    color: var(--ink);
}

/* Header */
.header {
    position: sticky; top: 0; z-index: 100;
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    background: rgba(247, 247, 251, 0.72);
    border-bottom: 1px solid var(--border);
}
@media (prefers-color-scheme: dark) {
    .header { background: rgba(10, 12, 31, 0.72); }
}
.header-inner {
    max-width: var(--max); margin: 0 auto;
    padding: 12px 24px;
    display: flex; align-items: center; gap: 16px;
}
.brand-mark {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 15px; color: var(--ink);
}
.brand-mark img { width: 28px; height: 28px; }
.nav { margin-left: auto; display: flex; gap: 20px; align-items: center; }
.nav a {
    color: var(--ink); font-size: 14px; font-weight: 500;
    opacity: 0.85;
}
.nav a:hover { opacity: 1; text-decoration: none; }
.nav-cta {
    background: var(--ink); color: var(--bg) !important;
    padding: 7px 14px; border-radius: 8px;
    font-weight: 600;
}
.nav-cta:hover { opacity: 0.9; }
@media (max-width: 720px) {
    .nav .nav-link { display: none; }
}

/* Hero */
.hero {
    background: var(--hero-grad);
    padding: 80px 24px 60px;
    text-align: center;
}
.hero-inner { max-width: 820px; margin: 0 auto; }
.hero-icon { width: 124px; height: 124px; filter: drop-shadow(0 18px 36px rgba(94,99,255,0.4)); }
.hero h1 {
    font-size: clamp(40px, 7vw, 64px);
    line-height: 1.05;
    letter-spacing: -0.025em;
    font-weight: 800;
    margin: 24px 0 12px;
    background: linear-gradient(180deg, var(--ink) 0%, color-mix(in srgb, var(--ink) 70%, var(--brand)) 100%);
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
}
.hero .tagline {
    font-size: clamp(17px, 2.2vw, 21px);
    color: var(--muted);
    max-width: 580px; margin: 0 auto;
}
.hero-actions {
    margin-top: 32px;
    display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;
}
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 22px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .08s ease, box-shadow .12s ease, background .12s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary {
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-2) 100%);
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(94,99,255,0.35);
}
.btn-primary:hover { box-shadow: 0 12px 30px rgba(94,99,255,0.45); }
.btn-ghost {
    background: var(--surface);
    color: var(--ink);
    border-color: var(--border-2);
}
.btn-ghost:hover { background: var(--surface-2); }
.hero-meta {
    margin-top: 18px;
    font-size: 13px;
    color: var(--muted);
    display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
}
.hero-meta span::before { content: "·"; margin-right: 16px; opacity: 0.5; }
.hero-meta span:first-child::before { content: ""; margin: 0; }

/* Mockup gallery */
.gallery {
    padding: 40px 24px 60px;
    background: var(--bg);
}
.gallery-inner { max-width: var(--max); margin: 0 auto; }
.tabs {
    display: flex; gap: 4px; justify-content: center;
    background: var(--surface);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--border);
    width: max-content; margin: 0 auto 28px;
}
.tab {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px; font-weight: 600;
    background: transparent; border: none;
    color: var(--muted); cursor: pointer;
    transition: background .12s ease, color .12s ease;
}
.tab.is-active { background: var(--brand-soft); color: var(--brand); }
.tab:hover:not(.is-active) { color: var(--ink); }

.mockup-frame {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    max-width: 960px;
    margin: 0 auto;
}
.mockup-frame img { display: block; width: 100%; height: auto; }
.mockup-panel { display: none; }
.mockup-panel.is-active { display: block; }
.mockup-caption {
    text-align: center;
    font-size: 14px;
    color: var(--muted);
    margin-top: 18px;
}

/* Sections */
section { padding: 80px 24px; }
.section-inner { max-width: var(--max); margin: 0 auto; }
.eyebrow {
    color: var(--brand); font-weight: 700;
    font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
    margin-bottom: 10px;
}
.section h2 {
    font-size: clamp(28px, 4vw, 40px);
    line-height: 1.15; letter-spacing: -0.02em;
    margin: 0 0 14px;
    font-weight: 800;
}
.section-lede {
    color: var(--muted); font-size: 17px;
    max-width: 640px; margin: 0 0 40px;
}

/* Feature grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}
.feature {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.feature:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-2);
}
.feature-icon {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: var(--brand-soft);
    color: var(--brand);
    border-radius: 10px;
    margin-bottom: 14px;
    font-size: 20px;
}
.feature h3 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
}
.feature p {
    margin: 0; color: var(--muted); font-size: 14px;
}

/* Install steps */
.steps {
    counter-reset: step;
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.step {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 24px 24px 60px;
    position: relative;
}
.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute; top: 22px; left: 20px;
    width: 28px; height: 28px;
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-2) 100%);
    color: white; font-weight: 700;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
}
.step h3 { margin: 0 0 6px; font-size: 16px; font-weight: 700; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }
.step code { font-size: 13px; }

/* Code blocks */
pre {
    background: var(--code-bg);
    color: var(--code-ink);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    overflow-x: auto;
    font-size: 13.5px;
    line-height: 1.55;
    margin: 16px 0;
    box-shadow: var(--shadow-sm);
}
pre code { background: transparent; padding: 0; color: inherit; font-size: inherit; }
code {
    background: var(--surface-2);
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 0.92em;
    color: var(--ink);
}
.tok-kw { color: var(--code-keyword); }
.tok-str { color: var(--code-string); }
.tok-cmt { color: var(--code-comment); font-style: italic; }
.tok-prompt { color: var(--code-muted); user-select: none; }
.tok-out { color: var(--code-muted); }

.copyable { position: relative; }
.copy-btn {
    position: absolute; top: 10px; right: 10px;
    background: rgba(255,255,255,0.08);
    color: var(--code-ink);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 5px;
    cursor: pointer;
    opacity: 0; transition: opacity .12s ease;
}
.copyable:hover .copy-btn { opacity: 1; }
.copy-btn.is-copied { background: rgba(40, 200, 64, 0.3); color: #d2ffd9; }

/* Table */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table {
    width: 100%; border-collapse: collapse;
    background: var(--surface);
    font-size: 14px;
}
th, td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--surface-2); font-weight: 600; font-size: 13px; }
tr:last-child td { border-bottom: none; }
td code { font-size: 13px; }

/* Architecture */
.architecture {
    background: linear-gradient(180deg, var(--bg) 0%, var(--brand-soft) 100%);
    padding: 80px 24px;
}
.arch-diagram {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-md);
    overflow-x: auto;
}
.arch-diagram img { width: 100%; height: auto; min-width: 720px; }
.arch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 30px;
}
.arch-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}
.arch-card h4 { margin: 0 0 6px; font-size: 15px; font-weight: 700; color: var(--brand); }
.arch-card p { margin: 0; color: var(--muted); font-size: 14px; }

/* CLI section */
.cli-demo {
    background: var(--code-bg);
    color: var(--code-ink);
    border-radius: var(--radius);
    padding: 24px 28px;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 14px;
    line-height: 1.7;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255,255,255,0.05);
}
.cli-demo .tok-prompt { color: var(--code-muted); }
.cli-demo .blank { display: block; height: 0.5em; }

/* FAQ */
details {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 24px;
    margin-bottom: 12px;
    transition: border-color .12s ease;
}
details[open] { border-color: var(--brand-soft-2); }
details summary {
    cursor: pointer;
    font-weight: 600; font-size: 15px;
    list-style: none;
    display: flex; align-items: center; justify-content: space-between;
}
details summary::-webkit-details-marker { display: none; }
details summary::after {
    content: "+";
    font-size: 22px; font-weight: 400;
    color: var(--brand);
    transition: transform .12s ease;
}
details[open] summary::after { transform: rotate(45deg); }
details p, details ul { color: var(--muted); font-size: 14.5px; }
details ul { padding-left: 18px; }

/* Footer */
footer {
    padding: 50px 24px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-size: 14px;
}
.footer-inner {
    max-width: var(--max); margin: 0 auto;
    display: flex; gap: 20px; flex-wrap: wrap; align-items: center; justify-content: space-between;
}
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--ink); }

/* Two column */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}
@media (max-width: 820px) {
    .two-col { grid-template-columns: 1fr; }
}

/* Warning callout */
.callout {
    border-left: 4px solid var(--brand);
    background: var(--brand-soft);
    padding: 16px 20px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 20px 0;
    font-size: 14.5px;
    color: var(--ink);
}
.callout strong { color: var(--brand); }
.callout-warn { border-left-color: #ff8c42; background: rgba(255, 140, 66, 0.10); }
.callout-warn strong { color: #c5621c; }
@media (prefers-color-scheme: dark) {
    .callout-warn strong { color: #ffa56a; }
}
