/* jpain.io: design/common.css + design/a-workbench.css, chosen by James 2026-09-28.
   Edit THIS file now; design/ keeps the four previews for reference. */
/* jpain.io shared base. Every colour and font is a token set by the design file that
   follows this one (design/<name>.css); this file only uses them. Tokens are named by
   job: --bg page, --fg text, --muted secondary text, --rule lines, --accent links and
   highlights, --accent-fg text on an accent fill, --panel code and figure backgrounds. */
* { box-sizing: border-box; }
html { scrollbar-gutter: stable; background: var(--bg); color: var(--fg); font: var(--body-size, 18px)/1.65 var(--font-body); -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; }
body { margin: 0 auto; max-width: var(--page, 46rem); padding: 2.2rem 1.25rem 3rem; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

header.site { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1.5rem; margin-bottom: 3rem; }
.wordmark { font-family: var(--font-head); font-weight: var(--head-weight, 700); font-size: 1.35rem; color: var(--fg); text-decoration: none; letter-spacing: var(--head-tracking, -.01em); }
nav { display: flex; gap: 1.25rem; font-size: .9rem; }
nav a { color: var(--muted); text-decoration: none; }
nav a:hover { color: var(--accent); }

.intro { margin-bottom: 3rem; }
.lede { font-size: 1.3rem; line-height: 1.5; margin: 0 0 1rem; max-width: 36rem; }
.hire { margin: 0; }
.hire a { font-weight: 600; }
.section-label { font-family: var(--font-mono); font-size: .78rem; font-weight: 500; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 .5rem; }

ul.posts { list-style: none; margin: 0; padding: 0; }
ul.posts li { padding: .85rem 0; border-top: 1px solid var(--rule); }
ul.posts li:last-child { border-bottom: 1px solid var(--rule); }
ul.posts time { display: block; font-family: var(--font-mono); font-size: .78rem; color: var(--muted); }
ul.posts a { font-family: var(--font-head); font-weight: var(--list-weight, 600); font-size: 1.2rem; line-height: 1.3; color: var(--fg); text-decoration: none; }
ul.posts a:hover { color: var(--accent); }
.summary { display: block; color: var(--muted); font-size: .95rem; margin-top: .25rem; }
ul.tags { list-style: none; padding: 0; columns: 2; }

h1, h2, h3 { font-family: var(--font-head); font-weight: var(--head-weight, 700); letter-spacing: var(--head-tracking, -.01em); line-height: 1.2; }
h1 { font-size: var(--h1, 2.3rem); margin: 0 0 .6rem; text-wrap: balance; }
h2 { font-size: 1.45rem; margin: 2.4rem 0 .6rem; }
h3 { font-size: 1.12rem; margin: 1.8rem 0 .4rem; }
.post-head { margin-bottom: 2rem; }
.meta { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); margin: 0; }
.meta .tags:not(:empty)::before { content: " · "; }
.meta .author::after { content: " · "; }
.meta .author { color: var(--fg); }
.meta .tags a { color: var(--muted); }

.e-content p, .e-content li { max-width: var(--measure, 40rem); }
.e-content img { max-width: 100%; height: auto; display: block; border-radius: var(--radius, 4px); margin: 1.5rem 0 .5rem; }
figure { margin: 1.8rem 0; }
figure img { margin: 0 auto; }
figcaption { color: var(--muted); font-size: .88rem; line-height: 1.5; margin-top: .5rem; }
blockquote { margin: 1.5rem 0; padding: .1rem 0 .1rem 1.1rem; border-left: 3px solid var(--accent); color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; margin: 1.5rem 0; }
th { text-align: left; border-bottom: 2px solid var(--fg); padding: .4rem .6rem; }
td { border-bottom: 1px solid var(--rule); padding: .4rem .6rem; vertical-align: top; }
code { font-family: var(--font-mono); font-size: .87em; background: var(--panel); padding: .1em .35em; border-radius: 3px; }
pre { background: var(--panel); padding: 1rem 1.1rem; overflow-x: auto; border-radius: var(--radius, 4px); line-height: 1.5; }
pre code { background: none; padding: 0; font-size: .85rem; }
.hl pre { margin: 1.5rem 0; }
.hl .c, .hl .c1, .hl .cm, .hl .ch { color: var(--muted); font-style: italic; }
.hl .k, .hl .kn, .hl .kd, .hl .kc, .hl .ow, .hl .nt { color: var(--accent); }
.hl .s, .hl .s1, .hl .s2, .hl .sd, .hl .na { color: var(--code-string); }
.hl .mi, .hl .mf, .hl .m { color: var(--code-number); }

