@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg: #f6f7f2;
  --surface: #ffffff;
  --ink: #17211b;
  --muted: #5c665f;
  --line: #d9dfd6;
  --accent: #0f7a4f;
  --accent-strong: #075c3b;
  --accent-soft: #e8f2ec;
  --terminal: #111714;
  --terminal-line: #27322d;
  --code: #f0f3ed;
  --gold: #d59b25;
  --blue: #315f96;
  --shadow: 0 18px 50px rgba(23, 33, 27, 0.1);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(246, 247, 242, 0) 320px),
    radial-gradient(circle at 18% 10%, rgba(15, 122, 79, 0.13), transparent 26rem),
    var(--bg);
  color: var(--ink);
  font-family:
    'Inter',
    Avenir Next,
    Segoe UI,
    Helvetica Neue,
    sans-serif;
  letter-spacing: -0.01em;
  line-height: 1.6;
}

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

code,
pre {
  font-family:
    JetBrains Mono,
    Cascadia Mono,
    SFMono-Regular,
    Consolas,
    monospace;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding: 0 48px;
  border-bottom: 1px solid rgba(217, 223, 214, 0.82);
  background: rgba(246, 247, 242, 0.9);
  backdrop-filter: blur(18px);
}

.brand,
.topnav,
.top-actions,
.hero-actions,
.terminal-chrome,
.doc-heading,
.doc-meta,
.reference-heading,
.api-list {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #ffffff;
  font-size: 12px;
  text-transform: uppercase;
}

.topnav {
  gap: 6px;
}

