/* swarmops.cc: one stylesheet, no web fonts, no scripts. Dark by default; light follows the
   reader's preference. Colours come from docs/assets/logo.svg: violet #7c5cff, amber #d97706. */
:root {
  color-scheme: dark light;
  --bg: #0b0e14;
  --bg-2: #0f141c;
  --surface: #141a23;
  --surface-2: #1a212c;
  --border: #252d3a;
  --text: #e6edf3;
  --muted: #9aa5b4;
  --violet: #8b70ff;
  --violet-strong: #7c5cff;
  --violet-soft: rgba(124, 92, 255, 0.14);
  --amber: #f5a524;
  --amber-soft: rgba(245, 165, 36, 0.14);
  --ahead: #3fb950;
  --parity: #8b949e;
  --behind: #f0883e;
  --code-bg: #0a0d12;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 40px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Ubuntu Sans", "Noto Sans", Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --bg-2: #f7f8fb;
    --surface: #ffffff;
    --surface-2: #f3f4f8;
    --border: #e1e4ea;
    --text: #1b1f27;
    --muted: #57606e;
    --violet: #5b3ee6;
    --violet-strong: #6b4cf0;
    --violet-soft: rgba(107, 76, 240, 0.09);
    --amber: #b45309;
    --amber-soft: rgba(217, 119, 6, 0.12);
    --ahead: #1a7f37;
    --parity: #57606e;
    --behind: #bc4c00;
    --code-bg: #f6f8fa;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 12px 32px rgba(16, 24, 40, 0.08);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--violet); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--amber); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 4px; }
code, pre { font-family: var(--mono); font-size: 0.875em; }
:not(pre) > code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 0.1em 0.35em; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }

/* Header */
.top {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.top .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: -0.01em; font-size: 18px; }
.brand img { width: 30px; height: 30px; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-size: 14.5px; padding: 6px 10px; border-radius: 8px; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav .gh { color: var(--text); border: 1px solid var(--border); }
@media (max-width: 860px) { .nav a:not(.gh) { display: none; } }

/* Hero */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto -10%; height: 120%;
  background: radial-gradient(60% 50% at 25% 40%, var(--violet-soft), transparent 70%),
              radial-gradient(40% 40% at 85% 20%, var(--amber-soft), transparent 70%);
  pointer-events: none;
}
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; padding: 88px 0 80px; }
@media (max-width: 960px) { .hero .wrap { grid-template-columns: 1fr; padding: 56px 0; gap: 36px; } }
.pill { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); border: 1px solid var(--border); background: var(--surface); padding: 4px 12px; border-radius: 999px; }
.pill b { color: var(--amber); font-weight: 600; }
h1 { font-size: clamp(36px, 5.2vw, 60px); line-height: 1.05; letter-spacing: -0.03em; margin: 18px 0 18px; }
h1 em { font-style: normal; background: linear-gradient(90deg, var(--violet), var(--amber)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: clamp(17px, 1.6vw, 19px); color: var(--muted); max-width: 36em; margin: 0 0 28px; }
.lead strong { color: var(--text); font-weight: 600; }
.ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 10px; font-weight: 600; font-size: 15px; text-decoration: none; border: 1px solid var(--border); color: var(--text); background: var(--surface); }
.btn:hover { color: var(--text); border-color: var(--violet); }
.btn.primary { background: var(--violet-strong); border-color: var(--violet-strong); color: #fff; }
.btn.primary:hover { background: var(--violet); color: #fff; }
.facts { display: flex; gap: 18px; flex-wrap: wrap; margin: 26px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 14px; }
.facts li::before { content: "◆"; color: var(--amber); font-size: 9px; margin-right: 7px; vertical-align: 2px; }

/* Terminal */
.term { background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.term .bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.term .bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--border); display: block; }
.term .bar span { margin-left: 8px; font: 12.5px var(--mono); color: var(--muted); }
.term pre { margin: 0; padding: 18px 20px; overflow-x: auto; line-height: 1.65; font-size: 13px; }
.term .p { color: var(--amber); user-select: none; }
.term .c { color: var(--muted); }
.term .k { color: var(--violet); }
.term .ok { color: var(--ahead); }
.term .err { color: var(--behind); }

/* Sections */
section { padding: 88px 0; border-bottom: 1px solid var(--border); }
section.alt { background: var(--bg-2); }
.eyebrow { font: 600 13px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber); margin: 0 0 12px; }
h2 { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 14px; }
.sub { color: var(--muted); max-width: 46em; margin: 0 0 40px; font-size: 17px; }
h3 { font-size: 19px; margin: 0 0 8px; letter-spacing: -0.01em; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 900px) { .cards { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.card p { color: var(--muted); margin: 0; }
.card .icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--violet-soft); color: var(--violet); margin-bottom: 16px; }
.card .icon svg { width: 22px; height: 22px; }

