:root {
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --bg: #ffffff;
  --bg-alt: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f3f4f6;
  --border: #e4e6eb;
  --border-strong: #d2d6dd;
  --text: #0f1115;
  --text-2: #4b5260;
  --text-3: #6b7280;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef0ff;
  --accent-text: #3f37c9;
  --on-accent: #ffffff;
  --live: #0f7a4a;
  --live-bg: #e8f6ee;
  --beta: #1d5fd1;
  --beta-bg: #e9f0fd;
  --proto: #8a5a00;
  --proto-bg: #fbf2df;
  --focus: #4f46e5;
  --shadow: 0 1px 2px rgba(16, 18, 24, 0.04), 0 1px 1px rgba(16, 18, 24, 0.03);
  --shadow-hover: 0 4px 16px rgba(16, 18, 24, 0.07), 0 1px 2px rgba(16, 18, 24, 0.05);
  --radius: 10px;
  --radius-sm: 7px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0c0e;
    --bg-alt: #101114;
    --surface: #141519;
    --surface-2: #1b1d22;
    --border: #25272e;
    --border-strong: #33363f;
    --text: #eceef2;
    --text-2: #a9aebb;
    --text-3: #8a8f9c;
    --accent: #7c7ff5;
    --accent-hover: #9396f8;
    --accent-soft: rgba(124, 127, 245, 0.13);
    --accent-text: #a5a7fa;
    --on-accent: #0b0c0e;
    --live: #4ccf8f;
    --live-bg: rgba(76, 207, 143, 0.12);
    --beta: #78a6ff;
    --beta-bg: rgba(120, 166, 255, 0.13);
    --proto: #e6b25a;
    --proto-bg: rgba(230, 178, 90, 0.13);
    --focus: #9396f8;
    --shadow: none;
    --shadow-hover: 0 0 0 1px var(--border-strong);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; }
p { margin: 0 0 12px; }
h1, h2, h3 { margin: 0; letter-spacing: -0.015em; font-weight: 600; }
code { font-family: var(--mono); font-size: 0.92em; }
svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 8px 12px; border-radius: var(--radius-sm); text-decoration: none; font-weight: 500; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; font-size: 15px; }
.logo { width: 22px; height: 22px; stroke-width: 1.6; }
.logo rect { fill: var(--text); stroke: none; }
.logo path { stroke: var(--bg); stroke-width: 2; }
.brand-sub { color: var(--text-3); font-weight: 500; padding-left: 8px; border-left: 1px solid var(--border-strong); }
.nav { display: flex; list-style: none; margin: 0; padding: 0; gap: 4px; }
.nav a { display: block; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--text-2); text-decoration: none; font-size: 14px; }
.nav a:hover { color: var(--text); background: var(--surface-2); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm); font: 500 14px/1 var(--font); text-decoration: none; cursor: pointer; border: 1px solid transparent; white-space: nowrap; transition: background 0.12s, border-color 0.12s, color 0.12s; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--border); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.is-copied { color: var(--live); }
.btn-primary.is-copied { color: var(--on-accent); }

