/* agentcomm — transit-map theme: warm paper, ink, route lines.
   Routes = channels · stops = commits · boarding = register. */
:root {
  --paper: #faf7f2;
  --paper-dim: #f1ece3;
  --ink: #1a2330;
  --dim: #5d6a7a;
  --card: #ffffff;
  --edge: #e3ddd2;
  --terminal: #171d26;        /* code stays a dark island */
  --terminal-text: #dbe6f2;
  --terminal-out: #7fd1a8;
  --line-git: #f2a900;        /* the Repo Line — school-bus yellow */
  --line-git-text: #8a6100;   /* amber-ink: yellow that survives as text */
  --line-blue: #2456c8;
  --line-green: #2e9e44;
  --line-amber: #e08a00;
  --line-red: #d64550;
  --line-violet: #7048b6;
  --accent: var(--line-git);
  --accent2: var(--line-violet);
  --text: var(--ink);
  --text-dim: var(--dim);
  --card-border: var(--edge);
  --bg-soft: var(--terminal);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", -apple-system, "Helvetica Neue", system-ui, sans-serif;
  --display: "Space Grotesk", var(--sans);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* the starfield belongs to the old night sky — not the transit map */
#bg-canvas, .vignette { display: none; }

main, header, footer { position: relative; z-index: 2; }

a { color: var(--line-git-text); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }

code, pre, .mono { font-family: var(--mono); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---- nav: the station sign ---- */
nav.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 3px solid var(--ink);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
}
.brand .dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--paper);
  border: 3.5px solid var(--line-git);
  box-shadow: none;
}
.nav-links { display: flex; gap: 22px; align-items: center; font-size: 0.92rem; }
.nav-links a { color: var(--dim); font-weight: 600; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }

/* ---- hero ---- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 88px 24px 36px;
}
.kicker {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--line-git);
  border-radius: 999px;
  padding: 6px 16px;
  margin-bottom: 22px;
}
h1.headline {
  font-family: var(--display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  line-height: 1.06;
  margin: 0 0 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 880px;
}
.subhead {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--dim);
  max-width: 600px;
  margin: 0 0 32px;
}
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-bottom: 26px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  border: 2px solid var(--ink);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--line-git);
  color: var(--ink);
  border-color: var(--ink);
  text-decoration: none;
}
.btn-primary:hover { text-decoration: none; filter: brightness(1.06); }
.btn-ghost { background: transparent; color: var(--ink); text-decoration: none; }
.btn-ghost:hover { background: var(--paper-dim); text-decoration: none; }

.badges { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.badge {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--dim);
  border: 1.5px solid var(--edge);
  border-radius: 999px;
  padding: 5px 12px;
  background: var(--card);
}

/* ---- the bus itself ---- */
.hero-bus { width: 100%; max-width: 640px; margin: 4px auto 30px; }
.hero-bus svg { display: block; width: 100%; height: auto; }
.hb-road { stroke: var(--ink); stroke-width: 4; }
.hb-dash { stroke: var(--paper-dim); stroke-width: 3; stroke-dasharray: 18 14; animation: hb-roll 1.6s linear infinite; }
@keyframes hb-roll { to { stroke-dashoffset: -32; } }
@media (prefers-reduced-motion: reduce) { .hb-dash { animation: none; } }

/* ---- code: always a dark terminal island ---- */
.codeblock {
  position: relative;
  background: var(--terminal);
  border: none;
  border-radius: 10px;
  padding: 14px 16px;
  text-align: left;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--terminal-text);
  overflow-x: auto;
  max-width: 560px;
  margin: 0 auto;
}
.codeblock .line { white-space: pre-wrap; overflow-wrap: anywhere; }
.codeblock .line + .line { margin-top: 4px; }
.codeblock .line.out { color: var(--terminal-out); }
.codeblock:has(.copy-btn) { padding-top: 40px; } /* Copy gets its own strip — text can never slide under it */
.copy-btn {
  position: absolute;
  top: 9px;
  right: 10px;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--terminal-text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  padding: 4px 9px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.copy-btn:hover { color: #fff; border-color: rgba(255, 255, 255, 0.45); }
.copy-btn.copied { color: var(--terminal-out); border-color: var(--terminal-out); }

/* ---- sections ---- */
section { padding: 84px 0; }
.section-head { text-align: center; margin-bottom: 48px; }
.section-head .kicker { margin-bottom: 14px; }
h2.section-title {
  font-family: var(--display);
  font-size: clamp(1.8rem, 3.4vw, 2.4rem);
  margin: 0 0 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.section-sub { color: var(--dim); max-width: 560px; margin: 0 auto; }

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---- architecture diagram: station boxes ---- */
.diagram { display: flex; flex-direction: column; align-items: center; gap: 0; }
.diagram-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.diagram-box {
  background: var(--card);
  border: 1.5px solid var(--edge);
  border-radius: 12px;
  padding: 14px 20px;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--ink);
  text-align: center;
  min-width: 150px;
  box-shadow: 0 2px 0 var(--edge);
}
.diagram-box.accent { border-color: var(--line-git); color: var(--line-git-text); font-weight: 600; }
.diagram-box .label-sub { color: var(--dim); font-size: 0.74rem; font-weight: 400; display: block; margin-top: 4px; }
.diagram-arrow { font-family: var(--mono); color: var(--dim); font-size: 1.1rem; margin: 10px 0; }
.backend-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 760px;
  margin-top: 4px;
}
@media (max-width: 720px) {
  .backend-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---- command grid: fare cards ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.card {
  background: var(--card);
  border: 1.5px solid var(--edge);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 2px 0 var(--edge);
  transition: border-color 0.2s, transform 0.2s;
}
.card:hover { border-color: var(--line-git); transform: translateY(-2px); }
.card .cmd {
  font-family: var(--mono);
  color: var(--line-git-text);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 8px;
  display: block;
}
.card p { color: var(--dim); margin: 0; font-size: 0.9rem; }

/* ---- backends: the network map ---- */
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1.5px solid var(--edge); background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; min-width: 720px; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--edge); }
th {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
  background: var(--paper-dim);
}
td.mono { font-family: var(--mono); color: var(--line-git-text); font-weight: 600; font-size: 0.84rem; }
tr:last-child td { border-bottom: none; }
.yes { color: var(--line-green); font-weight: 700; }
.no { color: var(--dim); }

