/* Firestore Data Analyzer — documentation site */

:root {
  --accent: #6366f1;
  --accent-dark: #4f46e5;
  --accent-soft: #eef2ff;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --bg: #ffffff;
  --bg-alt: #f9fafb;
  --code-bg: #f3f4f6;
  --radius: 10px;
  --max-width: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
}

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

code {
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.88em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

pre {
  background: #111827;
  color: #e5e7eb;
  padding: 16px 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.6;
}
pre code { background: none; padding: 0; color: inherit; }

/* ── Header ── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header .inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 24px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand .brand-mark { flex-shrink: 0; display: block; }

.site-nav { display: flex; gap: 22px; align-items: center; }
.site-nav a { color: var(--text-muted); font-size: 14.5px; font-weight: 500; }
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-nav a.active { color: var(--accent); }
.site-nav .btn { color: #fff; }

/* ── Buttons ── */

.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}
.btn:hover { background: var(--accent-dark); text-decoration: none; }

.btn.secondary {
  background: #fff;
  color: var(--accent);
}
.btn.secondary:hover { background: var(--accent-soft); }

/* ── Hero ── */

.hero {
  background: linear-gradient(180deg, var(--accent-soft) 0%, #fff 100%);
  padding: 72px 24px 64px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.2;
  margin: 0 auto 18px;
  max-width: 760px;
  letter-spacing: -0.02em;
}
.hero p.lede {
  font-size: 19px;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 30px;
}
.hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero .note { margin-top: 18px; font-size: 13.5px; color: var(--text-muted); }

/* ── Screenshots ── */

.screenshot { margin: 24px 0; }
.screenshot img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.10);
}
.screenshot figcaption {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--text-muted);
  text-align: center;
}
.hero .screenshot { max-width: 920px; margin: 44px auto 0; }

/* ── Sections ── */

.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px 24px;
}
.section.alt { background: var(--bg-alt); max-width: none; }
.section.alt > .inner { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

.section h2 {
  font-size: 28px;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
.section p.sub {
  color: var(--text-muted);
  margin: 0 0 36px;
  font-size: 16.5px;
}

/* ── Feature grid ── */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.feature-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  background: #fff;
}
.feature-card .icon { font-size: 26px; margin-bottom: 10px; }
.feature-card h3 { margin: 0 0 8px; font-size: 17px; }
.feature-card p { margin: 0; color: var(--text-muted); font-size: 14.5px; }
.feature-card a.more { font-size: 14px; font-weight: 500; display: inline-block; margin-top: 10px; }

/* ── Steps ── */

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 28px 56px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.steps li h3 { margin: 0 0 6px; font-size: 16.5px; }
.steps li p { margin: 0; color: var(--text-muted); font-size: 15px; }

/* ── Docs layout ── */

.docs-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px 80px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: 84px;
  font-size: 14px;
}
.docs-sidebar .group-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin: 18px 0 6px;
}
.docs-sidebar .group-label:first-child { margin-top: 0; }
.docs-sidebar a {
  display: block;
  padding: 5px 10px;
  border-radius: 6px;
  color: var(--text-muted);
}
.docs-sidebar a:hover { color: var(--text); background: var(--bg-alt); text-decoration: none; }

.docs-content h1 { font-size: 32px; letter-spacing: -0.02em; margin: 0 0 10px; }
.docs-content > p.lede { color: var(--text-muted); font-size: 17px; margin: 0 0 40px; }

.docs-content section { padding: 8px 0 28px; }
.docs-content h2 {
  font-size: 23px;
  margin: 28px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  letter-spacing: -0.01em;
}
.docs-content h3 { font-size: 17px; margin: 22px 0 8px; }
.docs-content p, .docs-content li { color: #374151; font-size: 15.5px; }
.docs-content ul, .docs-content ol { padding-left: 24px; }

.callout {
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  padding: 14px 18px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 18px 0;
  font-size: 14.5px;
}
.callout.warn { border-color: #f59e0b; background: #fffbeb; }
.callout p { margin: 0; }

/* ── Prose pages (privacy / terms / refunds) ── */

.prose {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.prose h1 { font-size: 30px; margin-bottom: 4px; letter-spacing: -0.02em; }
.prose .date { color: var(--text-muted); font-size: 14px; margin-bottom: 32px; }
.prose h2 { font-size: 20px; margin-top: 34px; }
.prose li { margin: 6px 0; }
.prose .highlight {
  background: var(--accent-soft);
  padding: 16px 20px;
  border-radius: var(--radius);
  margin: 16px 0;
}

/* ── FAQ ── */

.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 12px;
  background: #fff;
}
.faq summary { font-weight: 600; cursor: pointer; font-size: 15.5px; }
.faq details p { margin: 12px 0 0; color: var(--text-muted); font-size: 15px; }

/* ── Footer ── */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  margin-top: 40px;
}
.site-footer .inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text-muted);
}
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text); }

/* ── Responsive ── */

@media (max-width: 820px) {
  .docs-wrap { grid-template-columns: 1fr; gap: 8px; }
  .docs-sidebar { position: static; display: flex; flex-wrap: wrap; gap: 4px 10px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
  .docs-sidebar .group-label { width: 100%; margin: 10px 0 2px; }
  .site-nav { gap: 14px; }
}

@media (max-width: 640px) {
  .site-header .inner { padding: 10px 16px; }
  .brand { font-size: 15px; gap: 8px; }
  .brand .brand-mark { width: 22px; height: 22px; }
  .site-nav { gap: 12px; }
  .site-nav a { font-size: 13.5px; white-space: nowrap; }
  .site-nav .btn { padding: 7px 12px; font-size: 13.5px; }
  .hero { padding: 48px 20px 44px; }
  .section { padding: 40px 20px; }
}

@media (max-width: 430px) {
  .site-nav .btn { display: none; }
}