.topnav a,
.github-link,
.search-link,
.version-link {
  padding: 9px 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.topnav a:hover,
.topnav a.active,
.github-link:hover,
.search-link:hover,
.version-link:hover {
  color: var(--ink);
}

.top-actions {
  gap: 8px;
}

.search-link {
  min-width: 168px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: #7a847e;
}

.search-link::before {
  content: "/";
  display: inline-grid;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.version-link {
  border: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.hero {
  min-height: calc(100vh - 68px);
  padding: 76px 48px 44px;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(440px, 1.1fr);
  gap: 56px;
  max-width: 1180px;
  margin: 0 auto;
  align-items: center;
}

.eyebrow,
.section-kicker,
.sidebar-title {
  margin: 0 0 14px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(58px, 9vw, 128px);
  line-height: 0.9;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.02;
}

h3 {
  margin-bottom: 10px;
  font-size: 18px;
}

.lede,
.doc-section p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.lede {
  max-width: 620px;
  font-size: 21px;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border: 1px solid var(--ink);
  font-size: 15px;
  font-weight: 800;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button.primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.button.primary {
  background: var(--ink);
  color: #ffffff;
}

.button.secondary {
  background: transparent;
}

.home-band {
  padding: 0 48px 86px;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  max-width: 1180px;
  margin: 0 auto;
}

.home-grid a {
  display: grid;
  gap: 12px;
  min-height: 170px;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(23, 33, 27, 0.06);
}

.home-grid a {
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.home-grid a:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(15, 122, 79, 0.12);
}

.home-grid span {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.home-grid strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.35;
}

.hero-code {
  display: grid;
  gap: 18px;
}

.terminal,
.code-card {
  overflow: hidden;
  border: 1px solid var(--terminal-line);
  box-shadow: var(--shadow);
}

.terminal {
  background: var(--terminal);
  color: #eaf1e9;
}

.terminal.small {
  transform: translateY(6px);
}

.terminal.compact {
  align-self: start;
}

.terminal-chrome {
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-bottom: 1px solid var(--terminal-line);
  background: #161e1a;
}

.terminal-chrome span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d96556;
}

.terminal-chrome span:nth-child(2) {
  background: var(--gold);
}

.terminal-chrome span:nth-child(3) {
  background: #36a76d;
}

.terminal-chrome p {
  margin: 0 0 0 auto;
  color: #8f9a94;
  font-size: 12px;
  font-weight: 700;
}

pre {
  margin: 0;
  white-space: pre-wrap;
}

.terminal pre,
.code-card {
  padding: 22px;
  font-size: 14px;
  line-height: 1.75;
}

.prompt {
  color: #71d49c;
  font-weight: 800;
}

.code-card {
  border-color: var(--line);
  background: var(--code);
  color: #18201b;
}

.code-card.muted {
  color: #52615a;
}

.docs-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 190px;
  gap: 36px;
  max-width: 1320px;
  margin: 0 auto;
  padding: 44px 48px 92px;
  border-top: 1px solid var(--line);
}

.sidebar {
  position: sticky;
  top: 92px;
  align-self: start;
  display: grid;
  gap: 2px;
  padding: 18px 0;
}

.sidebar-group {
  margin: 22px 0 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.sidebar-group:first-of-type {
  margin-top: 4px;
}

.sidebar a,
.toc a {
  padding: 8px 10px;
  border-left: 3px solid transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.doc-content {
  display: grid;
  gap: 28px;
  min-width: 0;
}

.doc-section,
.reference-section {
  padding: 40px 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 88px;
}

.doc-section:first-child {
  padding-top: 12px;
}

.doc-heading {
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 10px;
}

.doc-heading h2 {
  margin-bottom: 0;
}

.doc-meta {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 220px;
}

.doc-meta span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.reference-section {
  padding: 34px 0;
}

.reference-section p {
  max-width: 780px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.68;
}

.reference-heading {
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 10px;
}

.reference-heading h2 {
  margin-bottom: 0;
  font-size: clamp(26px, 3vw, 38px);
}

.reference-heading .section-kicker {
  margin-bottom: 0;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(330px, 0.75fr);
  gap: 32px;
  align-items: start;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.quick-grid article {
  display: grid;
  gap: 7px;
  min-height: 118px;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.quick-grid strong {
  color: var(--ink);
  font-size: 14px;
}

.quick-grid span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.note {
  display: grid;
  gap: 4px;
  margin-top: 18px;
  padding: 14px 16px;
  border-left: 4px solid var(--gold);
  background: #fffaf0;
}

.note strong {
  color: var(--ink);
  font-size: 13px;
}

.note span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}

.feature-grid article {
  min-height: 160px;
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.feature-grid p {
  margin-bottom: 0;
  font-size: 15px;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.api-list {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.api-list a {
  padding: 10px 13px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--blue);
  font-weight: 750;
}

.api-list a {
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}

.api-list a:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.signature {
  margin: 18px 0;
  padding: 15px 16px;
  border-left: 4px solid var(--accent);
  background: var(--surface);
  color: #17211b;
  font-size: 14px;
  line-height: 1.6;
}

.reference-table {
  width: 100%;
  margin: 18px 0 22px;
  border-collapse: collapse;
  border-top: 1px solid var(--line);
  background: var(--surface);
  font-size: 15px;
}

.reference-table tr {
  border-bottom: 1px solid var(--line);
}

.reference-table th,
.reference-table td {
  padding: 14px 12px;
  vertical-align: top;
  text-align: left;
}

.reference-table th {
  width: 220px;
  background: #f8faf6;
  color: var(--ink);
  font-family:
    JetBrains Mono,
    Cascadia Mono,
    SFMono-Regular,
    Consolas,
    monospace;
  font-weight: 800;
}

.reference-table td {
  background: var(--surface);
  color: var(--muted);
  line-height: 1.55;
}

.final-cta {
  border-bottom: 0;
}

.toc {
  position: sticky;
  top: 92px;
  align-self: start;
  display: grid;
  gap: 2px;
  padding: 18px 0;
}

.toc-title {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.toc a {
  border-left-color: var(--line);
}

.toc a:hover {
  border-left-color: var(--accent);
  color: var(--ink);
}

/* ── Footer ────────────────────────────────────── */
.site-footer {
  margin-top: auto;
  padding: 42px 48px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  max-width: 1180px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 8px;
}

.footer-copy {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  max-width: 280px;
}

.footer-nav-group h4 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.footer-nav-group a {
  display: block;
  padding: 4px 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.14s ease;
}

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

.footer-bottom {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ── Feature highlights (homepage) ─────────────── */
.why-band {
  padding: 72px 48px;
  background: var(--ink);
  color: #fff;
}

.why-inner {
  max-width: 1180px;
  margin: 0 auto;
}

.why-band .section-kicker {
  color: #71d49c;
}

.why-band h2 {
  color: #fff;
  margin-bottom: 12px;
}

.why-band p {
  color: #b0bfb8;
  font-size: 19px;
  max-width: 600px;
  margin-bottom: 44px;
}

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

.why-card {
  padding: 28px 26px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.why-card:hover {
  border-color: rgba(113, 212, 156, 0.4);
  background: rgba(255,255,255,0.07);
}

.why-card h3 {
  margin-bottom: 8px;
  color: #fff;
  font-size: 16px;
}

.why-card p {
  margin-bottom: 0;
  color: #9daaa2;
  font-size: 14px;
  line-height: 1.6;
}

.why-card .card-icon {
  display: inline-block;
  margin-bottom: 14px;
  width: 36px;
  height: 36px;
  line-height: 36px;
  text-align: center;
  background: rgba(113, 212, 156, 0.15);
  border-radius: 6px;
  font-size: 18px;
}

/* ── Social/stats band ──────────────────────────── */
.stat-band {
  padding: 52px 48px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  max-width: 1180px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.stat-item {
  display: grid;
  gap: 4px;
}

.stat-num {
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  color: var(--ink);
}

.stat-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.stat-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Sidebar active-link transition ─────────────── */
.sidebar a,
.toc a {
  transition: border-left-color 0.13s ease, color 0.13s ease, background 0.13s ease;
}

/* ── Code highlight colours ─────────────────────── */
.kw  { color: #c678dd; }
.fn  { color: #61afef; }
.st  { color: #98c379; }
.cm  { color: #5c6370; font-style: italic; }
.num { color: #d19a66; }

@media (max-width: 920px) {
  .topbar {
    padding: 0 22px;
  }

  .topnav,
  .search-link,
  .toc {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 52px 22px 34px;
  }

  .hero-inner,
  .docs-shell,
  .two-column,
  .compare-grid {
    grid-template-columns: 1fr;
  }

  .hero-inner {
    gap: 34px;
  }

  .docs-shell {
    gap: 10px;
    padding: 26px 22px 64px;
  }

  .sidebar {
    position: static;
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 10px;
  }

  .sidebar-title {
    display: none;
  }

  .sidebar a {
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-left: 1px solid var(--line);
    background: var(--surface);
  }

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

  .home-band {
    padding: 0 22px 58px;
  }

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

  .doc-heading {
    display: grid;
  }

  .doc-meta {
    justify-content: start;
  }

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

  .why-band,
  .stat-band {
    padding: 52px 22px;
  }

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

  .site-footer {
    padding: 36px 22px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 32px;
  }
}

@media (max-width: 560px) {
  .github-link,
  .version-link {
    display: none;
  }

  h1 {
    font-size: 58px;
  }

  h2 {
    font-size: 34px;
  }

  .lede,
  .doc-section p {
    font-size: 16px;
  }

  .terminal pre,
  .code-card {
    padding: 16px;
    font-size: 12px;
  }

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

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