/* Post pages: serif headings and lede on the graph-paper column, body in mono like the rest of the site. */
.post-view { display: flex; flex-direction: column; gap: 28px; }
.back { align-self: flex-start; font-size: 12.5px; color: var(--ink-2); }
.back:hover { color: var(--box); }
.post-head { display: flex; flex-direction: column; gap: 8px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.kicker { font-size: 12px; color: var(--box); font-variant-numeric: tabular-nums; }
.post-head h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 46px; line-height: 50px; letter-spacing: -0.015em; text-wrap: balance; }
.byline { font-size: 12.5px; color: var(--ink-2); }

.prose { display: flex; flex-direction: column; gap: 16px; line-height: 24px; overflow-wrap: break-word; }
.prose > p, .prose > ul, .prose > ol, .prose > dl { max-width: 66ch; margin: 0; }
.prose > p:first-child { font-family: var(--serif); font-size: 23px; line-height: 31px; }
.prose strong { font-weight: 600; }
.prose h2 { margin: 28px 0 0; font-family: var(--serif); font-weight: 400; font-size: 29px; line-height: 34px; text-wrap: balance; scroll-margin-top: 24px; }
.prose h3 { margin: 12px 0 0; font-size: 13px; font-weight: 600; color: var(--box); scroll-margin-top: 24px; }
.prose .headerlink { margin-left: 0.35em; color: var(--line); opacity: 0; }
.prose h2:hover .headerlink, .prose h3:hover .headerlink, .prose .headerlink:focus-visible { opacity: 1; }
.prose a:not(.headerlink):not(.footnote-ref):not(.footnote-backref) { border-bottom: 1px solid var(--line); }
.prose a:hover { color: var(--box); border-color: var(--box); }
.prose ul, .prose ol { padding-left: 1.6em; display: flex; flex-direction: column; gap: 6px; }
.prose li::marker { color: var(--ink-2); font-size: 12px; }
.prose blockquote { margin: 4px 0; padding: 4px 0 4px 16px; border-left: 2px solid var(--box); font-family: var(--serif); font-size: 23px; line-height: 30px; max-width: 60ch; }
.prose blockquote p { margin: 0; }
.prose hr { width: 100%; border: 0; border-top: 1px dashed var(--line); margin: 12px 0; }
.prose code { font: 12.5px/1.5 var(--mono); background: color-mix(in srgb, var(--paper) 80%, transparent); border: 1px solid var(--line); padding: 0 4px; }
.prose pre { margin: 0; font: 12.5px/1.6 var(--mono); background: color-mix(in srgb, var(--paper) 80%, transparent); border: 1px solid var(--line); padding: 12px 14px; overflow-x: auto; }
.prose pre code { background: none; border: 0; padding: 0; }
.prose .codebox { position: relative; }
.prose .codebox pre { padding-right: 72px; }
.prose .codebox .copy { position: absolute; top: 8px; right: 8px; font: 500 11.5px/1 var(--mono); color: var(--ink); background: var(--paper); border: 1px solid var(--line); padding: 6px 9px; cursor: pointer; }
.prose .codebox .copy:hover { color: var(--box); border-color: var(--box); }
.prose img, .prose video { display: block; max-width: 100%; height: auto; }
.prose p:has(> img:only-child) + p > em:only-child { display: block; font-style: normal; font-size: 12px; color: var(--ink-2); margin-top: -8px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 12.5px; line-height: 19px; display: block; overflow-x: auto; background: color-mix(in srgb, var(--paper) 80%, transparent); }
.prose th, .prose td { border: 1px solid var(--ink); padding: 8px 10px; vertical-align: top; text-align: left; }
.prose th { font-weight: 500; color: var(--ink-2); }
.prose table + p > em:only-child { display: block; font-style: normal; font-size: 12px; color: var(--ink-2); margin-top: -8px; }
.prose .footnote { font-size: 12px; line-height: 18px; color: var(--ink-2); }
.prose .footnote ol { padding-left: 1.4em; }
.prose sup { line-height: 0; }

.post-end { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--ink-2); padding-top: 16px; border-top: 1px solid var(--line); }
.post-end a:hover { color: var(--box); }

@media (max-width: 600px) {
  .post-head h1 { font-size: 34px; line-height: 38px; }
  .prose h2 { font-size: 24px; line-height: 29px; }
}

/* Post components (wx-*): headline panels, bar charts, scorecards, steps, brain math, scatter.
   Blue (--box) = stock robot, orange (--hot) = an edit; the pair passes the palette checks on --paper. */