/* Numbers */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-top: 44px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .stats { grid-template-columns: 1fr; } }
.stat { background: var(--surface); padding: 22px 22px 20px; }
.stat b { display: block; font-size: 28px; letter-spacing: -0.02em; line-height: 1.1; white-space: nowrap; }
.stat span { color: var(--muted); font-size: 14px; }
.note { color: var(--muted); font-size: 13.5px; margin-top: 14px; }

/* Figure */
.figure { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.figure img { display: block; width: 100%; }
.figure figcaption { padding: 14px 20px 18px; color: var(--muted); font-size: 14.5px; border-top: 1px solid var(--border); }
/* The interactive figure comes in a dark and a light page: link the one the reader's theme wants. */
.on-light { display: none; }
@media (prefers-color-scheme: light) { .on-dark { display: none; } .on-light { display: inline; } }

/* Architecture */
.arch { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; }
@media (max-width: 900px) { .arch { grid-template-columns: 1fr; } }
.stack { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.stack li { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 18px; display: grid; grid-template-columns: 170px 1fr; gap: 14px; align-items: baseline; }
.stack li code { background: none; border: 0; padding: 0; color: var(--violet); font-weight: 600; }
.stack li span { color: var(--muted); font-size: 14.5px; }
@media (max-width: 520px) { .stack li { grid-template-columns: 1fr; gap: 2px; } }
.disk { margin: 0; overflow-x: auto; background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; font: 13.5px/1.75 var(--mono); }
.disk .d { color: var(--amber); }
.disk .m { color: var(--muted); }

/* Comparison */
.cmp { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cmp th, .cmp td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--border); vertical-align: top; font-size: 15px; }
.cmp tr:last-child td { border-bottom: 0; }
.cmp th { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--surface-2); }
.cmp td:first-child { font-weight: 600; white-space: nowrap; }
.cmp td:nth-child(2) { color: var(--muted); }
.v { display: inline-block; font: 600 12.5px/1 var(--sans); padding: 5px 9px; border-radius: 999px; white-space: nowrap; border: 1px solid currentColor; }
.v.ahead { color: var(--ahead); }
.v.parity { color: var(--parity); }
.v.behind { color: var(--behind); }
.v.later { color: var(--muted); border-style: dashed; }
.cmp td:last-child { color: var(--muted); font-size: 14px; }
.cmp td:last-child .v { margin-right: 4px; }
.cmp code { white-space: nowrap; }
@media (max-width: 720px) {
  .cmp td:nth-child(2) { display: none; } .cmp th:nth-child(2) { display: none; }
  .cmp th, .cmp td { padding: 12px; }
  .cmp td:first-child { white-space: normal; width: 36%; }
}

/* Code blocks */
.code { background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.code .label { font: 600 12px/1 var(--mono); color: var(--muted); padding: 11px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.code pre { margin: 0; padding: 18px 20px; overflow-x: auto; line-height: 1.7; font-size: 13.5px; }
.steps { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.steps.one { grid-template-columns: 1fr; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr; } }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.tools li { font: 13px var(--mono); padding: 5px 10px; border-radius: 8px; background: var(--violet-soft); color: var(--violet); }

/* Roadmap */
.road { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 900px) { .road { grid-template-columns: 1fr; } }
.road h3 { display: flex; align-items: center; gap: 10px; }
.road h3 .dot { width: 10px; height: 10px; border-radius: 50%; }
.road .done .dot { background: var(--ahead); }
.road .now .dot { background: var(--amber); }
.road .next .dot { background: var(--parity); }
.road ol { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.road li { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; }
.road li b { font-family: var(--mono); color: var(--violet); margin-right: 8px; }
.road li span { color: var(--muted); font-size: 14.5px; }
.usable { margin-top: 30px; color: var(--muted); }

/* Footer */
footer { padding: 44px 0 56px; color: var(--muted); font-size: 14.5px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; justify-content: space-between; }
footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--text); }

/* 404 */
.lost { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 60px 20px; }
.lost img { width: 96px; height: 96px; }
.arch.spaced { margin-top: 28px; }
