/*
  Shared styling for /blog/. The landing page and the policy each carry their
  own <style> block, which is fine for two pages that never change together;
  a growing set of posts is the case where one stylesheet earns its extra
  request. The token block below is the same one index.html declares, so a
  post and the site it links back to cannot drift apart in light or dark.
*/
:root {
  --brand: #95C11F;
  --brand-deep: #5f9a08;
  --bg: #ffffff;
  --bg-soft: #f6faee;
  --text: #16240a;
  --subtext: #5d7345;
  --card: #f4f6f0;
  --border: #e3e9d8;
  --shadow: 0 24px 60px rgba(40, 60, 15, .16);
  /* Diagram-only tokens. Kept next to the palette rather than inside the SVG
     so a figure recolours with the theme like everything else on the page. */
  --sealed: #14200a;
  --sealed-text: #eef3e6;
  --readable: #f6faee;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand: #9ae225;
    --brand-deep: #a8e83c;
    --bg: #0e120a;
    --bg-soft: #141a0e;
    --text: #eef3e6;
    --subtext: #9dae87;
    --card: #191f12;
    --border: #2a331e;
    --shadow: 0 24px 60px rgba(0, 0, 0, .5);
    --sealed: #05070b;
    --sealed-text: #9dae87;
    --readable: #1f2716;
  }
}

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

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

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 24px; }
a { color: var(--brand-deep); }

/* ---------- header, matching index.html ---------- */
header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 62px;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  text-decoration: none; color: inherit;
  font-size: 20px; font-weight: 800; letter-spacing: -.4px;
}
.brand img { width: 30px; height: 30px; display: block; }
.nav { display: flex; gap: 22px; font-size: 14px; font-weight: 600; }
.nav a { color: var(--subtext); text-decoration: none; }
.nav a:hover { color: var(--text); }
@media (max-width: 560px) { .nav a.hide-sm { display: none; } }

/* ---------- article ---------- */
.article { max-width: 720px; margin: 0 auto; padding: 56px 24px 24px; }
.eyebrow {
  font-size: 13px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; color: var(--brand-deep);
}
.article h1 {
  margin-top: 14px;
  font-size: clamp(32px, 5.6vw, 46px);
  line-height: 1.1; font-weight: 800; letter-spacing: -1.2px;
}
.meta { margin-top: 16px; font-size: 14px; color: var(--subtext); }
.standfirst {
  margin-top: 26px; font-size: 20px; line-height: 1.55; color: var(--subtext);
}
.article h2 {
  margin-top: 52px; font-size: 26px; line-height: 1.25;
  font-weight: 800; letter-spacing: -.6px;
}
.article h3 {
  margin-top: 34px; font-size: 18px; font-weight: 700; letter-spacing: -.2px;
}
.article p { margin-top: 18px; font-size: 17px; }
.article ul { margin: 18px 0 0 22px; font-size: 17px; }
.article li { margin-top: 10px; }
.article li strong { font-weight: 700; }
.article hr {
  margin-top: 52px; border: 0; border-top: 1px solid var(--border);
}

.callout {
  margin-top: 30px; padding: 20px 22px;
  background: var(--bg-soft); border: 1px solid var(--border);
  border-left: 3px solid var(--brand); border-radius: 12px;
}
.callout p:first-child { margin-top: 0; }
.callout p { font-size: 16px; }

/* ---------- figures ---------- */
figure { margin-top: 40px; }
figure svg { width: 100%; height: auto; display: block; }
figcaption {
  margin-top: 14px; font-size: 14px; line-height: 1.55; color: var(--subtext);
}
/* Wide figures scroll inside their own box rather than the page. */
.scroll-x { overflow-x: auto; }
.scroll-x > svg { min-width: 560px; }