/* ---- plugin panel ---- */
.plugin-panel {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 36px;
  align-items: center;
  background: var(--card);
  border: 1.5px solid var(--edge);
  border-radius: 18px;
  box-shadow: 0 2px 0 var(--edge);
  padding: 42px;
}
@media (max-width: 760px) {
  .plugin-panel { grid-template-columns: 1fr; }
}
.plugin-panel h3 { font-family: var(--display); margin-top: 0; font-size: 1.4rem; color: var(--ink); }
.plugin-panel p { color: var(--dim); }
.plugin-panel ul { color: var(--dim); padding-left: 18px; font-size: 0.92rem; }
.plugin-panel li { margin-bottom: 6px; }

/* ---- use cases: route cards ---- */
.usecase-stack { display: flex; flex-direction: column; gap: 28px; margin-bottom: 56px; }
.usecase-panel {
  --uc: var(--line-git);
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 36px;
  align-items: center;
  background: var(--card);
  border: 1.5px solid var(--edge);
  border-radius: 18px;
  box-shadow: 0 2px 0 var(--edge);
  padding: 38px;
}
.usecase-panel::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 6px;
  background: var(--uc);
}
.usecase-panel:nth-child(even) .usecase-copy { order: 2; }
.usecase-panel:nth-child(even) .usecase-visual { order: 1; }
.usecase-copy, .usecase-visual { min-width: 0; }
.uc-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--uc-text, #fff);
  background: var(--uc);
  border: none;
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 12px;
}
.usecase-panel h3 { font-family: var(--display); font-size: 1.35rem; margin: 0 0 10px; color: var(--ink); }
.usecase-copy p { color: var(--dim); font-size: 0.95rem; margin: 0; }
.uc-code { max-width: none; margin: 18px 0 0; font-size: 0.79rem; }
.uc-note { font-size: 0.84rem; margin-top: 14px !important; }
.usecase-visual .diagram-box { min-width: 128px; font-size: 0.78rem; padding: 12px 14px; }
.uc-bus {
  width: 100%;
  border-color: var(--uc);
  color: var(--uc-strong, var(--uc));
  font-weight: 700;
  position: relative;
  overflow: hidden;
}
.uc-bus::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 40%;
  left: -40%;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--uc) 12%, transparent), transparent);
  animation: bus-sweep 3.2s linear infinite;
}
@keyframes bus-sweep { to { left: 100%; } }
.uc-img {
  display: block;
  width: 100%;
  border-radius: 12px;
  border: 1.5px solid var(--edge);
}

/* ---- get-started steps: three stops on the line ---- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step {
  min-width: 0;
  background: var(--card);
  border: 1.5px solid var(--edge);
  border-radius: 14px;
  box-shadow: 0 2px 0 var(--edge);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.step-head { display: flex; align-items: center; gap: 10px; }
.step-head h3 { font-family: var(--display); font-size: 1.05rem; margin: 0; color: var(--ink); }
.step-n {
  width: 26px; height: 26px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-family: var(--mono); font-size: 0.8rem; font-weight: 700;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--line-git);
}
.step-code { max-width: none; margin: 0; font-size: 0.76rem; flex: 1; }
.step-code .line { white-space: pre-wrap; overflow-wrap: anywhere; }
.step-note { color: var(--dim); font-size: 0.84rem; margin: 0; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

/* ---- git graph: the two-line metro map ---- */
.git-anim { display: block; width: 100%; height: auto; }
.ga-label { fill: var(--dim); font: 700 12px var(--sans); }
.ga-line { stroke-width: 5; opacity: 1; stroke-linecap: round; }
.ga-line.ga-code-line { stroke: var(--line-blue); }
.ga-line.ga-msg-line { stroke: var(--line-git); }
.ga-dot { fill: var(--card); stroke-width: 3.5; }
.ga-dot.ga-code { stroke: var(--line-blue); }
.ga-dot.ga-msg { stroke: var(--line-git); }
.ga-tag { font: 600 11px var(--mono); text-anchor: middle; }
.ga-tag.ga-code-t { fill: var(--line-blue); }
.ga-tag.ga-msg-t { fill: var(--line-git-text); }
.ga-pop { opacity: 0; animation: ga-pop 13s linear infinite; }
@keyframes ga-pop {
  0% { opacity: 0; }
  3% { opacity: 1; }
  82% { opacity: 1; }
  92% { opacity: 0; }
  100% { opacity: 0; }
}
.ga-caption { margin-top: 10px; text-align: center; font-size: 0.82rem; color: var(--dim); }
.ga-caption code { color: var(--ink); font-weight: 700; }

