/* cxxmcp documentation — shared stylesheet */

:root {
  color-scheme: light dark;
  --bg: #f7f8fa;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #596579;
  --line: #d9dee7;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --accent-bg: #f0fdfa;
  --code: #f1f5f9;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --radius: 10px;
  --sidebar-w: 240px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1014;
    --panel: #151b21;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --line: #1e293b;
    --accent: #2dd4bf;
    --accent-strong: #5eead4;
    --accent-bg: #0f2927;
    --code: #1e293b;
    --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.2);
  }
}

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

body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

a {
  color: var(--accent-strong);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

/* ── Layout ────────────────────────────────────── */

.page {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  overflow-y: auto;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 20px 0;
  z-index: 100;
}

.sidebar-brand {
  font-weight: 750;
  font-size: 1.15rem;
  padding: 0 20px 16px;
  letter-spacing: 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.sidebar-brand a {
  color: var(--text);
  text-decoration: none;
}

.sidebar-section {
  padding: 12px 20px 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.sidebar a {
  display: block;
  padding: 6px 20px;
  font-size: 0.88rem;
  color: var(--muted);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

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

.sidebar a.active {
  color: var(--accent-strong);
  border-left-color: var(--accent);
  background: var(--accent-bg);
  font-weight: 600;
}

/* Main content */
.main-wrap {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
}

main {
  width: min(900px, calc(100% - 48px));
  margin: 0 auto;
  padding: 0 0 48px;
}

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

.hero {
  padding: 52px 0 38px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 32px;
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

h1 {
  max-width: 800px;
  margin: 10px 0 14px;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.lede {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 1.1rem;
}

/* ── Sections ──────────────────────────────────── */

.section {
  padding: 28px 0 8px;
}

.section h2 {
  margin: 0 0 10px;
  font-size: 1.3rem;
  letter-spacing: 0;
}

.section h3 {
  margin: 22px 0 8px;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.section p, .section li { color: var(--muted); }

/* ── Cards / Grid ──────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.card h2, .card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  letter-spacing: 0;
}

.card p { margin: 0; }

/* ── Code ──────────────────────────────────────── */

pre {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--code);
  padding: 16px 18px;
  margin: 12px 0;
}

pre code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
  background: transparent;
  padding: 0;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.88em;
}

/* highlight.js overrides */
pre code.hljs {
  padding: 0;
  background: transparent;
}

.hljs {
  background: transparent;
}

/* ── Tables ────────────────────────────────────── */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

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

th { color: var(--text); font-weight: 650; font-size: 0.92rem; }
td { color: var(--muted); font-size: 0.92rem; }

/* ── FAQ / Recipe blocks ───────────────────────── */

.faq, .recipe, .release, .phase, .note {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 18px 20px;
  margin: 14px 0;
  box-shadow: var(--shadow);
}

.faq h3, .recipe h3, .release h3, .phase h3 {
  margin: 0 0 8px;
  font-size: 1.02rem;
}

.faq p, .recipe p { margin: 0 0 10px; }
.note strong { color: var(--text); }

/* ── Step indicator ────────────────────────────── */

.step {
  border-left: 3px solid var(--accent);
  padding-left: 20px;
  margin: 22px 0;
}

.step-num {
  display: inline-block;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  text-align: center;
  line-height: 26px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-right: 6px;
}

/* ── Labels (roadmap) ──────────────────────────── */

.label {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0 0 10px;
}

.label.current { background: #d1fae5; color: #065f46; }
.label.near { background: #dbeafe; color: #1e40af; }
.label.later { background: #f3e8ff; color: #6b21a8; }
.label.done { background: #e5e7eb; color: #374151; }

@media (prefers-color-scheme: dark) {
  .label.current { background: #065f46; color: #d1fae5; }
  .label.near { background: #1e40af; color: #dbeafe; }
  .label.later { background: #6b21a8; color: #f3e8ff; }
  .label.done { background: #374151; color: #e5e7eb; }
}

/* ── Scope list (security) ─────────────────────── */

.scope-list { list-style: none; padding: 0; }
.scope-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.scope-list li:last-child { border-bottom: none; }

/* ── Actions ───────────────────────────────────── */

.actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-weight: 650;
  font-size: 0.92rem;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.15s;
}

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

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

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

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

footer {
  padding: 20px 0 32px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  margin-top: 40px;
}

/* ── Homepage: Crow-inspired ───────────────────── */

.home-hero {
  text-align: center;
  padding: 48px 0 36px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 40px;
}

.home-hero h1 {
  margin: 16px auto 18px;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.1;
}

.home-hero .lede {
  max-width: 640px;
  margin: 0 auto;
}

.home-hero hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 24px auto;
  max-width: 600px;
}

.home-hero .actions {
  justify-content: center;
  margin-top: 28px;
}

/* Feature cards with icons */
.feature-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin: 40px 0;
}

.feature-card {
  width: 180px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 28px 16px 20px;
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
  cursor: default;
}

.feature-card:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-hover);
}

.feature-card .icon {
  font-size: 2.4rem;
  margin-bottom: 12px;
  display: block;
}

.feature-card .icon-line {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 12px auto 14px;
  width: 80%;
  border: none;
}

.feature-card h3 {
  font-size: 0.92rem;
  font-weight: 650;
  margin: 0;
  color: var(--text);
}

.feature-card p {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 6px;
}

/* Alternating showcase sections */
.showcase {
  margin: 48px 0;
}

.showcase-row {
  display: flex;
  align-items: center;
  gap: 32px;
  margin: 36px 0;
}

.showcase-row.reverse {
  flex-direction: row-reverse;
}

.showcase-text {
  flex: 1;
  min-width: 0;
}

.showcase-text h2 {
  font-size: 1.35rem;
  margin: 0 0 10px;
}

.showcase-text p {
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

.showcase-code {
  flex: 1.2;
  min-width: 0;
}

.showcase-code pre {
  margin: 0;
}

@media (max-width: 700px) {
  .showcase-row, .showcase-row.reverse {
    flex-direction: column;
    gap: 16px;
  }
}

/* Install cards */
.install-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.install-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
  text-decoration: none;
  display: block;
}

.install-card:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-hover);
}

.install-card h3 {
  font-size: 0.95rem;
  margin: 0 0 4px;
}

.install-card h3 a {
  text-decoration: none;
}

.install-card p {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
}

.install-card code {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.78rem;
  background: var(--code);
  padding: 3px 8px;
  border-radius: 4px;
  word-break: break-all;
}

/* Conformance badges */
.conf-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin: 24px 0;
}

.conf-badge {
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 20px 28px;
  box-shadow: var(--shadow);
  min-width: 140px;
}

.conf-badge .num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.conf-badge .label {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 4px;
}

/* Section divider */
.section-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 48px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 8px;
}

.section-title h2 {
  font-size: 1.5rem;
  margin: 0;
}

.section-title p {
  color: var(--muted);
  margin-top: 6px;
  font-size: 0.95rem;
}

/* ── Mobile ────────────────────────────────────── */

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  font-size: 1.2rem;
  box-shadow: var(--shadow);
}

@media (max-width: 800px) {
  .sidebar-toggle { display: flex; align-items: center; justify-content: center; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-wrap {
    margin-left: 0;
  }

  main {
    width: calc(100% - 32px);
    padding-top: 56px;
  }

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

  h1 {
    font-size: 2rem;
  }
}
