:root {
  color-scheme: dark;
  --bg: #070a0f;
  --panel: #0e141c;
  --panel-2: #121b26;
  --line: #253242;
  --line-bright: #3a4d63;
  --text: #f4f7fb;
  --muted: #9eacbd;
  --accent: #61dafb;
  --accent-2: #a78bfa;
  --success: #57dda0;
  --warning: #f5bd68;
  --max: 1180px;
  --shadow: 0 26px 80px rgba(0, 0, 0, .32);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 78% 8%, rgba(97, 218, 251, .11), transparent 27%),
    radial-gradient(circle at 18% 34%, rgba(167, 139, 250, .08), transparent 24%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}
button, select { font: inherit; }
a { color: inherit; text-decoration: none; }
code, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 20;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
}
.skip-link:focus { top: 12px; }
.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; }

.nav {
  width: min(calc(100% - 40px), var(--max));
  min-height: 76px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; gap: 9px; align-items: center; font-weight: 800; letter-spacing: -.025em; }
.brand span { color: var(--accent); font-size: .7rem; }
nav { display: flex; gap: 26px; color: var(--muted); font-size: .9rem; }
nav a, footer a { transition: color .2s ease; }
nav a:hover, nav a:focus-visible, footer a:hover, footer a:focus-visible { color: var(--accent); }

