/* chocomarsh.com's light system (surface, Geologica + JetBrains Mono, hairlines, pill buttons) with
   swarmdash's own teal identity; the console blocks are the only dark surfaces on the page. */
:root {
  --bg: #f6f7f6;
  --card: #ffffff;
  --ink: #121a1c;
  --muted: #5b6669;
  --faint: #8a9497;
  --line: #e3e7e5;
  --line-2: #d9dfdd;
  --accent: #0b8576;
  --accent-soft: rgba(11, 133, 118, 0.1);
  --mark: linear-gradient(135deg, #14b8a6, #0ea5e9);
  --console: #0c1416;
  --console-ink: #d7e3e1;
  --console-dim: #6b8086;
  --console-line: #1d2a2d;
  --console-accent: #2dd4bf;
  --ok: #18a058;
  --locked: #a86f00;
  --down: #d93636;
  --font: 'Geologica', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }

a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

::selection { background: rgba(11, 133, 118, 0.18); }

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

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 32px;
}

/* Reveal-on-scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in-view { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(246, 247, 246, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--mark);
  color: #04201c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.logo-mark svg { width: 15px; height: 15px; }

.nav-links {
  display: flex;
  gap: 24px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}

.nav-links a:hover { color: var(--ink); }

.nav-right { display: flex; align-items: center; gap: 10px; }

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line-2);
}

.nav-icon:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

.nav-icon svg { width: 16px; height: 16px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 11px 20px;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(11, 133, 118, 0.25); }

.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }

.btn-ghost:hover { box-shadow: inset 0 0 0 1px var(--ink); }

.nav .btn, .btn-copy { font-family: var(--mono); font-size: 13.5px; font-weight: 500; }

.btn-copy { position: relative; overflow: hidden; }

.btn-copy .ok-flash {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  transform: translateY(100%);
  transition: transform .25s ease;
}

.btn-copy.copied .ok-flash { transform: translateY(0); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Hero */
.hero { padding: 60px 0 56px; }

.hero-top {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  align-items: end;
  margin-bottom: 36px;
}

h1 {
  font-size: 58px;
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 700;
  text-wrap: balance;
}

h1 .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.4em);
  animation: word-in 0.7s cubic-bezier(.2, .8, .2, 1) forwards;
}

h1 .accent, h2 em { font-style: normal; color: var(--accent); }

@keyframes word-in { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) { h1 .word { opacity: 1; transform: none; animation: none; } }

.lead { color: var(--muted); font-size: 17px; max-width: 46ch; margin-bottom: 22px; }

/* Console — the hero's centerpiece, and the only dark block besides the install command */
.console {
  background: var(--console);
  color: var(--console-ink);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(18, 26, 28, 0.06), 0 30px 70px -30px rgba(11, 133, 118, 0.45);
}

.console-bar, .mock-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 11px;
}

.console-bar { color: var(--console-dim); border-bottom: 1px solid var(--console-line); }

.console-bar i, .mock-bar i { width: 10px; height: 10px; border-radius: 50%; background: #26363a; flex: none; }

.console-bar span { margin-left: auto; }

.console-body {
  padding: 18px 20px 20px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
  min-height: 230px;
  overflow-x: auto;
}

.console-body > div { white-space: pre; }

.prompt { color: var(--console-accent); }

.console-body .out { color: var(--console-dim); }

.console-body .ok { color: #4ade80; }

.console-body .table { color: var(--console-ink); }

.console-body .table-head { color: var(--console-dim); }

.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  margin-left: 4px;
  vertical-align: -3px;
  background: var(--console-accent);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
}

.hero-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }

.hero-stat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  opacity: 0;
  transform: translateY(4px);
}

.hero-stat.is-loaded { opacity: 1; transform: none; transition: opacity .5s ease, transform .5s ease; }

.hero-stat:hover { color: var(--ink); }

.hero-stat-icon { width: 14px; height: 14px; color: var(--faint); flex: none; }

.hero-stat:hover .hero-stat-icon { color: var(--accent); }

