:root {
  --bg: #ffffff;
  --soft: #f5f5f7;
  --sidebar: #f7f7f8;
  --line: #e7e7ea;
  --line-strong: #d6d6db;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --faint: #a1a1a6;
  --accent: #0a84ff;
  --accent-hover: #0071e3;
  --me: #1f7aff;
  --agent: #f0f0f2;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 12px 40px rgb(0 0 0 / 0.08);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161618;
    --soft: #1d1d20;
    --sidebar: #1b1b1e;
    --line: #2c2c30;
    --line-strong: #3a3a3f;
    --ink: #f2f2f4;
    --muted: #a0a0a8;
    --faint: #6c6c73;
    --agent: #2a2a2e;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 12px 40px rgb(0 0 0 / 0.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161618;
  --soft: #1d1d20;
  --sidebar: #1b1b1e;
  --line: #2c2c30;
  --line-strong: #3a3a3f;
  --ink: #f2f2f4;
  --muted: #a0a0a8;
  --faint: #6c6c73;
  --agent: #2a2a2e;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 12px 40px rgb(0 0 0 / 0.4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img, svg { display: block; }
code, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.88em; }
code { background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 0.08em 0.38em; }
pre { background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; overflow-x: auto; line-height: 1.5; }
pre code { background: none; border: 0; padding: 0; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

/* header */
.nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid transparent; }
.nav.scrolled { border-bottom-color: var(--line); }
.nav .wrap { display: flex; align-items: center; height: 58px; gap: 8px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 16px; letter-spacing: -0.01em; text-decoration: none; margin-right: auto; }
.brand svg { width: 26px; height: 26px; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a { text-decoration: none; color: var(--muted); font-size: 14px; padding: 6px 10px; border-radius: 8px; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); background: var(--soft); }
.icon-link { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0 !important; }
.icon-link svg { width: 20px; height: 20px; }
@media (max-width: 520px) { .nav-links .hide-sm { display: none; } }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 550; font-size: 14.5px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--bg); transition: background 0.15s, transform 0.15s; }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn svg { width: 17px; height: 17px; }

