:root {
  --bg: #faf7f2;
  --bg-raised: #ffffff;
  --text: #232019;
  --text-muted: #6b6459;
  --border: #e4ddd0;
  --accent: #7a3b2e;
  --accent-ink: #ffffff;

  --documented-bg: #e4f3e6;
  --documented-fg: #1f6b30;
  --plausible-bg: #fbf1d6;
  --plausible-fg: #8a6a10;
  --debunked-bg: #fbe4e2;
  --debunked-fg: #a3352a;
  --unverified-bg: #eceae6;
  --unverified-fg: #5b564c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191713;
    --bg-raised: #221f1a;
    --text: #eee8de;
    --text-muted: #a89e8d;
    --border: #3a352c;
    --accent: #d98a72;
    --accent-ink: #191713;

    --documented-bg: #163821;
    --documented-fg: #7fd897;
    --plausible-bg: #3a2f0c;
    --plausible-fg: #e8c65a;
    --debunked-bg: #3b1a17;
    --debunked-fg: #ef8a7d;
    --unverified-bg: #2d2a24;
    --unverified-fg: #b8b0a1;
  }
}

* { box-sizing: border-box; }

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

.wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.25;
  color: var(--text);
}

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

/* header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
  max-width: 960px;
}
.brand {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: bold;
  font-size: 1.05rem;
  text-decoration: none;
  color: var(--text);
  margin-right: auto;
}
.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}
.site-header nav a {
  font-size: 0.88rem;
  text-decoration: none;
  color: var(--text-muted);
}
.site-header nav a:hover { color: var(--accent); }

main.wrap {
  max-width: 960px;
  padding-top: 2.5rem;
  padding-bottom: 4rem;
  min-height: 60vh;
}

/* hero */
.hero {
  max-width: 640px;
  margin-bottom: 3rem;
}
.hero h1 {
  font-size: 2.1rem;
  margin-bottom: 0.75rem;
}
.hero .lede {
  font-size: 1.1rem;
  color: var(--text-muted);
}
.hero-ctas {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.cta {
  display: inline-block;
  padding: 0.65rem 1.1rem;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.cta.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

/* card grid */
.index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.1rem;
}
.card {
  display: block;
  padding: 1.25rem 1.4rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease;
}
.card:hover { border-color: var(--accent); }
.card h2 {
  font-size: 1.1rem;
  margin: 0.15rem 0 0.4rem;
}
.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* article page */
.page h1 { font-size: 1.8rem; margin-bottom: 0.5rem; }
.page .lede {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 640px;
}
.prose { max-width: 700px; margin-top: 1.75rem; }
.prose h2 {
  font-size: 1.3rem;
  margin-top: 2.2rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.prose h3 { font-size: 1.05rem; margin-top: 1.6rem; }
.prose p { margin: 0.85rem 0; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin: 0.35rem 0; }
.prose pre {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.85rem;
}
.prose blockquote {
  margin: 1rem 0;
  padding: 0.4rem 1rem;
  border-left: 3px solid var(--accent);
  color: var(--text-muted);
}

/* investigation */
.investigation .badge-live {
  display: inline-block;
  margin-bottom: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--debunked-bg);
  color: var(--debunked-fg);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* family */
.family .badge {
  display: inline-block;
  margin-bottom: 0.6rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--unverified-bg);
  color: var(--unverified-fg);
  font-size: 0.78rem;
  font-weight: 600;
}
.tree-link {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

/* confidence badges */
.tag {
  display: inline;
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
}
.tag strong { font-weight: 600; }
.tag-documented { background: var(--documented-bg); color: var(--documented-fg); }
.tag-plausible { background: var(--plausible-bg); color: var(--plausible-fg); }
.tag-debunked { background: var(--debunked-bg); color: var(--debunked-fg); }
.tag-unverified { background: var(--unverified-bg); color: var(--unverified-fg); }

/* footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-raised);
  padding: 2rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.site-footer .legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.site-footer a { color: var(--text-muted); }
