/* Shared blog styles. Tokens match the home page. */
:root {
  --bg: #f4f4f1;
  --surface: #ffffff;
  --ink: #16181d;
  --muted: #5d626c;
  --line: #dcddd8;
  --accent: #2b44ff;
  --note: #fff4c2;
  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --serif: "IBM Plex Serif", Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121317; --surface: #1b1d23; --ink: #eceef2; --muted: #9ea3ad; --line: #2c2f37;
    --accent: #6f80ff; --note: #4a3f10; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121317; --surface: #1b1d23; --ink: #eceef2; --muted: #9ea3ad; --line: #2c2f37;
  --accent: #6f80ff; --note: #4a3f10; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--body); }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

header.site { border-bottom: 1px solid var(--line); }
.site-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; flex-wrap: wrap; }
.logo { font: 800 24px/1 var(--display); color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.logo span { color: var(--accent); }
header.site nav { display: flex; gap: 20px; }
header.site nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
header.site nav a:hover, header.site nav a.active { color: var(--ink); }

.kicker { font-size: 13px; color: var(--muted); margin: 0; }
.topic { font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }

.blog-head { padding: 40px 0 24px; }
.blog-head h1 { font: 800 clamp(34px, 5vw, 52px)/1 var(--display); margin: 0 0 10px; letter-spacing: -0.02em; }
.blog-head p { color: var(--muted); margin: 0; max-width: 60ch; }
/* Bento list: fixed columns per breakpoint, cards span rows/cols at random. */
.post-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 180px; grid-auto-flow: dense; gap: 18px; padding-bottom: 60px; }
@media (max-width: 900px) { .post-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .post-list { grid-template-columns: minmax(0, 1fr); } }
.post-card { grid-row: span 2; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-decoration: none; color: var(--ink); transition: transform .15s ease, box-shadow .15s ease; }
.post-card.tall { grid-row: span 3; }
.post-card.wide { grid-column: span 2; flex-direction: row; }
.post-card.wide .pc-cover { flex: 0 0 55%; }
@media (max-width: 560px) { .post-card.wide { grid-column: span 1; flex-direction: column; } .post-card.wide .pc-cover { flex: 1 1 auto; } }
.post-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(0,0,0,.35); }
.pc-cover { flex: 1 1 auto; min-height: 100px; position: relative; overflow: hidden; }
.pc-cover svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pc-body { flex: 0 0 auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.post-card.wide .pc-body { flex: 1 1 auto; justify-content: center; padding: 24px; }
.post-card h2 { font: 700 20px/1.2 var(--display); margin: 0; text-wrap: balance; }
.post-card.wide h2 { font-size: 26px; }
.pc-desc { margin: 0; color: var(--muted); font-size: 15px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.post-card.tall .pc-desc, .post-card.wide .pc-desc { -webkit-line-clamp: 5; }
.post-cover { margin: 0 0 32px; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 9; position: relative; }
.post-cover svg { width: 100%; height: 100%; display: block; }
@media (prefers-reduced-motion: reduce) { .post-card { transition: none; } .post-card:hover { transform: none; } }

.post { max-width: 720px; padding-top: 40px; padding-bottom: 60px; }
.post h1 { font: 800 clamp(32px, 5vw, 48px)/1.05 var(--display); margin: 12px 0 14px; letter-spacing: -0.02em; text-wrap: balance; }
.dek { font-size: 19px; color: var(--muted); margin: 0 0 10px; }
.byline { font-size: 14px; color: var(--muted); margin: 0 0 28px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.prose { font: 400 18px/1.7 var(--serif); }
.prose h2 { font: 700 24px/1.25 var(--display); margin: 36px 0 10px; }
.prose p, .prose ul, .prose ol { margin: 0 0 18px; }
.prose li { margin-bottom: 6px; }
.prose blockquote { margin: 0 0 18px; padding: 14px 18px; border-left: 3px solid var(--accent); background: var(--surface); font-style: italic; }
.prose blockquote p { margin: 0; }
.author-note { background: var(--note); border: 1px dashed var(--muted); border-radius: 8px; padding: 12px 14px; margin: 0 0 18px; font: 400 15px/1.5 var(--body); }
.back { margin-top: 32px; font-weight: 500; }

footer.site { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: 14px; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font: 400 15px/1.4 var(--body); font-variant-numeric: tabular-nums; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.prose th { font-weight: 600; color: var(--muted); }
.prose td:first-child { white-space: normal; }
