/* Prodogon — fast, minimal reference theme. System fonts, no external requests. */
:root {
  --bg: #ffffff;
  --bg-alt: #f5f7fa;
  --ink: #142033;
  --muted: #5b6b82;
  --line: #dde4ee;
  --accent: #2457d6;
  --accent-ink: #163a96;
  --teal: #0a7d6f;
  --callout-bg: #eef4ff;
  --callout-border: #b9cdf5;
  --answer-bg: #eafaf6;
  --answer-border: #b7e6da;
  --code-bg: #f4f6fa;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 32, 51, .06), 0 8px 24px rgba(20, 32, 51, .08);
  --max: 1120px;
  --measure: 70ch;
  --header-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1622;
    --bg-alt: #131c2b;
    --ink: #e7edf6;
    --muted: #9aa8bd;
    --line: #253247;
    --accent: #6f9bff;
    --accent-ink: #a8c2ff;
    --teal: #4fd1c0;
    --callout-bg: #16233c;
    --callout-border: #2b4a85;
    --answer-bg: #0f2a26;
    --answer-border: #1e4a40;
    --code-bg: #17202e;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
img, svg { max-width: 100%; height: auto; }
code, pre { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; }

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

.container { width: min(var(--max), 100% - 40px); margin: 0 auto; }
.container-narrow { width: min(var(--measure), 100% - 40px); margin: 0 auto; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  width: min(var(--max), 100% - 40px); margin: 0 auto;
  min-height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-word { font-weight: 800; font-size: 1.05rem; }
.brand-line { font-size: .72rem; color: var(--muted); }
.nav-menu { display: flex; align-items: center; gap: 18px; }
.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-links a { color: var(--muted); font-size: .95rem; font-weight: 600; }
.nav-links a:hover { color: var(--accent); text-decoration: none; }
.nav-search input {
  width: 180px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg); color: var(--ink); font-size: .9rem;
}
.nav-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--ink); margin: 3px 0; }

/* Hero (home) */
.hero { padding: 72px 0 40px; }
.hero-kicker {
  color: var(--teal); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 16px;
}
.hero h1 {
  margin: 0 0 18px; font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 800; max-width: 22ch;
}
.hero-sub { color: var(--muted); font-size: 1.12rem; max-width: 62ch; margin-bottom: 26px; }
.hero-search { display: flex; gap: 10px; max-width: 560px; }
.hero-search input {
  flex: 1; padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); color: var(--ink); font-size: 1rem;
}
.hero-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.hero-stat { margin-top: 14px; color: var(--muted); font-size: .85rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 18px; border-radius: var(--radius); border: 1px solid transparent;
  font-size: .95rem; font-weight: 700; cursor: pointer; line-height: 1;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }

/* Sections */
.section { padding: 48px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { padding-top: 32px; }
.section-title { margin: 0 0 6px; font-size: 1.7rem; font-weight: 800; }
.section-sub { color: var(--muted); margin-bottom: 22px; }

/* Category cards */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 20px; }
.cat-card {
  display: flex; flex-direction: column; gap: 8px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg);
  padding: 22px; color: var(--ink); box-shadow: var(--shadow);
}
.cat-card:hover { text-decoration: none; border-color: var(--accent); }
.cat-card h3 { margin: 0; font-size: 1.2rem; }
.cat-card p { margin: 0; color: var(--muted); font-size: .95rem; }
.cat-count { margin-top: auto; color: var(--accent); font-size: .85rem; font-weight: 700; }

/* Starter list */
.starter-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.starter-list li::before { content: "→ "; color: var(--accent); }
.starter-list a { font-size: 1.02rem; font-weight: 600; }

/* Recent posts list */
.recent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.recent-link {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); color: var(--ink);
}
.recent-link:hover { text-decoration: none; border-color: var(--accent); }
.recent-title { font-weight: 650; font-size: 1rem; }
.recent-link:hover .recent-title { color: var(--accent); }
.recent-meta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.recent-cat { text-transform: uppercase; letter-spacing: .04em; font-size: .72rem; }
.recent-date { color: var(--muted); font-size: .85rem; }

