/* blog.css — the engine room logbook (/blog/ and every entry under it).
   Layered on /tui.css (tokens, colour utilities, reduced-motion floor). The nav, buttons and footer
   follow the home page and the 404; the reading pages keep the backdrop still (no creeping floor). */

body{
  font-family:var(--sans); font-size:17px; line-height:1.7; min-height:100vh; display:flex; flex-direction:column;
  background:
    radial-gradient(1100px 600px at 75% 0%, rgba(53,116,240,.10), transparent 60%),
    radial-gradient(900px 600px at 5% 100%, rgba(199,125,187,.06), transparent 55%),
    var(--bg-deep);
}
/* faint blueprint grid of the hall's floor plan, faded towards the edges */
body::before{
  content:''; position:fixed; inset:0; z-index:0; pointer-events:none;
  background:
    linear-gradient(rgba(57,59,64,.45) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, rgba(57,59,64,.45) 1px, transparent 1px) 0 0 / 48px 48px;
  -webkit-mask-image:radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
  mask-image:radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
}
.sr{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

/* ---------------- top nav (as on the home page and the 404) ---------------- */
.nav{
  position:fixed; top:0; left:0; right:0; z-index:20;
  display:flex; align-items:center; gap:18px; padding:12px 22px;
  background:rgba(22,23,24,.72); border-bottom:1px solid var(--line);
  -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px);
  font-family:var(--mono); font-size:12.5px; line-height:1.6;
}
.brand{ display:inline-flex; align-items:center; gap:10px; color:var(--fg-bright); font-weight:700; }
.brand:hover{ text-decoration:none; }
.brand i{
  font-style:normal; display:grid; place-items:center; width:28px; height:28px; border-radius:5px;
  background:var(--strip); border:1px solid var(--line); color:var(--yellow); font-size:11px;
}
.nav ul{ display:flex; gap:4px; list-style:none; margin:0 0 0 auto; padding:0; }
.nav ul a{ display:block; padding:4px 10px; border-radius:4px; color:var(--muted); transition:color .15s ease, background .15s ease; }
.nav ul a:hover{ color:var(--fg-bright); background:rgba(53,116,240,.14); text-decoration:none; }
.nav ul a[aria-current]{ color:var(--on-accent); background:var(--accent); }
.nav .meta{ color:var(--muted); white-space:nowrap; }
.nav .meta .led{ color:var(--bright-green); animation:breathe 2.8s ease-in-out infinite; }
.btn{
  font:inherit; font-family:var(--mono); font-size:12.5px; cursor:pointer; display:inline-block;
  padding:6px 14px; border-radius:5px; border:1px solid var(--line);
  color:var(--fg); background:var(--strip);
  transition:color .15s ease, background .15s ease, border-color .15s ease, transform .15s ease;
}
.btn:hover{ color:var(--on-accent); background:var(--accent); border-color:var(--accent); text-decoration:none; transform:translateY(-1px); }

/* ---------------- page frame ---------------- */
main{ position:relative; z-index:1; flex:1; width:100%; max-width:820px; margin:0 auto; padding:118px 28px 72px; }
.eyebrow{ margin:0 0 10px; font-family:var(--mono); font-size:12px; letter-spacing:.06em; color:var(--cyan); }
h1, h2, h3{ font-family:var(--sans); color:var(--fg-bright); letter-spacing:-.02em; }
h1{ margin:0; font-size:clamp(34px, 6vw, 56px); line-height:1.05; font-weight:700; }
.lede{ margin:16px 0 0; max-width:56ch; color:var(--fg); }
.mono{ font-family:var(--mono); }

/* tags: chips as on the home page's stack cards */
.chips{ display:flex; flex-wrap:wrap; gap:6px; list-style:none; margin:0; padding:0; }
.chips li{
  font-family:var(--mono); font-size:11.5px; line-height:1.5; padding:2px 8px; border-radius:4px;
  color:var(--fg); background:var(--strip); border:1px solid var(--line);
}

