/* Build log pages: a film band for the title, then a paper reading column with the spec-sheet components
   (stat cells, ladders, bars, compare cells, rules, steps, receipts). Loaded after styles.css on /blog/ only.
   No inline styles: the CSP forbids them, so bar lengths are SVG rect widths. */

/* title band */
.post-hero { padding-block: clamp(3.5rem, 10vw, 6.5rem) clamp(2.5rem, 6vw, 4rem); }
.post-hero .inner { display: grid; gap: 1.1rem; position: relative; z-index: 1; }
.post-hero .shout { font-size: clamp(2.5rem, 7.2vw, 5.5rem); max-width: 21ch; }
.post-hero .glow { left: -12vw; top: -20vw; width: 60vw; height: 60vw; max-width: 46rem; max-height: 46rem; opacity: 0.4; }
.post-hero.lit .glow { background: radial-gradient(circle, rgba(255, 208, 128, 0.42) 0%, transparent 62%); opacity: 0.6; }
.lamp { width: 14px; height: 14px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 24px 7px rgba(255, 208, 128, 0.45); margin-bottom: 0.4rem; }
@media (prefers-reduced-motion: no-preference) {
  .lamp { animation: breathe 5s var(--ease) infinite; }
  @keyframes breathe { 50% { box-shadow: 0 0 36px 13px rgba(255, 208, 128, 0.5); } }
}
/* header figure (posts/art/<slug>.svg): a spec-plate line drawing of the post's mechanism, beside the title on wide screens.
   cream = structure, amber = what failed, lavender = the fix; only the fix moves: it draws in, holds, fades and redraws on a 6 s loop. */
.hero-text { display: grid; gap: 1.1rem; }
.hero-art { margin: 0; display: grid; gap: 0.75rem; max-width: 34rem; }
.hero-art svg { display: block; width: 100%; height: auto; }
@media (max-width: 40rem) { .hero-art svg { width: calc(100% + 2 * var(--gutter)); margin-inline: calc(-1 * var(--gutter)); } }  /* edge to edge on phones: labels stay 11 px or more from 330 px */
.hero-art figcaption { font: 400 0.8125rem/1.5 var(--mono); color: var(--cream-2); max-width: 46ch; }
@media (min-width: 62rem) {
  .post-hero.has-art .inner { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; column-gap: 3.5rem; }
  .post-hero.has-art .shout { font-size: clamp(2.75rem, 4.6vw, 4.75rem); }
}
.art .ln { fill: none; stroke: var(--cream-2); stroke-width: 1.25; }
.art .sub { fill: none; stroke: var(--cream-hi); stroke-width: 2; stroke-linejoin: round; }
.art .bad { fill: none; stroke: var(--amber); stroke-width: 2; stroke-linejoin: round; }
.art .fix { fill: none; stroke: var(--neon); stroke-width: 2.5; stroke-linejoin: round; filter: drop-shadow(0 0 4px var(--neon-glow)); }
.art .card { fill: var(--night); }
.art .dash { stroke-dasharray: 4 5; }
.art .grid { stroke: var(--night-line); stroke-width: 1; }
.art text { font: 500 16px var(--mono); letter-spacing: 0.06em; fill: var(--cream-2); }
.art text.b { fill: var(--amber); }
.art text.f { fill: var(--neon); }
@media (prefers-reduced-motion: no-preference) {
  .art .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 6s var(--ease) 0.5s infinite; }
  @keyframes draw { 0% { stroke-dashoffset: 1; opacity: 1; } 30%, 80% { stroke-dashoffset: 0; opacity: 1; } 92%, 100% { stroke-dashoffset: 0; opacity: 0; } }
}
/* public/art.js adds a Pause control to the caption (WCAG 2.2.2); paused stops the figure and the lamp */
.art-toggle { display: block; min-height: 44px; margin-top: 0.15rem; padding: 0; border: 0; background: none; cursor: pointer;
  font: 500 0.8125rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--cream-hi); }
.art-toggle:hover { color: var(--neon); }
.post-hero.paused .draw, .post-hero.paused .lamp { animation-play-state: paused; }
.draft { justify-self: start; border: 1px solid var(--amber); color: var(--amber); padding: 0.55rem 0.8rem; font: 500 0.8125rem/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }

