:root {
  --ink: #0e0e0c;
  --ink-2: #3d3d38;
  --ink-3: #7a7a72;
  --bg: #f8f6f0;
  --white: #ffffff;
  --gold: #b8934a;
  --gold-light: #f5edd8;
  --teal: #0f6e56;
  --teal-light: #e1f5ee;
  --border: rgba(14,14,12,0.09);
  --radius: 12px;
  --code-bg: #14171a;
  --code-ink: #e9ede9;
  --code-accent: #7fd9b8;
}
:root[data-theme="dark"] { --ink:#f2f3ed;--ink-2:#c2cac3;--ink-3:#98a39a;--bg:#0e1110;--white:#161a18;--gold:#d0ad68;--gold-light:#2a2418;--teal:#4bd0a3;--teal-light:#17372c;--border:rgba(242,243,237,.13); }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; scroll-behavior: smooth; }
body { font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--ink); line-height: 1.6; font-weight: 400; }
body::before { content: ''; display: block; height: 3px; background: linear-gradient(90deg, var(--teal) 0%, var(--gold) 60%, transparent 100%); }
a { color: var(--teal); }

.container { max-width: 720px; margin: 0 auto; padding: 0 clamp(16px, 5vw, 28px); }

/* Navigation is shared with the portfolio through site-shell.css. */

/* ARTICLE HEADER */
.post-hero { padding: 40px 0 8px; }
.post-kicker { font-size: 10px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--teal); margin-bottom: 14px; display: flex; align-items: center; gap: 9px; }
.post-kicker::before { content: ''; width: 22px; height: 1.5px; background: var(--teal); }
.post-title { font-family: 'Playfair Display', serif; font-size: clamp(30px, 6vw, 44px); font-weight: 900; line-height: 1.08; color: var(--ink); margin-bottom: 14px; text-wrap: balance; }
.post-dek { font-size: 17px; color: var(--ink-2); line-height: 1.7; margin-bottom: 18px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-3); padding-bottom: 24px; border-bottom: 1px solid var(--border); margin-bottom: 32px; }
.post-meta strong { color: var(--ink-2); font-weight: 500; }

/* ARTICLE BODY (prose) */
.prose { font-size: 17px; color: var(--ink-2); line-height: 1.8; padding-bottom: 20px; }
.prose p { margin-bottom: 20px; }
.prose h2 { font-family: 'Playfair Display', serif; font-size: 24px; font-weight: 900; color: var(--ink); margin: 40px 0 14px; line-height: 1.2; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 15px; font-weight: 600; color: var(--ink); margin: 28px 0 10px; }
.prose strong { color: var(--ink); font-weight: 500; }
.prose ul, .prose ol { margin: 0 0 20px 22px; }
.prose li { margin-bottom: 8px; }
.prose a { text-underline-offset: 2px; }
.prose blockquote { border-left: 3px solid var(--teal); padding: 4px 0 4px 18px; margin: 24px 0; color: var(--ink); font-size: 15.5px; font-style: italic; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 36px 0; }
.prose .callout { background: var(--white); border: 1px solid var(--border); border-left: 3px solid var(--gold); border-radius: 8px; padding: 14px 18px; margin: 24px 0; font-size: 14.5px; color: var(--ink-2); }

/* CODE */
.prose pre {
  background: var(--code-bg); color: var(--code-ink);
  border-radius: 10px; padding: 16px 18px; margin: 20px 0;
  overflow-x: auto; font-size: 13px; line-height: 1.7;
  font-family: 'SF Mono', ui-monospace, Menlo, Consolas, monospace;
}
.prose pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.prose code {
  font-family: 'SF Mono', ui-monospace, Menlo, Consolas, monospace;
  background: var(--teal-light); color: #0a5443;
  padding: 2px 6px; border-radius: 5px; font-size: 0.87em;
}
.prose pre .comment { color: #8a9a92; }
.post-figure { margin: 28px 0; }
.post-figure img, .post-figure video { display: block; width: 100%; border-radius: 10px; border: 1px solid var(--border); }
.post-figure figcaption { font-size: 12.5px; color: var(--ink-3); margin-top: 8px; text-align: center; }
.post-figure-row { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; margin: 28px 0; }
.post-figure-row .post-figure { margin: 0; flex: 1 1 220px; }
.diagram {
  background: var(--code-bg); color: var(--code-accent);
  border-radius: 10px; padding: 18px 20px; margin: 24px 0;
  overflow-x: auto; font-size: 12.5px; line-height: 1.65;
  font-family: 'SF Mono', ui-monospace, Menlo, Consolas, monospace;
  white-space: pre;
}

/* FOOTER / signoff */
.post-signoff { padding: 8px 0 4px; font-size: 14px; color: var(--ink-2); }
.post-nav-back { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; font-weight: 500; color: var(--teal); text-decoration: none; }
.post-nav-back:hover { text-decoration: underline; }
.topic-filters,.article-topics { display:flex; flex-wrap:wrap; gap:8px; margin-top:24px; }
.topic-filters a,.article-topics a { padding:7px 11px; border:1px solid var(--border); border-radius:999px; color:var(--ink-2); font-size:12px; font-weight:600; text-decoration:none; }
.related-writing { margin-top:48px; padding:24px; border:1px solid var(--border); border-radius:12px; background:var(--paper-2); }
.related-writing p { margin:0 0 6px; color:var(--ink-3); font-size:12px; text-transform:uppercase; letter-spacing:.1em; }
.related-writing a { color:var(--teal); font-weight:700; text-decoration:none; }

footer.site-footer { padding: 24px 0 44px; border-top: 1px solid var(--border); margin-top: 20px; }
.site-footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.footer-name { font-family: 'Playfair Display', serif; font-size: 15px; font-weight: 900; color: var(--ink); }
.footer-note { font-size: 11px; color: var(--ink-3); }

/* BLOG INDEX LIST */
.index-hero { padding: 40px 0 8px; }
.index-title { font-family: 'Playfair Display', serif; font-size: clamp(32px, 7vw, 52px); font-weight: 900; color: var(--ink); margin-bottom: 10px; }
.index-dek { font-size: 17px; color: var(--ink-2); line-height: 1.7; max-width: 56ch; }

.post-list { display: flex; flex-direction: column; gap: 4px; padding: 28px 0 40px; }
.post-card {
  display: block; text-decoration: none;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 10px;
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.post-card:hover { border-color: rgba(15,110,86,0.28); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15,110,86,0.08); }
.post-card-meta { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.09em; color: var(--gold); margin-bottom: 8px; }
.post-card-title { font-family: 'Playfair Display', serif; font-size: 21px; font-weight: 900; color: var(--ink); margin-bottom: 6px; line-height: 1.2; }
.post-card-dek { font-size: 15px; color: var(--ink-3); line-height: 1.65; margin-bottom: 10px; }
.post-card-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.pctag { font-size: 10px; font-weight: 500; padding: 2px 8px; border-radius: 100px; background: var(--bg); border: 1px solid var(--border); color: var(--ink-2); }

@media (max-width: 480px) {
  .post-title { font-size: 28px; }
  html { font-size: 16px; }
  .prose { font-size: 16px; }
  .post-card { padding: 16px 16px; }
}