/* hero */
.hero { padding: 72px 0 40px; }
.eyebrow { font-size: 13px; font-weight: 500; color: var(--accent-text); margin-bottom: 12px; }
.hero h1 { font-size: clamp(30px, 4.6vw, 46px); line-height: 1.1; letter-spacing: -0.025em; max-width: 760px; }
.lede { margin-top: 18px; font-size: 17px; color: var(--text-2); max-width: 640px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.stats { display: flex; gap: 28px; margin: 36px 0 0; padding: 0; }
.stats div { display: flex; flex-direction: column-reverse; }
.stats dt { font-size: 13px; color: var(--text-3); }
.stats dd { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* sections */
.section { padding: 56px 0; border-top: 1px solid var(--border); }
.section-alt { background: var(--bg-alt); }
.section h2 { font-size: 24px; }
.h3 { font-size: 18px !important; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 8px; }
.section-head p { margin: 6px 0 0; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font: 500 13px/1 var(--font); cursor: pointer; }
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip-n { font-variant-numeric: tabular-nums; opacity: 0.7; }

.group { margin-top: 32px; }
.group[hidden] { display: none; }
.group-title { font-size: 13px; font-weight: 500; color: var(--text-3); margin-bottom: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }

/* cards */
.card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); transition: border-color 0.12s, box-shadow 0.12s; }
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-hover); }
.card[hidden] { display: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-title { font-size: 16px; }
.card-title a { text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card-title a:focus-visible { outline: none; }
.card-title a:focus-visible::after { outline: 2px solid var(--focus); outline-offset: 2px; }
.card-desc { color: var(--text-2); margin: 8px 0 10px; font-size: 14px; }
.card-url { display: inline-flex; align-items: center; gap: 2px; font-family: var(--mono); font-size: 12.5px; color: var(--text-3); text-decoration: none; margin-bottom: 14px; align-self: flex-start; }
.card-url svg { width: 14px; height: 14px; }
.card:hover .card-url { color: var(--accent-text); }
.card-foot { margin-top: auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.plats, .tags { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; }
.plat, .tag, .tag a { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 6px; font-size: 12px; color: var(--text-2); text-decoration: none; }
.plat { background: var(--surface-2); }
.plat:hover { color: var(--text); background: var(--border); }
.plat svg, .tag svg { width: 13px; height: 13px; }
.plat-note { color: var(--text-3); }
.plat-note::before { content: "·"; margin-right: 4px; }
.tag { border: 1px solid var(--border); }
.tag a { padding: 0; height: auto; }
.tag a:hover { color: var(--text); }
.tag-accent { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 30%, transparent); background: var(--accent-soft); }

.status { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-live { color: var(--live); background: var(--live-bg); }
.status-beta { color: var(--beta); background: var(--beta-bg); }
.status-prototype { color: var(--proto); background: var(--proto-bg); }
.status-internal { color: var(--text-2); background: var(--surface-2); }
.status-planned { color: var(--text-2); background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); }
.status-possible { color: var(--text-2); background: transparent; box-shadow: inset 0 0 0 1px var(--border); }
.status-possible::before { background: transparent; box-shadow: inset 0 0 0 1px currentColor; }

.int-group + .int-group { margin-top: 28px; }
.int-list { list-style: none; margin: 12px 0 0; padding: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.int-row { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 12px 16px; }
.int-row + .int-row { border-top: 1px solid var(--border); }
.int-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }
.int-name { font-weight: 600; font-size: 14px; }
.int-name a { color: inherit; text-decoration: none; }
.int-name a:hover { text-decoration: underline; }
.int-kind { font-size: 12px; color: var(--text-2); }
.int-note { flex-basis: 100%; font-size: 13px; color: var(--text-2); }
.int-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.depth { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.depth-bars { display: inline-flex; gap: 2px; }
.depth-bars i { width: 4px; height: 10px; border-radius: 1px; background: var(--border-strong); }
.depth-bars i.on { background: var(--accent); }
@media (max-width: 640px) {
  .int-row { flex-direction: column; align-items: flex-start; }
  .int-meta { flex-direction: row; align-items: center; }
}

.legend { display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 32px 0 0; padding: 0; font-size: 13px; }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend dd { margin: 0; color: var(--text-2); }

/* agents */
.agent-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 40px; align-items: start; }
.agent-intro > p { color: var(--text-2); max-width: 520px; margin-top: 10px; }
.connector { margin: 22px 0 24px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.connector-label { display: block; font-size: 12px; font-weight: 500; color: var(--text-3); margin-bottom: 8px; }
.connector-row { display: flex; gap: 8px; }
.connector-input { flex: 1; min-width: 0; height: 36px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--bg-alt); color: var(--text); font: 500 14px/1 var(--mono); }
.connector-input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.connector-meta { margin: 10px 0 0; font-size: 12.5px; color: var(--text-3); }
.mini-title { font-size: 13px; font-weight: 500; color: var(--text-3); margin-bottom: 8px; }
.reach { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 12px; padding: 0; }
.reach a { display: inline-flex; height: 28px; align-items: center; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; font-size: 13px; font-weight: 500; }
.reach a:hover { border-color: var(--border-strong); }
.agent-intro .btn { margin-top: 6px; }
.agent-intro a:not(.btn) { color: var(--accent-text); }

.install { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.tabs { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--border); background: var(--bg-alt); }
.tabs button { flex: 1; height: 32px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font: 500 13.5px/1 var(--font); cursor: pointer; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border), var(--shadow); }
.panel { padding: 20px 22px 6px; }
.panel:focus-visible { outline-offset: -2px; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { position: relative; padding: 0 0 14px 34px; counter-increment: s; color: var(--text-2); font-size: 14px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); }
.codeline { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 8px 8px 8px 12px; border-radius: var(--radius-sm); background: var(--bg-alt); border: 1px solid var(--border); }
.codeline code { flex: 1; min-width: 0; white-space: normal; overflow-wrap: anywhere; font-size: 12.5px; line-height: 1.5; color: var(--text); }
.install-foot { margin: 0; padding: 12px 22px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-3); }
.install-foot a { color: var(--accent-text); }

