/* ============ Design tokens ============ */
:root {
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --ink: #16181d;
  --ink-soft: #3d4350;
  --ink-mute: #6b7280;
  --line: #e5e7eb;
  --accent: #b3223c;        /* wolfberry red */
  --accent-dark: #8f1a30;
  --accent-2: #2b6cb0;
  --code-bg: #14161c;
  --code-ink: #d7dae0;
  --code-key: #7fb4e8;
  --code-val: #a8d5a2;
  --code-comment: #7a8194;
  --code-head: #e8c07f;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 18, 26, .06), 0 8px 24px rgba(15, 18, 26, .07);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 .6em; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: var(--mono);
  font-size: .875em;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: .1em .35em;
}

pre {
  margin: 0;
  overflow-x: auto;
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  font-size: .82rem;
  line-height: 1.6;
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }
pre .k { color: var(--code-key); }
pre .v { color: var(--code-val); }
pre .c { color: var(--code-comment); font-style: italic; }
pre .h { color: var(--code-head); font-weight: 600; }

/* ============ Header / nav ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 26px; height: 26px; flex: none; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  font-size: .92rem;
  font-weight: 500;
}
.nav-links a { color: var(--ink-soft); }
.nav-links a:hover { color: var(--accent); text-decoration: none; }
.nav-github {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .3rem .85rem;
}

/* ============ Hero ============ */
.hero {
  padding: 5rem 0 4.5rem;
  background:
    radial-gradient(52rem 26rem at 82% -8rem, rgba(179, 34, 60, .07), transparent 60%),
    radial-gradient(40rem 22rem at -8% 110%, rgba(43, 108, 176, .06), transparent 60%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 3.5rem;
  align-items: center;
}

.eyebrow {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2.1rem, 4.5vw, 3rem);
  font-weight: 800;
}
.hero h1 em { font-style: normal; color: var(--accent); }

.lede { font-size: 1.13rem; color: var(--ink-soft); max-width: 34em; }

.cta-row { display: flex; gap: .8rem; flex-wrap: wrap; margin: 1.6rem 0 .9rem; }
.cta-row.center { justify-content: center; margin-top: 2.2rem; }

.btn {
  display: inline-block;
  border-radius: 8px;
  padding: .62rem 1.35rem;
  font-weight: 600;
  font-size: .95rem;
  transition: background .15s, border-color .15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); background: var(--bg); }
.btn-ghost:hover { border-color: var(--ink-mute); }

.hero-note { font-size: .9rem; color: var(--ink-mute); }

.hero-code { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }

.hero-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  color: var(--ink-mute);
  font-family: var(--mono);
  font-size: .8rem;
  padding: .1rem 0;
}

.code-card {
  margin: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-width: 0;
}
.code-card figcaption {
  display: flex;
  align-items: center;
  gap: .35rem;
  background: #1d2029;
  color: #9aa1b2;
  font-family: var(--mono);
  font-size: .74rem;
  padding: .5rem .95rem;
  border-bottom: 1px solid #2a2e3a;
}
.code-card figcaption .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: #3a3f4d;
}
.code-card figcaption .dot:first-child { margin-left: 0; }
.code-card figcaption .dot:nth-child(3) { margin-right: .45rem; }
.code-card pre { border-radius: 0; }

/* ============ Sections ============ */
.section { padding: 4.5rem 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-lede { font-size: 1.06rem; color: var(--ink-soft); max-width: 46em; margin-bottom: 2.2rem; }
.section-foot { margin-top: 2rem; color: var(--ink-soft); }

/* ============ Cards ============ */
.cards { display: grid; gap: 1.1rem; }
.cards.three { grid-template-columns: repeat(3, 1fr); }
.cards.four { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow);
}
.card h3 { margin-bottom: .45em; }
.card h3 code { font-size: 1rem; color: var(--accent); background: rgba(179, 34, 60, .07); border-color: rgba(179, 34, 60, .18); }
.card p { color: var(--ink-soft); font-size: .95rem; margin: 0; }
.card-cmd {
  display: block;
  margin-top: .9rem;
  padding: .4em .7em;
  font-size: .8rem;
  color: var(--ink-soft);
}

/* ============ Tabs ============ */
.tabs {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tab-bar {
  display: flex;
  gap: .25rem;
  border-bottom: 1px solid var(--line);
  padding: .5rem .75rem 0;
  background: var(--bg);
  overflow-x: auto;
}

.tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  font: inherit;
  font-size: .92rem;
  font-weight: 600;
  color: var(--ink-mute);
  padding: .55rem .95rem;
  cursor: pointer;
  white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }

