:root {
  --bg: #f7f7f5;
  --bg-elev: #ffffff;
  --bg-sunk: #eeeeea;
  --fg: #16181d;
  --fg-muted: #5b6069;
  --fg-faint: #8a8f98;
  --line: #dcdcd6;
  --line-strong: #c6c6bf;
  --accent: #0f8a5f;
  --accent-ink: #0b6b4a;
  --accent-soft: rgba(15, 138, 95, 0.12);
  --amber: #b26a00;
  --amber-soft: rgba(178, 106, 0, 0.12);
  --red: #c23a3a;
  --term-bg: #14171d;
  --term-fg: #d7dbe2;
  --term-muted: #7c8391;
  --term-green: #5ee39a;
  --term-amber: #f2b64c;
  --term-cyan: #7ad0f0;
  --term-red: #ff7b7b;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 12px 40px rgba(0, 0, 0, 0.08);
  --radius: 10px;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --max: 1120px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0c0e12;
  --bg-elev: #12151b;
  --bg-sunk: #090b0e;
  --fg: #e6e8ec;
  --fg-muted: #9aa1ac;
  --fg-faint: #656c77;
  --line: #22262e;
  --line-strong: #2f343e;
  --accent: #5ee39a;
  --accent-ink: #8cf0b8;
  --accent-soft: rgba(94, 227, 154, 0.12);
  --amber: #f2b64c;
  --amber-soft: rgba(242, 182, 76, 0.14);
  --red: #ff7b7b;
  --term-bg: #0a0c10;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 48px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0e12;
    --bg-elev: #12151b;
    --bg-sunk: #090b0e;
    --fg: #e6e8ec;
    --fg-muted: #9aa1ac;
    --fg-faint: #656c77;
    --line: #22262e;
    --line-strong: #2f343e;
    --accent: #5ee39a;
    --accent-ink: #8cf0b8;
    --accent-soft: rgba(94, 227, 154, 0.12);
    --amber: #f2b64c;
    --amber-soft: rgba(242, 182, 76, 0.14);
    --red: #ff7b7b;
    --term-bg: #0a0c10;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 48px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.35;
  mask-image: radial-gradient(ellipse 70% 50% at 50% 0%, #000 0%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 50% at 50% 0%, #000 0%, transparent 100%);
}

a {
  color: var(--accent-ink);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

code,
kbd,
pre {
  font-family: var(--mono);
  font-size: 0.9em;
}

p code,
li code,
td code,
h2 code,
h3 code,
dt code {
  background: var(--bg-sunk);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.08em 0.4em;
  font-size: 0.86em;
  color: var(--fg);
  white-space: nowrap;
}

h1,
h2,
h3,
h4 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  font-weight: 650;
}

h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 1em;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding-inline: 24px;
  min-width: 0;
}

.hero-grid > *,
.manifesto-grid > *,
.split > *,
.flow > *,
.docs > * {
  min-width: 0;
}

.kicker {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.kicker::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--accent);
}

.lede {
  font-size: 1.15rem;
  color: var(--fg-muted);
  max-width: 60ch;
}

/* Nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}

.nav .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 60px;
}

.brand {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.brand:hover {
  text-decoration: none;
}

.brand .cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  background: var(--accent);
  vertical-align: -0.15em;
  animation: blink 1.1s steps(2, start) infinite;
}

@keyframes blink {
  to {
    visibility: hidden;
  }
}

.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  color: var(--fg-muted);
  font-size: 0.92rem;
  padding: 6px 10px;
  border-radius: 6px;
}

.nav-links a:hover {
  color: var(--fg);
  background: var(--bg-sunk);
  text-decoration: none;
}

.nav-links a[aria-current="page"] {
  color: var(--fg);
}

.icon-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--fg-muted);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--fg);
  border-color: var(--line-strong);
}

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

:root[data-theme="dark"] .sun,
:root:not([data-theme="light"]) .sun {
  display: block;
}

:root[data-theme="dark"] .moon,
:root:not([data-theme="light"]) .moon {
  display: none;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .sun {
    display: none;
  }

  :root:not([data-theme="dark"]) .moon {
    display: block;
  }
}

:root[data-theme="light"] .sun {
  display: none;
}

:root[data-theme="light"] .moon {
  display: block;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--fg);
  color: var(--bg);
}

.btn-secondary {
  background: var(--bg-elev);
  color: var(--fg);
  border-color: var(--line-strong);
}

.btn svg {
  width: 16px;
  height: 16px;
}

/* Terminal */

.term {
  background: var(--term-bg);
  color: var(--term-fg);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.65;
  overflow: hidden;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--term-muted);
  font-size: 0.75rem;
}

