:root {
    --bg: #ffffff;
    --surface: #fafafa;
    --surface-tint: #f6f4ff;
    --border: #ececf2;
    --border-strong: #dcd6f5;
    --text: #0f0f17;
    --text-muted: #6b7280;
    --brand: #927bff;
    --brand-dark: #7b62ff;
    --brand-soft: #f3f0ff;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Header */
.nav {
    display: flex; align-items: center; justify-content: space-between;
    padding: 24px 0;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.mark {
    width: 36px; height: 36px; border-radius: 10px;
    display: grid; place-items: center;
    box-shadow: 0 4px 14px rgba(146,123,255,.35);
    overflow: hidden;
}
.mark img { width: 100%; height: 100%; display: block; object-fit: cover; }
.brand-name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.brand-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.nav-link {
    font-size: 14px; color: var(--text-muted); text-decoration: none;
    display: inline-flex; align-items: center; gap: 4px;
    padding: 8px 14px; border-radius: 8px;
    transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--text); background: var(--surface); }

/* Hero */
.hero {
    position: relative; padding: 72px 0 56px;
}
.hero::before {
    content: ""; position: absolute;
    top: 0; bottom: 0;
    left: 50%; width: 100vw;
    transform: translateX(-50%);
    background:
            radial-gradient(900px 420px at 80% -10%, rgba(146,123,255,.22), transparent 70%),
            radial-gradient(700px 360px at 15% 10%, rgba(146,123,255,.12), transparent 70%);
    z-index: -1;
    pointer-events: none;
}
.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 56px;
    align-items: center;
}
.hero-text { text-align: left; }
.hero-text h1 { margin-top: 0; }
.hero-text .lead { margin-left: 0; margin-right: 0; }
.hero-text .cta-row { justify-content: flex-start; }
@media (max-width: 960px) {
    .hero-grid { grid-template-columns: 1fr; gap: 40px; }
    .hero-text { text-align: center; }
    .hero-text .lead { margin-left: auto; margin-right: auto; }
    .hero-text .cta-row { justify-content: center; }
}

/* Demo card */
.demo-card {
    position: relative;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow:
            0 30px 60px -20px rgba(82, 60, 200, .25),
            0 12px 28px -10px rgba(15, 15, 23, .08);
    overflow: hidden;
    min-height: 420px;
    display: flex; flex-direction: column;
}
.demo-card::after {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(146,123,255,.04), transparent 30%);
    pointer-events: none;
}
.demo-header {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.demo-dots { display: flex; gap: 6px; }
.demo-dots span {
    width: 10px; height: 10px; border-radius: 50%;
    background: #e5e1f5;
}
.demo-dots span:nth-child(1) { background: #ff6159; }
.demo-dots span:nth-child(2) { background: #ffbd2e; }
.demo-dots span:nth-child(3) { background: #28c941; }
.demo-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 600; color: var(--text);
}
.demo-ai-logo {
    width: 22px; height: 22px; border-radius: 6px;
    display: grid; place-items: center;
    font-size: 11px; font-weight: 700; color: #fff;
    background: linear-gradient(135deg, #d97757, #c25c3e);
    transition: background .4s;
}
.demo-badge {
    margin-left: auto;
    font-size: 11px; font-weight: 500;
    color: var(--brand-dark);
    background: var(--brand-soft);
    padding: 4px 10px; border-radius: 999px;
    display: inline-flex; align-items: center; gap: 6px;
}
.demo-badge::before {
    content: ""; width: 6px; height: 6px; border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 0 rgba(146,123,255,.6);
    animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(146,123,255,.55); }
    100% { box-shadow: 0 0 0 8px rgba(146,123,255,0); }
}
.demo-body {
    position: relative;
    padding: 20px;
    flex: 1;
    display: flex; flex-direction: column; gap: 14px;
}
.demo-msg { display: flex; gap: 10px; align-items: flex-start; }
.demo-avatar {
    flex-shrink: 0;
    width: 28px; height: 28px; border-radius: 50%;
    display: grid; place-items: center;
    font-size: 11px; font-weight: 600;
    background: var(--surface); color: var(--text-muted);
    border: 1px solid var(--border);
}
.demo-avatar.ai {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff; border-color: transparent;
}
.demo-bubble {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
    max-width: 92%;
    min-height: 22px;
}
.demo-bubble .accent { color: var(--brand-dark); font-weight: 500; }
.demo-ai-content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.demo-tool-call {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(90deg, rgba(146,123,255,.08), rgba(146,123,255,.02));
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12.5px; color: var(--text);
    align-self: flex-start;
    position: relative; overflow: hidden;
}
.demo-tool-call::before {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(146,123,255,.18), transparent);
    transform: translateX(-100%);
    animation: shimmer 2.4s ease-in-out infinite;
}
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    60%, 100% { transform: translateX(100%); }
}
.demo-tool-icon { color: var(--brand-dark); }
.demo-tool-name { color: var(--brand-dark); font-weight: 600; }
.demo-tool-status { color: var(--text-muted); font-size: 11px; padding-left: 4px; }
.demo-result {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    min-height: 90px;
}

/* Result: TTS waveform */
.demo-wave {
    display: flex; align-items: center; gap: 12px;
}
.demo-play {
    flex-shrink: 0;
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--brand); color: #fff;
    display: grid; place-items: center;
    box-shadow: 0 4px 12px rgba(146,123,255,.4);
}
.demo-bars { display: flex; align-items: center; gap: 3px; flex: 1; height: 36px; }
.demo-bars span {
    display: block; width: 3px; border-radius: 2px;
    background: var(--brand);
    animation: barWave 1.1s ease-in-out infinite;
}
@keyframes barWave {
    0%, 100% { height: 20%; opacity: .5; }
    50% { height: 100%; opacity: 1; }
}
.demo-time { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--text-muted); }