.hero-stat-n { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.hero-stat-sep, .hero-stats + .meta-fact::before { width: 1px; height: 13px; background: var(--line-2); }

.meta-fact { display: inline-flex; align-items: center; gap: 20px; }

/* Only separated from the stats while they're there: a failed /stats fetch removes #hero-stats. */
.hero-stats + .meta-fact::before { content: ""; display: inline-block; }

@media (prefers-reduced-motion: reduce) { .hero-stat { transition: none; opacity: 1; transform: none; } }

/* Sections */
.section {
  padding: 64px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 60px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 10px;
}

h2 {
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 700;
  text-wrap: balance;
}

h2 code { font-size: 0.86em; font-weight: 500; }

.section-head { max-width: 680px; margin-bottom: 28px; }

.section-head p { color: var(--muted); margin-top: 10px; max-width: 62ch; }

.demo-note { color: var(--muted); font-size: 13px; margin-top: 14px; }

.demo-note code { color: var(--ink); }

/* Live demo shell — real captured swarmdash pages shown in a scaled iframe */
.mock-shell {
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(18, 26, 28, 0.04), 0 24px 60px rgba(11, 133, 118, 0.08);
}

.mock-bar { gap: 8px; border-bottom: 1px solid var(--line); }

.mock-bar i { background: var(--line-2); }

.mock-url {
  flex: 1;
  margin: 0 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--faint);
  text-align: center;
  font-size: 11.5px;
}

.mock-expand {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line-2);
  white-space: nowrap;
}

.mock-expand:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

.mock-expand svg { width: 12px; height: 12px; flex: none; }

.mock-tabs { display: flex; gap: 2px; padding: 0 10px; border-bottom: 1px solid var(--line); overflow-x: auto; }

.mock-tab {
  flex: none;
  padding: 10px 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}

.mock-tab:hover { color: var(--ink); }

.mock-tab:focus-visible { outline-offset: -2px; }

.mock-tab.active { color: var(--ink); border-color: var(--accent); }

@media (max-width: 700px) { .mock-expand span { display: none; } .mock-expand { padding: 6px 8px; } }

.snap-frame-wrap { position: relative; width: 100%; overflow: hidden; background: #f5f6fa; }

.snap-frame { display: block; width: 1440px; height: 900px; border: 0; transform-origin: top left; background: #f5f6fa; }

.snap-frame-wrap.loading::after {
  content: "loading snapshot…";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 12.5px;
}

/* Features — a two-column spec list, filled from FEATURES in index.js */
.spec { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; }

.spec > div {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
}

.spec dt { font-family: var(--mono); font-size: 13px; color: var(--accent); padding-top: 1px; }

.spec dd { color: var(--muted); }

/* Architecture */
.arch-wrap { display: grid; grid-template-columns: 0.85fr 1fr; gap: 52px; align-items: center; }

.arch-copy h2 { margin-bottom: 12px; }

.arch-copy p { color: var(--muted); max-width: 44ch; }

.arch-copy code, .security-item code { color: var(--ink); font-size: 0.9em; }

.arch-diagram {
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 26px 24px;
  min-width: 0;
}

.arch-node {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  min-width: 0;
}

.arch-node .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }

.arch-node b { font-weight: 500; }

.arch-node .tag { color: var(--faint); margin-left: auto; font-size: 11px; }

.arch-agent { flex-direction: column; align-items: flex-start; gap: 2px; }

.arch-agent .tag { margin-left: 0; }

.arch-link { position: relative; height: 34px; }

.arch-link .line { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--line-2); }

.arch-link .flow, .arch-bus .flow { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.arch-link .flow { left: 50%; margin-left: -2.5px; animation: flow-down 1.8s linear infinite; }

.arch-link .label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--card);
  padding: 0 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--faint);
  white-space: nowrap;
}

@keyframes flow-down { 0% { top: -6px; opacity: 0; } 15%, 85% { opacity: 1; } 100% { top: 100%; opacity: 0; } }

.arch-bus { position: relative; height: 22px; margin: 0 16.6%; }

.arch-bus .bar { position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line-2); }

.arch-bus .tick { position: absolute; top: 0; width: 1px; height: 22px; background: var(--line-2); }

.arch-bus .flow { top: -2.5px; animation: flow-across 2.6s ease-in-out infinite; }

@keyframes flow-across { 0% { left: 0%; opacity: 0; } 8%, 92% { opacity: 1; } 46% { left: 50%; } 100% { left: 100%; opacity: 0; } }