/* ---------------- the index: a list of log entries ---------------- */
.loghead{ padding-bottom:26px; border-bottom:1px solid var(--line); }
.loghead .links{ margin:18px 0 0; font-family:var(--mono); font-size:12.5px; color:var(--muted); }
.entries{ list-style:none; margin:0; padding:0; }
.entry{ padding:30px 0 4px; }
/* 2026-12-01 ── entry 001 ────────── */
.rule{
  display:flex; align-items:center; gap:12px; margin:0;
  font-family:var(--mono); font-size:12px; color:var(--muted); white-space:nowrap;
}
.rule time{ color:var(--yellow); }
.rule::after{ content:''; flex:1; border-top:1px solid var(--line); }
.entry h2{ margin:10px 0 0; font-size:clamp(22px, 3vw, 28px); line-height:1.2; }
.entry h2 a{ color:var(--fg-bright); }
.entry h2 a:hover{ color:var(--cyan); text-decoration:none; }
.entry .sum{ margin:8px 0 0; max-width:62ch; }
.meta{ display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px; margin:14px 0 0; font-family:var(--mono); font-size:12px; color:var(--muted); }
.empty{ margin:30px 0 0; font-family:var(--mono); font-size:13px; color:var(--muted); }
.elsewhere{ margin:44px 0 0; padding-top:18px; border-top:1px solid var(--line); font-family:var(--mono); font-size:12.5px; color:var(--muted); }

/* ---------------- an entry ---------------- */
.post > header{ padding-bottom:24px; border-bottom:1px solid var(--line); }
.post > header .eyebrow{ color:var(--yellow); }
.post > header .meta{ margin-top:18px; }

