/* ── Custom Properties ─────────────────────────────── */
:root {
  --text:        #111827;
  --text-mid:    #4b5563;
  --text-light:  #6b7280;
  --bg:          #ffffff;
  --bg-alt:      #f9fafb;
  --border:      #e5e7eb;
  --accent:      #111827;
  --radius:      8px;
  --max-w:       960px;
  --prose-w:     65ch;
  --gap:         1.5rem;
}

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

/* ── Base ─────────────────────────────────────────── */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

img { max-width: 100%; display: block; }

/* ── Layout ───────────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }

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

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
}

.site-logo {
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--text);
}

.site-nav { display: flex; gap: 1.5rem; align-items: center; }
.site-nav a {
  font-size: .875rem;
  color: var(--text-mid);
  text-decoration: none;
  transition: color .15s;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: .25rem; }
.nav-toggle svg { width: 24px; height: 24px; stroke: var(--text); }

/* ── Hero / Page Header ───────────────────────────── */
.page-header {
  padding: 3rem 0 2rem;
}

.page-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: -.02em;
  margin-bottom: .5rem;
}

.page-header .subtitle {
  font-size: 1.1rem;
  color: var(--text-mid);
  max-width: var(--prose-w);
}

/* ── Breadcrumbs ──────────────────────────────────── */
.breadcrumb {
  font-size: .8125rem;
  color: var(--text-light);
  margin-bottom: 1rem;
  list-style: none;
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
}

.breadcrumb li::after { content: "/"; margin-left: .35rem; }
.breadcrumb li:last-child::after { content: ""; }
.breadcrumb a { color: var(--text-light); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); text-decoration: underline; }

/* ── Category Grid ────────────────────────────────── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
  margin: 2rem 0;
}

/* ── Cards ────────────────────────────────────────── */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: box-shadow .15s;
}

.card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.06); }

.card h2, .card h3 {
  font-size: 1.125rem;
  margin-bottom: .5rem;
}

.card h2 a, .card h3 a { text-decoration: none; color: var(--text); }
.card h2 a:hover, .card h3 a:hover { text-decoration: underline; }

.card p { color: var(--text-mid); font-size: .9375rem; }

.card .meta {
  font-size: .8125rem;
  color: var(--text-light);
  margin-top: .75rem;
}

/* ── Post List ────────────────────────────────────── */
.post-list { list-style: none; display: flex; flex-direction: column; gap: var(--gap); }

/* ── Article / Prose ──────────────────────────────── */
.prose { max-width: var(--prose-w); }

.prose h2 {
  font-size: 1.375rem;
  margin-top: 2rem;
  margin-bottom: .75rem;
  letter-spacing: -.01em;
}

.prose h3 {
  font-size: 1.125rem;
  margin-top: 1.5rem;
  margin-bottom: .5rem;
}

.prose p { margin-bottom: 1rem; color: var(--text-mid); }
.prose p:last-child { margin-bottom: 0; }

.prose ul, .prose ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  color: var(--text-mid);
}

.prose li { margin-bottom: .35rem; }

.prose blockquote {
  border-left: 3px solid var(--border);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--text-light);
  font-style: italic;
}

.prose strong { color: var(--text); }

.prose a { text-decoration: underline; }

/* ── Article Meta ─────────────────────────────────── */
.article-meta {
  font-size: .8125rem;
  color: var(--text-light);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.category-tag {
  display: inline-block;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .125rem .5rem;
  font-size: .75rem;
  color: var(--text-mid);
  text-decoration: none;
}

.category-tag:hover { background: var(--border); text-decoration: none; }

/* ── About Page ───────────────────────────────────── */
.quick-facts {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
}

.quick-facts h2 {
  font-size: 1rem;
  margin-bottom: .75rem;
}

.quick-facts dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .35rem 1rem;
  font-size: .9375rem;
}

.quick-facts dt { color: var(--text-light); }
.quick-facts dd { color: var(--text); }

/* ── Section ──────────────────────────────────────── */
.section { padding: 2.5rem 0; }
.section--alt { background: var(--bg-alt); }

.section-title {
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
  letter-spacing: -.01em;
}

/* ── Footer ───────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 3rem;
  font-size: .8125rem;
  color: var(--text-light);
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links { display: flex; gap: 1.25rem; list-style: none; }
.footer-links a { color: var(--text-light); text-decoration: none; }
.footer-links a:hover { color: var(--text); }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 720px) {
  .site-nav { display: none; }
  .site-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 3.5rem;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    gap: .75rem;
  }
  .nav-toggle { display: block; }

  .page-header { padding: 2rem 0 1.5rem; }

  .category-grid { grid-template-columns: 1fr; }

  .site-footer .container { flex-direction: column; text-align: center; }

  .quick-facts dl { grid-template-columns: 1fr; }
  .quick-facts dt { font-weight: 600; }
}
