/* ── Variables ───────────────────────────────────────────────────────────── */
:root {
  /* Matches app: slate-900 header, pink-500/600 brand, blue-600 actions */
  --color-header:        #0f172a; /* slate-900 */
  --color-primary:       #db2777; /* pink-600  */
  --color-primary-light: #ec4899; /* pink-500  */
  --color-blue:          #2563eb; /* blue-600  */
  --color-blue-light:    #3b82f6; /* blue-500  */
  --color-bg:            #f8fafc; /* slate-50  */
  --color-surface:       #ffffff;
  --color-border:        #e2e8f0; /* slate-200 */
  --color-border-dark:   #cbd5e1; /* slate-300 */
  --color-text:          #1e293b; /* slate-800 */
  --color-text-muted:    #94a3b8; /* slate-400 */
  --color-text-subtle:   #64748b; /* slate-500 */
  --color-code-bg:       #f1f5f9; /* slate-100 */
  --nav-height: 60px;
  --sidebar-width: 224px;
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
}

/* ── Navigation — matches app's slate-900 header bar ─────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-header);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  height: var(--nav-height);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
  color: #ffffff;
  letter-spacing: 0.01em;
}

.nav-brand-icon { color: var(--color-primary-light); font-size: 1.2rem; }

.nav-links { display: flex; gap: 1rem; list-style: none; align-items: center; }

.nav-link {
  text-decoration: none;
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s;
}
.nav-link:hover { color: #ffffff; }
.nav-link-gh {
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: #cbd5e1;
}
.nav-link-gh:hover { border-color: rgba(255,255,255,0.35); color: #ffffff; background: rgba(255,255,255,0.05); }

/* ── Hero — dark slate-900 band, mirrors app header aesthetic ────────────── */
.hero {
  background: var(--color-header);
  padding: 5rem 1.5rem 4rem;
  text-align: center;
}

.hero-container { max-width: 760px; margin: 0 auto; }

.hero-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.13;
  margin-bottom: 1.25rem;
  letter-spacing: -0.03em;
  color: #ffffff;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  background: var(--color-primary);
  color: white;
  font-weight: 600;
  padding: 0.6rem 1.4rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 0.01em;
}
.btn-primary:hover { background: var(--color-primary-light); transform: translateY(-1px); }

/* ── App screenshot ──────────────────────────────────────────────────────── */
.app-screenshot {
  background: var(--color-header);
  padding: 0 1.5rem 3.5rem;
}
.app-screenshot-container {
  max-width: 1100px;
  margin: 0 auto;
}
.app-screenshot-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}

/* ── CTA — dark slate-900 band bookending the page ───────────────────────── */
.cta {
  background: var(--color-header);
  color: white;
  padding: 4.5rem 1.5rem;
  text-align: center;
}
.cta-container { max-width: 600px; margin: 0 auto; }
.cta h2 { font-size: 1.9rem; font-weight: 700; margin-bottom: 0.75rem; letter-spacing: -0.02em; }
.cta p { color: #94a3b8; margin-bottom: 1.75rem; line-height: 1.7; }
.cta .btn-primary { background: var(--color-primary); color: white; }
.cta .btn-primary:hover { background: var(--color-primary-light); }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--color-header);
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 1.25rem 1.5rem;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.825rem;
}
.footer-container { max-width: 1200px; margin: 0 auto; }

.footer-container a {
  color: var(--color-primary-light);
  text-decoration: none;
}

.footer-container a:hover { color: var(--color-primary); transition: ease 0.15s; }

/* ── Sidebar — mirrors app's white sidebar with slate-200 border ─────────── */
.docs-sidebar { width: var(--sidebar-width); flex-shrink: 0; }

.docs-sidebar nav {
  position: sticky;
  top: calc(var(--nav-height) + 1.5rem);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 0.75rem 0.5rem;
}

.sidebar-heading {
  /* Matches app: text-xs font-bold text-slate-400 uppercase tracking-wider */
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--color-text-muted);
  padding: 0.25rem 0.75rem 0.5rem;
}

