:root {
  --accent: #2f6f4e;
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #5a5a5a;
  --border: #e2e2e2;
  --code-bg: #f6f8f7;
  --max-width: 1100px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #6fcf9a;
    --bg: #14161a;
    --fg: #e8e8e8;
    --muted: #a3a3a3;
    --border: #2c2f33;
    --code-bg: #1c1f23;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
}

a { color: var(--accent); }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  max-width: var(--max-width);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
  color: var(--fg);
}

.logo-mark { color: var(--accent); flex-shrink: 0; }

.top-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1.25rem;
}

.top-nav a {
  text-decoration: none;
  color: var(--fg);
}

.top-nav a:hover, .top-nav a.active { color: var(--accent); }

.layout {
  display: flex;
  max-width: var(--max-width);
  margin: 0 auto;
  align-items: flex-start;
  gap: 2rem;
}

.sidebar {
  flex: 0 0 240px;
  padding: 1.5rem 1rem;
  font-size: 0.92rem;
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
}

.sidebar ul { list-style: none; margin: 0; padding-left: 0.9rem; }
.sidebar > ul { padding-left: 0; }

.sidebar a {
  display: block;
  padding: 0.15rem 0;
  text-decoration: none;
  color: var(--fg);
}

.sidebar a:hover, .sidebar a.active { color: var(--accent); font-weight: 600; }

.nav-group {
  display: block;
  margin-top: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.content {
  flex: 1;
  min-width: 0;
  padding: 1.5rem;
}

.content.marketing {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
}

/* Hero */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 2.5rem;
  text-align: center;
}

.hero .logo-mark { margin-bottom: 1rem; }

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: 2.75rem;
}

.hero-tagline {
  max-width: 640px;
  margin: 0 auto;
  font-size: 1.15rem;
  color: var(--muted);
}

.hero-ctas {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin: 1.75rem 0 1.5rem;
}

.hero-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hero-badges img { height: 20px; }

/* Sections */
.page-hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 0.5rem;
  text-align: center;
}
.page-hero h1 { margin: 0 0 0.9rem; font-size: 2.4rem; }
.page-hero .section-lede { max-width: 720px; margin-bottom: 0; }

.section { margin: 3rem 0; }
.section h2 { font-size: 1.6rem; text-align: center; margin-bottom: 1.25rem; }

.section-lede {
  max-width: 680px;
  margin: 0 auto 1.75rem;
  text-align: center;
  color: var(--muted);
  font-size: 1.05rem;
}

/* Feature cards */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.feature-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.4rem;
}

.feature-card h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.feature-card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Architecture diagram */
.arch-diagram-wrap {
  overflow-x: auto;
  padding: 0 0.5rem;
}

.arch-diagram {
  display: block;
  width: 100%;
  min-width: 480px;
  max-width: 560px;
  margin: 0 auto;
}

.arch-diagram line { stroke: var(--border); stroke-width: 2; }
.arch-diagram .core { fill: var(--accent); fill-opacity: 0.12; stroke: var(--accent); stroke-width: 3; }
.arch-diagram .core-label { fill: var(--fg); font-weight: 700; font-size: 15px; }
.arch-diagram .node { fill: var(--bg); stroke: var(--accent); stroke-width: 2.5; }
.arch-diagram .node-label { fill: var(--fg); font-size: 13px; }

/* Quickstart */
.quickstart-label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 0.4rem;
}

.quickstart-step { margin-bottom: 1.25rem; }

.install-line { text-align: center; }
.install-line code { font-size: 1rem; padding: 0.4rem 0.8rem; }

/* Platform grid */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.platform-pill {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  text-align: center;
}

.platform-pill strong { display: block; margin-bottom: 0.3rem; }
.platform-pill span { color: var(--muted); font-size: 0.85rem; }

@media (max-width: 700px) {
  .hero h1 { font-size: 2.1rem; }
  .feature-grid { grid-template-columns: 1fr; }
  .platform-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .site-header { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
  .top-nav { gap: 0.4rem 1rem; }
}

.content h1 { font-size: 2rem; }
.content h1:first-child { margin-top: 0; }

.content pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
}

.content code {
  background: var(--code-bg);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
  font-size: 0.9em;
}

.content pre code { background: none; padding: 0; }

.content table {
  border-collapse: collapse;
  width: 100%;
  overflow-x: auto;
  display: block;
}

.content th, .content td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.6rem;
  text-align: left;
}

.cta { text-align: center; margin-top: 2.5rem; }

.button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1.4rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
}

.button-secondary {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border);
}

.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

@media (max-width: 800px) {
  /* Content first, nav demoted to a labelled directory at the foot of the page - so a docs page
     opens straight into what you clicked, the way the single-column marketing pages read, instead
     of dumping the whole nav tree above the content. */
  .layout { flex-direction: column; gap: 0; }
  .content { order: 1; padding: 1.25rem 1rem; }
  .sidebar {
    order: 2;
    position: static;
    max-height: none;
    width: 100%;
    margin-top: 2.5rem;
    padding: 1.25rem 1rem;
    border-top: 1px solid var(--border);
  }
  .sidebar::before {
    content: "Documentation";
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
  }
}
