:root {
  --bg: #080b10;
  --bg-soft: #0b0f16;
  --panel: #0a0e14;
  --line: #1b2431;
  --line-soft: #151c26;
  --fg: #c8d5e4;
  --fg-dim: #8b9bb0;
  --muted: #66768c;
  --green: #3fb950;
  --cyan: #58a6ff;
  --amber: #d29922;
  --red: #f85149;
  --magenta: #bc8cff;
  --term-bg: #05070a;
  --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: ui-sans-serif, -apple-system, "Segoe UI", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --radius: 12px;
  --max: 1160px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(900px 520px at 50% -140px, rgba(63, 185, 80, .10), transparent 70%),
    radial-gradient(700px 420px at 85% 0, rgba(88, 166, 255, .07), transparent 70%),
    var(--bg);
  color: var(--fg);
  font: 15px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre { font-family: var(--mono); font-variant-ligatures: none; }

/* ---------- top bar ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px max(18px, calc((100vw - var(--max)) / 2));
  border-bottom: 1px solid var(--line-soft);
  background: rgba(8, 11, 16, .82);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--fg);
  font-weight: 650;
  font-size: 14px;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; color: #fff; }
.logo {
  color: var(--green);
  font-size: 17px;
  line-height: 1;
  animation: blink 1.4s steps(1) infinite;
}

.nav { display: flex; align-items: center; gap: 4px; font-size: 13.5px; }
.nav a {
  color: var(--fg-dim);
  padding: 6px 10px;
  border-radius: 8px;
}
.nav a:hover { color: var(--fg); background: #121822; text-decoration: none; }
.nav .gh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fg);
  border: 1px solid var(--line);
  margin-left: 6px;
}
.nav .gh:hover { background: #131b25; border-color: #2a3648; }
.lang {
  margin-left: 4px;
  padding: 6px 9px;
  font: 500 12px var(--mono);
  color: var(--fg-dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}
.lang:hover { color: var(--fg); border-color: #2a3648; }

/* ---------- hero ---------- */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 74px 22px 34px;
  text-align: left;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  padding: 5px 12px 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 500 12.5px var(--mono);
  color: var(--fg-dim);
  background: #0b1017;
}
.dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(63, 185, 80, .16);
}