/* Result: STT transcript */
.demo-transcript { font-size: 13.5px; line-height: 1.6; color: var(--text); }
.demo-transcript .meta { font-size: 11px; color: var(--text-muted); margin-top: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Result: Video frame */
.demo-video {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background:
            linear-gradient(135deg, #4b3aa3, #927bff 40%, #d8c8ff);
    display: grid; place-items: center;
}
.demo-video::before {
    content: ""; position: absolute; inset: 0;
    background:
            radial-gradient(180px 100px at 30% 40%, rgba(255,255,255,.35), transparent 60%),
            radial-gradient(140px 80px at 70% 70%, rgba(255,255,255,.2), transparent 60%);
}
.demo-video-play {
    position: relative;
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(255,255,255,.92);
    display: grid; place-items: center;
    color: var(--brand-dark);
    box-shadow: 0 8px 20px rgba(0,0,0,.2);
}
.demo-video-meta {
    position: absolute; bottom: 8px; left: 10px; right: 10px;
    display: flex; justify-content: space-between;
    font-size: 11px; color: rgba(255,255,255,.92);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Cycle fade */
.demo-fade {
    animation: demoFadeIn .5s ease-out both;
}
@keyframes demoFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
.demo-typing {
    display: inline-flex; gap: 4px; padding: 4px 0;
}
.demo-typing span {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--text-muted); opacity: .5;
    animation: typing 1.2s ease-in-out infinite;
}
.demo-typing span:nth-child(2) { animation-delay: .15s; }
.demo-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: .35; }
    30% { transform: translateY(-3px); opacity: 1; }
}
.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px; border-radius: 999px;
    background: var(--brand-soft); color: var(--brand-dark);
    font-size: 13px; font-weight: 500;
    margin-bottom: 24px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
h1 {
    font-size: clamp(34px, 5.2vw, 56px);
    font-weight: 700; line-height: 1.08;
    letter-spacing: -0.025em;
    margin: 0 0 20px;
}
h1 .grad {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead {
    font-size: 18px; color: var(--text-muted);
    max-width: 600px; margin: 0 auto 36px;
    line-height: 1.6;
}
.cta-row {
    display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
    margin-bottom: 36px;
}
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 22px; border-radius: 10px;
    font-size: 14px; font-weight: 500;
    text-decoration: none; cursor: pointer; border: 1px solid transparent;
    transition: transform .15s, box-shadow .15s, background .15s, border-color .15s;
}
.btn-primary {
    background: var(--brand); color: #fff;
    box-shadow: 0 4px 14px rgba(146,123,255,.35);
}
.btn-primary:hover { background: var(--brand-dark); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(146,123,255,.45); }
.btn-ghost {
    background: var(--bg); color: var(--text);
    border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--border-strong); background: var(--surface); }

/* Endpoint copy box */
.endpoint {
    display: inline-flex; align-items: center; gap: 12px;
    padding: 10px 14px 10px 18px; border-radius: 12px;
    background: var(--surface); border: 1px solid var(--border);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 14px; color: var(--text);
    cursor: pointer; user-select: all;
    transition: border-color .15s, background .15s;
}
.endpoint:hover { border-color: var(--brand); background: var(--brand-soft); }
.endpoint .label { color: var(--text-muted); font-family: inherit; user-select: none; }
.endpoint .copy-icon {
    display: inline-grid; place-items: center;
    width: 28px; height: 28px; border-radius: 6px;
    background: var(--bg); border: 1px solid var(--border);
    color: var(--text-muted); font-size: 12px;
    user-select: none;
}
.endpoint.copied { border-color: var(--brand); background: var(--brand-soft); }
.endpoint.copied .copy-icon { color: var(--brand); border-color: var(--brand); }

/* Section base */
section { padding: 56px 0; }
.section-head { margin-bottom: 32px; }
.section-tag {
    display: inline-block;
    font-size: 12px; font-weight: 600; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--brand);
    margin-bottom: 8px;
}
h2 {
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 700; letter-spacing: -0.02em;
    margin: 0 0 8px;
}
.section-lead { color: var(--text-muted); margin: 0; max-width: 540px; font-size: 15px; }

