/* ============================================================
   Cairn Website — Master Stylesheet
   Design tokens mirror the Cairn app exactly.
   ============================================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

/* ---------- Design Tokens ---------- */
:root {
  --background:    #0d0d0d;
  --foreground:    #e8e4dc;
  --surface:       #141414;
  --surface-2:     #1a1a1a;
  --surface-3:     #222222;
  --border:        #2a2a2a;
  --border-subtle: #1f1f1f;

  --accent:        #7c6af7;
  --accent-hover:  #9281ff;
  --accent-dim:    rgba(124, 106, 247, 0.15);

  --text-primary:   #e8e4dc;
  --text-secondary: #9e9a94;
  --text-tertiary:  #66635f;

  --success: #3ecf8e;
  --warning: #f59e0b;
  --danger:  #ef4444;
  --info:    #60a5fa;

  --max-width: 1100px;
  --section-y: 80px;
  --section-y-mobile: 48px;
  --gap: 24px;
  --gap-tight: 16px;
  --gap-loose: 48px;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--background);
  color: var(--text-secondary);
  font-family: "Geist", ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

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

img, svg {
  display: block;
  max-width: 100%;
}

ul, ol {
  list-style: none;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.display {
  font-size: clamp(40px, 6vw, 68px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.section-heading {
  font-size: clamp(26px, 3.5vw, 38px);
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.sub-heading {
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-secondary);
}

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

code, kbd, pre {
  font-family: "Geist Mono", ui-monospace, monospace;
}

/* ---------- Layout Utilities ---------- */
.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 24px;
}

.section {
  padding-block: var(--section-y);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

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

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.text-center { text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
  transition: background 150ms, color 150ms, border-color 150ms, box-shadow 150ms;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 20px rgba(124, 106, 247, 0.35);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
}
.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}

.btn-lg {
  padding: 13px 28px;
  font-size: 15px;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color 200ms;
}
.card:hover {
  border-color: rgba(124, 106, 247, 0.4);
}

.card-sm {
  padding: 16px;
  border-radius: var(--radius);
}

/* ---------- Code Blocks ---------- */
.code-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  font-family: "Geist Mono", monospace;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
  overflow-x: auto;
  position: relative;
}

.code-block pre {
  margin: 0;
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
  font-family: "Geist", sans-serif;
  transition: color 150ms, border-color 150ms;
}
.copy-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}
.copy-btn.copied {
  color: var(--success);
  border-color: var(--success);
}

/* ---------- Accent Glow ---------- */
.accent-glow {
  box-shadow: 0 0 80px rgba(124, 106, 247, 0.12);
}

/* ---------- Badge / Tag ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(124, 106, 247, 0.3);
  border-radius: 99px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ---------- Divider ---------- */
.divider {
  border: none;
  border-top: 1px solid var(--border);
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 13, 13, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

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

.nav-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: color 150ms;
}
.nav-links a:hover {
  color: var(--text-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-secondary);
}

.nav-mobile {
  display: none;
  flex-direction: column;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border-subtle);
  gap: 4px;
}

.nav-mobile a {
  display: block;
  padding: 10px 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  transition: color 150ms;
}
.nav-mobile a:hover { color: var(--text-primary); }
.nav-mobile a:last-child { border-bottom: none; }

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

/* ---------- Hero ---------- */
.hero {
  padding-block: 96px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(124, 106, 247, 0.1) 0%, transparent 70%);
  pointer-events: none;
}

.hero-icon {
  margin-bottom: 24px;
}

.hero-icon img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-inline: auto;
}

.hero-eyebrow {
  margin-bottom: 20px;
}

.hero h1 {
  margin-bottom: 20px;
}

.hero-sub {
  font-size: clamp(16px, 1.5vw, 19px);
  color: var(--text-secondary);
  max-width: 600px;
  margin-inline: auto;
  margin-bottom: 36px;
  line-height: 1.6;
}

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

.hero-screenshot {
  max-width: 900px;
  margin-inline: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--border-subtle), 0 40px 100px rgba(0,0,0,0.6), 0 0 80px rgba(124, 106, 247, 0.08);
}

.hero-screenshot img {
  width: 100%;
  height: auto;
  display: block;
}

/* Screenshot placeholder */
.screenshot-placeholder {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 13px;
  font-family: "Geist Mono", monospace;
  max-width: 900px;
  margin-inline: auto;
  box-shadow: 0 40px 100px rgba(0,0,0,0.5), 0 0 80px rgba(124, 106, 247, 0.06);
}

