@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

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

:root {
  --bg: #060b18;
  --bg-secondary: #0c1225;
  --bg-tertiary: #0f1629;
  --border: #1a2344;
  --border-light: #243056;
  --text: #f0f6ff;
  --text-secondary: #8b9dc0;
  --text-tertiary: #4a5880;
  --accent: #00e599;
  --accent-hover: #33edb0;
  --accent-dim: rgba(0, 229, 153, 0.10);
  --accent-glow: 0 0 0 1px rgba(0, 229, 153, 0.25), 0 0 24px rgba(0, 229, 153, 0.15);
  --accent-glow-strong: 0 0 0 1px rgba(0, 229, 153, 0.45), 0 0 40px rgba(0, 229, 153, 0.25);
  --cyan: #38bdf8;
  --violet: #a78bfa;
  --red: #f87171;
  --orange: #fb923c;
  --max-width: 1080px;
  --nav-height: 60px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 24px);
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  color: var(--accent-hover);
}

code,
pre,
.mono {
  font-family: 'JetBrains Mono', 'Fira Code', Menlo, Consolas, monospace;
}

/* ── Nav ─────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 11, 24, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  font-family: 'JetBrains Mono', 'Fira Code', Menlo, monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 1px;
}

.nav-logo:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

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

.nav-links .github-link {
  display: flex;
  align-items: center;
}

.nav-links .github-link svg {
  width: 20px;
  height: 20px;
  fill: var(--text-secondary);
  transition: fill 0.2s;
}

.nav-links .github-link:hover svg {
  fill: var(--text);
}

/* Right-side action cluster: always visible in the bar (so search stays
   reachable on mobile, not buried behind the hamburger). The toggle inside
   is hidden on desktop by the existing .nav-toggle rule. */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.search-link {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  /* Comfortable touch target (>=40px) without enlarging the icon. */
  padding: 10px;
  margin: -10px;
}

.search-link svg {
  width: 19px;
  height: 19px;
  stroke: var(--text-secondary);
  transition: stroke 0.2s;
}

.search-link:hover svg {
  stroke: var(--text);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-secondary);
  margin: 5px 0;
  transition: 0.3s;
}

/* ── Container ───────────────────────────────────── */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 80px 0;
}

section + section {
  border-top: 1px solid var(--border);
}

/* ── Hero ────────────────────────────────────────── */

.hero {
  padding: 110px 0 80px;
  text-align: center;
  border-top: none;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.22;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 500px;
  background: radial-gradient(ellipse at center top, rgba(0, 229, 153, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero > .container {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero h1 .line-plain {
  display: block;
  color: var(--text);
}

.hero h1 .line-accent {
  display: block;
  background: linear-gradient(90deg, var(--accent) 0%, var(--cyan) 50%, var(--violet) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 32px;
  line-height: 1.6;
  font-weight: 400;
}

/* ── Hero eyebrow ────────────────────────────────── */

.hero-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
  padding: 4px 12px;
  background: var(--accent-dim);
  border: 1px solid rgba(0, 229, 153, 0.2);
  border-radius: 20px;
}

/* ── Install widget ──────────────────────────────── */

.hero-installs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.install-widget {
  display: inline-flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px 14px 10px 18px;
  gap: 12px;
  font-size: 14px;
  box-shadow: var(--accent-glow);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.install-widget:hover {
  border-color: rgba(0, 229, 153, 0.35);
  box-shadow: var(--accent-glow-strong);
}

.install-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-tertiary);
  padding: 2px 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  white-space: nowrap;
}

.install-widget code {
  color: var(--accent);
  white-space: nowrap;
  font-size: 13px;
}

.install-widget .copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-tertiary);
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s, background 0.2s;
}

.install-widget .copy-btn:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

.hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-tertiary);
}

