:root {
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --text: #1a1d23;
  --text-muted: #5b6270;
  --border: #e3e6ea;
  --accent: #2f5dff;
  --accent-dark: #1c3fc9;
  --card-bg: #ffffff;
  --max-width: 1080px;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12141a;
    --bg-alt: #1a1d24;
    --text: #e8eaee;
    --text-muted: #a2a8b4;
    --border: #2b2f38;
    --accent: #6b8cff;
    --accent-dark: #93aaff;
    --card-bg: #1a1d24;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 17px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 12px;
  z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
}
.brand span { color: var(--accent); }
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1.2rem;
  padding: 4px 10px;
  cursor: pointer;
  color: var(--text);
}
.site-nav ul {
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
}
.site-nav a {
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
}
.site-nav a:hover { color: var(--accent); }

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    width: 100%;
  }
  .site-nav.open { display: block; }
  .site-nav ul {
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--border);
    margin-top: 12px;
  }
  .site-nav li { padding: 10px 0; border-bottom: 1px solid var(--border); }
  .header-inner { flex-wrap: wrap; }
}

/* Main / breadcrumbs */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 20px 60px;
}
.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 0 0 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 6px; color: var(--text-muted); }
.breadcrumbs a { color: var(--text-muted); }

/* Hero */
.hero { padding: 20px 0 10px; }
.hero h1 { font-size: 2.2rem; margin-bottom: 8px; }
.lede { font-size: 1.15rem; color: var(--text-muted); max-width: 65ch; }

.hero-image { margin: 20px 0; }
.hero-image img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  display: block;
}
.hero-image figcaption {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Prose */
.prose { max-width: 72ch; }
.prose h1 { font-size: 2rem; margin-bottom: 6px; }
.prose h2 { font-size: 1.3rem; margin-top: 2em; margin-bottom: 0.5em; }
.prose p { margin: 0.9em 0; }
.prose ul { padding-left: 1.2em; }
.prose li { margin: 0.4em 0; }
.callout {
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  padding: 14px 16px;
  border-radius: 6px;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.card {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.card h3 { margin: 0 0 6px; font-size: 1.05rem; color: var(--text); }
.card p { margin: 0; font-size: 0.9rem; color: var(--text-muted); }

/* Filter input */
.filter-input {
  width: 100%;
  max-width: 420px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--bg-alt);
  color: var(--text);
  margin-top: 10px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  margin-top: 40px;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 36px 20px 10px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 24px;
}
.footer-col h3 { font-size: 0.9rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: 10px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin: 6px 0; }
.footer-col p { color: var(--text-muted); font-size: 0.9rem; max-width: 32ch; }
.footer-note {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 16px 20px 24px;
  max-width: var(--max-width);
  margin: 0 auto;
}
@media (max-width: 640px) {
  .footer-inner { grid-template-columns: 1fr; }
}