/* ---------- Value Props ---------- */
.value-props {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.value-prop {
  padding: 36px 24px;
  border-right: 1px solid var(--border);
}
.value-prop:last-child { border-right: none; }

.value-prop-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  border: 1px solid rgba(124, 106, 247, 0.2);
  border-radius: var(--radius);
  color: var(--accent);
  margin-bottom: 16px;
}

.value-prop h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

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

/* ---------- Feature Showcase ---------- */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.feature-row.reverse {
  direction: rtl;
}
.feature-row.reverse > * {
  direction: ltr;
}

.feature-text .badge {
  margin-bottom: 16px;
}

.feature-text h2 {
  font-size: clamp(22px, 2.5vw, 30px);
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.feature-text p {
  font-size: 15px;
  margin-bottom: 20px;
  line-height: 1.7;
}

.feature-text ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feature-text ul li {
  font-size: 14px;
  color: var(--text-secondary);
  padding-left: 16px;
  position: relative;
}

.feature-text ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.feature-visual {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface);
}

.feature-visual img {
  width: 100%;
  height: auto;
  display: block;
}

/* ---------- Docs Screenshots ---------- */
.docs-screenshot {
  margin: 28px 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface);
}

.docs-screenshot img {
  width: 100%;
  height: auto;
  display: block;
}

.docs-screenshot figcaption {
  font-size: 12px;
  color: var(--text-tertiary);
  padding: 8px 14px;
  border-top: 1px solid var(--border);
}

/* ---------- Feature Callout (Undo/Redo) ---------- */
.feature-callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 48px;
}

.feature-callout-inner {
  max-width: 680px;
}

.feature-callout h2 {
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.feature-callout p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.feature-callout ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.feature-callout ul li {
  font-size: 14px;
  color: var(--text-secondary);
  padding-left: 16px;
  position: relative;
}

.feature-callout ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent);
}

kbd {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2, var(--surface));
  color: var(--text-primary);
}

/* ---------- MCP Section ---------- */
.mcp-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.mcp-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.mcp-text h2 {
  font-size: clamp(24px, 2.8vw, 34px);
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.mcp-text p {
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 12px;
}

/* ---------- Comparison Table ---------- */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.comparison-table th {
  text-align: left;
  padding: 14px 16px;
  color: var(--text-tertiary);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.comparison-table th:first-child {
  color: var(--text-secondary);
}

.comparison-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.comparison-table tr:last-child td { border-bottom: none; }

.comparison-table th.highlight,
.comparison-table td.highlight {
  color: var(--text-primary);
  background: rgba(124, 106, 247, 0.05);
}

.check { color: var(--success); }
.cross { color: var(--text-tertiary); }
.partial { color: var(--warning); }

/* ---------- FAQ ---------- */
.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 20px 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: inherit;
  transition: color 150ms;
}
.faq-question:hover { color: var(--accent); }

.faq-chevron {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  transition: transform 250ms;
}
.faq-item.open .faq-chevron {
  transform: rotate(180deg);
  color: var(--accent);
}

.faq-answer {
  overflow: hidden;
  max-height: 0;
  transition: max-height 300ms ease, padding 300ms ease;
}
.faq-item.open .faq-answer {
  max-height: 300px;
}

.faq-answer p {
  padding-bottom: 20px;
  font-size: 14px;
  line-height: 1.7;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding-block: 40px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-logo {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 13px;
  color: var(--text-tertiary);
  transition: color 150ms;
}
.footer-links a:hover { color: var(--text-secondary); }

.footer-built {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* ---------- Docs Layout ---------- */
.docs-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  min-height: calc(100vh - 60px);
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 32px 0;
  background: var(--surface);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.docs-sidebar::-webkit-scrollbar {
  width: 4px;
}
.docs-sidebar::-webkit-scrollbar-track { background: transparent; }
.docs-sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.sidebar-section {
  padding: 0 20px;
  margin-bottom: 28px;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  padding: 0 8px;
}

.sidebar-link {
  display: block;
  padding: 7px 8px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: background 150ms, color 150ms;
}
.sidebar-link:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}
.sidebar-link.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 500;
}

.docs-content {
  padding: 48px 60px;
  max-width: 760px;
}

/* Docs typography */
.docs-content h1 {
  font-size: clamp(24px, 2.5vw, 32px);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
}

.docs-content .docs-lead {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 40px;
  line-height: 1.7;
}

.docs-content h2 {
  font-size: 20px;
  font-weight: 600;
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.015em;
}

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

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

.docs-content ul,
.docs-content ol {
  margin-bottom: 16px;
  padding-left: 0;
}

.docs-content ul li,
.docs-content ol li {
  font-size: 15px;
  color: var(--text-secondary);
  padding: 3px 0 3px 20px;
  position: relative;
  line-height: 1.65;
}

.docs-content ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 500;
}

