/* Blog styles. Tokens, header, footer and buttons are copied from the inline <style> in
   web/public/index.html so blog pages look like the landing page. If you change the brand
   colours or the nav there, change them here too. */

:root {
  --bg: #f4f7f5; --surface: #ffffff; --surface-2: #f0f4f1; --ink: #16211c;
  --muted: #5c6b64; --brand: #2a9d78; --brand-strong: #1f7d5f; --brand-soft: #e6f5ee;
  --border: #e2e9e4; --gold: #b7822a; --gold-soft: #f6edda;
  --shadow-sm: 0 1px 2px rgba(16,40,30,.06), 0 6px 16px -10px rgba(16,40,30,.16);
  --radius: 14px; --maxw: 1140px; --measure: 70ch;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1512; --surface: #14201b; --surface-2: #182620; --ink: #e8f2ec;
    --muted: #93a89e; --brand: #3fbf93; --brand-strong: #58cfa5; --brand-soft: #12352a;
    --border: #22322a; --gold: #d6a24e; --gold-soft: #2b2213;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 8px 20px -12px rgba(0,0,0,.5);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { text-wrap: balance; }

/* nav (from index.html) */
header.nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand .mark { color: var(--brand); display: inline-flex; line-height: 0; }
.brand-word { font-weight: 800; font-size: 20px; letter-spacing: -.5px; }
.brand-word b { color: var(--brand); font-weight: 800; }
.nav-mid { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.nav-link { color: var(--muted); font-size: 15px; font-weight: 600; transition: color .15s ease; }
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--ink); }
.nav-actions { display: flex; align-items: center; gap: 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; font: inherit; font-weight: 650; font-size: 15px; padding: 10px 18px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, background .15s ease, border-color .15s ease, color .15s ease; white-space: nowrap; }
.btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; }
.btn-ghost { color: var(--ink); border-color: var(--border); background: var(--surface); }
.btn-ghost:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); color: var(--brand-strong); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-strong); transform: translateY(-1px); }
.btn-lg { padding: 14px 24px; font-size: 16px; }

.eyebrow { display: inline-flex; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-strong); background: var(--brand-soft); padding: 6px 12px; border-radius: 999px; margin-bottom: 18px; }

/* footer (from index.html) */
footer { border-top: 1px solid var(--border); padding: 34px 0; margin-top: 72px; }
.foot-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.foot-links { display: flex; gap: 22px; color: var(--muted); font-size: 14.5px; flex-wrap: wrap; }
.foot-links a:hover { color: var(--brand-strong); }
.copy { color: var(--muted); font-size: 14px; }

/* blog index */
.blog-index { padding-top: 64px; }
.index-head { max-width: 720px; margin-bottom: 40px; }
.index-head h1 { font-size: clamp(2rem, 4vw, 2.9rem); line-height: 1.08; font-weight: 820; letter-spacing: -.025em; margin: 0; }
.empty { color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.card { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); transition: transform .15s ease, border-color .15s ease; }
.card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); }
.card h3 { margin: 0; font-size: 1.2rem; line-height: 1.3; letter-spacing: -.01em; }
.card-meta { margin: 0; color: var(--muted); font-size: 13.5px; }
.card-meta b { color: var(--gold); }
.card-desc { margin: 0; color: var(--muted); font-size: 15.5px; flex: 1; }
.card-more { color: var(--brand-strong); font-weight: 650; font-size: 15px; }

/* article */
.article-wrap { max-width: calc(var(--measure) + 48px); padding-top: 36px; }
.crumbs { display: flex; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 28px; }
.crumbs a:hover { color: var(--brand-strong); }
.post-head h1 { font-size: clamp(2rem, 4.4vw, 2.8rem); line-height: 1.1; font-weight: 820; letter-spacing: -.025em; margin: 0 0 16px; }
.post-desc { font-size: 1.2rem; color: var(--muted); margin: 0 0 16px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 14.5px; margin: 0 0 32px; }
.draft-flag { display: inline-block; background: var(--gold-soft); color: var(--gold); font-weight: 700; font-size: 13px; padding: 4px 10px; border-radius: 6px; margin: 0 0 14px; }

.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; margin: 0 0 36px; }
.toc-title { margin: 0 0 8px; font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin: 4px 0; }
.toc a { color: var(--brand-strong); }
.toc a:hover { text-decoration: underline; }

.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: 1.6rem; line-height: 1.25; letter-spacing: -.015em; margin: 2.2em 0 .6em; }
.prose h3 { font-size: 1.25rem; line-height: 1.3; margin: 1.8em 0 .5em; }
.prose h4 { font-size: 1.05rem; margin: 1.5em 0 .4em; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose .table-wrap, .prose pre { margin: 0 0 1.15em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .3em 0; }
.prose a { color: var(--brand-strong); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.prose a:hover { text-decoration-thickness: 2px; }
/* The mid-article CTA sits inside .prose; keep it a button, not a text link. */
.prose a.btn, .prose a.btn:hover { text-decoration: none; }
.prose a.btn-primary, .prose a.btn-primary:hover { color: #fff; }
.prose strong { font-weight: 700; }
.prose img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.4em 0; }
.prose code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 5px; border-radius: 5px; }
.prose pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; overflow-x: auto; }
.prose pre code { background: none; border: 0; padding: 0; }
/* Blockquotes double as callouts ("> **Note:** …"). */
.prose blockquote { background: var(--brand-soft); border-left: 4px solid var(--brand); border-radius: 0 10px 10px 0; padding: 14px 18px; }
.prose blockquote > :last-child { margin-bottom: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.prose table { border-collapse: collapse; width: 100%; font-size: 15.5px; }
.prose th, .prose td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { background: var(--surface-2); font-weight: 700; }
.prose tr:last-child td { border-bottom: 0; }
.prose td[align="right"], .prose th[align="right"] { text-align: right; font-variant-numeric: tabular-nums; }

.anchor { float: left; margin-left: -1em; width: 1em; color: var(--muted); opacity: 0; text-decoration: none !important; font-weight: 400; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .anchor:focus { opacity: 1; }

.cta { display: flex; align-items: center; justify-content: space-between; gap: 24px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--border)); border-radius: var(--radius); padding: 24px 26px; margin: 2.4em 0; box-shadow: var(--shadow-sm); }
.cta-title { margin: 0 0 4px; font-weight: 750; font-size: 1.15rem; }
.cta-text { margin: 0; color: var(--muted); font-size: 15.5px; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 10px; flex-shrink: 0; }
.prose a.btn-ghost, .prose a.btn-ghost:hover { color: var(--ink); }

.related { margin-top: 56px; }
.related h2 { font-size: 1.4rem; margin: 0 0 18px; }

@media (max-width: 920px) {
  .nav-mid { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .nav-actions .btn-ghost { display: none; }
  .cta { flex-direction: column; align-items: flex-start; }
  .blog-index { padding-top: 40px; }
}

/* GFM task lists ("- [ ] item") render as a checklist, not bullets. */
.prose li:has(> input[type="checkbox"]) { list-style: none; margin-left: -1.4em; }
.prose li > input[type="checkbox"] { accent-color: var(--brand); margin-right: .5em; transform: translateY(1px); }