.hero h1 {
  margin: 0 0 22px;
  font-size: clamp(30px, 5.1vw, 54px);
  line-height: 1.12;
  letter-spacing: -.03em;
  font-weight: 700;
}
.grad {
  background: linear-gradient(96deg, #3fb950 0%, #58d0b8 42%, #58a6ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  max-width: 700px;
  margin: 0 0 26px;
  color: var(--fg-dim);
  font-size: 15.5px;
}

.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 17px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--fg);
  font-size: 14px;
  font-weight: 550;
  background: #0d131b;
  transition: border-color .15s, background .15s, transform .15s;
}
.btn:hover { text-decoration: none; border-color: #33425a; background: #111923; }
.btn.primary {
  background: linear-gradient(180deg, #2ea043, #238636);
  border-color: #2ea043;
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 6px 18px -8px rgba(46, 160, 67, .8);
}
.btn.primary:hover { background: linear-gradient(180deg, #35b24c, #2a9a3e); }

.honest {
  max-width: 700px;
  padding: 12px 14px;
  border-left: 2px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

/* ---------- stage ---------- */
.stage-wrap {
  scroll-margin-top: 72px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 26px 22px 10px;
}
.stage-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.stage-head h2 { margin: 0; font-size: 18px; letter-spacing: -.01em; }

.scenarios { display: flex; gap: 6px; flex-wrap: wrap; }
.scen {
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #0b1017;
  color: var(--fg-dim);
  font: 500 13px var(--sans);
  cursor: pointer;
  transition: all .15s;
}
.scen:hover { color: var(--fg); border-color: #33425a; }
.scen.on {
  color: #dff5e4;
  border-color: rgba(63, 185, 80, .55);
  background: rgba(63, 185, 80, .12);
}

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 12px;
  align-items: stretch;
}

.col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 470px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 13px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--fg-dim);
  background: #0a0f16;
}
.col-head .muted { font: 500 11px var(--mono); color: #4d5b6e; text-transform: lowercase; }

/* agent chat column */
.chat {
  flex: 1;
  overflow-y: auto;
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: #22303f transparent;
}
.chat::-webkit-scrollbar { width: 8px; }
.chat::-webkit-scrollbar-thumb { background: #1e2a38; border-radius: 4px; }

.msg { animation: rise .28s ease-out both; }

.msg .call {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font: 12.5px/1.5 var(--mono);
  color: var(--fg-dim);
  word-break: break-word;
}
.msg .call .tname { color: var(--cyan); font-weight: 600; }
.msg .call .paren { color: #46566a; }
.msg .call .k { color: #8b9bb0; }
.msg .call .v { color: #d8c48a; }
.msg .call .n { color: var(--magenta); }

.res {
  margin: 6px 0 0;
  padding: 9px 11px;
  border: 1px solid var(--line-soft);
  border-left: 2px solid #24344a;
  border-radius: 7px;
  background: #060a0f;
  font: 11.6px/1.55 var(--mono);
  color: #9fb0c4;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 190px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.res.err { border-left-color: var(--red); background: rgba(248, 81, 73, .05); color: #ffb3ae; }
.res .g { color: var(--green); }
.res .y { color: var(--amber); }
.res .r { color: var(--red); }
.res .c { color: var(--cyan); }
.res .d { color: #5a6a7e; }
.res .m { color: var(--magenta); }

.badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.badge {
  padding: 1px 7px;
  border-radius: 999px;
  font: 600 10.5px/1.7 var(--mono);
  border: 1px solid;
}
.badge.ok { color: #6fdd82; border-color: rgba(63, 185, 80, .35); background: rgba(63, 185, 80, .10); }
.badge.warn { color: #e8b93f; border-color: rgba(210, 153, 34, .35); background: rgba(210, 153, 34, .10); }
.badge.bad { color: #ff8f88; border-color: rgba(248, 81, 73, .38); background: rgba(248, 81, 73, .10); }
.badge.info { color: #82bdff; border-color: rgba(88, 166, 255, .32); background: rgba(88, 166, 255, .10); }

.note {
  align-self: flex-start;
  max-width: 92%;
  padding: 8px 11px;
  border-radius: 9px;
  background: #0e1520;
  border: 1px solid var(--line-soft);
  color: #a8b8cb;
  font-size: 12.5px;
  line-height: 1.55;
}
.note.you { border-color: rgba(188, 140, 255, .35); background: rgba(188, 140, 255, .07); }
.note b { color: var(--fg); font-weight: 600; }

/* terminal panel */
.panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: var(--term-bg);
}

.tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px 0;
  background: #0a0e15;
  border-bottom: 1px solid var(--line-soft);
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 7px 7px 0 0;
  font: 500 12px var(--sans);
  color: #5d6b7d;
}
.tab.active { color: var(--fg); background: var(--term-bg); box-shadow: 0 -1px 0 var(--line-soft) inset; }
.tabs-right { margin-left: auto; padding: 0 6px 5px; color: #3b4859; font: 11px var(--mono); }

.panelbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  background: #080c12;
  border-bottom: 1px solid var(--line-soft);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(63, 185, 80, .28);
  background: rgba(63, 185, 80, .09);
  color: #7fdc90;
  font: 500 11.5px var(--sans);
  white-space: nowrap;
}
.pdot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.human { color: #e8b93f; border-color: rgba(210, 153, 34, .3); background: rgba(210, 153, 34, .1); }
.pill.observe { color: #82bdff; border-color: rgba(88, 166, 255, .3); background: rgba(88, 166, 255, .1); }
.pill.sealed { color: #ff8f88; border-color: rgba(248, 81, 73, .32); background: rgba(248, 81, 73, .1); }
.pill.exited { color: #8b9bb0; border-color: var(--line); background: #0b1017; }

.panel-actions { display: flex; align-items: center; gap: 4px; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 24px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #6b7c91;
  cursor: pointer;
  transition: all .15s;
}
.icon-btn:hover { color: var(--fg); background: #121a24; border-color: var(--line); }
.icon-btn[hidden] { display: none; }
.icon-btn.on { color: #82bdff; border-color: rgba(88, 166, 255, .4); background: rgba(88, 166, 255, .12); }
.icon-btn.on.danger { color: #ff8f88; border-color: rgba(248, 81, 73, .4); background: rgba(248, 81, 73, .12); }

.pulse { animation: pulse 1.35s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(63, 185, 80, .0); color: var(--green); border-color: rgba(63, 185, 80, .55); }
  50% { box-shadow: 0 0 0 5px rgba(63, 185, 80, .12); color: #8ff0a2; border-color: rgba(63, 185, 80, .9); }
}

.pending {
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid rgba(188, 140, 255, .35);
  background: rgba(188, 140, 255, .1);
  color: #cfadff;
  font: 500 11px var(--mono);
  white-space: nowrap;
}

.light {
  height: 2px;
  background: linear-gradient(90deg, #3fb950, #58d0b8, #58a6ff, #bc8cff, #3fb950);
  background-size: 300% 100%;
  opacity: .12;
  transition: opacity .3s;
}
.light.run { opacity: 1; animation: sweep 1.9s linear infinite; }
@keyframes sweep { to { background-position: 300% 0; } }

.term {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 13px 14px 16px;
  outline: none;
  cursor: text;
  scrollbar-width: thin;
  scrollbar-color: #1b2632 transparent;
}
.term::-webkit-scrollbar { width: 8px; }
.term::-webkit-scrollbar-thumb { background: #1b2632; border-radius: 4px; }
.term:focus-visible { box-shadow: inset 0 0 0 1px rgba(88, 166, 255, .35); }

.term-lines {
  font: 12.2px/1.5 var(--mono);
  color: #c2cfdd;
  white-space: pre-wrap;
  word-break: break-word;
  letter-spacing: .002em;
}
.term-lines .ln { min-height: 1.5em; }
.term-lines .g { color: var(--green); }
.term-lines .y { color: var(--amber); }
.term-lines .r { color: var(--red); }
.term-lines .c { color: var(--cyan); }
.term-lines .m { color: var(--magenta); }
.term-lines .d { color: #55657a; }
.term-lines .b { color: #e8f1fa; font-weight: 600; }
.term-lines .echo { color: #d7e3f0; }

.cur {
  display: inline-block;
  width: .55em;
  height: 1.05em;
  margin-left: 1px;
  vertical-align: -.16em;
  background: #b9c7d6;
  animation: blink 1.1s steps(1) infinite;
}
.typing .cur { background: #58a6ff; }

.gate {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-top: 1px solid rgba(63, 185, 80, .3);
  background: linear-gradient(180deg, rgba(63, 185, 80, .13), rgba(63, 185, 80, .05));
  color: #b9f0c4;
  font-size: 12.5px;
}
.gate[hidden] { display: none; }
.gate-ico { color: var(--green); font-weight: 700; }
.gate-skip {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(63, 185, 80, .3);
  background: transparent;
  color: #8fcf9d;
  font: 11.5px var(--sans);
  cursor: pointer;
  white-space: nowrap;
}
.gate-skip:hover { background: rgba(63, 185, 80, .15); color: #d6ffdf; }

/* transport */
.transport {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0a0f16;
}
.tp-left { display: flex; align-items: center; gap: 2px; }
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 27px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--fg-dim);
  cursor: pointer;
}
.btn-icon:hover { color: var(--fg); background: #121a24; border-color: var(--line); }
.btn-icon[hidden] { display: none; }
.btn-icon.speed { font: 600 11px var(--mono); width: 34px; }

.caption {
  margin: 0;
  min-height: 1.4em;
  color: #a4b4c8;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}
.caption b { color: #e6f0fa; font-weight: 600; }

.tp-right { display: flex; align-items: center; gap: 10px; }
.beatnum { font: 500 11px var(--mono); color: #4d5b6e; white-space: nowrap; }
.progress { width: 96px; height: 3px; border-radius: 2px; background: #16202c; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #2ea043, #58d0b8); transition: width .3s; }

/* ---------- cards ---------- */
.cards {
  max-width: var(--max);
  margin: 0 auto;
  padding: 54px 22px 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.card {
  padding: 18px 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #0c121a, #0a0f16);
}
.card h3 { margin: 0 0 10px; font-size: 14.5px; letter-spacing: -.01em; color: #e3edf7; }
.card p { margin: 0; color: var(--fg-dim); font-size: 13.2px; line-height: 1.68; }

/* ---------- tools ---------- */
.tools, .install {
  scroll-margin-top: 72px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 46px 22px 0;
}
.tools h2, .install h2 { margin: 0 0 8px; font-size: 19px; letter-spacing: -.01em; }
.section-note { margin: 0 0 16px; color: var(--muted); font-size: 13.2px; max-width: 720px; }

.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #0a0f16; }
table { width: 100%; border-collapse: collapse; font-size: 13.2px; }
th, td { padding: 9px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line-soft); }
th { font: 600 11.5px var(--mono); color: #64748b; background: #080d13; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #0c131c; }
td code { color: #8fd0ff; font-size: 12.4px; }
td:first-child { white-space: nowrap; width: 190px; }
td:last-child { color: var(--fg-dim); }

/* ---------- install ---------- */
.install-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
}
.install h4 { margin: 0 0 6px; font-size: 13.5px; color: #dbe6f2; }
.install p { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.install pre {
  margin: 0;
  padding: 12px 13px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #060a0f;
  overflow-x: auto;
}
.install pre code { font-size: 12px; color: #a9bdd2; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- footer ---------- */
.foot {
  max-width: var(--max);
  margin: 60px auto 0;
  padding: 20px 22px 34px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12.5px;
}
.muted { color: var(--muted); }

@keyframes rise { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr; }
  .install-grid { grid-template-columns: 1fr; }
  .stage { grid-template-columns: 1fr; }
  .col { height: auto; }
  .agent-col { height: 290px; }
  .term-col { height: 400px; }
  .transport { grid-template-columns: auto 1fr; grid-template-areas: "left right" "cap cap"; }
  .transport .tp-left { grid-area: left; }
  .transport .caption { grid-area: cap; padding: 4px 6px 0; }
  .transport .tp-right { grid-area: right; justify-self: end; }
  .hero { padding-top: 48px; }
  td:first-child { width: auto; }
}

@media (max-width: 640px) {
  .nav a:not(.gh) { display: none; }
  .hero h1 { letter-spacing: -.02em; }
  .stage-head h2 { font-size: 16px; }
  .scen { font-size: 12.5px; padding: 6px 11px; }
  .term-lines { font-size: 11.5px; }
  .progress { width: 60px; }
  .toolbar-hide { display: none; }
  .stage-wrap { padding-left: 14px; padding-right: 14px; }
  .hero, .cards, .tools, .install, .foot { padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}

/* sealed panel gets a red hairline, content stays visible to the person */
.panel.sealed .term { box-shadow: inset 0 2px 0 rgba(248, 81, 73, .55); }
.panel.sealed .light { background: var(--red); opacity: .35; }