.docs-content ol {
  counter-reset: docs-counter;
}
.docs-content ol li {
  counter-increment: docs-counter;
}
.docs-content ol li::before {
  content: counter(docs-counter) '.';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
}

.docs-content code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 13px;
  color: var(--text-primary);
}

.docs-content pre {
  margin: 20px 0;
}

.docs-content pre.code-block code {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
}

.docs-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(124, 106, 247, 0.4);
  transition: text-decoration-color 150ms;
}
.docs-content a:hover {
  text-decoration-color: var(--accent);
}

/* Callout / Note box */
.callout {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.callout p {
  margin: 0;
  font-size: 14px;
}

.callout-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.callout.warning { border-left-color: var(--warning); }
.callout.warning .callout-title { color: var(--warning); }

/* Docs tool table */
.tool-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 24px;
}

.tool-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.tool-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
  line-height: 1.5;
  color: var(--text-secondary);
}

.tool-table tr:last-child td { border-bottom: none; }

.tool-table td code {
  background: var(--surface-3);
  border: none;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
}

/* Docs breadcrumb */
.docs-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 24px;
}
.docs-breadcrumb a { color: var(--text-tertiary); transition: color 150ms; }
.docs-breadcrumb a:hover { color: var(--text-secondary); }
.docs-breadcrumb span { color: var(--text-tertiary); }

/* Docs page nav */
.docs-page-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  gap: 16px;
}

.docs-nav-card {
  flex: 1;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 200ms;
  text-decoration: none !important;
}
.docs-nav-card:hover { border-color: var(--accent); }

.docs-nav-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.docs-nav-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.docs-nav-card.next { text-align: right; }

/* Mobile hamburger icon */
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 20px;
}
.hamburger span {
  display: block;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 1px;
  transition: transform 200ms, opacity 200ms;
}

/* ---------- Scroll-fade animation ---------- */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 500ms ease, transform 500ms ease;
}
.fade-up.visible {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-actions .btn { display: none; }
  .nav-toggle { display: flex; }

  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }

  .value-props .grid-3 { grid-template-columns: 1fr; }
  .value-prop { border-right: none; border-bottom: 1px solid var(--border); }
  .value-prop:last-child { border-bottom: none; }

  .feature-row,
  .feature-row.reverse {
    grid-template-columns: 1fr;
    direction: ltr;
    gap: 32px;
  }

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

  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; flex-wrap: wrap; }

  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
  }
  .docs-content { padding: 32px 24px; }

  /* Comparison table — allow horizontal scroll on small screens */
  .comparison-table { font-size: 13px; }
  .comparison-table th,
  .comparison-table td { padding: 10px 10px; }

  /* Tool tables in docs */
  .tool-table { font-size: 12px; }
  .tool-table th,
  .tool-table td { padding: 8px 10px; }

  /* MCP code block — prevent overflow */
  .code-block { font-size: 12px; }

  .hero { padding-block: 60px 48px; }
  .section { padding-block: var(--section-y-mobile); }

  /* Hero icon slightly smaller on tablet */
  .hero-icon img { width: 96px; height: 96px; }

  /* Changelog two-col → single col */
  .release { grid-template-columns: 1fr; gap: 10px 0; }
}

@media (max-width: 600px) {
  .container { padding-inline: 16px; }

  .hero-ctas { flex-direction: column; align-items: stretch; }
  .hero-ctas .btn { text-align: center; justify-content: center; }

  /* Hero icon smaller on phone */
  .hero-icon img { width: 80px; height: 80px; }

  /* Feature section gap tighter */
  .feature-row { gap: 20px; }

  /* Wrap comparison table horizontally */
  .card { overflow-x: auto; }

  /* Docs page nav stacks */
  .docs-page-nav { flex-direction: column; }

  /* Docs content full-bleed on small screens */
  .docs-content { padding: 24px 16px; }

  /* Sidebar links slightly larger tap target */
  .sidebar-link { padding: 10px 8px; }

  /* Code blocks don't overflow viewport */
  .code-block { max-width: calc(100vw - 32px); }

  /* Nav logo text stays visible */
  .nav-logo { font-size: 16px; }
  .nav-logo-img { width: 24px; height: 24px; }

  /* Changelog */
  .changelog-page { padding: 40px 16px 64px; }
  .release-tag { font-size: 12px; }
}
