:root {
  --bg: #f1f5f9;
  --bg-2: #e8eef4;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #0f766e;
  --accent-deep: #115e59;
  --accent-soft: #ccfbf1;
  --ok: #15803d;
  --ok-bright: #4ade80;
  --warn: #b45309;
  --warn-bright: #facc15;
  --danger: #b91c1c;
  --border: #e2e8f0;
  --on-accent: #ffffff;
  --shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 48px -24px rgba(15, 23, 42, 0.28);
  --radius: 14px;
  --radius-sm: 8px;
  --maxw: 1120px;
  --font: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
a:hover { color: var(--accent-deep); }
code, kbd { font-family: var(--mono); font-size: 0.92em; }
pre {
  overflow: auto;
  background: #0f172a;
  color: #e2e8f0;
  padding: 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.45;
}
pre code { font-size: inherit; color: inherit; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(241, 245, 249, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header.is-scrolled { box-shadow: var(--shadow); }
.nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand:hover { color: var(--text); }
.brand img { width: 32px; height: 32px; }
.nav-links {
  display: flex;
  gap: 8px 20px;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--accent-deep); }
.nav > .btn { flex-shrink: 0; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
}
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn-primary:hover { background: var(--accent-deep); color: var(--on-accent); }
.btn-ghost {
  background: var(--surface);
  color: var(--accent-deep);
  border-color: var(--accent);
}
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-deep); }
.btn-lg { min-height: 48px; padding: 0 20px; }
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  margin: 6px 10px;
  background: var(--text);
}