.prose { --hot: #c8551c; --hot-soft: #f6e3d6; --other: #b9bab2; --track: rgba(40, 50, 70, 0.08); }
.prose video { width: 100%; background: #000; aspect-ratio: 8 / 3; }
.prose video.wx-ex { aspect-ratio: 1280 / 800; }
.wx-panels { display: flex; flex-direction: column; gap: 26px; padding-top: 10px; }
.wx-panel { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.4fr); gap: 16px; align-items: center;
  padding-top: 20px; background: color-mix(in srgb, var(--paper) 80%, transparent); }
.wx-txt { display: flex; flex-direction: column; gap: 6px; }
.wx-txt b { font-weight: 600; line-height: 20px; }
.wx-big { font-family: var(--serif); font-size: 52px; line-height: 52px; color: var(--hot); }
.wx-small { font-size: 12px; line-height: 17px; color: var(--ink-2); }
.wx-pair { display: flex; flex-direction: column; gap: 4px; }
.wx-lab { display: grid; grid-template-columns: 1fr 1fr; font-size: 11.5px; }
.wx-lab span:first-child { color: var(--box); } .wx-lab span:last-child { color: var(--hot); }
.prose .wx-pair + p > em:only-child, .prose p:has(> video:only-child) + p > em:only-child { display: block; font-style: normal; font-size: 12px; color: var(--ink-2); margin-top: -8px; }

.wx-chart { border: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 85%, transparent); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.wx-t { font-weight: 600; font-size: 13px; }
.wx-legend { font-size: 11.5px; color: var(--ink-2); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.wx-legend i { display: inline-block; width: 9px; height: 9px; } .wx-legend i.s { background: var(--box); } .wx-legend i.e { background: var(--hot); }
.wx-bars { display: flex; flex-direction: column; gap: 7px; }
.wx-grp { font-size: 11px; color: var(--ink-2); padding-top: 4px; }
.wx-bar { display: grid; grid-template-columns: minmax(7rem, 13rem) minmax(0, 1fr) 3rem; align-items: center; gap: 10px; font-size: 12.5px; }
.wx-bar.key span { font-weight: 600; }
.wx-bar i { position: relative; height: 12px; background: var(--track); }
.wx-bar b { position: absolute; inset: 0 auto 0 0; width: calc(var(--v) * 1%); background: var(--other); }
.wx-bar b.s { background: var(--box); } .wx-bar b.e { background: var(--hot); }
.wx-chance .wx-bar i::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; border-left: 1.5px dashed var(--ink-2); }
.wx-bar em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }

.wx-score { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.wx-sc { border: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 85%, transparent); padding: 12px; display: flex; flex-direction: column; gap: 5px; }
.wx-sc b { font-weight: 600; font-size: 13px; line-height: 18px; }
.wx-sc p { font-size: 12px; line-height: 17px; color: var(--ink-2); }
.wx-sc strong { font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 30px; margin-top: auto; }
.wx-sc strong small { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); }
.wx-pill { align-self: flex-start; font-size: 10.5px; line-height: 17px; padding: 0 6px; border: 1px solid var(--ink-2); color: var(--ink-2); }
.wx-pill.bad { border-color: var(--hot); color: var(--hot); }

.prose ol.wx-steps { max-width: none; list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; counter-reset: st; }
.wx-steps li { border: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 85%, transparent); padding: 12px; display: flex; flex-direction: column; gap: 4px; counter-increment: st; }
.wx-steps li::before { content: counter(st, decimal-leading-zero); font-size: 11px; color: var(--hot); }
.wx-steps b { font-weight: 600; } .wx-steps span { font-size: 12px; line-height: 17px; color: var(--ink-2); }

.wx-math { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); padding: 16px; background: color-mix(in srgb, var(--paper) 85%, transparent); }
.wx-chip { border: 1px solid var(--line); padding: 8px 10px; display: flex; flex-direction: column; text-align: center; min-width: 8rem; background: var(--paper); }
.wx-chip b { font-weight: 600; font-size: 13px; } .wx-chip span { font-size: 11px; color: var(--ink-2); }
.wx-chip.s { border-color: var(--box); } .wx-chip.e { border-color: var(--hot); background: var(--hot-soft); }
.wx-op { font-family: var(--serif); font-size: 28px; color: var(--ink-2); }

