/* Public Record — detroit.primals.eco
   Design: Sober, factual, accessible. Black/white/dark blue. No sensationalism. */

:root {
  --bg: #ffffff;
  --bg-alt: #f8f9fa;
  --text: #1a1a2e;
  --text-muted: #4a4a6a;
  --accent: #16213e;
  --accent-light: #0f3460;
  --border: #dee2e6;
  --link: #1a56db;
  --link-hover: #0f3460;
  --stat-bg: #16213e;
  --stat-text: #e8e8e8;
  --danger: #9b2335;
  --max-width: 48rem;
  --nav-height: 3.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --bg-alt: #161b22;
    --text: #e6edf3;
    --text-muted: #8b949e;
    --accent: #c9d1d9;
    --accent-light: #58a6ff;
    --border: #30363d;
    --link: #58a6ff;
    --link-hover: #79c0ff;
    --stat-bg: #161b22;
    --stat-text: #e6edf3;
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff; padding: 0.5rem 1rem; z-index: 1000;
}
.skip-link:focus { left: 0; }

/* Nav */
.site-nav {
  background: var(--accent);
  color: #fff;
  height: var(--nav-height);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  height: 100%;
  gap: 1.5rem;
}
.nav-brand {
  color: #fff; font-weight: 700; font-size: 1.1rem;
  white-space: nowrap;
}
.nav-brand:hover { color: #fff; text-decoration: none; }
.nav-links {
  display: flex; list-style: none; gap: 1rem; flex-wrap: wrap;
}
.nav-links a { color: #cbd5e1; font-size: 0.85rem; }
.nav-links a:hover { color: #fff; text-decoration: none; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; }
.nav-toggle span {
  display: block; width: 1.25rem; height: 2px;
  background: #fff; margin: 4px 0;
}

@media (max-width: 768px) {
  .nav-toggle { display: block; margin-left: auto; }
  .nav-links {
    display: none; position: absolute; top: var(--nav-height);
    left: 0; right: 0; background: var(--accent);
    flex-direction: column; padding: 1rem; gap: 0.5rem;
  }
  .nav-links.open { display: flex; }
}

/* Main */
.site-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1rem;
  flex: 1;
  width: 100%;
}

/* Hero */
.hero {
  text-align: center;
  padding: 3rem 0 2rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 2rem;
}
.hero h1 { font-size: 2.2rem; font-weight: 800; margin-bottom: 0.5rem; }
.hero-sub { font-size: 1.15rem; color: var(--text-muted); }

.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}
.stat {
  background: var(--stat-bg);
  color: var(--stat-text);
  padding: 1.25rem 0.75rem;
  border-radius: 6px;
  text-align: center;
}
.stat-number { display: block; font-size: 1.8rem; font-weight: 800; }
.stat-label { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.8; }

/* Sections */
section { margin-bottom: 2.5rem; }
section h2 {
  font-size: 1.4rem; font-weight: 700;
  margin-bottom: 0.75rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}

/* CTAs */
.cta-row {
  display: flex; gap: 1rem; flex-wrap: wrap;
  justify-content: center;
  margin: 2rem 0;
}
.cta {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.95rem;
}
.cta:hover { background: var(--accent-light); color: #fff; text-decoration: none; }
.cta-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}
.cta-outline:hover { background: var(--accent); color: #fff; }

/* Page list */
.page-list { list-style: none; }
.page-list li { border-bottom: 1px solid var(--border); }
.page-list a {
  display: block; padding: 1rem 0;
}
.page-list .page-desc { display: block; color: var(--text-muted); font-size: 0.9rem; }
.page-list time { display: block; color: var(--text-muted); font-size: 0.8rem; }

/* Letter meta */
.letter-meta {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
  margin: 1rem 0;
  font-size: 0.9rem;
}
.letter-meta p { margin: 0.25rem 0; }
.response-status { font-style: italic; }

/* Content body */
.content-body { margin: 2rem 0; }
.content-body h2 { margin-top: 2rem; }
.content-body h3 { margin-top: 1.5rem; font-size: 1.1rem; }
.content-body p { margin-bottom: 1rem; }
.content-body ul, .content-body ol { margin: 0.5rem 0 1rem 1.5rem; }
.content-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  background: var(--bg-alt);
  font-style: italic;
}
.content-body table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.9rem; }
.content-body th, .content-body td { padding: 0.5rem; border: 1px solid var(--border); text-align: left; }
.content-body th { background: var(--bg-alt); font-weight: 600; }
.content-body code { background: var(--bg-alt); padding: 0.15rem 0.3rem; border-radius: 3px; font-size: 0.9em; }
.content-body pre { background: var(--bg-alt); padding: 1rem; border-radius: 4px; overflow-x: auto; margin: 1rem 0; }
.content-body pre code { background: none; padding: 0; }

/* Footer */
.site-footer {
  background: var(--accent);
  color: #cbd5e1;
  padding: 2rem 1rem;
  margin-top: auto;
  text-align: center;
  font-size: 0.85rem;
}
.footer-inner { max-width: var(--max-width); margin: 0 auto; }
.site-footer a { color: #93c5fd; }
.site-footer strong { color: #fff; }
.footer-license { margin-top: 1rem; opacity: 0.7; }

/* Provenance footer on pages */
.page-footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.provenance { font-size: 0.85rem; color: var(--text-muted); }

/* Section page */
.section-page h1 { margin-bottom: 1rem; }
.section-content { margin-bottom: 2rem; }

/* Article */
.page-content header { margin-bottom: 2rem; }
.page-content header time { color: var(--text-muted); font-size: 0.9rem; }