/* hero */
.hero { text-align: center; padding-block: 72px 40px; }
.hero .logo { width: 72px; height: 72px; margin: 0 auto 22px; }
.hero h1 { font-size: clamp(34px, 6vw, 56px); line-height: 1.06; letter-spacing: -0.035em; margin: 0 auto 16px; max-width: 760px; font-weight: 700; }
.hero p.lead { font-size: clamp(16px, 2.2vw, 19px); color: var(--muted); max-width: 600px; margin: 0 auto 28px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.small-note { margin-top: 14px; font-size: 13px; color: var(--faint); }

/* app mock */
.window { margin: 48px auto 0; max-width: 980px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); box-shadow: var(--shadow); overflow: hidden; display: grid; grid-template-columns: 250px 1fr; height: 470px; text-align: left; }
.window .side { background: var(--sidebar); border-right: 1px solid var(--line); padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.dots { display: flex; gap: 7px; padding: 4px 8px 14px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; }
.dots i:nth-child(3) { background: #28c840; }
.thread { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; }
.thread.active { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.thread .meta { min-width: 0; flex: 1; }
.thread b { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 600; }
.thread b span { font-weight: 400; color: var(--faint); font-size: 11.5px; }
.thread small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.window .chat { display: flex; flex-direction: column; min-width: 0; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 14px; }
.msgs { flex: 1; padding: 18px 22px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.bubble { max-width: 78%; padding: 9px 15px; border-radius: 20px; font-size: 13.5px; line-height: 1.45; }
.bubble.me { align-self: flex-end; background: var(--me); color: #fff; }
.bubble.ag { align-self: flex-start; background: var(--agent); }
.event { align-self: flex-start; color: var(--muted); font-size: 13px; padding: 2px 4px; }
.tool { align-self: flex-start; display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; border: 1px solid var(--line); border-radius: 10px; padding: 4px 10px; color: var(--muted); }
.tool b { color: var(--ink); font-weight: 600; }
.composer { margin: 0 18px 16px; border: 1px solid var(--line); border-radius: 22px; padding: 9px 16px; color: var(--faint); font-size: 13.5px; display: flex; justify-content: space-between; }
.composer span:last-child { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); opacity: 0.35; }
@media (max-width: 760px) {
  .window { grid-template-columns: 1fr; height: auto; }
  .window .side { display: none; }
}

/* sections */
section { padding-block: 72px; }
.section-title { text-align: center; margin-bottom: 40px; }
.section-title h2 { font-size: clamp(26px, 4vw, 36px); letter-spacing: -0.025em; margin: 0 0 10px; line-height: 1.15; }
.section-title p { color: var(--muted); margin: 0 auto; max-width: 560px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--bg); }
.card .av { margin-bottom: 14px; }
.card h3 { margin: 0 0 6px; font-size: 16px; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.soft { background: var(--soft); }
.soft .card { background: var(--bg); }

.providers { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 760px; margin: 0 auto; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 14px; background: var(--bg); }

.cta { text-align: center; }
.cta h2 { font-size: clamp(26px, 4vw, 36px); letter-spacing: -0.025em; margin: 0 0 12px; }
.cta p { color: var(--muted); margin: 0 0 24px; }

/* footer */
footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 13.5px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; }
footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-left: auto; }
footer a { text-decoration: none; }
footer a:hover { color: var(--ink); }

/* prose pages (docs, privacy, changelog) */
.page { padding-block: 48px 80px; }
.page-head { margin-bottom: 34px; }
.page-head h1 { font-size: clamp(30px, 5vw, 42px); letter-spacing: -0.03em; margin: 0 0 8px; line-height: 1.1; }
.page-head p { color: var(--muted); margin: 0; }
.prose { max-width: 720px; min-width: 0; overflow-wrap: anywhere; }
.prose h2 { font-size: 22px; letter-spacing: -0.015em; margin: 44px 0 12px; scroll-margin-top: 76px; }
.prose h3 { font-size: 16.5px; margin: 28px 0 8px; scroll-margin-top: 76px; }
.prose p, .prose li { color: color-mix(in srgb, var(--ink) 86%, var(--muted)); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 4px 0; }
.prose a { color: var(--accent); text-decoration: none; }
.prose a:hover { text-decoration: underline; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 14px 0; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 600; color: var(--muted); font-size: 13px; }
.note { border: 1px solid var(--line); background: var(--soft); border-radius: 12px; padding: 12px 16px; font-size: 14px; color: var(--muted); }

.docs { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 48px; }
.toc { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 96px); overflow-y: auto; font-size: 14px; }
.toc a { display: block; text-decoration: none; color: var(--muted); padding: 5px 10px; border-radius: 8px; }
.toc a:hover { background: var(--soft); color: var(--ink); }
.toc .group { font-size: 12px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: 0.04em; padding: 14px 10px 4px; }
@media (max-width: 860px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { position: static; max-height: none; border: 1px solid var(--line); border-radius: 12px; padding: 6px; margin-bottom: 24px; display: flex; flex-wrap: wrap; }
  .toc .group { display: none; }
}

.release { border-left: 2px solid var(--line); padding-left: 22px; margin-bottom: 40px; position: relative; }
.release::before { content: ""; position: absolute; left: -6px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.release h2 { margin-top: 0 !important; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.release time, .badge { font-size: 13px; color: var(--muted); font-weight: 500; }
.badge { border: 1px solid var(--line-strong); border-radius: 999px; padding: 1px 9px; }

/* ---------- 0.3 landing: color, hero scene, install ---------- */
:root {
  --c-blue: #2f86eb;
  --c-violet: #8b5cf6;
  --c-pink: #f0508a;
  --c-red: #f04848;
  --c-amber: #f6ad2b;
  --c-green: #34b27b;
  --grad: linear-gradient(100deg, var(--c-blue) 0%, var(--c-violet) 45%, var(--c-pink) 75%, var(--c-amber) 100%);
  --aurora-opacity: 0.55;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --aurora-opacity: 0.32; }
}
:root[data-theme="dark"] { --aurora-opacity: 0.32; }

.hero-stage { position: relative; overflow: hidden; isolation: isolate; }
.hero-stage .hero { position: relative; z-index: 2; padding-block: 96px 64px; }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; opacity: 0; transition: opacity 0.8s ease; }
#hero-canvas.ready { opacity: 1; }
#hero-canvas.ready ~ .hero .logo { display: none !important; }
@media (prefers-reduced-motion: reduce) { #hero-canvas { opacity: 1; } }

.aurora { position: absolute; inset: -20% -10% 0; z-index: 0; pointer-events: none; filter: blur(70px) saturate(1.2); opacity: var(--aurora-opacity); }
.aurora i { position: absolute; border-radius: 50%; animation: drift 22s ease-in-out infinite alternate; }
.aurora i:nth-child(1) { width: 46vw; height: 46vw; left: -6vw; top: 4%; background: radial-gradient(circle, var(--c-blue), transparent 68%); }
.aurora i:nth-child(2) { width: 40vw; height: 40vw; right: -4vw; top: -6%; background: radial-gradient(circle, var(--c-violet), transparent 68%); animation-delay: -6s; }
.aurora i:nth-child(3) { width: 34vw; height: 34vw; right: 14vw; bottom: -14%; background: radial-gradient(circle, var(--c-pink), transparent 68%); animation-delay: -11s; }
.aurora i:nth-child(4) { width: 30vw; height: 30vw; left: 18vw; bottom: -18%; background: radial-gradient(circle, var(--c-amber), transparent 70%); animation-delay: -16s; }
.hero-stage::after { content: ""; position: absolute; inset: auto 0 0; height: 120px; z-index: 1; background: linear-gradient(to bottom, transparent, var(--bg)); pointer-events: none; }
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(4vw, 3vw, 0) scale(1.08); }
  100% { transform: translate3d(-3vw, -2vw, 0) scale(0.96); }
}
@media (prefers-reduced-motion: reduce) { .aurora i { animation: none; } }