.tab-panel { display: none; padding: 1.25rem; }
.tab-panel.is-active { display: block; }
.panel-note { margin: 1rem 0 0; font-size: .92rem; color: var(--ink-mute); }

/* ============ CLI grid ============ */
.cmd-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; }

.cmd {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  background: var(--bg);
}
.cmd > code {
  display: inline-block;
  font-weight: 600;
  color: var(--accent-dark);
  background: rgba(179, 34, 60, .06);
  border-color: rgba(179, 34, 60, .15);
  margin-bottom: .55rem;
}
.cmd p { margin: 0; font-size: .88rem; color: var(--ink-soft); }

/* ============ Split (agents) ============ */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.checklist { list-style: none; padding: 0; margin: 1.2rem 0 0; }
.checklist li {
  position: relative;
  padding-left: 1.9rem;
  margin-bottom: .95rem;
  color: var(--ink-soft);
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .42em;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: var(--accent);
  -webkit-mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="black" d="M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zm3.7 5.9-4.2 4.6a.75.75 0 0 1-1.1.02L4.3 8.4a.75.75 0 1 1 1.08-1.04l1.55 1.6 3.66-4.03a.75.75 0 0 1 1.11 1z"/></svg>') center / contain no-repeat;
          mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="black" d="M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zm3.7 5.9-4.2 4.6a.75.75 0 0 1-1.1.02L4.3 8.4a.75.75 0 1 1 1.08-1.04l1.55 1.6 3.66-4.03a.75.75 0 0 1 1.11 1z"/></svg>') center / contain no-repeat;
}
.checklist strong { color: var(--ink); }

/* ============ Install ============ */
.install-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.install-grid.two { grid-template-columns: 1fr 1fr; }

.install-note {
  margin-top: 1.2rem;
  font-size: .9rem;
  color: var(--ink-mute);
}

.install {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.install-label {
  display: block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding: .6rem 1rem .45rem;
}
.install pre { border-radius: 0; }

/* ============ Docs ============ */
.doc-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }

.doc {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  color: inherit;
  background: var(--bg);
  transition: border-color .15s, box-shadow .15s;
}
.doc:hover { text-decoration: none; border-color: var(--accent); box-shadow: var(--shadow); }
.doc h3 { color: var(--accent); margin-bottom: .35em; font-size: 1.02rem; }
.doc p { margin: 0; font-size: .89rem; color: var(--ink-soft); }

/* ============ Footer ============ */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
  padding: 3rem 0 2rem;
  font-size: .92rem;
  color: var(--ink-soft);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
}
.footer-grid a { display: block; color: var(--ink-soft); margin-bottom: .45rem; }
.footer-grid a:hover { color: var(--accent); }

.footer-brand { font-weight: 700; color: var(--ink); margin-bottom: .5rem; }
.footer-h {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: .8rem;
}

.footer-legal {
  margin-top: 2.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  font-size: .85rem;
  color: var(--ink-mute);
}

/* ============ Comparison table ============ */
/* The table is wider than a phone; let it scroll inside its own box rather than
   forcing the page to scroll sideways. */
.table-wrap { overflow-x: auto; margin: 0 -1px; }

.compare {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: .93rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.compare th,
.compare td {
  padding: .85rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.compare thead th {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-mute);
  background: var(--bg-alt);
  white-space: nowrap;
}
.compare tbody th {
  font-weight: 600;
  color: var(--ink-soft);
  width: 11rem;
}
.compare td { color: var(--ink-soft); }
.compare tbody tr:last-child th,
.compare tbody tr:last-child td { border-bottom: 0; }

/* The AMARK column is the point of the table - keep it visually distinct. */
.compare .is-us { background: rgba(179, 34, 60, .045); color: var(--ink); }
.compare thead .is-us { color: var(--accent); background: rgba(179, 34, 60, .08); }

/* ============ Responsive ============ */
@media (max-width: 920px) {
  .hero-grid, .split { grid-template-columns: 1fr; gap: 2.2rem; }
  .cards.three, .cmd-grid, .doc-list { grid-template-columns: 1fr 1fr; }
  .hero { padding: 3.2rem 0; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .nav-links { gap: .9rem; }
  .nav-links a:not(.nav-github) { display: none; }
  .cards.three, .cards.four, .cmd-grid, .doc-list, .install-grid, .footer-grid { grid-template-columns: 1fr; }
  .section { padding: 3rem 0; }
  h2 { font-size: 1.55rem; }
}