@media (prefers-reduced-motion: reduce) { .arch-link .flow, .arch-bus .flow { animation: none; opacity: 0; } }

.arch-fanout { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

/* Access */
.free-tags { display: flex; flex-wrap: wrap; gap: 8px; font-family: var(--mono); font-size: 13px; }

.free-tag {
  position: relative;
  color: var(--muted);
  padding: 6px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.free-tag::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 50%;
  height: 1.5px;
  background: var(--down);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s ease;
}

.free-tag.struck::after { transform: scaleX(1); }

.free-ours { padding: 6px 14px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 500; }

.compare {
  margin-top: 28px;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  overflow: hidden;
}

.compare-toggle { display: flex; gap: 6px; padding: 12px; border-bottom: 1px solid var(--line); }

.toggle-btn {
  padding: 7px 14px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line-2);
}

.toggle-btn:hover { color: var(--ink); }

.toggle-btn.active { color: #fff; background: var(--accent); box-shadow: none; }

.compare-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  opacity: 0;
  transform: translateY(6px);
  animation: row-in .4s ease forwards;
}

.compare-row:first-child { border-top: 0; }

.compare-row .label { color: var(--ink); }

.compare-row .val { font-family: var(--mono); font-size: 12.5px; text-align: right; }

.compare-row .val.locked { color: var(--locked); }

.compare-row .val.free { color: var(--accent); font-weight: 700; }

@keyframes row-in { to { opacity: 1; transform: none; } }

/* Security — one light panel split by hairlines, like chocomarsh.com's #about tiles */
.security-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  overflow: hidden;
}

.security-item { background: var(--card); padding: 20px 22px; min-width: 0; }

.security-item .label { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 6px; }

.security-item .label svg { width: 15px; height: 15px; color: var(--accent); flex: none; }

.security-item p { color: var(--muted); font-size: 14px; }

.security-cta { margin-top: 22px; }

/* Install */
.pipe {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  overflow: hidden;
}

.step { padding: 20px 22px; border-right: 1px solid var(--line); min-width: 0; }

.step:last-child { border-right: 0; }

.step .mono { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: var(--faint); transition: color .3s ease; }

.step .box {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid var(--line-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: transparent;
  transition: all .3s ease;
}

.step.done .mono { color: var(--accent); }

.step.done .box { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.step b { display: block; margin: 6px 0 2px; font-size: 17px; }

.step p { font-size: 14px; color: var(--muted); }

.cmd {
  margin-top: 14px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--console);
  color: var(--console-ink);
  border-radius: 14px;
  padding: 16px 18px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.8;
}

.cmd-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }

.term-copy {
  flex: none;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--console-accent);
  color: #04201c;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
}

/* CTA */
.cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  padding: 36px;
}

.cta > div:first-child { min-width: 0; flex: 1 1 380px; }

.cta p { color: var(--muted); margin-top: 8px; max-width: 52ch; }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 36px 0 28px; }

.footer-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; }

.footer-row .logo { font-size: 17px; }

.footer-links { display: flex; gap: 20px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }

.footer-links a:hover { color: var(--ink); }

.footer-note { margin-top: 22px; font-family: var(--mono); font-size: 12px; color: var(--muted); }

.footer-note a:hover { color: var(--ink); }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .hero-top, .spec, .arch-wrap { grid-template-columns: 1fr; }
  .hero-top { gap: 20px; }
  .security-grid { grid-template-columns: 1fr 1fr; }
  .support-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pipe { grid-template-columns: 1fr 1fr; }
  .step:nth-child(2) { border-right: 0; }
  .step:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 600px) {
  .container { padding: 0 18px; }
  h1 { font-size: 38px; }
  h2 { font-size: 27px; }
  .hero { padding: 36px 0 44px; }
  .section { padding: 48px 0; }
  .spec > div { grid-template-columns: 1fr; gap: 2px; }
  .security-grid, .support-grid, .pipe { grid-template-columns: 1fr; }
  .step { border-right: 0; border-bottom: 1px solid var(--line); }
  .step:last-child { border-bottom: 0; }
  .arch-fanout { grid-template-columns: 1fr; }
  .arch-bus { display: none; }
  .nav-icon { display: none; }
  .nav .btn { padding: 9px 14px; }
  .cta { padding: 26px; }
  .cmd { flex-direction: column; }
}