.hero-meta a {
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hero-meta a:hover {
  color: var(--text-secondary);
}

/* ── Hero CTAs ───────────────────────────────────── */

.hero-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.btn-github {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn-github:hover {
  background: var(--bg-secondary);
  border-color: var(--accent);
  color: var(--text);
  box-shadow: var(--accent-glow-strong);
}

.btn-github .gh-stars-badge {
  background: var(--bg);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 12px;
  color: var(--text-secondary);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn-secondary:hover {
  color: var(--text);
  border-color: var(--accent);
  box-shadow: var(--accent-glow);
}

/* ── Terminal demo ───────────────────────────────── */

.terminal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  max-width: 640px;
  margin: 48px auto 0;
  overflow: hidden;
  text-align: left;
  box-shadow: var(--accent-glow), 0 24px 64px rgba(0, 0, 0, 0.4);
}

.terminal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.red { background: var(--red); }
.terminal-dot.yellow { background: var(--orange); }
.terminal-dot.green { background: var(--accent); }

.terminal-title {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-left: 8px;
  font-family: 'JetBrains Mono', monospace;
}

.terminal-gif {
  display: block;
  width: 100%;
  border-radius: 0 0 12px 12px;
}

.terminal-body {
  padding: 20px;
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
}

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

.terminal-body .cmd {
  color: var(--text);
}

.terminal-body .comment {
  color: var(--text-tertiary);
}

.terminal-body .output {
  color: var(--text-secondary);
}

.terminal-body .highlight {
  color: var(--accent);
}

/* ── Stats bar ───────────────────────────────────── */

.stats-bar {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 28px 24px;
}

.stats-bar .container {
  display: flex;
  justify-content: center;
  gap: 56px;
  flex-wrap: wrap;
}

.stats-bar .stat-item {
  text-align: center;
}

.stats-bar .stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1;
}

.stats-bar .stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 500;
}

/* ── Features grid ───────────────────────────────── */

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: 12px;
  padding: 28px;
  box-shadow: var(--accent-glow);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: rgba(0, 229, 153, 0.4);
  border-top-color: var(--accent);
  box-shadow: var(--accent-glow-strong);
  transform: translateY(-4px);
}

.feature-icon {
  font-size: 18px;
  display: inline;
}

.feature-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.feature-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Horizontal variant: icon left, title + copy right (see #features). */
.feature-card--row {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.feature-card--row .feature-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  border-radius: 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
}

.feature-card--row h3 {
  margin-bottom: 6px;
}

.feature-card code {
  font-size: 12px;
  background: var(--bg-tertiary);
  color: var(--accent);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ── Articles section ────────────────────────────── */

.article-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 40px;
}

.article-row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: 12px;
  padding: 20px 24px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.article-row:hover {
  border-color: rgba(0, 229, 153, 0.4);
  border-left-color: var(--accent);
  box-shadow: var(--accent-glow-strong);
  transform: translateX(4px);
}

.article-row .article-num {
  flex-shrink: 0;
  font-family: var(--font-mono, monospace);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.article-row .article-body {
  flex: 1;
  min-width: 0;
}

.article-row h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.article-row h3 a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s;
}

.article-row h3 a:hover {
  color: var(--accent);
}

.article-row p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 12px;
}

.article-links {
  display: flex;
  gap: 8px;
}

.article-links a {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}

.article-links a:hover {
  border-color: rgba(0, 229, 153, 0.4);
  color: var(--accent);
}

/* ── Why section (numbered) ──────────────────────── */

.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
}

.why-card {
  border-radius: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.why-card:hover {
  transform: translateY(-4px);
}

.why-card:hover .why-number {
  color: var(--accent);
}

.why-card .why-number {
  font-size: 48px;
  font-weight: 800;
  color: var(--border-light);
  line-height: 1;
  margin-bottom: 16px;
  font-family: 'JetBrains Mono', monospace;
  transition: color 0.2s;
}

.why-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

.why-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.why-card code {
  font-size: 12px;
  background: var(--bg-tertiary);
  color: var(--accent);
  padding: 1px 5px;
  border-radius: 4px;
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-heading {
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: var(--text);
}

.section-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.6;
}

/* ── Comparison table ────────────────────────────── */

.table-wrapper {
  margin-top: 32px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-x: auto;
  overflow-y: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  text-align: left;
  padding: 14px 20px;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

thead th:last-child {
  color: var(--accent);
}

tbody td {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

tbody td:first-child {
  color: var(--text);
  font-weight: 500;
}

tbody td:last-child {
  background: rgba(0, 229, 153, 0.03);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: var(--bg-secondary);
}

tbody tr:hover td:last-child {
  background: rgba(0, 229, 153, 0.06);
}

td code {
  font-size: 12px;
  color: var(--accent);
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
}

td .badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--accent-dim);
  color: var(--accent);
}

/* ── Install section ─────────────────────────────── */

.install-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 32px;
}

.install-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--accent-glow);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.install-card:hover {
  border-color: rgba(0, 229, 153, 0.35);
  box-shadow: var(--accent-glow-strong);
  transform: translateY(-4px);
}

.install-card h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.install-card pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 13px;
  overflow-x: auto;
  color: var(--accent);
  line-height: 1.6;
  word-break: break-all;
  white-space: pre-wrap;
}

.install-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 10px;
}

/* ── Languages ───────────────────────────────────── */

.lang-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