.term-bar .dots {
  display: inline-flex;
  gap: 6px;
}

.term-bar .dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #3a3f4a;
}

.term-bar .title {
  margin-left: auto;
  margin-right: auto;
}

.term-body {
  padding: 16px 18px 18px;
  margin: 0;
  overflow-x: auto;
  white-space: pre;
  min-height: 15.5em;
}

.term .p {
  color: var(--term-muted);
}

.term .c {
  color: var(--term-fg);
  font-weight: 600;
}

.term .g {
  color: var(--term-green);
}

.term .a {
  color: var(--term-amber);
}

.term .cy {
  color: var(--term-cyan);
}

.term .r {
  color: var(--term-red);
}

.term .m {
  color: var(--term-muted);
}

.term .caret {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  background: var(--term-green);
  vertical-align: -0.2em;
  animation: blink 1s steps(2, start) infinite;
}

/* Code blocks */

.code {
  position: relative;
  background: var(--term-bg);
  color: var(--term-fg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  margin: 0 0 1.25em;
  overflow: hidden;
}

.code pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
}

.code .p {
  color: var(--term-muted);
  user-select: none;
}

.code .g {
  color: var(--term-green);
}

.code .a {
  color: var(--term-amber);
}

.code .cy {
  color: var(--term-cyan);
}

.code .r {
  color: var(--term-red);
}

.code .m {
  color: var(--term-muted);
}

.code .k {
  color: #c792ea;
}

.code .s {
  color: #c3e88d;
}

.copy {
  position: absolute;
  top: 8px;
  right: 8px;
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--term-muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.code:hover .copy,
.copy:focus-visible {
  opacity: 1;
}

.copy:hover {
  color: var(--term-fg);
}

.code[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 10px;
  right: 60px;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--term-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  pointer-events: none;
}

/* Hero */

.hero {
  padding: 88px 0 72px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 56px;
  align-items: center;
}

.hero h1 .accent {
  color: var(--accent);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 22px;
}

.install-line {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--fg-muted);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 8px 8px 14px;
  max-width: 100%;
}

.install-line code {
  color: var(--fg);
  white-space: nowrap;
  overflow-x: auto;
  min-width: 0;
}

.install-line button {
  flex-shrink: 0;
}

.term {
  max-width: 100%;
}

.install-line button {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-sunk);
  color: var(--fg-muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.install-line button:hover {
  color: var(--fg);
}

.agents {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--fg-faint);
  font-size: 0.85rem;
  font-family: var(--mono);
}

.agents span::before {
  content: "✓ ";
  color: var(--accent);
}

/* Manifesto */

.manifesto {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-elev);
  padding: 80px 0;
}

.manifesto-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
}

.manifesto h2 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  max-width: 16ch;
}

.manifesto .big {
  font-size: 1.2rem;
  color: var(--fg);
  max-width: 48ch;
}

.claims {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 18px;
}

.claims li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 14px;
  align-items: start;
}

.claims .n {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.8rem;
  padding-top: 5px;
}

.claims strong {
  display: block;
  font-weight: 650;
  margin-bottom: 2px;
}

.claims p {
  margin: 0;
  color: var(--fg-muted);
}

/* Sections */

.section {
  padding: 80px 0;
}

.section-head {
  max-width: 62ch;
  margin-bottom: 40px;
}

/* Flow */

.flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 16px;
  align-items: stretch;
}

.node {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  min-height: 150px;
}

.node .tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 8px;
}

.node h3 {
  font-family: var(--mono);
  font-size: 1rem;
  margin-bottom: 8px;
  font-weight: 600;
}

.node p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.92rem;
}

.edge {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  color: var(--fg-faint);
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 0 4px;
}

.edge code {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid transparent;
  padding: 3px 8px;
  border-radius: 6px;
}

.edge svg {
  width: 44px;
  height: 14px;
  color: var(--line-strong);
}

.flow-note {
  margin-top: 24px;
  color: var(--fg-muted);
  max-width: 70ch;
}

/* Feature grid */

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.feature {
  background: var(--bg-elev);
  padding: 26px 24px;
}

.feature .glyph {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 12px;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent-soft);
}

.feature h3 {
  font-size: 1.02rem;
  margin-bottom: 6px;
}

.feature p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.93rem;
}

/* Two-column blocks */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.split .code {
  margin: 0;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: grid;
  gap: 14px;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  color: var(--fg-muted);
}

.steps li::before {
  content: "0" counter(step);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  padding-top: 4px;
}

.steps strong {
  color: var(--fg);
  font-weight: 600;
}