.sidebar-nav { list-style: none; display: flex; flex-direction: column; gap: 1px; }

.sidebar-link {
  display: block;
  padding: 0.42rem 0.75rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.84rem;
  color: var(--color-text-subtle);
  transition: background 0.1s, color 0.1s;
}
.sidebar-link:hover { background: #f8fafc; color: var(--color-text); }
.sidebar-link.active {
  background: #fdf2f8;
  color: var(--color-primary);
  font-weight: 600;
  border-left: 2px solid var(--color-primary);
  padding-left: calc(0.75rem - 2px);
}

/* ── Docs content ────────────────────────────────────────────────────────── */
.docs-content { flex: 1; min-width: 0; }

/* Single-page sections */
.doc-section {
  scroll-margin-top: calc(var(--nav-height) + 1.5rem);
}
.doc-section + .doc-section {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--color-border);
}
.doc-section-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 1.5rem;
  color: var(--color-text);
}

/* Legacy single-page h1 (kept for page.html) */
.docs-content > h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  letter-spacing: -0.025em;
}

/* ── Prose ───────────────────────────────────────────────────────────────── */
.prose h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 2rem 0 0.65rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
  letter-spacing: -0.01em;
  color: var(--color-text);
}
.prose h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.375rem;
  color: var(--color-text);
}
.prose p { margin-bottom: 1rem; line-height: 1.75; color: var(--color-text); }
.prose ul, .prose ol { margin: 0.5rem 0 1rem 1.5rem; }
.prose li { margin-bottom: 0.4rem; line-height: 1.7; color: var(--color-text); }
.prose a { color: var(--color-blue); text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: var(--color-blue-light); }
.prose strong { font-weight: 600; }

.prose code {
  background: var(--color-code-bg);
  padding: 0.15em 0.45em;
  border-radius: 5px;
  font-size: 0.85em;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  color: #db2777;  /* pink-600, matches app's active text accents */
  border: 1px solid var(--color-border);
}
.prose pre {
  background: var(--color-header);
  color: #94a3b8;
  padding: 1.1rem 1.4rem;
  border-radius: 10px;
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  line-height: 1.65;
  border: 1px solid rgba(255,255,255,0.07);
}
.prose pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  color: #e2e8f0;
  border: none;
}

.prose blockquote {
  border-left: 3px solid var(--color-primary-light);
  padding: 0.65rem 1rem;
  background: #fdf2f8;
  border-radius: 0 8px 8px 0;
  margin: 1rem 0;
}
.prose blockquote p { color: var(--color-text-subtle); margin: 0; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.875rem;
}
.prose th {
  background: var(--color-code-bg);
  font-weight: 600;
  text-align: left;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--color-border);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-subtle);
}
.prose td {
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--color-border);
  vertical-align: top;
}
.prose tr:nth-child(even) td { background: var(--color-bg); }

.prose kbd {
  display: inline-block;
  background: var(--color-surface);
  border: 1px solid var(--color-border-dark);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.1em 0.45em;
  font-size: 0.8em;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  white-space: nowrap;
  color: var(--color-text-subtle);
}

/* ── Prev / Next navigation ──────────────────────────────────────────────── */
.page-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  gap: 1rem;
}
.page-nav a {
  text-decoration: none;
  color: var(--color-blue);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  transition: background 0.1s, border-color 0.1s;
  background: var(--color-surface);
}
.page-nav a:hover { background: #eff6ff; border-color: var(--color-blue-light); }

/* ── Docs layout ─────────────────────────────────────────────────────────── */
.docs-layout {
  display: flex;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  gap: 2.5rem;
  min-height: calc(100vh - var(--nav-height) - 52px);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .docs-layout { flex-direction: column; gap: 1.5rem; padding: 1.25rem 1rem; }
  .docs-sidebar { width: 100%; }
  .docs-sidebar nav { position: static; }
  .hero { padding: 2rem 1rem 1.5rem; }
  .cta { padding: 3rem 1rem; }
}