/* ---------- the two-column ledger ---------- */
.ledger {
  margin-top: 34px; display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.ledger section {
  padding: 22px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--card);
}
.ledger h3 { margin-top: 0; font-size: 16px; }
.ledger ul { margin: 14px 0 0 20px; font-size: 15px; }
.ledger li { margin-top: 8px; }

/* ---------- index list ---------- */
.posts { max-width: 720px; margin: 0 auto; padding: 56px 24px 0; }
.posts h1 {
  font-size: clamp(34px, 6vw, 48px); line-height: 1.06;
  font-weight: 800; letter-spacing: -1.4px;
}
.posts .lede { margin-top: 18px; font-size: 19px; color: var(--subtext); }
.post-card {
  display: block; margin-top: 20px; padding: 26px;
  border: 1px solid var(--border); border-radius: 16px;
  background: var(--card); text-decoration: none; color: inherit;
}
.post-card:hover { border-color: var(--brand); }
.post-card h2 {
  margin-top: 10px; font-size: 22px; font-weight: 800; letter-spacing: -.5px;
}
.post-card p { margin-top: 10px; font-size: 16px; color: var(--subtext); }
.post-card .date { font-size: 13px; color: var(--subtext); }

/* ---------- cta + footer ---------- */
.cta {
  margin: 56px auto 0; max-width: 720px;
  padding: 30px 26px; border-radius: 18px;
  background: var(--bg-soft); border: 1px solid var(--border);
  text-align: center;
}
.cta h2 { margin-top: 0; font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.cta p { margin-top: 12px; font-size: 16px; color: var(--subtext); }
.cta .buttons { margin-top: 20px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cta a.button {
  display: inline-block; padding: 12px 24px; border-radius: 999px;
  background: var(--brand); color: #14200a;
  font-weight: 700; font-size: 15px; text-decoration: none;
}
.cta a.button.ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }

footer {
  margin-top: 72px; padding: 34px 0 44px;
  border-top: 1px solid var(--border);
  text-align: center; font-size: 14px; color: var(--subtext);
}
footer a { color: var(--subtext); }
footer .sep { opacity: .5; margin: 0 4px; }

/* ---------- diagram text ----------
   These live here rather than in a <style> inside each <svg>: an SVG style
   element is not scoped, so class names like .t and .h declared inside a figure
   would apply to the whole document. Prefixed and hoisted, they cannot collide
   with page styling, and two figures can share them. */
.d-lyr { fill: none; stroke-width: 1.5; }
.d-core, .d-lbl, .d-h {
  font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.d-sub, .d-t, .d-tn {
  font-weight: 400;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.d-core { font-size: 15px; }
.d-lbl  { font-size: 14px; }
.d-h    { font-size: 14px; }
.d-sub  { font-size: 12.5px; }
.d-t    { font-size: 13px; }
.d-tn   { font-size: 12px; }

/* ---------- the disclosure table ----------
   Three states, not two: sealed, readable, and the metadata that is neither.
   Wide enough to need its own scroll box on a phone rather than pushing the
   page sideways. */
.tablewrap { margin-top: 30px; overflow-x: auto; }
table.disclose {
  width: 100%; min-width: 520px;
  border-collapse: collapse; font-size: 15px;
}
table.disclose caption {
  caption-side: top; text-align: left;
  font-size: 14px; color: var(--subtext); padding-bottom: 12px;
}
table.disclose th, table.disclose td {
  text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
table.disclose thead th {
  font-size: 13px; letter-spacing: .4px; text-transform: uppercase;
  color: var(--subtext); border-bottom: 1px solid var(--border);
}
table.disclose tbody th { font-weight: 500; color: var(--text); }
table.disclose td { color: var(--subtext); white-space: nowrap; }
.tag {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 700;
}
.tag.no  { background: var(--sealed); color: var(--sealed-text); }
.tag.yes { background: var(--brand); color: #14200a; }
.tag.meta {
  background: transparent; color: var(--subtext);
  border: 1px solid var(--border); font-weight: 600;
}