/* Languages section: 9 tags in a 5+4 grid so every tile is exactly
   the same size, instead of flex-growing to fill leftover space. */
.lang-grid-fixed {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

@media (max-width: 720px) {
  .lang-grid-fixed {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .lang-grid-fixed {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.lang-tag {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  /* Fixed-width tile so a row with fewer tags doesn't stretch them.
     Languages grid overrides with full-width via .lang-grid-fixed. */
  flex: 0 0 140px;
  white-space: nowrap;
  transition: border-color 0.2s, box-shadow 0.2s, color 0.2s;
}

.lang-grid-fixed .lang-tag {
  flex: unset;
  width: 100%;
}

.lang-tag:hover {
  border-color: rgba(0, 229, 153, 0.35);
  box-shadow: var(--accent-glow);
  color: var(--text);
}

.lang-tag svg,
.lang-tag img {
  flex-shrink: 0;
}

/* Brand-colored SVGs ship in site/assets/. They sit directly on the dark
   pill — no wrapper. Each SVG was recolored to its native brand tint. */
.lang-tag img.editor-mark {
  width: 20px;
  height: 20px;
}

/* ── CTA ─────────────────────────────────────────── */

.cta {
  text-align: center;
  padding: 80px 0;
}

.cta h2 {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.cta p {
  color: var(--text-secondary);
  margin-bottom: 28px;
  font-size: 16px;
}

/* ── How It Works ────────────────────────────────── */

.how-it-works {
  text-align: center;
}

.how-steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  max-width: 760px;
  margin: 40px auto 0;
}

.how-step {
  flex: 1;
  padding: 0 20px;
  text-align: center;
}

.how-step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid rgba(0, 229, 153, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin: 0 auto 12px;
  box-shadow: 0 0 16px rgba(0, 229, 153, 0.2);
}

.how-step-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.how-step code {
  display: block;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 8px;
}

.how-step p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.how-arrow {
  padding-top: 18px;
  color: var(--border-light);
  font-size: 20px;
  flex-shrink: 0;
  user-select: none;
}

@media (max-width: 600px) {
  .how-steps {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .how-arrow {
    transform: rotate(90deg);
    padding-top: 0;
  }

  .how-step {
    padding: 0;
    width: 100%;
  }

  .hero-installs {
    width: 100%;
    align-items: stretch;
  }

  .install-widget {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .install-widget code {
    font-size: 12px;
    white-space: normal;
    word-break: break-all;
  }

  /* Wide comparison tables scroll sideways within their box. Always show the
     scrollbar so the swipe affordance is visible (cell backgrounds occlude a
     background-fade, so the scrollbar is the honest cue). */
  .table-wrapper {
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg-tertiary);
  }

  .table-wrapper::-webkit-scrollbar {
    height: 8px;
  }

  .table-wrapper::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
  }

  .table-wrapper::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 8px;
  }

  .stats-bar .container {
    gap: 28px;
  }

  .hero-ctas {
    flex-direction: column;
    align-items: center;
  }

  .btn-github,
  .btn-secondary {
    width: 100%;
    justify-content: center;
  }
}

/* ── Footer ──────────────────────────────────────── */

.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-tertiary);
}

.footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
}

.footer-links a {
  color: var(--text-tertiary);
  font-size: 13px;
}

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

/* ── Install group label ─────────────────────────── */

.install-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

/* ── Responsive ──────────────────────────────────── */

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 24px;
    gap: 16px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

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

  .article-row {
    gap: 16px;
    align-items: flex-start;
  }

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

  .install-options {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }

  section {
    padding: 56px 0;
  }

  .hero {
    padding: 80px 0 56px;
  }

  .install-widget {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* ── Usage page ──────────────────────────────────── */

/* Docs page widens past the global --max-width to fit the third (TOC) rail. */
.container--docs {
  max-width: 1320px;
}

.docs-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 220px;
  gap: 48px;
  padding-top: 40px;
  padding-bottom: 80px;
}

.docs-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  align-self: start;
  max-height: calc(100vh - var(--nav-height) - 48px);
  overflow-y: auto;
}

.docs-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Collapsible section group (native <details>). Closed by default; the active
   group is opened by the scroll-spy script. */
.docs-sidebar .sidebar-group {
  margin-bottom: 4px;
}

.docs-sidebar .sidebar-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  list-style: none;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.docs-sidebar .sidebar-label::-webkit-details-marker {
  display: none;
}

.docs-sidebar .sidebar-label:hover {
  background: var(--bg-secondary);
  color: var(--text);
}

/* Chevron, rotates when the group is open. */
.docs-sidebar .sidebar-label::after {
  content: "▸";
  font-size: 10px;
  color: var(--text-secondary);
  transition: transform 0.15s ease;
}