.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pill { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 26px; padding: 6px 14px 6px 10px; border-radius: 999px; font-size: 13px; font-weight: 550; text-decoration: none; color: var(--ink); background: color-mix(in srgb, var(--bg) 70%, transparent); border: 1px solid color-mix(in srgb, var(--line-strong) 80%, transparent); backdrop-filter: blur(10px); transition: border-color 0.2s; }
.pill:hover { border-color: var(--c-violet); }
.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-violet) 18%, transparent); }
.hero h1 { text-wrap: balance; }
.hero p.lead { text-wrap: pretty; }

.btn.primary { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, white), var(--accent)); box-shadow: 0 1px 0 rgb(255 255 255 / 0.25) inset, 0 8px 24px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn.primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.hero .btn:not(.primary) { background: color-mix(in srgb, var(--bg) 75%, transparent); backdrop-filter: blur(10px); }

.oneliner { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; margin-top: 22px; padding: 5px 5px 5px 14px; border-radius: 12px; border: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(10px); }
.oneliner code { background: none; border: 0; padding: 0; font-size: 13px; white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.oneliner code::-webkit-scrollbar { display: none; }
.copy { flex-shrink: 0; font: inherit; font-size: 12.5px; font-weight: 550; color: var(--muted); background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; cursor: pointer; }
.copy:hover { color: var(--ink); }
.copy.ok { color: var(--c-green); }
.small-note a { color: var(--accent); text-decoration: none; }
.small-note code { font-size: 0.9em; }

.window { margin-top: 0; position: relative; z-index: 3; }
.file-card { align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 16px; padding: 8px 14px 8px 8px; font-size: 13px; background: var(--bg); }
.file-card.me { align-self: flex-end; }
.file-card b { display: block; font-weight: 600; }
.file-card small { color: var(--muted); font-size: 11.5px; }
.file-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; font-size: 9.5px; font-weight: 700; letter-spacing: 0.02em; color: var(--c-blue); background: color-mix(in srgb, var(--c-blue) 12%, transparent); }

