/* The blog at /blog/ (generated by build-blog.mjs). "Technical Swiss": paper and ink, hairline rules,
   square corners, one blue accent. The colours match the workbench tokens in web/src/tokens.css and
   the front page in web/src/landing.css. */
@font-face {
  font-family: "Inter Tight";
  src: url("fonts/inter-tight-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
:root {
  --font-ui: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 2px;
  --bg: #f5f3ee;
  --panel: #fbfaf7;
  --fg: #17191c;
  --muted: #5b5f66;
  --line: #8a8577;
  --grid: #e3dfd4;
  --accent: #1e40af;
  --on-accent: #ffffff;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141517;
    --panel: #1b1c20;
    --fg: #f2efe8;
    --muted: #a7a296;
    --line: #75705f;
    --grid: #2a2b30;
    --accent: #8fb0ff;
    --on-accent: #0f1116;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141517;
  --panel: #1b1c20;
  --fg: #f2efe8;
  --muted: #a7a296;
  --line: #75705f;
  --grid: #2a2b30;
  --accent: #8fb0ff;
  --on-accent: #0f1116;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.blog {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3, p, figure, ul, ol { margin: 0; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
code { font-family: var(--font-mono); font-size: 0.92em; background: var(--panel); border: 1px solid var(--grid); border-radius: var(--radius); padding: 0 4px; overflow-wrap: anywhere; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--fg);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--fg); border-color: var(--fg); color: var(--bg); font-weight: 600; }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* Header and footer match the front page. */
.site-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.brand { display: inline-flex; align-items: center; gap: 6px; color: var(--fg); font-weight: 600; font-size: 16px; letter-spacing: -0.01em; text-decoration: none; white-space: nowrap; }
.logo { display: inline-block; flex: none; width: 22px; height: 22px; }
.logo rect { fill: var(--fg); }
.logo path { fill: none; stroke: var(--bg); stroke-width: 4.8; stroke-linecap: round; stroke-linejoin: round; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; }
.site-nav a { color: var(--muted); text-decoration: none; padding: 4px 0; box-shadow: inset 0 -1px 0 transparent; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--fg); box-shadow: inset 0 -2px 0 var(--accent); }
.head-cta { margin-left: auto; min-height: 34px; padding: 6px 12px; font-size: 14px; }
@media (max-width: 719px) { .site-nav { order: 3; width: 100%; } }

.site-foot { margin-top: 72px; padding: 28px 16px 36px; border-top: 1px solid var(--line); background: var(--panel); font-size: 14px; color: var(--muted); }
.site-foot > * { max-width: 1200px; margin: 0 auto; }
.site-foot p { margin-bottom: 12px; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-foot a { color: var(--muted); }
.site-foot a:hover { color: var(--accent); }

.eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.02em; color: var(--muted); text-transform: uppercase; }
.lead { color: var(--muted); font-size: 18px; }

/* Index */
.index { max-width: 1200px; margin: 0 auto; padding: 56px 16px 0; }
.index-head { display: grid; gap: 12px; max-width: 760px; margin-bottom: 36px; }
.index-head h1 { font-size: clamp(32px, 4.6vw, 48px); }
.post-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.post-card { display: flex; flex-direction: column; gap: 8px; padding: 0 0 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--fg); text-decoration: none; overflow: hidden; }
.post-card:hover { border-color: var(--accent); }
.post-card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-bottom: 1px solid var(--grid); }
.post-card > :not(img) { margin: 0 16px; }
.post-card h2, .post-card h3 { font-size: 20px; }
.post-card p { color: var(--muted); font-size: 15px; }
.post-date { font-family: var(--font-mono); font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em; }
.post-card .post-date { margin-top: 12px; }
@media (min-width: 720px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .post-grid { grid-template-columns: repeat(3, 1fr); } }

/* Post */
.post { max-width: 760px; margin: 0 auto; padding: 40px 16px 0; }
.crumbs { margin-bottom: 20px; font-size: 14px; }
.post-head { display: grid; gap: 12px; margin-bottom: 28px; }
.post-head h1 { font-size: clamp(30px, 4.4vw, 44px); }
.post-hero { margin-bottom: 36px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.post-hero img { display: block; width: 100%; height: auto; }
.post-hero figcaption { padding: 10px 12px; border-top: 1px solid var(--grid); font-size: 13px; color: var(--muted); }
.prose { font-size: 17px; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 2em; font-size: 26px; }
.prose h3 { margin-top: 1.6em; font-size: 20px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.4em; }
.prose pre { margin: 1.2em 0; padding: 14px 16px; overflow-x: auto; border: 1px solid var(--grid); border-radius: var(--radius); background: var(--panel); font-size: 14px; line-height: 1.5; }
.prose pre code { padding: 0; border: 0; background: none; font-size: inherit; }
.prose figure { margin: 1.6em 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.prose figure img { display: block; width: 100%; height: auto; }
.prose figcaption { padding: 10px 12px; border-top: 1px solid var(--grid); font-size: 13px; color: var(--muted); }
.prose blockquote { margin: 1.4em 0; padding: 2px 0 2px 16px; border-left: 3px solid var(--accent); color: var(--muted); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { padding: 8px 10px; border: 1px solid var(--grid); text-align: left; }
.prose th { background: var(--panel); font-weight: 600; }
.post-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: 48px; padding: 20px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.post-cta p { color: var(--muted); }
.post-nav { display: grid; gap: 12px; margin-top: 20px; }
.post-nav a { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--grid); border-radius: var(--radius); color: var(--fg); font-weight: 600; text-decoration: none; }
.post-nav a:hover { border-color: var(--accent); }
.post-nav span { font-family: var(--font-mono); font-size: 12px; font-weight: 400; color: var(--muted); text-transform: uppercase; }
@media (min-width: 720px) { .post-nav { grid-template-columns: repeat(2, 1fr); } }