/* Steps */
.steps {
    display: grid; gap: 16px;
    grid-template-columns: repeat(3, 1fr);
}
.step {
    padding: 24px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    position: relative;
}
.step-num {
    display: inline-grid; place-items: center;
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--brand-soft); color: var(--brand-dark);
    font-weight: 600; font-size: 14px;
    margin-bottom: 14px;
}
.step h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.step p { margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.55; }
.step a { color: var(--brand-dark); text-decoration: none; font-weight: 500; }
.step a:hover { text-decoration: underline; }

/* Integrations */
.integrations-grid {
    display: grid; gap: 16px;
    grid-template-columns: repeat(3, 1fr);
}
.int-card {
    padding: 24px;
    border-radius: 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    transition: border-color .2s, transform .2s, box-shadow .2s;
}
.int-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(146,123,255,.08);
}
.int-icon {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--brand-soft); color: var(--brand-dark);
    display: grid; place-items: center;
    font-size: 16px; font-weight: 700;
    margin-bottom: 14px;
}
.int-card h3 { margin: 0 0 8px; font-size: 16px; font-weight: 600; }
.int-card p { margin: 0 0 14px; font-size: 14px; color: var(--text-muted); line-height: 1.55; }
.int-card ol { margin: 0 0 14px; padding-left: 18px; font-size: 14px; color: var(--text-muted); line-height: 1.7; }
.int-card ol code { background: var(--surface); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; color: var(--text); }
.snippet {
    position: relative;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; padding: 12px 14px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12.5px; color: var(--text);
    overflow-x: auto;
    cursor: pointer;
    transition: border-color .15s;
}
.snippet:hover { border-color: var(--brand); }
.snippet pre { margin: 0; white-space: pre; }
.snippet .copy-tag {
    position: absolute; top: 8px; right: 8px;
    font-size: 11px; padding: 3px 8px; border-radius: 5px;
    background: var(--bg); border: 1px solid var(--border);
    color: var(--text-muted); user-select: none;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}
.snippet.copied { border-color: var(--brand); }
.snippet.copied .copy-tag { color: var(--brand); border-color: var(--brand); }

/* Auth banner */
.auth-banner {
    display: flex; align-items: center; gap: 16px;
    padding: 20px 24px;
    background: var(--surface-tint);
    border: 1px solid var(--border-strong);
    border-radius: 14px;
}
.auth-icon {
    flex-shrink: 0;
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--bg); border: 1px solid var(--border-strong);
    display: grid; place-items: center; color: var(--brand-dark);
}
.auth-banner h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.auth-banner p { margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.5; }

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 32px 0 48px;
    margin-top: 32px;
    color: var(--text-muted); font-size: 13px;
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px;
}
footer a { color: var(--text-muted); text-decoration: none; margin-right: 18px; }
footer a:hover { color: var(--brand-dark); }

/* Responsive */
@media (max-width: 720px) {
    .steps, .integrations-grid { grid-template-columns: 1fr; }
    .hero { padding: 48px 0 32px; }
    section { padding: 40px 0; }
    .endpoint { font-size: 13px; }
    .auth-banner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Language switcher — light theme */
.lang-switcher { position: relative; display: inline-block; }
.lang-button {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 10px 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit; font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}
.lang-button:hover { border-color: var(--border-strong); color: var(--text); background: var(--surface); }
.lang-switcher.open .lang-button { border-color: var(--brand); color: var(--text); background: var(--brand-soft); }
.lang-globe { flex-shrink: 0; opacity: .8; }
.lang-chev { transition: transform .15s; }
.lang-switcher.open .lang-chev { transform: rotate(180deg); }
.lang-current { font-size: 13px; }

.lang-menu {
    position: absolute; top: calc(100% + 6px); right: 0;
    min-width: 160px;
    margin: 0; padding: 6px;
    list-style: none;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(15,15,23,.08), 0 2px 6px rgba(15,15,23,.04);
    opacity: 0; transform: translateY(-4px);
    pointer-events: none;
    transition: opacity .15s, transform .15s;
    z-index: 50;
}
.lang-switcher.open .lang-menu {
    opacity: 1; transform: translateY(0);
    pointer-events: auto;
}
.lang-menu li { margin: 0; padding: 0; }
.lang-option {
    display: block; width: 100%;
    padding: 8px 12px;
    background: transparent; border: 0;
    border-radius: 6px;
    text-align: left;
    font: inherit; font-size: 13.5px;
    color: var(--text);
    cursor: pointer;
    transition: background .12s, color .12s;
}
.lang-option:hover { background: var(--surface); }
.lang-option.is-active {
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-weight: 500;
}
.nav-right { display: flex; align-items: center; gap: 8px; }