/* account */
.account { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.account p { color: var(--text-2); margin-top: 10px; max-width: 480px; }
.account-apps { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.account-apps li + li { border-top: 1px solid var(--border); }
.account-apps a { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; text-decoration: none; font-size: 14px; font-weight: 500; }
.account-apps a:hover { background: var(--bg-alt); }
.account-apps .muted { font-family: var(--mono); font-size: 12.5px; font-weight: 400; }

/* discover */
.discover p { margin-top: 6px; }
.discover-links { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 10px 28px; }
.discover-links li { display: flex; gap: 10px; align-items: baseline; font-size: 14px; }
.discover-links a { color: var(--accent-text); }

/* footer */
.footer { border-top: 1px solid var(--border); padding: 28px 0 40px; font-size: 13px; color: var(--text-3); }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer p { margin: 0; }
.footer ul { display: flex; gap: 18px; list-style: none; margin: 0; padding: 0; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--text); }

@media (max-width: 860px) {
  .agent-grid, .account { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .nav li:not(:nth-child(-n+2)):not(:nth-child(4)) { display: none; }
  .nav a { padding: 6px 8px; }
  .brand-sub { display: none; }
  .hero { padding: 44px 0 28px; }
  .lede { font-size: 16px; }
  .section { padding: 40px 0; }
  .grid { grid-template-columns: 1fr; }
  .stats { gap: 22px; }
  .connector-row { flex-direction: column; }
  .connector-row .btn { width: 100%; }
  .tabs button { font-size: 13px; }
  .panel { padding: 18px 16px 4px; }
  .install-foot { padding: 12px 16px 14px; }
  .chip { height: 36px; padding: 0 12px; }
  .plat, .tag { height: 30px; }
  .reach a { height: 34px; }
}

/* hero → vision teaser */
.vision-teaser { margin-top: 14px; font-size: 14px; color: var(--text-2); max-width: 640px; }
.vision-teaser a { color: var(--accent-text); font-weight: 500; text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 2px; }
.vision-teaser a:hover { text-decoration: underline; }
.vision-teaser svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }

/* /vision */
.v-hero { padding: 64px 0 36px; }
.v-hero h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.12; letter-spacing: -0.025em; max-width: 820px; text-wrap: balance; }
.v-section { padding: 44px 0; }
.v-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 20px; flex-wrap: wrap; margin-bottom: 18px; }
.v-head p { margin: 0; font-size: 14px; }
.v-head a, .v-foot a { color: var(--accent-text); }
.v-two { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.v-two h2 { margin-bottom: 14px; }
.v-two h2 + * + h2 { margin-top: 28px; }

.stack { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column-reverse; gap: 4px; }
.stack-layer { display: grid; grid-template-columns: 24px 112px minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: 14px; }
.stack-n { font: 500 12px/1 var(--mono); color: var(--text-3); }
.stack-name { font-weight: 600; }
.stack-text { color: var(--text-2); font-size: 13px; line-height: 1.5; }
.stack-layer[data-layer="graph"] { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--accent-soft); }
.stack-layer[data-layer="graph"] .stack-n { color: var(--accent-text); }

.principles { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.principles li { padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.horizon { margin: 0; display: grid; gap: 8px; }
.horizon div { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; font-size: 14px; }
.horizon dt { font-weight: 600; }
.horizon dd { margin: 0; color: var(--text-2); }

.vmap { columns: 4 240px; column-gap: 12px; }
.vgroup { break-inside: avoid; margin: 0 0 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 14px 14px 10px; }
.vgroup h3 { font-size: 14px; }
.vgroup-line { margin: 2px 0 10px; font-size: 12.5px; color: var(--text-3); }
.vgroup ul { list-style: none; margin: 0; padding: 0; }
.vgroup li { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 5px 0; font-size: 13.5px; line-height: 18px; border-top: 1px solid var(--border); }
.vgroup li:first-child { border-top: 0; }
.vname { min-width: 0; }
.vname a, .vchips a { color: var(--text); text-decoration: none; }
.vname a:hover, .vchips a:hover { color: var(--accent-text); text-decoration: underline; }
.vision .status { height: 18px; padding: 0 6px; font-size: 11px; gap: 4px; flex-shrink: 0; }
.vision .status::before { width: 5px; height: 5px; }

.vweb { display: grid; gap: 18px; }
.vweb-group h3 { font-size: 13px; font-weight: 500; color: var(--text-3); margin-bottom: 8px; }
.vchips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.vchips li { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 4px 0 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 13px; }
.v-foot { margin-top: 22px; }

@media (max-width: 860px) {
  .v-two { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 640px) {
  .v-hero { padding: 40px 0 24px; }
  .v-section { padding: 32px 0; }
  .stack-layer { grid-template-columns: 20px minmax(0, 1fr); row-gap: 2px; }
  .stack-text { grid-column: 2; }
  .vmap { columns: 1; }
  .vgroup li { padding: 7px 0; }
  .vchips li { height: 32px; }
}