/* reading column: 18 px, 1.65, about 68 characters */
.post { padding-block: clamp(2.5rem, 6vw, 4rem) 4.5rem; }
.prose { display: grid; gap: 1.15rem; max-width: 48rem; font-size: 1.125rem; line-height: 1.65; }
.prose p, .prose li { max-width: 68ch; }
.prose .lede { font-size: clamp(1.25rem, 2.4vw, 1.4rem); line-height: 1.5; color: var(--ink); }
.prose .lede b { font-weight: 600; }
.prose b, .prose strong { font-weight: 600; }
.prose section { display: grid; gap: 1.1rem; margin-top: 2.5rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.prose section > .eyebrow { margin-bottom: -0.45rem; }
.prose h2 { margin: 0; font: 600 clamp(1.5rem, 3vw, 1.875rem)/1.2 var(--sans); letter-spacing: -0.025em; color: var(--ink); text-wrap: balance; }
.prose ol, .prose ul { margin: 0; padding-left: 1.4rem; display: grid; gap: 0.55rem; }
.prose li::marker { color: var(--ink-3); font-family: var(--mono); font-size: 0.9em; }
.prose code { font: 400 0.88em var(--mono); background: var(--s2); padding: 0.1em 0.35em; overflow-wrap: anywhere; }
.prose .note { font-size: 0.9375rem; color: var(--ink-3); }
.back { margin-top: 3rem; font: 500 0.8125rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.back a { color: var(--ink-2); }

/* stat cells */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); border-top: 1px solid var(--ink); border-left: 1px solid var(--line); }
.stat { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 1rem 1.1rem 1.15rem; display: grid; gap: 0.4rem; align-content: start; background: var(--s1); }
.stat strong { font: 500 2.25rem/1 var(--sans); letter-spacing: -0.035em; font-variant-numeric: tabular-nums; color: var(--ink); }
.stat span { font-size: 0.9375rem; color: var(--ink-2); line-height: 1.4; }

/* boxes and chips */
.box { background: var(--s1); border: 1px solid var(--line); padding: 1rem 1.15rem 1.1rem; display: grid; gap: 0.45rem; min-width: 0; }
.box h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6rem; margin: 0; font: 600 1.125rem/1.3 var(--sans); letter-spacing: -0.01em; }
.box p { color: var(--ink-2); font-size: 1rem; line-height: 1.55; }
.where { font: 400 0.875rem/1.45 var(--mono); color: var(--ink-3); }
.chip { font: 500 0.75rem/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; padding: 0.3rem 0.45rem; white-space: nowrap; }
.chip.code { border: 1px solid var(--line-2); color: var(--ink-2); }
.chip.model { background: var(--brand-soft); color: var(--brand); }
.chip.gate { border: 1px dashed var(--line-2); color: var(--ink-3); }

/* the ladder */
.legend { display: flex; flex-wrap: wrap; gap: 1.2rem; font: 500 0.8125rem/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 7px; }
.legend .code { border: 1px solid var(--ink-2); } .legend .model { background: var(--brand); }
.ladder { list-style: none; margin: 0; padding: 0; display: grid; }
.ladder li { max-width: none; }
.rung { display: grid; grid-template-columns: 42px 1fr; gap: 0.9rem; position: relative; padding-bottom: 1rem; }
.rung::before { content: ""; position: absolute; left: 20px; top: 42px; bottom: 0; width: 1px; background: var(--line-2); }
.rung:last-child { padding-bottom: 0; }
.rung:last-child::before { display: none; }
.node { width: 42px; height: 42px; display: grid; place-items: center; position: relative; z-index: 1; font: 600 0.9375rem/1 var(--mono); border: 1px solid currentColor; background: var(--bg); }
.rung.code .node { color: var(--ink-2); }
.rung.model .node { color: var(--brand); background: var(--brand-soft); }
.rung.gate .node { color: var(--ok); border-style: dashed; }