/* Topic list (category pages) */
.topic-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.topic-list li { counter-increment: topic; }
.topic-list a {
  display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); color: var(--ink);
}
.topic-list a:hover { text-decoration: none; border-color: var(--accent); }
.topic-title { display: block; font-weight: 700; font-size: 1.05rem; color: var(--ink); }
.topic-list a:hover .topic-title { color: var(--accent); }
.topic-desc { display: block; color: var(--muted); font-size: .9rem; margin-top: 4px; }
.topic-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* Breadcrumbs */
.breadcrumbs { font-size: .82rem; color: var(--muted); margin: 24px 0 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }

/* Article */
.article { position: relative; }
.reading-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200;
  background: transparent; pointer-events: none;
}
.reading-progress-bar {
  height: 100%; width: 0; background: var(--accent);
  transition: width .08s linear;
}
.article-layout {
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px;
  width: min(1040px, 100% - 40px); margin: 0 auto; align-items: start;
}
.article-main { width: 100%; margin: 0; max-width: none; }

/* Table of contents */
.toc { font-size: .85rem; }
.toc-title {
  font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin: 0 0 10px;
}
.toc-desktop { position: sticky; top: calc(var(--header-h) + 24px); max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; padding-right: 4px; }
.toc-list, .toc-sublist { list-style: none; margin: 0; padding: 0; }
.toc-sublist { margin: 2px 0 6px 12px; padding-left: 8px; border-left: 1px solid var(--line); }
.toc-item a {
  display: block; padding: 4px 10px; border-radius: 6px;
  color: var(--muted); text-decoration: none; line-height: 1.4;
}
.toc-item a:hover { color: var(--accent); background: var(--bg-alt); }
.toc-item a.is-active { color: var(--accent-ink); font-weight: 700; background: var(--callout-bg); }
.toc-sublist .toc-item a { font-size: .8rem; }

.toc-mobile { display: none; }

.article-header { margin-bottom: 10px; }
.article-header h1 { margin: 12px 0 12px; font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; }
.lede { color: var(--muted); font-size: 1.08rem; max-width: 62ch; }
.badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: .74rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: var(--accent-ink); background: var(--callout-bg);
  border: 1px solid var(--callout-border);
}
.article-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 24px; }
.article-tags {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 8px 0 24px; padding-top: 20px; border-top: 1px solid var(--line);
}
.article-tags-label { font-size: .8rem; font-weight: 700; color: var(--muted); }
.article-share {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 8px 0 24px; padding-top: 20px; border-top: 1px solid var(--line);
}
.article-share-label { font-size: .8rem; font-weight: 700; color: var(--muted); margin-right: 2px; }
.share-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); font-size: .8rem; font-weight: 600;
  font-family: inherit; cursor: pointer; line-height: 1;
}
.share-btn:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.share-btn svg { flex: none; }
.share-native { color: var(--accent-ink); }
.tag-chip {
  display: inline-block; padding: 5px 12px; border-radius: 999px;
  font-size: .8rem; font-weight: 600; color: var(--accent-ink);
  background: var(--callout-bg); border: 1px solid var(--callout-border);
}
.tag-chip:hover { text-decoration: none; background: var(--accent); color: #fff; border-color: var(--accent); }

/* Tag cloud (taxonomy index) */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 12px; }
.tag-cloud-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); font-weight: 600; font-size: .92rem;
  box-shadow: var(--shadow);
}
.tag-cloud-chip:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.tag-count {
  min-width: 22px; text-align: center; padding: 1px 7px; border-radius: 999px;
  background: var(--callout-bg); color: var(--accent-ink); font-size: .76rem; font-weight: 700;
}
.meta-chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem;
  color: var(--muted); background: var(--bg-alt); border: 1px solid var(--line);
}