.prose{ margin-top:8px; overflow-wrap:break-word; }
.prose > *{ max-width:68ch; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose table, .prose figure{ margin:20px 0 0; }
.prose h2{ margin:46px 0 0; font-size:clamp(22px, 3vw, 27px); line-height:1.25; }
.prose h3{ margin:32px 0 0; font-size:20px; line-height:1.3; }
.prose h2 + p, .prose h3 + p{ margin-top:12px; }
.prose a{ text-decoration:underline; text-decoration-color:rgba(86,168,245,.4); text-underline-offset:3px; }
.prose a:hover{ text-decoration-color:var(--cyan); }
.prose strong{ color:var(--fg-bright); font-weight:700; }
.prose li + li{ margin-top:6px; }
.prose li::marker{ color:var(--muted); }
.prose hr{ max-width:none; margin:40px 0 0; border:0; border-top:1px solid var(--line); }
.prose img{ display:block; max-width:100%; height:auto; border:1px solid var(--line); border-radius:6px; }
.prose figcaption{ margin-top:8px; font-family:var(--mono); font-size:12px; color:var(--muted); }
.prose blockquote{ padding:2px 0 2px 18px; border-left:2px solid var(--purple); color:var(--fg); font-style:italic; }
.prose :not(pre) > code, .prose kbd{
  font-family:var(--mono); font-size:.84em; color:var(--cyan); background:var(--strip);
  border:1px solid var(--line); border-radius:4px; padding:1px 5px;
}
.prose kbd{ color:var(--fg-bright); border-bottom-width:2px; }
.prose table{ display:block; overflow-x:auto; border-collapse:collapse; font-size:15px; }
.prose th, .prose td{ padding:8px 14px 8px 0; border-bottom:1px solid var(--line); text-align:left; vertical-align:top; }
.prose th{ font-family:var(--mono); font-size:12px; font-weight:500; color:var(--pink); }

/* code: a terminal card like the home page's drawer. Colour by hand with the tui.css utilities
   (.dim .g .c .p .o .y .pk); anything marked data-nocopy (prompts) stays out of the copy button */
.code{
  max-width:none; background:rgba(30,31,34,.94); border:1px solid var(--line); border-radius:8px;
  box-shadow:0 14px 40px rgba(0,0,0,.25);
}
.code .bar{
  display:flex; align-items:center; gap:10px; margin:0; padding:7px 12px; border-bottom:1px solid var(--line);
  background:var(--bg-deep); border-radius:8px 8px 0 0; font-family:var(--mono); font-size:12px; color:var(--muted);
}
.code .bar b{ color:var(--fg); font-weight:500; }
.code .copy{
  margin-left:auto; font:inherit; color:var(--muted); background:transparent; border:1px solid transparent;
  border-radius:4px; padding:0 6px; cursor:pointer;
}
.code .copy:hover{ color:var(--fg-bright); border-color:var(--line); }
.code pre{ margin:0; padding:14px 16px; overflow-x:auto; font-family:var(--mono); font-size:13.5px; line-height:1.6; color:var(--fg); }
.code [data-nocopy]{ -webkit-user-select:none; user-select:none; }

/* callouts: note (blue), warn (yellow), incident (red) */
.callout{
  padding:14px 18px; border:1px solid var(--line); border-left:3px solid var(--cyan); border-radius:6px;
  background:rgba(25,26,28,.8);
}
.callout > :first-child{ margin-top:0; }
.callout .label{ display:block; margin-bottom:4px; font-family:var(--mono); font-size:12px; letter-spacing:.04em; color:var(--cyan); font-style:normal; }
.callout.warn{ border-left-color:var(--yellow); } .callout.warn .label{ color:var(--yellow); }
.callout.incident{ border-left-color:var(--red); } .callout.incident .label{ color:var(--red); }
/* tl;dr at the top of an entry: green, like a passing health check */
.callout.tldr{ margin-top:28px; border-left-color:var(--bright-green); } .callout.tldr .label{ color:var(--bright-green); }
.callout ul, .callout ol{ margin-top:6px; padding-left:20px; }

/* diagrams: inline SVG, coloured by token classes (no hexes in the markup).
   d-box = a node, d-name/d-sub = its label, d-up/d-down = the two directions of a flow (cyan / purple),
   d-lbl = a step label on an arrow, d-head-t = a direction heading. */
.diagram{ display:block; width:100%; height:auto; max-width:640px; font-family:var(--mono); }
.d-box{ fill:var(--strip); stroke:var(--line); stroke-width:1.5; }
.d-box.d-s3{ stroke:var(--yellow); stroke-dasharray:6 4; }
.d-name{ fill:var(--fg-bright); font-size:14px; font-weight:700; text-anchor:middle; }
.d-sub{ fill:var(--muted); font-size:11px; text-anchor:middle; }
path.d-up, path.d-down{ fill:none; stroke-width:2; }
path.d-up{ stroke:var(--cyan); } path.d-down{ stroke:var(--purple); }
.d-tip-up{ fill:var(--cyan); } .d-tip-down{ fill:var(--purple); }
text.d-up{ fill:var(--cyan); } text.d-down{ fill:var(--purple); }
.d-lbl{ font-size:11px; text-anchor:middle; }
.d-head-t{ font-size:12px; letter-spacing:.06em; text-anchor:middle; }

/* draft marker: text the owner still has to write. Never ship a page that shows one. */
.todo{ color:var(--orange); background:rgba(207,142,109,.1); border:1px dashed var(--orange); border-radius:4px; padding:0 4px; }

/* previous / next entry */
.pager{
  display:grid; grid-template-columns:1fr 1fr; gap:14px; margin:56px 0 0; padding-top:22px; border-top:1px solid var(--line);
  font-family:var(--mono); font-size:12.5px;
}
.pager a, .pager span{ display:block; padding:12px 14px; border:1px solid var(--line); border-radius:6px; background:var(--strip); color:var(--muted); }
.pager a:hover{ border-color:var(--accent); text-decoration:none; }
.pager b{ display:block; margin-top:2px; font-family:var(--sans); font-size:15px; font-weight:500; color:var(--fg-bright); }
.pager .next{ text-align:right; }
.back{ display:inline-block; margin-top:22px; font-family:var(--mono); font-size:12.5px; }

footer{
  position:relative; z-index:1; padding:18px 28px; border-top:1px solid var(--line);
  background:rgba(22,23,24,.8); font-family:var(--mono); font-size:12px; line-height:1.6; color:var(--muted);
  display:flex; flex-wrap:wrap; gap:6px 18px; justify-content:space-between;
}

@media (max-width:860px){
  .nav{ padding:10px 14px; gap:10px; }
  .nav .meta{ display:none; }
  main{ padding:88px 16px 48px; }
  footer{ padding:16px; }
}
@media (max-width:520px){
  body{ font-size:16px; }
  .brand span{ display:none; }
  .pager{ grid-template-columns:1fr; }
  .pager .next{ text-align:left; }
}
@media (prefers-reduced-motion:reduce){
  .btn, .btn:hover{ transition:none; transform:none; }
}