/* bars */
.bars { border: 1px solid var(--line); border-top: 1px solid var(--ink); background: var(--s1); padding: 1.1rem 1.2rem; display: grid; gap: 1rem; }
.bar-head { display: flex; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; font-size: 1rem; }
.bar-head b { font-weight: 600; }
.bar-head span { font: 400 0.875rem/1.7 var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.track { display: block; width: 100%; height: 10px; margin-top: 0.45rem; }
.track .bg { fill: var(--s2); }
.track .fill { fill: var(--ink); }
.track .fill.slow { fill: var(--warn); }
.track .fill.agent { fill: var(--brand); }
.track .fill.ghost { fill: var(--brand); opacity: 0.3; }
.axis { display: flex; justify-content: space-between; font: 400 0.8125rem var(--mono); color: var(--ink-3); }

/* compare cells */
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0; border-top: 1px solid var(--ink); border-left: 1px solid var(--line); }
.compare > .box { border-width: 0 1px 1px 0; }
.compare strong { font: 500 2.5rem/1 var(--sans); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.compare .warn { box-shadow: inset 3px 0 0 var(--warn); }
.compare .warn strong { color: var(--warn); }
.compare .good { box-shadow: inset 3px 0 0 var(--ok); }
.compare .good strong { color: var(--ok); }

/* rules, steps, keyed items */
.rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.rules li { border-left: 2px solid var(--brand); padding-left: 1rem; max-width: 68ch; }
.rules b { display: block; font-weight: 600; }
.rules span { color: var(--ink-2); font-size: 1rem; }
.advice { background: var(--bg-2); border: 1px solid var(--line); border-top: 1px solid var(--ink); padding: 1.3rem 1.4rem; display: grid; gap: 0.8rem; }
.advice ol { gap: 0.75rem; }
.items { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.items li { display: grid; grid-template-columns: 2.8rem 1fr; gap: 0 1rem; padding-block: 1.3rem; border-bottom: 1px solid var(--line); max-width: none; }
.items .k { font: 500 0.8125rem/2 var(--mono); color: var(--ink-3); }
.items h3 { margin: 0 0 0.45rem; font: 600 1.25rem/1.3 var(--sans); letter-spacing: -0.015em; }
.items p { color: var(--ink-2); }

/* the equation */
.equation { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 0.6rem; align-items: center; }
.equation div { border: 1px solid var(--line); padding: 0.95rem; background: var(--s1); min-width: 0; }
.equation b { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.equation span { font-size: 0.9375rem; color: var(--ink-2); line-height: 1.45; display: block; }
.equation i { font: 400 1.5rem/1 var(--mono); color: var(--ink-3); font-style: normal; text-align: center; }
.equation .result { border-color: var(--ink); box-shadow: inset 0 3px 0 var(--light); }
@media (max-width: 35rem) { .equation { grid-template-columns: 1fr; } .equation i { line-height: 0.6; } }
.moves { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; counter-reset: m; }
.moves li { counter-increment: m; display: grid; grid-template-columns: 2.8rem 1fr; gap: 0.75rem; max-width: none; }
.moves li::before { content: "0" counter(m); font: 500 0.875rem/1.9 var(--mono); color: var(--ink-3); }

/* receipts on paper: the film's dark trace card */
.trace { margin: 0; background: var(--night); color: var(--cream); border: 1px solid var(--night-line); padding: 1rem 1.2rem; display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.2rem; font: 400 0.9375rem/1.5 var(--mono); }
.trace dt { color: var(--cream-2); }
.trace dd { margin: 0; overflow-wrap: anywhere; }
.trace .bad { color: #ff8a7a; }

/* status grid: word and shape first, colour last */
.timeline { display: grid; grid-template-columns: max-content repeat(2, 1fr); border-top: 1px solid var(--ink); border-left: 1px solid var(--line); }
.timeline > * { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--s1); padding: 0.75rem 1rem; font-size: 1rem; }
.timeline .h { font: 500 0.8125rem/1.5 var(--mono); color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; }
.st { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 600; }
.st.ok { color: var(--ok); } .st.bad { color: var(--alert); }

/* the index page */
.spec.first { border-top: 0; }
.intro { font-size: 1.125rem; color: var(--ink-2); max-width: 44rem; margin: -1rem 0 2.25rem; }