/* Prose */
.prose { padding-bottom: 40px; }
.prose h2 {
  margin: 2em 0 .6em; font-size: 1.4rem; font-weight: 800;
  border-bottom: 1px solid var(--line); padding-bottom: .35em;
}
.prose h3 { margin: 1.6em 0 .5em; font-size: 1.12rem; font-weight: 750; }
.prose h4 { margin: 1.4em 0 .4em; font-size: 1rem; font-weight: 750; }
.prose a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 2px; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.prose li { margin-bottom: .35em; }
.prose li::marker { color: var(--accent); }
.prose blockquote {
  margin: 1.4em 0; padding: 14px 18px; border-left: 4px solid var(--accent);
  background: var(--callout-bg); border-radius: 0 var(--radius) var(--radius) 0;
}
.prose blockquote p { margin: 0 0 .5em; }
.prose blockquote p:last-child { margin: 0; }
.prose blockquote strong { color: var(--accent-ink); }
/* Quick-answer box: the first blockquote in each article */
.prose > blockquote:first-of-type {
  background: var(--answer-bg);
  border: 1px solid var(--answer-border);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  padding: 18px 22px;
}
.prose > blockquote:first-of-type strong { color: var(--teal); font-size: 1.02rem; }
.prose > blockquote:first-of-type ul { margin-bottom: 0; }
.prose > blockquote:first-of-type p:last-child { margin-bottom: 0; }
.prose code {
  background: var(--code-bg); border: 1px solid var(--line); border-radius: 5px;
  padding: 1px 6px; font-size: .88em;
}
.prose pre {
  background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; overflow-x: auto; font-size: .86rem; line-height: 1.55;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: .92rem; }
.prose th, .prose td { text-align: left; padding: 9px 12px; border: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--bg-alt); font-weight: 700; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

/* Search page */
.search-form { display: flex; gap: 10px; max-width: 560px; margin: 20px 0 28px; }
.search-form input {
  flex: 1; padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); color: var(--ink); font-size: 1rem;
}
.search-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.search-results-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.result-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--bg); }
.result-item a { font-weight: 700; }
.result-item .result-cat { color: var(--teal); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.result-item p { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }
.result-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.result-tag {
  font-size: .72rem; color: var(--accent-ink); background: var(--callout-bg);
  border: 1px solid var(--callout-border); border-radius: 999px; padding: 2px 8px;
}
.search-empty { color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-alt); padding: 44px 0 0; }
.footer-inner {
  width: min(var(--max), 100% - 40px); margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px;
}
.footer-about .brand-word { font-size: 1.2rem; }
.footer-about p { color: var(--muted); font-size: .9rem; margin-top: 10px; max-width: 40ch; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col strong { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink); margin-bottom: 4px; }
.footer-col a { color: var(--muted); font-size: .92rem; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--line); margin-top: 36px; padding: 18px 0;
}
.footer-bottom p { width: min(var(--max), 100% - 40px); margin: 0 auto; color: var(--muted); font-size: .82rem; }

/* Cookie banner */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 90;
  max-width: 620px; margin: 0 auto;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner-inner { display: flex; align-items: center; gap: 16px; }
.cookie-banner-inner p { margin: 0; font-size: .9rem; color: var(--muted); flex: 1; }
.cookie-actions { display: flex; gap: 8px; flex: none; }

@media (max-width: 960px) {
  .article-layout { grid-template-columns: 1fr; gap: 0; }
  .toc-desktop { display: none; }
  .toc-mobile {
    display: block; margin: 8px 0 16px; padding: 12px 16px;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-alt);
  }
  .toc-mobile summary { cursor: pointer; font-weight: 700; color: var(--accent-ink); }
  .toc-mobile .toc-list { margin-top: 10px; }
}

@media (max-width: 800px) {
  .card-grid { grid-template-columns: 1fr; }
  .recent-link { flex-direction: column; align-items: flex-start; gap: 8px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .nav-toggle { display: block; }
  .nav-menu {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 16px 20px;
    flex-direction: column; align-items: stretch; gap: 12px;
  }
  .nav-menu.open { display: flex; }
  .nav-links { flex-direction: column; align-items: stretch; gap: 12px; }
  .nav-search input { width: 100%; }
  .cookie-banner-inner { flex-direction: column; align-items: stretch; }
  .cookie-actions { justify-content: flex-end; }
}

@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; }
  .hero-search, .search-form { flex-direction: column; }
  .brand-line { display: none; }
}
