:root {
  --bg: #f6f6f2;
  --bg-band: #ecece6;
  --surface: #ffffff;
  --text: #1e1e2e;
  --muted: #5c5f77;
  --border: #d8d8d0;
  --accent: #1e66f5;
  --accent-text: #ffffff;
  --green: #40a02b;
  --code-bg: #e9e9e2;
  --term: #1e1e2e;
  --term-text: #cdd6f4;
  --shadow: 0 10px 40px rgba(30, 30, 46, 0.18);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11111b;
    --bg-band: #181825;
    --surface: #1e1e2e;
    --text: #cdd6f4;
    --muted: #a6adc8;
    --border: #313244;
    --accent: #89b4fa;
    --accent-text: #11111b;
    --green: #a6e3a1;
    --code-bg: #262637;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--sans);
  overflow-x: hidden;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img, video { max-width: 100%; height: auto; display: block; }
code, kbd, pre { font-family: var(--mono); font-size: 0.88em; }
code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 5px; }
kbd {
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0.05em 0.4em;
  white-space: nowrap;
}
pre { background: var(--term); color: var(--term-text); padding: 14px 16px; border-radius: 10px; overflow-x: auto; line-height: 1.5; }
pre code { background: none; padding: 0; font-size: 0.92em; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

/* header */
.top { border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.top-row { display: flex; align-items: center; gap: 20px; height: 58px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font: 700 1.1rem var(--mono); color: var(--text); text-decoration: none; }
.nav { display: flex; gap: 18px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; white-space: nowrap; }
.nav a:hover { color: var(--text); }
.gh {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px;
  color: var(--text); text-decoration: none; font-size: 0.9rem; background: var(--surface);
}
.gh .count { border-left: 1px solid var(--border); padding-left: 6px; color: var(--muted); }
@media (max-width: 760px) {
  .top-row { gap: 12px; }
  .nav { display: none; }
  .gh { margin-left: auto; }
}

/* sections */
section { padding: 64px 0; }
.band { background: var(--bg-band); }
.sec { font-size: clamp(1.6rem, 3vw, 2.1rem); text-align: center; margin: 0 0 16px; }
.hero { padding: 56px 0 64px; text-align: center; }
.eyebrow { color: var(--muted); font-size: 0.95rem; margin: 0 0 12px; }
.hero h1 { font-size: clamp(2rem, 5.2vw, 3.4rem); margin: 0 auto 18px; max-width: 900px; }
.lead { font-size: clamp(1.08rem, 2vw, 1.25rem); color: var(--text); max-width: 720px; margin: 0 auto 24px; }
.cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 0 0 16px; }
.btn {
  display: inline-block; padding: 11px 20px; border-radius: 10px; font-weight: 600;
  border: 1px solid var(--border); color: var(--text); background: var(--surface); text-decoration: none;
}
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn:hover { filter: brightness(1.07); text-decoration: none; }

/* terminal frames */
.demo { margin-top: 36px; }
.tabs { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button {
  font: inherit; font-size: 0.95rem; cursor: pointer; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
}
.tabs button[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.term { margin: 0 auto; max-width: 1028px; border-radius: 12px; overflow: hidden; background: var(--term); box-shadow: var(--shadow); border: 1px solid var(--border); }
.term-bar { display: flex; gap: 7px; padding: 10px 12px; background: #181825; }
.term-bar span { width: 11px; height: 11px; border-radius: 50%; background: #45475a; }
.term video { width: 100%; aspect-ratio: 1028 / 599; background: var(--term); }
.term figcaption { background: var(--bg); padding: 10px 4px 0; font-size: 0.9rem; text-align: center; }
.term.small { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25); }

/* features */
.feature { display: grid; grid-template-columns: 1fr 1.5fr; gap: 40px; align-items: center; margin: 48px 0; }
.feature.flip .feature-text { order: 2; }
.feature h3 { font-size: 1.5rem; margin: 0 0 10px; }
.feature p { margin: 0; }
@media (max-width: 860px) {
  .feature { grid-template-columns: 1fr; gap: 18px; margin: 36px 0; }
  .feature.flip .feature-text { order: 0; }
}

/* agents */
.agents { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 28px; }
.agent-card {
  display: flex; flex-direction: column; gap: 8px; padding: 10px 10px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none;
}
.agent-card img { border-radius: 7px; }
.agent-card:hover { border-color: var(--accent); }
.agent-name { font-weight: 600; }
.agent-card code { align-self: flex-start; }
@media (max-width: 900px) { .agents { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .agents { grid-template-columns: 1fr; } }

/* install */
.install .tabs { justify-content: flex-start; }
.cmd { margin: 0 0 14px; white-space: pre; }
.end .cmd { display: inline-block; text-align: left; max-width: 100%; }

/* facts */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.facts h2 { font-size: 1.2rem; margin: 0 0 8px; }
.facts p { margin: 0; }
@media (max-width: 860px) { .facts { grid-template-columns: 1fr; gap: 24px; } }

/* faq */
details { border-bottom: 1px solid var(--border); padding: 14px 0; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 10px 0 0; }

/* prose pages */
.prose { padding-top: 40px; padding-bottom: 64px; }
.prose h1 { font-size: clamp(1.9rem, 4.4vw, 2.6rem); margin: 0 0 14px; }
.prose .lead { margin: 0 0 28px; text-align: left; max-width: none; }
.prose h2 { font-size: 1.45rem; margin: 40px 0 10px; }
.prose h3 { font-size: 1.15rem; margin: 28px 0 8px; }
.prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; font-size: 0.95rem; margin: 16px 0; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--bg-band); }
.prose li { margin: 4px 0; }
.prose .term { margin: 24px 0; }
.agent-hero .term { margin-top: 28px; }
.agent-body { padding-top: 0; }
.others { margin-top: 40px; color: var(--muted); }

/* docs */
.docs { display: grid; grid-template-columns: 210px 1fr; gap: 40px; }
.docs-nav { display: flex; flex-direction: column; gap: 2px; padding-top: 44px; position: sticky; top: 58px; align-self: start; }
.docs-nav a { color: var(--muted); text-decoration: none; padding: 5px 10px; border-radius: 7px; }
.docs-nav a:hover { color: var(--text); }
.docs-nav a[aria-current="page"] { background: var(--bg-band); color: var(--text); font-weight: 600; }
.docs .prose { min-width: 0; }
.doc-list { padding-left: 18px; }
@media (max-width: 860px) {
  .docs { grid-template-columns: 1fr; gap: 0; }
  .docs-nav { position: static; flex-direction: row; flex-wrap: wrap; padding-top: 20px; }
}

/* footer */
.foot { border-top: 1px solid var(--border); padding: 40px 0 56px; font-size: 0.95rem; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 24px; }
.foot h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 8px; }
.foot a:not(.logo) { display: block; color: var(--text); text-decoration: none; padding: 2px 0; }
.foot a:not(.logo):hover { color: var(--accent); }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