.kicker { display: inline-block; margin-bottom: 10px; font-size: 12.5px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.card { transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease; }
.card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c-violet) 35%, var(--line)); box-shadow: 0 12px 32px -18px color-mix(in srgb, var(--c-violet) 55%, transparent); }
.chip { transition: border-color 0.2s; }
.chip:hover { border-color: var(--c-blue); }
code.big { font-size: 0.82em; padding: 0.04em 0.3em; border-radius: 10px; }

/* install */
.install { max-width: 720px; margin: 0 auto; border: 1px solid var(--line); border-radius: 20px; background: var(--bg); box-shadow: var(--shadow); overflow: hidden; }
.tabs { display: flex; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); background: var(--soft); }
.tabs button { flex: 1; font: inherit; font-size: 14px; font-weight: 550; color: var(--muted); background: none; border: 0; border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); background: var(--bg); box-shadow: 0 1px 3px rgb(0 0 0 / 0.08); }
.tab-panel { padding: 22px 24px 6px; }
.step { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-weight: 550; }
.step span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 12px; font-weight: 700; color: #fff; background: var(--grad); flex-shrink: 0; }
.term { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; padding: 12px 12px 12px 16px; border-radius: 12px; background: #16161a; color: #f2f2f4; }
.term code { flex: 1; min-width: 0; background: none; border: 0; padding: 0; color: inherit; font-size: 13.5px; white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.term code::-webkit-scrollbar { display: none; }
.term code::before { content: "$ "; color: #8b8b94; }
.term .copy { background: #26262c; border-color: #34343b; color: #c9c9d1; }
.term .copy:hover { color: #fff; }
.alt { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.alt a, .install-foot a { color: var(--accent); text-decoration: none; }
.alt a:hover, .install-foot a:hover { text-decoration: underline; }
.install-foot { margin: 0; padding: 12px 24px 16px; font-size: 13px; color: var(--faint); border-top: 1px solid var(--line); }

/* final call to action */
.cta-card { position: relative; overflow: hidden; border-radius: 28px; padding: 56px 24px; text-align: center; color: #fff; background: radial-gradient(120% 140% at 0% 0%, var(--c-blue) 0%, transparent 55%), radial-gradient(120% 140% at 100% 0%, var(--c-violet) 0%, transparent 55%), radial-gradient(120% 140% at 50% 120%, var(--c-pink) 0%, transparent 60%), #3b3bd1; }
.cta-card h2 { color: #fff; margin: 14px 0 10px; }
.cta-card p { color: rgb(255 255 255 / 0.82); }
.cta-faces { display: flex; justify-content: center; align-items: flex-end; gap: 6px; }
.cta-faces span:nth-child(2) { transform: translateY(-6px); }
.btn.light { background: #fff; color: #1d1d1f; border-color: #fff; box-shadow: none; }
.btn.light:hover { background: #f2f2f7; }
.btn.ghost { background: rgb(255 255 255 / 0.12); color: #fff; border-color: rgb(255 255 255 / 0.35); }
.btn.ghost:hover { background: rgb(255 255 255 / 0.2); }
section.cta { padding-block: 40px 80px; }

@media (max-width: 760px) {
  .hero-stage .hero { padding-block: 120px 160px; }
  .tab-panel { padding: 18px 16px 4px; }
  .install-foot { padding: 12px 16px 14px; }
}

/* Provider logos: drawn with currentColor, so they follow the light/dark theme. */
.logos { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 12px; max-width: 800px; margin: 0 auto; }
.logo { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; height: 68px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); color: var(--ink); transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s; }
.logo svg { width: 30px; height: 30px; flex: none; }
.logo:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.logo .cli { font: 600 11px/1 ui-monospace, "SF Mono", Menlo, monospace; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 6px; padding: 3px 5px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