.docs-sidebar .sidebar-group[open] > .sidebar-label::after {
  transform: rotate(90deg);
}

.docs-sidebar a {
  display: block;
  padding: 6px 12px 6px 20px;
  font-size: 13px;
  color: var(--text);
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.docs-sidebar a:hover {
  background: var(--bg-secondary);
  color: var(--accent);
}

.docs-sidebar a.active {
  background: var(--accent-dim);
  color: var(--accent);
}

/* Right rail: "On this page" sub-heading TOC with scroll-spy. */
.docs-toc {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  align-self: start;
  max-height: calc(100vh - var(--nav-height) - 48px);
  overflow-y: auto;
}

.docs-toc.is-empty {
  visibility: hidden;
}

.docs-toc-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-tertiary);
  padding: 8px 12px 8px;
}

.docs-toc-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 1px solid var(--border);
}

.docs-toc-nav a {
  display: block;
  padding: 5px 12px;
  margin-left: -1px;
  font-size: 13px;
  color: var(--text-tertiary);
  border-left: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.docs-toc-nav a:hover {
  color: var(--text-secondary);
}

.docs-toc-nav a.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

.docs-content {
  min-width: 0;
}

.docs-content h2 {
  font-size: 24px;
  font-weight: 700;
  margin-top: 48px;
  margin-bottom: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.docs-content h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.docs-content h3 {
  font-size: 17px;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 10px;
  color: var(--text);
}

.docs-content h3 code {
  font-size: 15px;
  color: var(--accent);
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: 4px;
}

.docs-content p {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.65;
}

.docs-content pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 20px;
  font-size: 13px;
  overflow-x: auto;
  margin-bottom: 16px;
  line-height: 1.6;
  color: var(--accent);
}

.docs-content pre .comment {
  color: var(--text-tertiary);
}

.docs-content ul {
  padding-left: 20px;
  margin-bottom: 14px;
}

.docs-content li {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  line-height: 1.55;
}

.docs-content code {
  font-size: 13px;
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent);
  /* Long inline tokens (cartog_rag_index, env var names) break instead of
     widening their container (summary rows, list items) on narrow screens. */
  overflow-wrap: break-word;
}

.docs-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.docs-content table {
  margin-bottom: 16px;
  /* Wide reference tables (MCP tool shape, config keys) must scroll within
     their own box on narrow screens instead of widening the whole page.
     display:block lets overflow-x:auto take effect on the table element. */
  display: block;
  overflow-x: auto;
  max-width: 100%;
}

.mcp-client {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: var(--bg-tertiary);
}

.mcp-client > summary {
  cursor: pointer;
  font-size: 14px;
  user-select: none;
  list-style: none;
}

.mcp-client > summary::-webkit-details-marker {
  display: none;
}

.mcp-client > summary::before {
  content: "▸";
  display: inline-block;
  width: 14px;
  color: var(--accent);
  transition: transform 0.15s ease;
}

.mcp-client[open] > summary::before {
  transform: rotate(90deg);
}

.mcp-client[open] {
  padding-bottom: 4px;
}

.mcp-client > *:not(summary) {
  margin-top: 12px;
}

.example-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 8px;
  margin-bottom: 4px;
}

pre.example-output {
  background: var(--bg-secondary);
  border-left: 3px solid var(--accent);
  color: var(--text-secondary);
  font-size: 12px;
  margin-bottom: 16px;
}

/* Rendered --mermaid diagrams. Holds the source until mermaid swaps in the
   SVG; centered, no code-block chrome. */
pre.mermaid {
  background: var(--bg-secondary);
  border-left: 3px solid var(--accent);
  margin-bottom: 24px;
  padding: 16px;
  text-align: center;
  overflow-x: auto;
}

/* Hide the raw source until mermaid has drawn (it adds data-processed). */
pre.mermaid:not([data-processed]) {
  color: transparent;
}

pre.mermaid svg {
  max-width: 100%;
  height: auto;
}

/* Drop the right TOC rail first when the viewport can't fit three columns. */
@media (max-width: 1100px) {
  .docs-layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .docs-toc {
    display: none;
  }
}

@media (max-width: 768px) {
  .docs-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .docs-sidebar {
    position: static;
    max-height: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
  }
}

/* ── Scroll-reveal ───────────────────────────────── */
/* Elements tagged [data-reveal] start hidden; JS adds .is-visible on
   intersection. --reveal-delay staggers siblings within a grid. */

[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* No JS / not-yet-observed fallback: never leave content invisible. */
.no-js [data-reveal] {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
