:root {
  --paper: #f6f3ea;
  --ink: #1f2522;
  --forest: #204132;
  --moss: #5e7b62;
  --line: #d8d2c2;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
}
.shell { width: min(1100px, 92vw); margin: 0 auto; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; background: #fff; padding: .4rem .7rem; }
.topbar { position: sticky; top: 0; background: rgba(246,243,234,.95); border-bottom: 1px solid var(--line); z-index: 20; }
.topbar .shell { display: flex; align-items: center; justify-content: space-between; padding: .8rem 0; }
.brand { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; color: var(--forest); text-decoration: none; }
.menu { list-style: none; display: flex; gap: 1rem; margin: 0; padding: 0; flex-wrap: wrap; }
.menu a { color: var(--ink); text-decoration: none; border-bottom: 1px solid transparent; }
.menu a:hover, .menu a:focus { border-color: var(--moss); }
.hero-block img, .doc-page img, .post-head img { width: 100%; height: auto; border-radius: .4rem; border: 1px solid var(--line); }
.hero-copy { padding: 1rem 0 0; }
h1 { line-height: 1.2; font-size: clamp(1.8rem, 2.8vw, 2.7rem); margin-bottom: .5rem; }
h2 { margin-top: 2rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.section-label { font: 600 .78rem/1 ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--moss); }
.lede { font-size: 1.05rem; }
.post-layout { display: grid; grid-template-columns: 260px minmax(0,1fr) 280px; gap: 2rem; align-items: start; }
.toc { position: sticky; top: 5rem; padding: .8rem; border-radius: .4rem; background: #f9f7f0; min-width: 0; }
aside.toc { border: 1px solid var(--line); }
.toc h2 { border-top: none; margin-top: 0; padding-top: 0; font-size: .9rem; }
.toc ol, .toc ul { padding-left: 1.1rem; margin: .5rem 0; }
/* Prevent wide code/table content from blowing out the grid */
.post-content { min-width: 0; }
.post-content pre { overflow-x: auto; max-width: 100%; }
.post-content table { display: block; overflow-x: auto; max-width: 100%; }
/* ── Post sidebar / newsletter panel ── */
.post-sidebar { position: sticky; top: 5rem; }
.signup-panel { border: 1px solid var(--line); border-radius: .5rem; padding: 1.2rem 1.1rem; background: #f7f5ee; }
.signup-eyebrow { font: 600 .72rem/1 ui-monospace, monospace; letter-spacing: .09em; text-transform: uppercase; color: var(--moss); margin: 0 0 .4rem; }
.signup-heading { font-size: 1.1rem; margin: 0 0 .55rem; line-height: 1.25; border-top: none; padding-top: 0; }
.signup-subtext { font-size: .88rem; color: #4a4a44; margin: 0 0 1rem; }
.signup-form { display: flex; flex-direction: column; gap: .6rem; }
.signup-field { display: flex; flex-direction: column; gap: .25rem; }
.signup-field label { font-size: .8rem; font-weight: 600; color: var(--ink); }
.signup-field input { padding: .5rem .6rem; border: 1px solid #b4b09f; border-radius: .3rem; font-size: .9rem; background: #fff; width: 100%; box-sizing: border-box; }
.signup-field input:focus { outline: 2px solid var(--forest); outline-offset: 1px; border-color: var(--forest); }
.signup-btn { margin-top: .3rem; padding: .6rem .8rem; background: var(--forest); color: var(--paper); border: none; border-radius: .35rem; font-size: .92rem; font-weight: 600; cursor: pointer; }
.signup-btn:hover { background: #163027; }
.signup-btn:disabled { opacity: .6; cursor: default; }
.signup-notice { font-size: .82rem; color: #a03020; margin: 0; }
.signup-fine { font-size: .75rem; color: #7a7a72; margin: .6rem 0 0; }
.signup-links { margin: .5rem 0 0; padding-left: 1.1rem; font-size: .88rem; }
.signup-links li { margin-bottom: .35rem; }
.signup-trap { display: none !important; }
.cat-link { color: var(--moss); text-decoration: none; }
.cat-link:hover { text-decoration: underline; }
.post-tags { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.post-tags-label { font: 600 .75rem/1 ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--moss); white-space: nowrap; }
.tag-list { display: flex; flex-wrap: wrap; gap: .3rem; list-style: none; padding: 0; margin: 0; }
.tag-link { font-size: .78rem; padding: .2rem .45rem; border: 1px solid var(--line); border-radius: .25rem; color: var(--ink); text-decoration: none; background: #faf9f4; }
.tag-link:hover { background: var(--forest); color: var(--paper); border-color: var(--forest); }
.post-list { list-style: none; padding: 0; display: grid; gap: 1rem; }
.post-list li { border-left: 3px solid var(--moss); padding: .4rem .8rem; background: #faf9f4; }
.post-list p { margin: .3rem 0 0; }
.callout { border-left: 4px solid var(--forest); background: #eef2eb; padding: .8rem 1rem; }
.search-panel { border: 1px solid var(--line); background: #fcfbf7; padding: .8rem; border-radius: .4rem; }
.search-input { width: 100%; padding: .6rem; border: 1px solid #b4b09f; border-radius: .3rem; }
.site-footer { margin-top: 3rem; border-top: 1px solid var(--line); padding: 1.5rem 0; }
.footer-grid { display: flex; gap: 1rem; flex-wrap: wrap; }
.footer-grid a { color: var(--ink); text-decoration: none; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
@media (max-width: 900px) {
  .post-layout { grid-template-columns: 1fr; }
  .toc { position: static; }
  .post-sidebar { position: static; }
}