/* Hero — keep copy + phone on one 15″ laptop screen */
.hero {
  padding: 32px 0 24px;
  background:
    radial-gradient(900px 420px at 90% -10%, rgba(15, 118, 110, 0.16), transparent 60%),
    radial-gradient(700px 380px at 0% 20%, rgba(204, 251, 241, 0.7), transparent 55%),
    var(--bg);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 1.2fr);
  gap: 28px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 14px;
}
.hero .sub {
  font-size: 17px;
  color: var(--muted);
  margin: 0 0 20px;
  max-width: 34em;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.tech-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  align-items: center;
}
.tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow);
}
.tech-badge:hover { color: var(--text); border-color: var(--accent); }
.tech-badge img {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.tech-badge.react { color: #0f172a; }
.tech-badge.couchbase { color: #0f172a; }
.hero-note { margin-top: 12px; color: var(--muted); font-size: 14px; }

.hero-visual {
  min-width: 0;
  align-self: center;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.hero-film {
  position: relative;
  width: 100%;
  aspect-ratio: 688 / 464;
  background: #1a2744;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hero-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  vertical-align: top;
}

/* Sections */
.section { padding: 48px 0; }
.section.alt { background: var(--surface); border-block: 1px solid var(--border); }
.eyebrow {
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.section h1 {
  font-size: clamp(28px, 3vw, 36px);
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}
.section h2 {
  font-size: clamp(22px, 2.6vw, 28px);
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}
.lede { color: var(--muted); max-width: 42em; margin: 0 0 32px; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.features-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.features-5 .ico {
  width: 36px;
  height: 36px;
  color: var(--accent);
  margin-bottom: 10px;
}
.features-5 .ico svg { width: 36px; height: 36px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card .kicker { font-size: 13px; color: var(--accent); font-weight: 700; margin-bottom: 6px; }

.shots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.shot {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.shot img { width: 100%; height: auto; }
.shot figcaption {
  padding: 12px 16px 16px;
  color: var(--muted);
  font-size: 14px;
}

.diagram {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.diagram img { width: 100%; height: auto; }

.steps {
  display: grid;
  gap: 16px;
}
.step {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  align-items: start;
}
.num {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 700;
  display: grid;
  place-items: center;
}
.hud-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hud-table th, .hud-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.hud-table th { background: var(--accent-deep); color: var(--on-accent); font-size: 13px; }
.dot-demo {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--warn-bright);
  vertical-align: middle;
  margin-right: 6px;
}
.dot-ok { background: var(--ok-bright); }

.doc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.doc-grid a {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
}
.doc-grid a:hover { border-color: var(--accent); }
.doc-grid strong { display: block; margin-bottom: 4px; }
.doc-grid span { color: var(--muted); font-size: 14px; }

/* Docs article */
.doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 40px;
  padding: 40px 0 80px;
}
.prose { min-width: 0; }
.prose h1 { font-size: 32px; letter-spacing: -0.03em; margin: 0 0 16px; }
.prose h2 { margin-top: 36px; font-size: 22px; }
.prose h3 { margin-top: 24px; font-size: 18px; }
.prose p, .prose li { color: #334155; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 16px 0 24px;
  overflow-x: auto;
  display: block;
}
.prose th, .prose td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  background: var(--surface);
}
.prose th { background: #f8fafc; }
.prose blockquote {
  margin: 16px 0;
  padding: 8px 16px;
  border-left: 4px solid var(--accent);
  color: var(--muted);
}
.toc {
  position: sticky;
  top: 88px;
  align-self: start;
  font-size: 13px;
  max-height: calc(100vh - 120px);
  overflow: auto;
}
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin: 6px 0; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--accent); }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.crumb a { color: var(--muted); }

footer.site-footer {
  background: var(--accent-deep);
  color: var(--accent-soft);
  padding: 40px 0;
  font-size: 14px;
}
footer.site-footer a { color: var(--on-accent); }
footer.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mt { margin-top: 12px; }
.mt-lg { margin-top: 28px; }
.mt-xl { margin-top: 40px; }

.faq-search {
  position: relative;
  max-width: 720px;
  margin: 8px auto 12px;
}
.faq-search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.faq-search input {
  width: 100%;
  height: 58px;
  border: 1px solid var(--border);
  border-radius: 29px;
  padding: 0 20px 0 52px;
  font-family: inherit;
  font-size: 18px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.faq-search input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: var(--accent);
}
.faq-count {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 20px;
}
.faq-empty {
  text-align: center;
  color: var(--muted);
  padding: 32px 16px;
}
mark.faq-hit {
  background: #facc15;
  color: var(--text);
  padding: 0 0.12em;
  border-radius: 2px;
}

.faq-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 28px;
}
.faq-jump[hidden] { display: none !important; }
.faq-jump a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--accent-deep);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.faq-jump a:hover { background: var(--accent-soft); }
.faq-list { display: grid; gap: 8px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  padding: 14px 18px;
  min-height: 48px;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  color: var(--accent);
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
}
.faq-item[open] summary::after { content: "–"; }
.faq-item .faq-a {
  padding: 0 18px 16px;
  color: #334155;
}
.faq-item .faq-a p:first-child { margin-top: 0; }
.faq-item .faq-a a { font-weight: 600; }

.code-block {
  position: relative;
  margin: 12px 0 20px;
}
.code-block pre {
  margin: 0;
  padding-top: 40px;
}
.code-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(226, 232, 240, 0.2);
  background: rgba(15, 23, 42, 0.85);
  color: #ccfbf1;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.code-copy:hover { background: var(--accent); color: var(--on-accent); }

.schema-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  margin: 0 0 20px;
  padding: 12px 14px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.schema-bar a { font-weight: 600; }

.db-tree {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: var(--radius);
  padding: 16px 18px 18px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  overflow: auto;
}
.db-tree a { color: #5eead4; text-decoration: none; }
.db-tree a:hover { text-decoration: underline; color: #ccfbf1; }
.db-tree .tree-root { color: #f8fafc; font-weight: 600; margin-bottom: 8px; }
.db-tree ul { list-style: none; margin: 0; padding-left: 18px; border-left: 1px solid #334155; }
.db-tree > ul { padding-left: 12px; border-left: 0; }
.db-tree li { margin: 4px 0; }
.db-tree .scope { color: #94a3b8; }
.db-tree .meta { color: #64748b; font-size: 12px; }
.db-tree .id { color: #64748b; }

.modes-dev {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.docs-split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: start;
}

.guide-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 24px;
  box-shadow: var(--shadow);
}
.guide-panel h2 { margin: 0 0 8px; font-size: 22px; }
.guide-panel h3 { margin: 0 0 8px; font-size: 18px; }
.guide-panel .lede { margin-bottom: 16px; }
#database { scroll-margin-top: 80px; }
.prose .guide-panel { margin: 0 0 32px; }
.prose .guide-panel h2,
.prose .guide-panel h3 { margin-top: 0; }
.prose .db-tree li { color: #e2e8f0; }

@media (max-width: 1100px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr); gap: 20px; }
  .modes-dev, .docs-split { grid-template-columns: 1fr; }
  .features-5 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .hero-grid, .cards, .shots, .doc-grid, .doc-layout, .features-5 { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .toc { display: none; }
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 64px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 24px 24px;
    align-items: stretch;
  }
  .nav.is-open .nav-links { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-video { pointer-events: none; }
}
