/* ─────────────────────────────────────────────────────────────────────────────
   Starbucks light theme — every article under /blog.

   The rest of the site is near-black. These are long reads (the shortest is ~1,200
   words, the longest ~3,500), and a dark ground is tiring at that length, so the
   blog runs on warm neutral instead.

   Loaded AFTER each page's inline <style>, so it wins on specificity ties without
   touching 23 files' worth of markup. Almost every rule in those inline blocks is
   written against the :root custom properties, so redefining the tokens flips the
   page; only the fixed nav, the ambient gradient and a handful of literal colours
   need restating, and those are grouped below.

   Contrast, measured against the ground each colour sits on:
     House Green  #1E3932 on #F2F0EB — 10.9:1   (ink)
     body         #40534C on #F2F0EB —  7.2:1
     muted        #5A6A63 on #F2F0EB —  4.6:1
     Starbucks    #00704A on #F2F0EB —  5.4:1   (links, accents)
   The brand gold #CBA258 manages only 2.1:1, so it is used for fills and rules
   and never for text.

   Typography: SoDo Sans is proprietary. Montserrat stands in for the geometric
   display, Lato for the body; JetBrains Mono stays on figures for tabular numerals.
   ───────────────────────────────────────────────────────────────────────────── */

:root {
  --bg-dark: #F2F0EB;
  --bg-card: #FFFFFF;
  --bg-card-hover: #FAF8F4;
  --accent-primary: #00704A;
  --accent-secondary: #1E3932;
  --accent-success: #006241;
  --accent-warning: #8A6A1F;
  --accent-danger: #A6342B;
  --accent-purple: #1E3932;
  --text-primary: #1E3932;
  --text-secondary: #40534C;
  --text-muted: #5A6A63;
  --border: #DED9CF;
}

body {
  background: var(--bg-dark);
  color: var(--text-secondary);
  font-family: 'Lato', Inter, system-ui, sans-serif;
}

/* The site's ambient dark wash muddies paper; two faint brand tints instead. */
.bg-gradient {
  background:
    radial-gradient(circle at 12% 18%, rgba(0, 112, 74, 0.05), transparent 42%),
    radial-gradient(circle at 88% 8%, rgba(203, 162, 88, 0.07), transparent 38%);
}

/* ── Chrome ───────────────────────────────────────────────────────────────── */
.top-nav {
  background: rgba(242, 240, 235, 0.92);
  border-bottom: 1px solid var(--border);
}
.nav-brand,
.nav-link { color: var(--text-primary); }
.nav-link:hover { color: var(--accent-primary); }
.nav-link.active { background: rgba(0, 112, 74, 0.10); color: var(--accent-primary); }
.nav-link.primary { background: var(--accent-primary); color: #FFFFFF; }
.nav-link.primary:hover { background: var(--accent-secondary); }
.nav-brand-icon {
  background: linear-gradient(135deg, #00704A, #1E3932);
  color: #FFFFFF;
}
footer { border-top: 1px solid var(--border); }

/* ── Type ─────────────────────────────────────────────────────────────────── */
h1, h2, h3, h4,
.nav-brand {
  font-family: 'Montserrat', Inter, system-ui, sans-serif;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}
.article-header h1,
.blog-hero h1 { letter-spacing: -0.025em; }
.subtitle { color: var(--text-secondary); }

/* ~68 characters is the comfortable measure for Lato at this size. Applied to
   running text only — tables, figures and diagrams still use the full column. */
.article-content p,
.article-content ul,
.article-content ol {
  max-width: 68ch;
  font-size: 1.06rem;
  line-height: 1.78;
}
.article-content strong { color: var(--text-primary); font-weight: 700; }

/* ── Links ────────────────────────────────────────────────────────────────── */
/* Body links previously had no rule at all and fell back to the UA blue: ~5:1 and
   vibrating against a near-black ground, which is what made them painful to read. */
.article-content a,
.faq-item a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-decoration-color: rgba(0, 112, 74, 0.32);
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
.article-content a:hover,
.faq-item a:hover {
  color: var(--accent-secondary);
  text-decoration-color: rgba(30, 57, 50, 0.75);
}
.article-content a:focus-visible,
.faq-item a:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: 2px;
}
.article-content ol a { word-break: break-word; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent-primary); }

/* ── Components ───────────────────────────────────────────────────────────── */
.article-content code {
  background: #EFECE4;
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.article-content pre { background: #FFFFFF; }
.article-content pre code { background: none; border: 0; color: var(--text-secondary); }
.article-content tbody tr:hover { background: var(--bg-card-hover); }
.article-content .callout {
  border-left-color: #CBA258;             /* brand gold: fills and rules only */
  background: rgba(203, 162, 88, 0.12);
}
.keybox {
  border-left-color: var(--accent-primary);
  background: rgba(0, 112, 74, 0.07);
}
.toc,
.faq-item,
.related-card,
.article-card,
.stat-callout { background: var(--bg-card); }
.meta-tag {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.meta-tag.category,
.article-category {
  background: rgba(0, 112, 74, 0.12);
  color: var(--accent-primary);
}
.project-link-box a { background: var(--accent-primary); color: #FFFFFF; }
.project-link-box a:hover { background: var(--accent-secondary); }

/* Category chips on the index are colour-coded per topic. On paper the dark-theme
   values wash out, so each gets a darker sibling that clears 4.5:1 here. */
.article-category.economic      { background: rgba(0, 98, 65, 0.12);  color: #006241; }
.article-category.infrastructure{ background: rgba(138, 106, 31, 0.14); color: #8A6A1F; }
.article-category.social        { background: rgba(27, 77, 177, 0.12); color: #1B4DB1; }
.article-category.environment   { background: rgba(15, 107, 79, 0.12); color: #0F6B4F; }
.article-category.digital       { background: rgba(166, 52, 43, 0.12); color: #A6342B; }
.article-category.engineering   { background: rgba(0, 112, 74, 0.12);  color: #00704A; }

/* Cards lift off the paper with a shadow rather than a glow. */
.article-card:hover,
.related-card:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 6px 20px rgba(30, 57, 50, 0.08);
}

/* The index hero clips a gradient to the wordmark. The original ran white → slate,
   which is all but invisible on paper; this keeps the effect and re-aims it. */
.blog-hero h1 {
  background: linear-gradient(135deg, #1E3932 0%, #00704A 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.article-count strong { color: var(--accent-primary); }