main, footer { width: min(calc(100% - 40px), var(--max)); margin: auto; }
.hero { min-height: 700px; padding: 96px 0 84px; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 70px; align-items: center; }
.hero-copy { min-width: 0; }
.eyebrow { margin: 0 0 16px; color: var(--accent); font-size: .76rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3 { line-height: 1.08; letter-spacing: -.04em; margin: 0; }
h1 { font-size: clamp(3.15rem, 7vw, 6.2rem); max-width: 880px; }
h1 span { color: transparent; background: linear-gradient(90deg, var(--accent), #c4a7ff); background-clip: text; -webkit-background-clip: text; }
.lede { max-width: 780px; margin: 28px 0; color: var(--muted); font-size: clamp(1.02rem, 2vw, 1.22rem); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0; }
.button { border: 1px solid var(--line-bright); padding: 10px 17px; border-radius: 9px; font-weight: 750; cursor: pointer; transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--accent); }
.button:focus-visible, select:focus-visible, .install button:focus-visible { outline: 3px solid rgba(97, 218, 251, .35); outline-offset: 2px; }
.button.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.button.secondary, .button.ghost { background: transparent; color: var(--text); }
.button.ghost { color: var(--muted); border-color: transparent; }
.button:disabled { opacity: .42; cursor: not-allowed; }
.install { max-width: 660px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: rgba(3, 6, 10, .82); }
.install code { color: #c7eaff; white-space: nowrap; }
.install button { flex: 0 0 auto; padding: 5px 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.requirement { color: var(--muted); font-size: .84rem; }
.scope-card { padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, rgba(18, 27, 38, .95), rgba(9, 14, 20, .95)); box-shadow: var(--shadow); transform: rotate(1.2deg); }
.scope-card h2 { font-size: 2rem; }
.scope-card ul { margin: 24px 0; padding: 0; display: grid; gap: 12px; list-style: none; }
.scope-card li { padding-bottom: 10px; border-bottom: 1px solid var(--line); color: #dbe7f5; }
.scope-card > p:last-child { margin-bottom: 0; color: var(--muted); font-size: .88rem; }
.status-dot { margin-top: 0; color: var(--success); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.status-dot span, .demo-mode span, .backend-grid small span { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }

.positioning { padding: 100px 0; border-top: 1px solid var(--line); display: grid; gap: 48px; }
.positioning-intro { display: grid; grid-template-columns: minmax(0, .8fr) minmax(340px, 1.2fr); column-gap: 70px; align-items: start; }
.positioning-intro .eyebrow { grid-column: 1 / -1; }
.positioning h2 { font-size: clamp(2.5rem, 5.5vw, 5rem); }
.positioning h2 span { color: transparent; background: linear-gradient(90deg, var(--accent), #c4a7ff); background-clip: text; -webkit-background-clip: text; }
.positioning blockquote { margin: 5px 0 26px; padding: 0 0 0 22px; border-left: 3px solid var(--accent); color: #dce9f7; font-size: clamp(1.05rem, 2vw, 1.35rem); }
.fit-grid { grid-column: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.fit-grid p { margin: 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; background: rgba(18, 27, 38, .7); color: var(--muted); font-size: .8rem; }
.comparison-wrap { overflow-x: auto; border: 1px solid var(--line-bright); border-radius: 16px; background: rgba(9, 14, 20, .8); }
.comparison-table { width: 100%; min-width: 850px; border-collapse: collapse; text-align: left; }
.comparison-table th, .comparison-table td { padding: 17px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.comparison-table thead th { color: var(--muted); background: var(--panel-2); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.comparison-table tbody th { width: 20%; color: var(--text); font-size: .9rem; }
.comparison-table tbody th a { color: var(--accent); }
.comparison-table tbody td { width: 40%; color: var(--muted); font-size: .84rem; }
.comparison-table tbody tr:last-child th, .comparison-table tbody tr:last-child td { border-bottom: 0; }
.comparison-table tbody tr:hover { background: rgba(97, 218, 251, .035); }
.comparison-note { margin: 0; padding: 17px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
.comparison-note strong { color: var(--warning); }

.demo-section { padding: 100px 0; border-top: 1px solid var(--line); }
.section-heading { margin-bottom: 34px; display: grid; grid-template-columns: 1fr minmax(300px, 470px); gap: 60px; align-items: end; }
.section-heading h2, .backends h2, .quickstart h2 { font-size: clamp(2.2rem, 5vw, 4.2rem); }
.section-heading > p { margin: 0; color: var(--muted); }
.section-heading strong { color: var(--text); }
.demo-shell { overflow: hidden; border: 1px solid var(--line-bright); border-radius: 22px; background: rgba(10, 15, 22, .92); box-shadow: var(--shadow); }
.demo-toolbar { padding: 18px 20px; display: grid; grid-template-columns: auto minmax(260px, 1fr) auto auto; gap: 14px; align-items: center; border-bottom: 1px solid var(--line); background: rgba(18, 27, 38, .72); }
.demo-toolbar label { color: var(--muted); font-size: .78rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.demo-toolbar select { width: 100%; padding: 10px 38px 10px 12px; border: 1px solid var(--line-bright); border-radius: 8px; background: var(--panel); color: var(--text); }
.demo-actions { display: flex; gap: 6px; }
.demo-actions .button { padding: 8px 12px; font-size: .86rem; }
.demo-mode { margin: 0; color: var(--success); font-size: .75rem; white-space: nowrap; }
.demo-workspace { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(330px, .8fr); min-height: 590px; }
.architecture-panel { min-width: 0; padding: 22px; border-right: 1px solid var(--line); background: radial-gradient(circle at 50% 42%, rgba(97, 218, 251, .07), transparent 43%); }
.run-meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .78rem; }
.state-pill { padding: 4px 10px; border: 1px solid var(--line-bright); border-radius: 999px; color: var(--muted); font-weight: 700; }
.demo-shell[data-demo-state="running"] .state-pill { border-color: rgba(87, 221, 160, .45); color: var(--success); }
.demo-shell[data-demo-state="paused"] .state-pill { border-color: rgba(245, 189, 104, .45); color: var(--warning); }
.architecture { position: relative; width: min(100%, 680px); aspect-ratio: 640 / 440; margin: 34px auto 0; }
.architecture svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.routes path { stroke: var(--line-bright); stroke-width: 2; vector-effect: non-scaling-stroke; }
.demo-shell[data-demo-state="running"] .routes path { stroke: url(#route-gradient); stroke-dasharray: 7 11; animation: route-flow .8s linear infinite; }
.pulse-dots circle { fill: var(--accent); opacity: 0; }
.demo-shell[data-demo-state="running"] .pulse-dots circle { opacity: .95; }
.agent-node { position: absolute; z-index: 2; width: 25%; min-width: 108px; min-height: 66px; padding: 10px 9px; display: grid; grid-template-columns: 31px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; border: 1px solid var(--line-bright); border-radius: 12px; background: var(--panel-2); box-shadow: 0 10px 32px rgba(0, 0, 0, .24); transform: translate(-50%, -50%); transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.node-icon { grid-row: 1 / 3; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line-bright); border-radius: 8px; color: var(--accent); font: 700 .72rem "SFMono-Regular", monospace; }
.agent-node strong { overflow: hidden; font-size: clamp(.7rem, 1.3vw, .88rem); text-overflow: ellipsis; white-space: nowrap; }
.agent-node small { color: var(--muted); font-size: .69rem; text-transform: uppercase; letter-spacing: .08em; }
.agent-node[data-status="active"] { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(97, 218, 251, .12), 0 12px 38px rgba(0, 0, 0, .3); transform: translate(-50%, -50%) scale(1.035); }
.agent-node[data-status="active"] small { color: var(--accent); }
.agent-node[data-status="complete"] { border-color: rgba(87, 221, 160, .6); }
.agent-node[data-status="complete"] small { color: var(--success); }
.supervisor { left: 50%; top: 12%; }
.researcher { left: 17.2%; top: 52%; }
.analyst { left: 50%; top: 52%; }
.writer { left: 82.8%; top: 52%; }
.memory { left: 50%; top: 91%; width: 34%; }
.memory .node-icon { color: var(--accent-2); }

.telemetry { min-width: 0; padding: 22px; display: grid; grid-template-rows: auto 245px auto minmax(0, 1fr); background: #080d13; }
.tab-heading { display: flex; justify-content: space-between; align-items: center; }
.tab-heading h3 { font-size: .92rem; letter-spacing: -.01em; }
.tab-heading span { color: var(--muted); font: .68rem "SFMono-Regular", monospace; text-transform: uppercase; }
#context-json { min-height: 0; margin: 12px 0 20px; padding: 16px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #05080c; color: #bfe4ff; font-size: .72rem; line-height: 1.65; white-space: pre-wrap; }
.log-heading { padding-top: 16px; border-top: 1px solid var(--line); }
.event-log { min-height: 0; margin: 12px 0 0; padding: 0; overflow-y: auto; list-style: none; }
.event-log li { position: relative; margin-left: 7px; padding: 0 0 13px 18px; border-left: 1px solid var(--line); color: var(--muted); font-size: .76rem; }
.event-log li::before { content: ""; position: absolute; left: -4px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.event-log strong { color: var(--text); font-weight: 700; }
.final-output { margin: 0 22px 22px; padding: 22px; border: 1px solid rgba(87, 221, 160, .35); border-radius: 12px; background: rgba(87, 221, 160, .07); }
.final-output .eyebrow { color: var(--success); }
.final-output h3 { font-size: 1.25rem; }
.final-output p:last-child { margin-bottom: 0; color: #d8eee3; }

.features { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, 1fr); }
.features article { padding: 52px 34px 52px 0; }
.features article + article { padding-left: 34px; border-left: 1px solid var(--line); }
.number { color: var(--accent); font-family: "SFMono-Regular", monospace; }
.features h2 { font-size: 1.4rem; letter-spacing: -.02em; }
.features article p:last-child { color: var(--muted); }
.backends, .quickstart { padding: 100px 0; }
.backends { display: grid; grid-template-columns: .85fr 1.15fr; gap: 80px; align-items: start; }
.backend-grid { display: grid; gap: 10px; }
.backend-grid > div { padding: 15px 17px; display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.backend-grid code { color: #cfe3ff; }
.backend-grid small, .section-copy { color: var(--muted); }
.backend-grid small { font-size: .76rem; }
.backend-grid .ready { color: var(--success); }
.backend-grid .template { color: var(--warning); }
.quickstart { border-top: 1px solid var(--line); }
.quickstart pre { margin-top: 36px; padding: 26px; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: #cfe3ff; }
footer { padding: 34px 0 55px; display: flex; justify-content: space-between; gap: 30px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
footer div { display: flex; gap: 22px; }

@keyframes route-flow { to { stroke-dashoffset: -18; } }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 35px; }
  .scope-card { max-width: 620px; transform: none; }
  .demo-toolbar { grid-template-columns: auto 1fr auto; }
  .demo-mode { grid-column: 2 / 4; }
  .demo-workspace { grid-template-columns: 1fr; }
  .architecture-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .telemetry { min-height: 520px; }
}

@media (max-width: 760px) {
  .nav { width: min(calc(100% - 28px), var(--max)); }
  nav { gap: 14px; }
  nav a:nth-child(3) { display: none; }
  main, footer { width: min(calc(100% - 28px), var(--max)); }
  .hero { min-height: auto; padding: 68px 0; }
  .section-heading { grid-template-columns: 1fr; gap: 18px; }
  .demo-toolbar { grid-template-columns: 1fr; align-items: stretch; }
  .demo-toolbar label { margin-bottom: -7px; }
  .demo-actions { display: grid; grid-template-columns: repeat(3, 1fr); }
  .demo-mode { grid-column: auto; }
  .architecture-panel { padding: 15px 8px; }
  .architecture { margin-top: 28px; }
  .agent-node { min-width: 88px; min-height: 60px; padding: 7px 5px; grid-template-columns: 24px 1fr; column-gap: 5px; }
  .node-icon { width: 24px; height: 24px; font-size: .58rem; }
  .agent-node strong { font-size: .61rem; }
  .agent-node small { font-size: .54rem; }
  .memory { width: 43%; }
  .telemetry { padding: 16px; }
  .features, .backends { grid-template-columns: 1fr; }
  .features article + article { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .backends { gap: 34px; }
  footer { flex-direction: column; gap: 8px; }
}

@media (max-width: 480px) {
  nav a:first-child, nav a:nth-child(2) { display: none; }
  h1 { font-size: 2.75rem; }
  .install { font-size: .76rem; }
  .architecture { transform: scale(.98); }
  .agent-node { width: 29%; }
  .memory { width: 48%; }
  footer div { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .pulse-dots { display: none; }
}
