/* ── Reset & base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:       #2563eb;
  --blue-dark:  #1d4ed8;
  --blue-light: #eff6ff;
  --ink:        #0f172a;
  --ink-2:      #334155;
  --muted:      #64748b;
  --border:     #e2e8f0;
  --bg:         #ffffff;
  --bg-2:       #f8fafc;
  --code-bg:    #0f172a;
  --code-fg:    #e2e8f0;
  --green:      #16a34a;
  --font:       -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono:       "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 2.75rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; }

p { color: var(--ink-2); }

code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  color: var(--ink);
}

pre {
  background: var(--code-bg);
  color: var(--code-fg);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.65;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { text-align: left; font-weight: 600; padding: 0.6rem 1rem; background: var(--bg-2); border-bottom: 2px solid var(--border); }
td { padding: 0.6rem 1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: 780px; margin: 0 auto; padding: 0 1.5rem; }

/* ── Nav ─────────────────────────────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
}

.nav-logo svg { color: var(--blue); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.nav-links a { color: var(--ink-2); }
.nav-links a:hover { color: var(--blue); text-decoration: none; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-decoration: none;
}

.btn-primary { background: var(--blue); color: #fff; border: 1px solid var(--blue); }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); text-decoration: none; }
.btn-outline { background: transparent; color: var(--ink); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--bg-2); text-decoration: none; }
.btn-sm { padding: 0.35rem 0.8rem; font-size: 0.8rem; }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  padding: 6rem 0 5rem;
  text-align: center;
  background: linear-gradient(180deg, var(--blue-light) 0%, var(--bg) 100%);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.9rem;
  background: #dbeafe;
  color: var(--blue-dark);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hero h1 { margin-bottom: 1rem; }

.hero-sub {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 2.5rem;
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 3.5rem;
}

.hero-code {
  max-width: 520px;
  margin: 0 auto;
  text-align: left;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}

.hero-code-header {
  background: #1e293b;
  padding: 0.6rem 1rem;
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #22c55e; }

/* ── Sections ────────────────────────────────────────────────────────────── */
section { padding: 5rem 0; }
section + section { border-top: 1px solid var(--border); }

.section-label {
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--blue);
  margin-bottom: 0.75rem;
}

.section-title { margin-bottom: 0.75rem; }
.section-sub { font-size: 1.05rem; color: var(--muted); max-width: 540px; }

.section-header { margin-bottom: 3rem; }

/* ── Features grid ───────────────────────────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .features-grid { grid-template-columns: 1fr; }
  h1 { font-size: 2rem; }
  .hero { padding: 4rem 0 3rem; }
}

.feature-card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  transition: box-shadow 0.15s;
}

.feature-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); }

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.9rem;
  color: var(--blue);
}

.feature-card h3 { margin-bottom: 0.4rem; font-size: 1rem; }
.feature-card p { font-size: 0.9rem; line-height: 1.55; }

/* ── Stack section ───────────────────────────────────────────────────────── */
.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 768px) {
  .stack-grid { grid-template-columns: repeat(2, 1fr); }
}

.stack-item {
  padding: 1.25rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
}

.stack-item .label { font-size: 0.75rem; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.35rem; }
.stack-item .value { font-weight: 700; font-size: 1rem; }

/* ── CTA section ─────────────────────────────────────────────────────────── */
.cta-section {
  background: var(--ink);
  color: #fff;
  text-align: center;
  padding: 5rem 0;
  border-top: none !important;
}

.cta-section h2 { color: #fff; margin-bottom: 0.75rem; }
.cta-section p { color: #94a3b8; margin-bottom: 2rem; font-size: 1.05rem; }
.cta-section .btn-primary { background: #fff; color: var(--ink); border-color: #fff; }
.cta-section .btn-primary:hover { background: #f1f5f9; border-color: #f1f5f9; }
.cta-section .btn-outline { color: #94a3b8; border-color: #334155; }
.cta-section .btn-outline:hover { background: #1e293b; }
.cta-section .btn-group { display: flex; justify-content: center; gap: 0.75rem; flex-wrap: wrap; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ── Docs layout ─────────────────────────────────────────────────────────── */
.docs-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  min-height: calc(100vh - 60px);
}

.docs-sidebar {
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 2rem 1rem;
  background: var(--bg-2);
}

.sidebar-group { margin-bottom: 1.75rem; }
.sidebar-group-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 0.5rem; padding: 0 0.5rem; }

.sidebar-group ul { list-style: none; }
.sidebar-group ul li a {
  display: block;
  padding: 0.3rem 0.5rem;
  border-radius: 5px;
  font-size: 0.875rem;
  color: var(--ink-2);
  font-weight: 500;
}

.sidebar-group ul li a:hover { background: var(--border); text-decoration: none; color: var(--ink); }
.sidebar-group ul li a.active { background: var(--blue-light); color: var(--blue); }

.docs-content {
  padding: 3rem 2.5rem;
  max-width: 820px;
}

.docs-content h2 { margin-top: 3rem; margin-bottom: 0.75rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.docs-content h2:first-child { border-top: none; margin-top: 0; }
.docs-content h3 { margin-top: 2rem; margin-bottom: 0.5rem; }
.docs-content p { margin-bottom: 1rem; }
.docs-content ul, .docs-content ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.docs-content li { margin-bottom: 0.3rem; color: var(--ink-2); }
.docs-content pre { margin: 1.25rem 0; }
.docs-content table { margin: 1.25rem 0; }

.docs-page-title { margin-bottom: 0.5rem; }
.docs-page-sub { color: var(--muted); font-size: 1.05rem; margin-bottom: 2.5rem; }

.callout {
  padding: 1rem 1.25rem;
  border-radius: 8px;
  border-left: 4px solid;
  margin: 1.25rem 0;
  font-size: 0.9rem;
}

.callout-note { background: var(--blue-light); border-color: var(--blue); color: var(--blue-dark); }
.callout-warn { background: #fffbeb; border-color: #f59e0b; color: #92400e; }
.callout p { color: inherit; margin: 0; }
.callout strong { color: inherit; }

@media (max-width: 768px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { position: static; height: auto; }
  .docs-content { padding: 2rem 1rem; }
}
