:root {
  color-scheme: light;
  --bg: #f6f7f2;
  --surface: #ffffff;
  --surface-2: #eef2ed;
  --ink: #121714;
  --muted: #66736d;
  --line: #d8ded7;
  --green: #0e7a5f;
  --amber: #9a6a12;
  --dark: #101816;
  --shadow: 0 18px 44px rgba(25, 35, 30, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
input { min-width: 0; width: 100%; }
h1, h2, h3, p, span, strong, code {
  overflow-wrap: anywhere;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 32px;
  background: rgba(246, 247, 242, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.topbar,
main,
.footer {
  max-width: 100vw;
}

.label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.brand,
.nav,
.endpoint-line,
.version-switch {
  display: flex;
  align-items: center;
}

.brand { gap: 10px; font-weight: 760; }
.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background:
    linear-gradient(135deg, transparent 42%, rgba(255,255,255,0.9) 43% 56%, transparent 57%),
    linear-gradient(135deg, var(--green), #2f5d8c);
}

.nav { gap: 22px; color: var(--muted); font-size: 14px; }
.nav a { padding: 8px 0; }
.nav a:hover, .nav a:focus-visible { color: var(--ink); }

.docs-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 32px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 84px 32px 42px;
}

.docs-hero > *,
.docs-layout > *,
.docs-strip > * {
  max-width: 100%;
}

.hero-copy {
  min-width: 0;
  min-height: 430px;
  padding: 52px;
  color: #ffffff;
  background:
    linear-gradient(90deg, rgba(16,24,22,0.96), rgba(16,24,22,0.72)),
    url("product-hero.png") center / cover;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-copy .eyebrow { color: #8ee0cc; }
h1, h2, h3, p, pre { margin-top: 0; }

h1 {
  max-width: 720px;
  margin-bottom: 22px;
  font-size: clamp(52px, 9vw, 104px);
  line-height: 0.94;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 { margin-bottom: 8px; font-size: 20px; }

.lead {
  max-width: 660px;
  margin-bottom: 28px;
  color: rgba(255,255,255,0.78);
  font-size: clamp(18px, 2vw, 22px);
}

.hero-search {
  display: grid;
  gap: 8px;
  max-width: 560px;
  color: rgba(255,255,255,0.72);
  font-size: 13px;
}

.hero-search input,
.search-input {
  height: 48px;
  padding: 0 14px;
  color: var(--ink);
  background: #ffffff;
  border: 0;
  border-radius: 8px;
}

.release-card,
.feature-panel,
.code-panel,
.docs-sidebar,
.guide-card,
.schema-table,
.changelog,
.status-grid article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.release-card {
  min-width: 0;
  align-self: stretch;
  padding: 24px;
}

.release-badge {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 10px;
  color: var(--green);
  background: #e5f4ee;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 820;
}

.release-card h2 { margin: 22px 0 14px; }
.release-card p { color: var(--muted); }
.release-card dl { display: grid; gap: 1px; margin: 26px 0 0; background: var(--line); border: 1px solid var(--line); }
.release-card div { display: flex; justify-content: space-between; gap: 16px; padding: 14px; background: var(--surface); }
.release-card dt, .release-card dd { margin: 0; }
.release-card dt { color: var(--muted); }
.release-card dd { font-weight: 760; }

.docs-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 1180px;
  margin: 0 auto 24px;
  padding: 0 32px;
}

.docs-strip > div {
  min-height: 110px;
  padding: 22px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.docs-strip > div:first-child {
  border-radius: 8px 0 0 8px;
}

.docs-strip > div:last-child {
  border-right: 1px solid var(--line);
  border-radius: 0 8px 8px 0;
}

.docs-strip strong {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1;
}

.docs-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px 80px;
}

.docs-sidebar {
  position: sticky;
  top: 92px;
  align-self: start;
  padding: 20px;
}

.collection-nav {
  display: grid;
  gap: 4px;
  margin-top: 14px;
}

.collection-nav a {
  min-height: 38px;
  padding: 9px 10px;
  color: var(--muted);
  border-radius: 8px;
  font-size: 14px;
}

.collection-nav a:hover,
.collection-nav a.is-active {
  color: var(--ink);
  background: var(--surface-2);
}

.side-note {
  display: grid;
  gap: 6px;
  margin-top: 24px;
  padding: 14px;
  background: var(--surface-2);
  border-radius: 8px;
}

.side-note span {
  color: var(--green);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
}

.docs-content {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(340px, 1.1fr);
  gap: 24px;
}

.section-grid > *,
.guide-card,
.schema-table,
.changelog,
.status-grid article,
.sdk-card {
  min-width: 0;
}

.feature-panel,
.code-panel,
.guide-section,
.schema-section,
.changelog-section,
.sync-section {
  padding: 24px;
}

.feature-panel p {
  color: var(--muted);
}

.endpoint-line {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.endpoint-line span {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 10px;
  color: #ffffff;
  background: var(--green);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 820;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.endpoint-line code {
  font-weight: 760;
}

.endpoint-line button {
  height: 34px;
  padding: 0 12px;
  color: #ffffff;
  background: var(--ink);
  border: 0;
  border-radius: 8px;
}

.reference-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  margin-top: 26px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.reference-list p {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 14px;
  background: var(--surface);
}

.reference-list span {
  color: var(--muted);
  font-size: 14px;
}

.code-panel {
  padding: 0;
  overflow: hidden;
  background: #111816;
}

.code-head {
  display: flex;
  justify-content: space-between;
  padding: 14px 18px;
  color: rgba(255,255,255,0.64);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  font-size: 13px;
}

pre {
  overflow: auto;
  margin: 0;
  padding: 22px;
  color: #d8f5ea;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.version-switch {
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border-radius: 8px;
}

.version-switch button {
  height: 34px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
}

.version-switch button.is-active {
  color: var(--ink);
  background: #ffffff;
}

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

.guide-card {
  min-height: 190px;
  padding: 18px;
  box-shadow: none;
}

.guide-card[hidden],
.empty-state[hidden],
.toast[hidden] { display: none; }

.guide-card span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 30px;
  margin-bottom: 26px;
  color: var(--green);
  background: #e5f4ee;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 820;
}

.guide-card p,
.empty-state,
.changelog p {
  color: var(--muted);
}

.empty-state {
  margin: 18px 0 0;
}

.schema-table,
.changelog {
  overflow: hidden;
  margin-top: 22px;
  box-shadow: none;
}

.sdk-section,
.quality-section {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.dark-button {
  min-height: 38px;
  padding: 0 14px;
  color: #ffffff;
  background: var(--ink);
  border: 0;
  border-radius: 8px;
  font-weight: 760;
}

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

.sdk-card {
  overflow: hidden;
  background: #111816;
  border-radius: 8px;
}

.sdk-card span {
  display: block;
  padding: 12px 16px;
  color: rgba(255,255,255,0.66);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  font-size: 13px;
  font-weight: 760;
}

.sdk-card pre {
  min-height: 170px;
  padding: 18px;
}

.schema-row {
  display: grid;
  grid-template-columns: 1.1fr 0.7fr 1fr 0.6fr;
  gap: 16px;
  align-items: center;
  min-height: 58px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.schema-row:last-child { border-bottom: 0; }
.schema-head { min-height: 46px; color: var(--muted); background: var(--surface-2); font-size: 13px; font-weight: 760; }
.state { color: var(--green); font-size: 13px; }
.state.watch { color: var(--amber); }

.changelog {
  display: grid;
  gap: 1px;
  padding: 0;
  list-style: none;
  background: var(--line);
}

.changelog li {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  padding: 18px;
  background: var(--surface);
}

.changelog time {
  color: var(--green);
  font-weight: 760;
}

.changelog p { margin-bottom: 0; }

.gate-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.gate-list article {
  display: grid;
  gap: 12px;
  min-height: 140px;
  padding: 18px;
  background: var(--surface-2);
  border-radius: 8px;
}

.gate-list span {
  color: var(--muted);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.status-grid article {
  display: grid;
  gap: 16px;
  min-height: 130px;
  padding: 18px;
  box-shadow: none;
}

.status-grid span {
  color: var(--green);
  font-weight: 760;
}

.status-grid article:last-child span {
  color: var(--amber);
}

.footer {
  display: flex;
  justify-content: space-between;
  padding: 28px 32px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  padding: 10px 14px;
  color: #ffffff;
  background: var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

@media (max-width: 1060px) {
  .docs-hero,
  .docs-layout,
  .section-grid {
    grid-template-columns: 1fr;
  }
  .docs-strip,
  .sdk-grid,
  .gate-list {
    grid-template-columns: 1fr 1fr;
  }
  .docs-sidebar {
    position: static;
  }
  .collection-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .guide-grid,
  .status-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 16px 20px;
  }
  .nav { flex-wrap: wrap; gap: 14px; }
  .nav {
    width: 100%;
    column-gap: 12px;
    row-gap: 8px;
    font-size: 13px;
  }
  .nav a {
    padding: 4px 0;
  }
  .docs-hero,
  .docs-layout,
  .docs-strip,
  .footer {
    width: 100vw;
    max-width: 100vw;
    margin-left: 0;
    margin-right: 0;
    padding-left: 20px;
    padding-right: 20px;
  }
  .docs-strip,
  .sdk-grid,
  .gate-list {
    grid-template-columns: 1fr;
  }
  .docs-strip > div {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }
  .docs-strip > div:first-child {
    border-radius: 8px 8px 0 0;
  }
  .docs-strip > div:last-child {
    border-bottom: 1px solid var(--line);
    border-radius: 0 0 8px 8px;
  }
  .hero-copy {
    min-height: 500px;
    padding: 28px;
  }
  h1 {
    font-size: clamp(44px, 12vw, 56px);
  }
  .lead {
    font-size: 18px;
  }
  pre {
    white-space: pre-wrap;
    word-break: break-word;
  }
  .collection-nav,
  .guide-grid,
  .status-grid,
  .schema-row,
  .changelog li {
    grid-template-columns: 1fr;
  }
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .footer {
    flex-direction: column;
    gap: 6px;
  }
}