.post-foot { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
button.kudos { display: inline-flex; align-items: baseline; gap: .7rem; font: 600 .9rem var(--font-body); color: var(--fg); background: transparent; border: 1px solid var(--rule); border-radius: var(--radius, 4px); padding: .45rem .9rem; cursor: pointer; }
button.kudos:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
button.kudos:not(.ready) { visibility: hidden; }  /* keeps its space: no shift when the count arrives */
.kudos-count { font-family: var(--font-mono); font-weight: 400; color: var(--muted); }
button.kudos.given { border-color: var(--accent); background: var(--accent); color: var(--accent-fg); cursor: default; }
button.kudos.given .kudos-count { color: var(--accent-fg); }
button.kudos.given .kudos-label::after { content: " ✓"; }
iframe.demo { display: block; width: 100%; height: 420px; border: 0; margin: 1.5rem 0 .5rem; }
.demo-caption { color: var(--muted); font-size: .88rem; line-height: 1.5; margin: 0 0 1.8rem; }
figure.demo-format img { margin: 0 auto; }
.format-sizes { width: auto; margin: .6rem 0 0; font-family: var(--font-mono); font-size: .8rem; }
.format-sizes td, .format-sizes th { padding: .2rem .9rem .2rem 0; border: 0; }
.format-sizes tr.got td { color: var(--accent); font-weight: 600; }
.format-sizes tr.got td:first-child::before { content: "→ "; }
/* Figures built from real images: a grid of panels, each with an HTML label, and one
   caption. .pixel enlarges small crops with sharp pixels; .hold panels swap to their
   comparison image while held (site.js). .keep keeps the columns on phones, for captions
   that say "left" and "right". */
figure.panels { display: grid; gap: .9rem .7rem; margin: 1.8rem 0; align-items: start; }
figure.panels.cols-2 { grid-template-columns: repeat(2, 1fr); }
figure.panels.cols-3 { grid-template-columns: repeat(3, 1fr); }
figure.panels > figcaption { grid-column: 1 / -1; margin-top: -.2rem; }
.panel { margin: 0; }
.e-content .panel img { display: block; width: 100%; height: auto; margin: 0; border-radius: 2px; }
figure.pixel .panel img { image-rendering: pixelated; }
.panel-label { font-size: .78rem; line-height: 1.45; color: var(--muted); margin: .35rem 0 0; }
.panel-label b { color: var(--fg); font-weight: 600; }
.panel.hold { cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.panel.hold img { outline: 1px solid var(--rule); }
.panel.hold.holding img { outline: 2px solid var(--accent); }
.hold-hint { display: block; color: var(--accent); font-size: .72rem; }
@media (max-width: 40rem) {
  figure.panels.cols-3:not(.keep) { grid-template-columns: repeat(2, 1fr); }
  figure.panels.cols-2:not(.keep) { grid-template-columns: 1fr; }
  figure.panels.keep { gap: .6rem .4rem; }
}
.filter-note { font-family: var(--font-mono); font-size: .85rem; color: var(--muted); }

footer.site { margin-top: 4rem; padding-top: 1.2rem; border-top: 1px solid var(--rule); font-size: .85rem; color: var(--muted); }
footer.site a { color: var(--muted); }

@media (max-width: 40rem) {
  html { font-size: 17px; }
  body { padding-top: 1.4rem; }
  header.site { margin-bottom: 2.2rem; }
  h1 { font-size: calc(var(--h1, 2.3rem) * .8); }
  .lede { font-size: 1.15rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
/* A, Workbench: an engineer's notebook. IBM Plex Sans + Plex Mono, crisp paper, one cobalt accent. */
@font-face { font-family: "Plex Sans"; src: url(/fonts/plex-sans-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url(/fonts/plex-sans-400i.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url(/fonts/plex-sans-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url(/fonts/plex-mono-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url(/fonts/plex-mono-600.woff2) format("woff2"); font-weight: 500 600; font-display: swap; }
:root {
  --font-body: "Plex Sans", system-ui, sans-serif; --font-head: "Plex Sans", system-ui, sans-serif; --font-mono: "Plex Mono", ui-monospace, monospace;
  --head-weight: 600; --head-tracking: -.015em; --h1: 2.2rem; --radius: 2px;
  --bg: #f6f6f3; --fg: #15171c; --muted: #5a5f6b; --rule: #dcddd8; --accent: #2448e0; --accent-fg: #fff; --panel: #ebebe6;
  --code-string: #1c7349; --code-number: #9a4b00;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #101216; --fg: #e8e9ec; --muted: #9ba0ab; --rule: #272b33; --accent: #8aa4ff; --accent-fg: #101216; --panel: #191c22;
  --code-string: #7fd6a8; --code-number: #f2b264;
} }
html { border-top: 4px solid var(--accent); }
.wordmark { font-family: var(--font-mono); font-size: 1.1rem; font-weight: 500; }
.wordmark::before { content: "~/"; color: var(--accent); }
.section-label::before, h2::before { content: "// "; color: var(--accent); font-family: var(--font-mono); font-weight: 400; }
ul.posts li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0 1rem; align-items: baseline; }
ul.posts li .summary, ul.posts li br { grid-column: 2; }
ul.posts a { font-size: 1.12rem; }
.meta { border-left: 2px solid var(--accent); padding-left: .7rem; }
.e-content img, pre { border: 1px solid var(--rule); }
@media (max-width: 40rem) { ul.posts li { grid-template-columns: 1fr; } ul.posts li .summary { grid-column: 1; } }