/* Tables */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 0 0 1.4em;
}

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-faint);
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.4em;
}

.table-wrap table {
  margin: 0;
  min-width: 480px;
}

/* Footer */

.footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: center;
}

.footer .brand {
  font-size: 0.95rem;
}

.footer nav {
  margin-left: auto;
  display: flex;
  gap: 20px;
}

.footer a {
  color: var(--fg-muted);
}

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

/* Docs layout */

.docs {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 56px;
  padding-block: 40px 96px;
}

.sidebar {
  position: sticky;
  top: 84px;
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  font-size: 0.9rem;
}

.sidebar h4 {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin: 18px 0 8px;
  font-weight: 600;
}

.sidebar h4:first-child {
  margin-top: 0;
}

.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar a {
  display: block;
  padding: 5px 10px;
  border-left: 2px solid transparent;
  color: var(--fg-muted);
  border-radius: 0 6px 6px 0;
}

.sidebar a:hover {
  color: var(--fg);
  background: var(--bg-sunk);
  text-decoration: none;
}

.sidebar a.active {
  color: var(--accent-ink);
  border-left-color: var(--accent);
  background: var(--accent-soft);
}

.sidebar a code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.88em;
}

.sidebar-toggle {
  display: none;
}

.content {
  max-width: 76ch;
}

.content > section {
  padding-bottom: 40px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--line);
}

.content > section:last-child {
  border-bottom: none;
}

.content h2 {
  font-size: 1.7rem;
  margin-top: 0;
  scroll-margin-top: 84px;
}

.content h3 {
  margin-top: 2em;
  scroll-margin-top: 84px;
}

.content h2 a.anchor,
.content h3 a.anchor {
  color: var(--fg-faint);
  font-weight: 400;
  margin-left: 8px;
  opacity: 0;
  text-decoration: none;
}

.content h2:hover a.anchor,
.content h3:hover a.anchor {
  opacity: 1;
}

.content h3 code {
  font-size: 0.95em;
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent-ink);
}

.content p,
.content li {
  color: var(--fg);
}

.content ul {
  padding-left: 1.2em;
}

.content li {
  margin-bottom: 0.35em;
}

.cmd-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
}

.cmd-head .summary {
  color: var(--fg-muted);
  font-size: 0.95rem;
}

.usage {
  font-family: var(--mono);
  font-size: 0.88rem;
  background: var(--bg-sunk);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 12px 0 16px;
  overflow-x: auto;
  white-space: nowrap;
}

.usage .arg {
  color: var(--accent-ink);
}

.callout {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--bg-elev);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 0 0 1.4em;
  font-size: 0.95rem;
}

.callout.warn {
  border-left-color: var(--amber);
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout strong {
  font-weight: 650;
}

.symbols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 0 0 1.4em;
}

.symbols div {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 0.85rem;
}

.symbols b {
  display: inline-block;
  width: 1.4em;
  font-weight: 700;
}

.symbols .plus b {
  color: var(--accent);
}

.symbols .tilde b {
  color: var(--term-cyan);
}

.symbols .minus b {
  color: var(--fg-faint);
}

.symbols .bang b {
  color: var(--amber);
}

.exit-code {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent-ink);
}

/* Responsive */

@media (max-width: 960px) {
  .hero-grid,
  .manifesto-grid,
  .split {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .features {
    grid-template-columns: repeat(2, 1fr);
  }

  .flow {
    grid-template-columns: 1fr;
  }

  .term-body {
    height: 15.5em;
    overflow-y: hidden;
  }

  .edge {
    grid-auto-flow: column;
    padding: 4px 0;
  }

  .edge svg {
    transform: rotate(90deg);
    width: 24px;
  }

  .docs {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .sidebar {
    position: static;
    max-height: none;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    background: var(--bg-elev);
  }

  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }

  .sidebar[hidden] {
    display: none;
  }
}

@media (max-width: 640px) {
  .hero {
    padding: 56px 0 48px;
  }

  .features {
    grid-template-columns: 1fr;
  }

  .symbols {
    grid-template-columns: repeat(2, 1fr);
  }

  .code[data-lang]::before {
    display: none;
  }

  .nav .wrap {
    gap: 12px;
  }

  .nav-links {
    gap: 2px;
  }

  .nav-links a {
    padding: 6px 7px;
    font-size: 0.88rem;
  }

  .nav-links a.hide-sm {
    display: none;
  }

  .section,
  .manifesto {
    padding: 56px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .brand .cursor,
  .term .caret {
    animation: none;
  }

  .term-body {
    height: auto;
  }

  .btn:hover {
    transform: none;
  }
}