svg.wx-scatter { width: 100%; height: auto; display: block; overflow: visible; }
svg.wx-scatter text { font-family: var(--mono); font-size: 13px; fill: var(--ink); }
svg.wx-scatter .m { fill: var(--ink-2); }
svg.wx-scatter .g { stroke: var(--line); } svg.wx-scatter .z { stroke: var(--ink-2); stroke-dasharray: 4 4; }
svg.wx-scatter circle { fill: var(--box); stroke: var(--paper); stroke-width: 2; } svg.wx-scatter circle.k { fill: var(--hot); }

@media (max-width: 600px) {
  .wx-panel { grid-template-columns: minmax(0, 1fr); }
  .wx-score, .prose ol.wx-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wx-bar { grid-template-columns: minmax(0, 1fr) 3rem; row-gap: 3px; } .wx-bar span { grid-column: 1 / -1; }
  .wx-math { flex-direction: column; } .wx-chip { width: 100%; }
  svg.wx-scatter text { font-size: 17px; }
}
@media (max-width: 420px) { .wx-score { grid-template-columns: minmax(0, 1fr); } }
.prose details { border: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 85%, transparent); padding: 10px 14px; display: flex; flex-direction: column; gap: 10px; }
.prose details summary { cursor: pointer; font-size: 12.5px; color: var(--ink-2); }
.prose details[open] summary { margin-bottom: 10px; }
.prose details > p > em:only-child { display: block; font-style: normal; font-size: 12px; color: var(--ink-2); margin-top: 8px; }

/* "Watch it think": a recorded fold beside two rows of neuron lamps, a timeline and a one-line status */
.wx-think { display: flex; flex-direction: column; gap: 8px; }
.prose .wx-think video { aspect-ratio: 4 / 3; }
.wx-rows { display: flex; flex-direction: column; gap: 6px; }
.wx-row { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-2); }
.wx-lamps { display: flex; gap: 5px; }
.wx-lamps i { width: 14px; height: 14px; border-radius: 50%; opacity: .12; transition: opacity .08s linear; }
.wx-lamps.g i { background: var(--hot); box-shadow: 0 0 6px var(--hot); } .wx-lamps.r i { background: var(--box); box-shadow: 0 0 6px var(--box); }
.wx-tl { position: relative; height: 14px; margin-top: 2px; border-top: 1px solid var(--line); }
.wx-tl b { position: absolute; top: 2px; width: 0; height: 0; margin-left: -4px; border: 4px solid transparent; }
.wx-tl b.grab { border-bottom-color: var(--hot); top: -6px; } .wx-tl b.release { border-top-color: var(--box); top: 1px; }
.wx-tl u { position: absolute; top: -5px; bottom: -2px; width: 1.5px; background: var(--ink); }
.wx-now { font-size: 12px; min-height: 18px; color: var(--ink-2); }
.wx-now.grab { color: var(--hot); } .wx-now.release { color: var(--box); }

/* "The flip": two layer sheets; the edited neurons light up, then flip */
.wx-flip { border: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 85%, transparent); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.wx-flip canvas { width: 100%; display: block; }
.wx-flip-state { font-size: 12px; } .wx-flip-state.e { color: var(--hot); } .wx-flip-state.s { color: var(--box); }

/* The full neuron viewer: breaks out of the text column, rendered at 1280x800 and scaled to fit (wx.js) */
.wx-embed { position: relative; left: 50%; transform: translateX(-50%); width: min(1280px, calc(100vw - 32px)); overflow: hidden; border: 1px solid var(--line); background: #000; }
.wx-embed iframe { display: block; width: 1280px; height: 800px; border: 0; transform-origin: 0 0; }

/* TL;DR block and the linked byline with affiliations */
.wx-tldr { display: flex; flex-direction: column; gap: 10px; max-width: none; padding: 16px 20px; background: #fdfcf8; border: 1px solid var(--line); border-left: 3px solid var(--box); border-radius: 0 6px 6px 0; }
.wx-tldr p { margin: 0; font-size: 14px; line-height: 24px; color: #54595a; }
.wx-tldr b, .wx-tldr strong { font-weight: 700; color: var(--ink); }
.wx-tldr p:first-child > b:first-child, .wx-tldr p:first-child > strong:first-child { font-weight: 600; font-size: 12px; color: var(--box); letter-spacing: 0.04em; margin-right: 6px; }
.wx-tldr a { border-bottom: 1px solid var(--line); }
.byline a { border-bottom: 1px solid var(--line); } .byline a:hover { color: var(--box); border-color: var(--box); }
.byline sup { font-size: 9px; color: var(--box); margin-left: 1px; }
.byline .aff { display: block; margin-top: 2px; font-size: 11.5px; }
