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

:root {
  --bg-primary: hsl(0 0% 100%);
  --text-primary: hsl(0 0% 0%);
  --text-muted: hsl(0 0% 35%);
  --border: hsl(42 8% 90%);
  --surface: hsl(42 8% 96%);
  --surface-strong: hsl(42 8% 94%);
  --button-bg: hsl(0 0% 0%);
  --button-txt: hsl(0 0% 100%);
  --shadow: 0 0 #0000;
}

html, body {
  min-height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body { margin: 0; }
a { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 22px;
  gap: 16px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.logo img { height: 24px; width: auto; }

.logo-text {
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
}

.header-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.header-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.header-links a:hover,
.header-links a.active {
  color: var(--text-primary);
}

.header-categories {
  border-top: 1px solid var(--border);
  padding: 0 22px;
}

.category-nav {
  display: flex;
  align-items: flex-end;
  gap: 28px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-nav::-webkit-scrollbar {
  display: none;
}

.category-link {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 2px 11px;
  position: relative;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s;
}

.category-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 36px;
  height: 2px;
  transform: translateX(-50%);
  background: transparent;
  transition: background-color 0.2s;
}

.category-link:hover,
.category-link.active {
  color: var(--text-primary);
}

.category-link.active::after {
  background: var(--text-primary);
}

.docs-page {
  margin: 0 auto;
  max-width: 1480px;
  padding: 0 18px 76px;
}

.docs-page-with-sidebar {
  margin: 0;
  max-width: none;
  padding-left: 22px;
  padding-right: 22px;
}

.docs-layout {
  display: grid;
  grid-template-columns: clamp(198px, 17vw, 228px) minmax(0, 1fr);
  gap: clamp(22px, 2.2vw, 30px);
  align-items: start;
  justify-content: start;
}

.docs-page-with-sidebar .docs-layout {
  grid-template-columns: 220px minmax(0, 1160px);
  gap: 24px;
}

.docs-sidebar {
  position: sticky;
  top: 124px;
  padding-top: 30px;
  padding-right: 14px;
  border-right: 1px solid var(--border);
}

.docs-sidebar-group + .docs-sidebar-group {
  margin-top: 28px;
}

.docs-sidebar-label,
.snapshot-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 10px;
}

.docs-sidebar-links {
  display: grid;
  gap: 4px;
}

.docs-sidebar-links a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s, color 0.2s;
}

.docs-sidebar-links a:hover {
  background: var(--surface);
  color: var(--text-primary);
}

.docs-sidebar-links a.active {
  background: var(--surface-strong);
  color: var(--text-primary);
}

.docs-content {
  min-width: 0;
  padding-top: 30px;
}

.page-shell {
  max-width: none;
  width: 100%;
}

.page-intro {
  margin-bottom: 36px;
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #737373;
  margin-bottom: 12px;
}

.page-intro h1 {
  font-size: clamp(2.5rem, 4vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  max-width: 880px;
}

.page-intro p {
  max-width: 760px;
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0;
}

.section-stack {
  margin-bottom: 36px;
  scroll-margin-top: 118px;
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading h2 {
  font-size: 1.45rem;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

.section-heading p {
  color: var(--text-muted);
  margin: 0;
  max-width: 760px;
}

.doc-prose {
  color: var(--text-muted);
  font-size: 1rem;
}

.doc-prose p {
  margin: 0 0 14px;
}

.doc-prose a,
.text-link {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.content-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.content-card-muted {
  background: var(--surface);
}

.content-card-success {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.content-card-warning {
  background: #fff7ed;
  border-color: #fdba74;
}

.content-card h2,
.content-card h3 {
  margin: 0 0 10px;
  letter-spacing: -0.015em;
}

.content-card p {
  color: var(--text-muted);
  margin: 0;
}

.content-card p + p {
  margin-top: 10px;
}

.content-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
}

.content-card li + li {
  margin-top: 8px;
}

.content-card-success p,
.content-card-success li {
  color: #065f46;
}

.content-card-warning p,
.content-card-warning li {
  color: #9a3412;
}

.card-grid {
  display: grid;
  gap: 16px;
}

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

.card-grid.three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card-grid.four-up {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.split-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 400px);
  gap: 24px;
  align-items: start;
}

.media-card img {
  display: block;
  width: 100%;
  height: auto;
}

.media-card p {
  margin-top: 12px;
  font-size: 0.92rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.btn-primary {
  background: var(--button-bg);
  color: var(--button-txt);
}

.btn-primary:hover {
  background: #111111;
}

.btn-secondary {
  background: #ffffff;
  color: var(--text-primary);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--surface);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}

.action-row.compact {
  margin-top: 16px;
}

code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
}

pre {
  margin: 0;
  overflow-x: auto;
  padding: 16px 18px;
  border-radius: 10px;
  background: #111111;
  color: #ffffff;
}

.snapshot-grid {
  margin-bottom: 18px;
}

.snapshot-value {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.45;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.92rem;
}

.supported-shell {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
}

.supported-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: baseline;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.supported-title {
  font-size: 1.05rem;
  font-weight: 600;
}

.supported-meta {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.supported-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.supported-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  background: var(--surface);
}

.supported-name {
  font-weight: 600;
  margin-bottom: 6px;
}

.supported-count {
  color: var(--text-muted);
  font-size: 0.94rem;
}

.supported-note {
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 0.94rem;
}

.status-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 20px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  color: var(--text-primary);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #16a34a;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.14);
}

.stat-separator {
  width: 1px;
  height: 16px;
  background: var(--border);
}

.footer-link {
  text-decoration: none;
  color: inherit;
}

.footer-link:hover {
  color: var(--text-primary);
}

@media (max-width: 960px) {
  .docs-page {
    padding: 0 20px 56px;
  }

  .docs-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .docs-sidebar {
    position: static;
    top: auto;
    padding-top: 24px;
    padding-right: 0;
    padding-bottom: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .docs-content {
    padding-top: 0;
  }

  .card-grid.two-up,
  .card-grid.three-up,
  .card-grid.four-up,
  .split-panel,
  .supported-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .header-main,
  .header-categories {
    padding-left: 16px;
    padding-right: 16px;
  }

  .header-main {
    min-height: 60px;
  }

  .header-links {
    gap: 14px;
  }

  .category-nav {
    gap: 20px;
  }
}

@media (min-width: 1024px) {
  .header-main,
  .header-categories {
    padding-left: 28px;
    padding-right: 28px;
  }

  .docs-page-with-sidebar {
    padding-left: 28px;
    padding-right: 28px;
  }
}