/* ---- enterprise band ---- */
.enterprise-band {
  border: 2px solid var(--ink);
  background: var(--card);
  border-radius: 18px;
  box-shadow: 0 3px 0 var(--ink);
  padding: 42px;
}
.enterprise-head { max-width: 720px; margin: 0 auto 28px; text-align: center; }
.enterprise-head h3 { font-family: var(--display); font-size: 1.6rem; margin: 0 0 12px; color: var(--ink); }
.enterprise-head p { color: var(--dim); margin: 0; }
.enterprise-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.enterprise-foot { text-align: center; color: var(--dim); font-size: 0.88rem; margin: 24px 0 0; }

/* ---- footer ---- */
footer {
  border-top: 3px solid var(--ink);
  padding: 36px 0 48px;
  text-align: center;
  color: var(--dim);
  font-size: 0.86rem;
}
footer a { color: var(--dim); }
footer a:hover { color: var(--ink); }
.footer-links { display: flex; gap: 18px; justify-content: center; margin-bottom: 14px; flex-wrap: wrap; }

/* ---- mobile ---- */
@media (max-width: 720px) {
  nav.topbar { display: block; text-align: center; padding: 10px 12px; }
  nav.topbar .brand { justify-content: center; margin-bottom: 6px; }
  nav.topbar .nav-links { display: block; font-size: 0.85rem; line-height: 1.9; }
  nav.topbar .nav-links a { margin: 0 7px; white-space: nowrap; }
  .wrap { padding: 0 16px; }
  section { padding: 56px 0; }
  .hero { padding: 64px 16px 40px; }
  .subhead { margin-bottom: 28px; }
  .codeblock { max-width: 100%; font-size: 0.78rem; }
  .section-head { margin-bottom: 34px; }
  .plugin-panel { padding: 24px 18px; gap: 24px; }
  .usecase-panel { grid-template-columns: 1fr; padding: 22px 16px 22px 24px; gap: 22px; }
  .usecase-panel:nth-child(even) .usecase-copy { order: 1; }
  .usecase-panel:nth-child(even) .usecase-visual { order: 2; }
  .usecase-stack { margin-bottom: 36px; }
  .enterprise-band { padding: 26px 18px; }
  .enterprise-head h3 { font-size: 1.35rem; }
  .enterprise-grid { grid-template-columns: 1fr; }
  .diagram-box { min-width: 100px; padding: 10px 12px; font-size: 0.76rem; }
  .uc-code { font-size: 0.72rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ga-pop { animation: none; opacity: 1; }
  .uc-bus::after { animation: none; }
}

/* ---- live board: departures, straight from the bus branch ---- */
.board {
  max-width: 760px;
  margin: 0 auto;
  background: var(--terminal);
  border-radius: 14px;
  padding: 18px 22px 10px;
  font-family: var(--mono);
}
.board-head, .board-row {
  display: grid;
  grid-template-columns: 200px 1fr 130px;
  gap: 14px;
  padding: 8px 4px;
  align-items: baseline;
  min-width: 0;
}
.board-head {
  color: #8494a8;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.board-row { border-bottom: 1px solid rgba(255, 255, 255, 0.06); font-size: 0.82rem; }
.board-row:last-child { border-bottom: none; }
.board-name { color: var(--line-git); font-weight: 700; display: flex; gap: 8px; align-items: center; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.board-dot { width: 8px; height: 8px; border-radius: 50%; background: #3a4453; flex: none; }
.board-dot.on { background: var(--terminal-out); box-shadow: 0 0 6px var(--terminal-out); }
.board-status { color: var(--terminal-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-status.idle { color: #8494a8; font-style: italic; }
.board-seen { color: #8494a8; font-size: 0.76rem; text-align: right; }
.board-foot { color: #8494a8; font-size: 0.78rem; font-family: var(--sans); padding: 12px 4px 8px; margin: 0; }
.board-foot a { color: var(--line-git); }
@media (max-width: 720px) {
  .board-head, .board-row { grid-template-columns: 130px 1fr; }
  .board-head span:last-child, .board-seen { display: none; }
}
