/* =============================================================================
   BLOG 2026 — one stylesheet for the whole blog family: /blog, the six hubs
   (/blog/{research,playbooks,guides,compare,basics,notes}), /blog/all,
   /resources and every post.

   Remade 2026-10-06 (owner: "make blogs look like this … same style", a
   screenshot of an independent tech newsroom's front page; then "why the
   fuck you made it dark, it does not match my website": the same day it
   went back onto the site's paper). The layout is the newsroom's: a
   3-column grid of 16:9 photo cards, a featured story with the photo
   beside it, Space Grotesk for every title, Space Mono uppercase for
   labels, bylines and buttons, Inter for reading text. The colours are the
   site's own: paper #f9f8f4, ink, ultramarine — the same tokens as the
   homepage, and the site header and footer exactly as on every other page.
   Photos are real, licensed documentary photos (scripts/blog/photos.js,
   credited on each post and in /assets/blog/photos/NOTICE.txt) or the
   owner's own screenshots: no generated art.

   The 2026-09-24 type-only remake ("set in type, no covers") is superseded; its
   class names are kept because blog.js, the localizer, check-blog-dates and
   the tests key on them (.pc, .pc-title, .pc-excerpt, .pc-read, .section-nav,
   .chip, .bl-lead, .mostread, .bl-month, .pc-grid--all, .post-*).

   Rules this sheet keeps:
     - one file, in cascade order: 1 fonts + tokens, 2 base, 3 (retired),
       4 shared pieces, 5 cards, 6 index, 7 hubs + archive, 8 resources,
       9 post, 10 responsive, 11 focus, 12 modes
     - no importance overrides except :focus-visible rings that must beat
       a11y.css (it loads after and forces one ring everywhere)
     - nothing under 12px; secondary text is --text-dim (5.6:1 on paper)
     - semantic green/amber/red only mean verdicts, never decoration
   ========================================================================== */

/* ── 1. Fonts and tokens ────────────────────────────────────────────────── */
/* OFL 1.1, self-hosted (fonts/*-OFL.txt): latin + latin-ext of each. */
@font-face {
    font-family: 'Space Grotesk'; font-style: normal; font-weight: 300 700; font-display: swap;
    src: url(/assets/fonts/spacegrotesk-var-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Space Grotesk'; font-style: normal; font-weight: 300 700; font-display: swap;
    src: url(/assets/fonts/spacegrotesk-var-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap;
    src: url(/assets/fonts/inter-var-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Inter'; font-style: normal; font-weight: 400 700; font-display: swap;
    src: url(/assets/fonts/inter-var-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Space Mono'; font-style: normal; font-weight: 400; font-display: swap;
    src: url(/assets/fonts/spacemono-400-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Space Mono'; font-style: normal; font-weight: 400; font-display: swap;
    src: url(/assets/fonts/spacemono-400-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    /* the site's paper and ink (home-2026.css §1) */
    --bg: #f9f8f4;               /* the page: paper */
    --bg-1: #ffffff;             /* boxes: newsletter, TL;DR, CTA, tables, figures */
    --bg-2: #f1efe8;             /* image placeholder, recessed trays */
    --bg-3: #f1efe8;             /* inline code */
    --line: #e4e1d8;
    --line-2: #d6d2c6;
    --field: #8b887f;            /* form-field edges: 3.5:1 on white (WCAG 1.4.11) */

    --ink: #15161a;              /* titles */
    --text: #2f2f2c;             /* reading text */
    --text-2: #3d3d3a;           /* excerpts, deks */
    --text-dim: #64625c;         /* meta, captions: 5.6:1 on paper */

    /* the one accent: ultramarine */
    --accent: #2733d9;
    --accent-hi: #1f2abf;
    --accent-line: #c9cdf5;
    --accent-wash: #eef0fd;

    /* names the post-body SVG figures read */
    --paper: var(--bg);
    --surface: var(--bg-1);
    --accent-deep: #1f2abf;
    --hairline: var(--line);
    --hairline-soft: #ece9e1;

    /* verdicts only */
    --ok: #15803d;
    --warn: #b45309;
    --danger: #b91c1c;

    /* code: the one dark surface family, each block sets its own ground */
    --code-bg: #1b1c21;
    --code-fg: #e6e5df;
    --code-dim: rgba(230, 229, 223, 0.6);
    --code-accent: #aab3f6;

    --display: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
    --sans: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
    --label: 'Space Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    --r: 3px;                    /* one radius: photos, boxes, buttons */
    --ease: cubic-bezier(0.22, 1, 0.36, 1);

    /* layout */
    --shell: 1240px;             /* 1184 of content at 28px gutters */
    --gutter: 28px;
    --col-gap: 32px;
    --row-gap: 72px;
    --measure: 760px;            /* post column, ~75 characters at 18px */
    --rail: 264px;               /* TOC rail at >= 1180px */
    --nav-h: 64px;

    /* type floor */
    --t-label: 0.8125rem;        /* 13px: labels, meta */
    --t-small: 0.875rem;         /* 14px */
    --t-body: 1.125rem;          /* 18px: post body */
}

/* ── 2. Base ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; background: var(--bg); color-scheme: light; scroll-padding-top: 88px; }
/* clip, not hidden: sticky still works and no scroll container is created */
html, body { overflow-x: clip; }

body {
    font-family: var(--sans);
    font-size: 1rem; line-height: 1.6;
    color: var(--text); background: var(--bg);
    min-height: 100vh;
    display: flex; flex-direction: column;   /* sticky footer */
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
body > main { flex: 1 0 auto; width: 100%; }

::selection { background: #dde0fb; color: var(--ink); }

img, svg, video { max-width: 100%; height: auto; }
img { display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
input, textarea { font: inherit; }

.skip-link {
    position: absolute; top: -40px; left: 0; z-index: 10001;
    transform: translateY(-100%);
    background: var(--accent); color: #fff; padding: 10px 18px;
    font: 400 var(--t-label)/1.3 var(--label); text-transform: uppercase; text-decoration: none;
    transition: transform 0.15s;
}
.skip-link:focus { transform: translateY(48px); outline: none; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.bl-shell { max-width: var(--shell); margin: 0 auto; padding: 0 var(--gutter); width: 100%; }

/* The display face, one idiom everywhere: Space Grotesk at its regular
   weight, titles in sentence case. */
.bl-h1, .bl-lead-title, .bl-shelf-h, .pc-title, .mostread-n, .mostread-title,
.bl-month-h, .res-group-h, .nl-title, h1.post-title, .post-body h2, .post-body h3,
.post-cta h2, .post-pag-title, .post-author-name {
    font-family: var(--display); font-weight: 400; color: var(--ink);
    letter-spacing: -0.01em;
}

/* The label idiom: Space Mono, uppercase. Tags, bylines, tabs, buttons. */
.bl-tag, .chip, .bl-rss, .pc-kicker, .pc-meta, .bl-byline, .bl-lead-kicker,
.bl-sec-h, .bl-sec-meta, .bl-shelf-all, .bl-stacks-h, .bl-stacks-list a,
.bl-crumbs, .bl-head-meta, .bl-count, .post-crumbs, .post-meta, .post-hero figcaption,
.post-pag-dir, .toc-top, .readlink, .btn, .mostread-meta, .res-n, .code-lang,
.post-related-h, .post-author-role, .post-toc--inline summary, .mob-cta-txt,
.nl-msg, .bl-discovery button {
    font-family: var(--label); font-weight: 400; text-transform: uppercase; letter-spacing: 0.02em;
}

/* ── 4. Shared pieces ───────────────────────────────────────────────────── */

/* Block label (tag() in blog-chrome.js): "In short", "On this page",
   "Written by", "Try it", "Fraud Brief". */
.bl-tag {
    display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px;
    font-size: var(--t-label); line-height: 1.4; color: var(--ink);
}
.bl-tag-meta { margin-left: auto; color: var(--text-dim); }
.bl-tag-meta a { color: inherit; }
.bl-rule { border: 0; border-top: 1px solid var(--line); margin: 0 0 18px; }

/* Read link: "Open the scanner", "Get an API key", the author's links. */
.readlink {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: var(--t-label); color: var(--ink);
    text-decoration: underline; text-decoration-color: var(--accent);
    text-underline-offset: 5px; text-decoration-thickness: 1px;
    transition: color 0.15s;
}
.readlink:hover { color: var(--accent); }

/* Avatar: a round photo, or the initials mark until one exists. */
.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0; border-radius: 50%; overflow: hidden; object-fit: cover;
    width: 28px; height: 28px; background: var(--bg-3);
}
.avatar--20 { width: 20px; height: 20px; }
.avatar--22 { width: 22px; height: 22px; }
.avatar--28 { width: 28px; height: 28px; }
.avatar--40 { width: 40px; height: 40px; }
.avatar--64 { width: 64px; height: 64px; }
.avatar--initials {
    color: var(--ink); font: 400 0.75rem/1 var(--label); letter-spacing: 0;
}
.avatar--20.avatar--initials { font-size: 0.5rem; }
.avatar--64.avatar--initials { font-size: 1.1rem; }

/* Meta separator: a middle dot. */
.dot { display: inline-block; flex-shrink: 0; color: var(--text-dim); }
.dot::before { content: '\00b7'; content: '\00b7' / ''; }

/* Section tabs (chip() in blog-chrome.js): the label row under the masthead.
   The current one is ink with an accent rule under it. */
.bl-tabs {
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    margin-top: 40px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.section-nav { display: flex; align-items: center; gap: 4px 28px; flex-wrap: wrap; min-width: 0; }
.chip {
    position: relative; display: inline-flex; align-items: baseline; gap: 7px;
    padding: 16px 0 15px;
    font-size: var(--t-label); line-height: 1.3;
    color: var(--text-dim); text-decoration: none; white-space: nowrap;
    transition: color 0.15s;
}
.chip:hover { color: var(--ink); }
.chip-n { font-size: 0.75rem; color: var(--text-dim); }
.chip--current { color: var(--ink); }
.chip--current::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -1px;
    height: 2px; background: var(--accent);
}
.bl-rss { flex-shrink: 0; align-self: flex-start; padding: 16px 0 15px; font-size: var(--t-label); line-height: 1.3; color: var(--text-dim); text-decoration: none; }
.bl-rss:hover { color: var(--ink); }

/* Buttons: flat, mono, square-cornered. */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 46px; padding: 12px 22px;
    font-size: var(--t-label); line-height: 1.2;
    text-decoration: none; text-align: center; white-space: nowrap;
    border: 1px solid transparent; border-radius: var(--r);
    cursor: pointer; background: transparent; color: inherit;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn svg { flex-shrink: 0; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); color: #fff; }
.btn--ghost, .btn--ghost-on-dark { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn--ghost:hover, .btn--ghost-on-dark:hover { border-color: var(--ink); color: var(--ink); }
.btn--small { min-height: 38px; padding: 8px 16px; }
.btn[disabled], .btn:disabled { opacity: 0.6; cursor: default; }

/* The page keeps its room above the footer. */
body > main#main-content { padding-bottom: 104px; }

/* Reading progress, created by blog.js on posts. */
.read-progress {
    position: fixed; top: 0; left: 0; z-index: 1000;
    width: 100%; height: 2px; background: var(--accent);
    transform: scaleX(0); transform-origin: 0 50%; pointer-events: none;
}

/* Newsletter: a bordered box, copy left, form right. */
.nl {
    display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    column-gap: 64px; align-items: center;
    margin-top: 112px; padding: 44px 48px;
    background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r);
}
.nl > .bl-tag, .nl-title, .nl-sub { grid-column: 1; }
.nl > .bl-tag { color: var(--accent); }
.nl > .bl-tag .bl-tag-meta { margin-left: 0; }
.nl-title { margin-top: 14px; font-size: clamp(1.6rem, 2.6vw, 2.15rem); line-height: 1.15; text-wrap: balance; }
.nl-sub { margin-top: 12px; font-size: 1rem; line-height: 1.6; color: var(--text-2); max-width: 52ch; }
.nl-form { grid-column: 2; grid-row: 1 / span 3; display: flex; gap: 10px; align-self: center; }
.nl-form[hidden], .bl-empty[hidden] { display: none; }
.nl-msg { grid-column: 2; font-size: var(--t-label); color: var(--text-dim); text-transform: none; }
.nl-msg:empty { display: none; }
.nl-msg.is-ok { color: var(--ok); }
.nl-msg.is-err { color: var(--danger); }
.nl-form .btn { flex-shrink: 0; }

/* The one input style: newsletter, index search, /blog/all search. */
.field, .nl-input {
    flex: 1 1 auto; min-width: 0; height: 46px; padding: 0 16px;
    background: #fff; color: var(--ink); border: 1px solid var(--field); border-radius: var(--r);
    font-size: 1rem;
}
.field::placeholder, .nl-input::placeholder { color: var(--text-dim); opacity: 1; }
.field:focus-visible, .nl-input:focus-visible { border-color: var(--accent); }

/* ── 5. Cards ───────────────────────────────────────────────────────────── */
/* <a class="pc"> is the whole card (one link, no nested anchors): the 16:9
   photo, the section as an underlined label, the title, the excerpt and the
   byline row (author · date · read time). The container lays them out. */
.pc { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; color: inherit; text-decoration: none; }
.pc-media {
    display: block; align-self: stretch; aspect-ratio: 16 / 9; overflow: hidden;
    border-radius: var(--r); background: var(--bg-2);
}
.pc-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.pc-media, .bl-lead-media, .post-hero-frame { position: relative; }
.pc-media::after, .bl-lead-media::after, .post-hero-frame::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(20, 20, 19, 0.06);
}
.pc:hover .pc-media img { transform: scale(1.03); }
.pc-kicker {
    display: block; margin-top: 18px;
    font-size: var(--t-label); line-height: 1.3; color: var(--ink);
    text-decoration: underline; text-decoration-color: var(--accent);
    text-decoration-thickness: 1px; text-underline-offset: 4px;
}
.pc > .pc-kicker:first-child { margin-top: 0; }
.pc-title {
    margin-top: 12px; font-size: 1.625rem; line-height: 1.24; text-wrap: balance;
    text-decoration: underline; text-decoration-color: transparent;
    text-decoration-thickness: 2px; text-underline-offset: 5px;
    transition: text-decoration-color 0.15s;
}
.pc > .pc-title:first-child { margin-top: 0; }
.pc:hover .pc-title { text-decoration-color: var(--accent); }
.pc-excerpt {
    margin-top: 10px; font-size: 1rem; line-height: 1.6; color: var(--text-2);
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.pc-meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
    margin-top: 16px; font-size: var(--t-label); line-height: 1.3; color: var(--text-dim);
}
.pc-by { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.pc-meta > :not(:last-child)::after { content: '\00b7'; content: '\00b7' / ''; margin-left: 10px; color: var(--text-dim); }
.pc-meta time, .pc-read { white-space: nowrap; }

/* Under every grid: where the photos' credits and licences are. */
.bl-photo-credits { margin-top: 40px; font-size: 0.75rem; line-height: 1.5; color: var(--text-dim); }
.bl-photo-credits a { color: var(--text-2); text-decoration: underline; text-decoration-color: var(--text-dim); text-underline-offset: 3px; }
.bl-photo-credits a:hover { color: var(--ink); }

/* The grids. Three columns on a desktop, two on a tablet, one on a phone. */
.pc-grid, .pc-list {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--row-gap) var(--col-gap);
}

/* ── 6. Index (/blog) ───────────────────────────────────────────────────── */

.bl-head { padding-top: 64px; }
.bl-head--index {
    display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 28px 72px; align-items: end; padding-top: 64px;
}
.bl-h1 { font-size: clamp(2.6rem, 5vw, 4.4rem); line-height: 1.02; letter-spacing: -0.02em; text-wrap: balance; }
.bl-head--index .bl-h1 { font-size: clamp(2.6rem, 5.2vw, 4.6rem); max-width: 12ch; }
.bl-dek { margin-top: 18px; font-size: 1.125rem; line-height: 1.6; color: var(--text-2); max-width: 62ch; text-wrap: pretty; }
.bl-head--index .bl-dek { margin-top: 0; max-width: 46ch; }

.bl-discovery {
    display: flex; align-items: center; gap: 10px;
    margin-top: 22px; padding: 4px 4px 4px 14px;
    background: #fff; border: 1px solid var(--field); border-radius: var(--r);
    color: var(--text-dim);
}
.bl-discovery:focus-within { border-color: var(--accent); }
.bl-discovery > svg { flex: none; }
.bl-discovery input {
    flex: 1; min-width: 0; height: 42px; padding: 0 4px;
    font-size: 1rem; color: var(--ink); background: none; border: 0;
}
.bl-discovery input::placeholder { color: var(--text-dim); opacity: 1; }
.bl-discovery button {
    flex: none; height: 40px; padding: 0 18px; border: 0; border-radius: 2px;
    background: var(--accent); color: #fff; font-size: var(--t-label); cursor: pointer;
    transition: background-color 0.15s;
}
.bl-discovery button:hover { background: var(--accent-hi); }

/* The featured story: text left, the photo right (the photo comes first on
   a phone). One link to the post: the title, stretched over the block, so
   the photo and the dek click through; the section label sits above it. */
.bl-lead {
    position: relative;
    display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 32px 48px; align-items: center; margin-top: 48px;
}
.bl-lead--solo { grid-template-columns: minmax(0, 1fr); }
.bl-lead-main { min-width: 0; }
.bl-lead-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r); background: var(--bg-2); }
.bl-lead-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.bl-lead:hover .bl-lead-media img { transform: scale(1.02); }
.bl-lead-kicker { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; font-size: var(--t-label); color: var(--text-dim); }
.bl-lead-kicker a {
    position: relative; z-index: 1; color: var(--ink);
    text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; text-decoration-thickness: 1px;
}
.bl-lead-kicker a:hover { color: var(--accent); }
.bl-lead-title { margin-top: 18px; font-size: clamp(2.1rem, 3.6vw, 3.1rem); line-height: 1.08; letter-spacing: -0.015em; text-wrap: balance; }
.bl-lead-title a {
    color: inherit; text-decoration: underline; text-decoration-color: transparent;
    text-decoration-thickness: 2px; text-underline-offset: 7px; transition: text-decoration-color 0.15s;
}
.bl-lead-title a::after { content: ''; position: absolute; inset: 0; }
.bl-lead:hover .bl-lead-title a { text-decoration-color: var(--accent); }
.bl-lead-dek { margin-top: 18px; font-size: 1.1875rem; line-height: 1.55; color: var(--text-2); max-width: 46ch; text-wrap: pretty; }
.bl-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 24px; font-size: var(--t-label); line-height: 1.3; color: var(--text-dim); }
.bl-byline > span { white-space: nowrap; }
.bl-byline > :not(:last-child)::after { content: '\00b7'; content: '\00b7' / ''; margin-left: 10px; }
.bl-byline-name { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
/* the author is a flex box: its own gap already sits before the dot */
.pc-meta > .pc-by::after, .bl-byline > .bl-byline-name::after { margin-left: 2px; }

/* Section heads on the index (Latest, Most read) and after a post (Keep
   reading): a mono label, then a hairline to the edge. */
.bl-sec-head {
    display: flex; align-items: center; gap: 16px;
    margin-bottom: 32px;
}
.bl-sec-head::after { content: ''; order: 1; flex: 1 1 auto; height: 1px; background: var(--line); }
.bl-sec-h { font-size: var(--t-label); line-height: 1.3; color: var(--ink); white-space: nowrap; }
.bl-sec-meta { order: 2; font-size: var(--t-label); color: var(--text-dim); white-space: nowrap; }
.bl-latest { margin-top: 96px; }

/* Most read: a real ranking, so it is numbered. Four across. */
.bl-mostread { margin-top: 104px; }
.mostread { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px var(--col-gap); }
.mostread a {
    display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; align-items: start;
    padding-top: 16px; border-top: 1px solid var(--line);
    color: inherit; text-decoration: none;
}
.mostread-n { grid-row: 1 / span 2; font-size: 2.25rem; line-height: 0.95; color: var(--accent); font-variant-numeric: tabular-nums; }
.mostread-title {
    font-size: 1.125rem; line-height: 1.3; color: var(--ink);
    text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: 1px; text-underline-offset: 4px;
    transition: text-decoration-color 0.15s;
}
.mostread a:hover .mostread-title { text-decoration-color: var(--accent); }
.mostread-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 8px; font-size: 0.75rem; color: var(--text-dim); }

/* Section shelves: name + one line + "All N articles", then three cards. */
.bl-shelf { margin-top: 112px; }
.bl-shelf-head {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px 32px;
    margin-bottom: 32px; padding-bottom: 18px; border-bottom: 1px solid var(--line);
}
.bl-shelf-h { font-size: clamp(1.75rem, 2.6vw, 2.25rem); line-height: 1.1; letter-spacing: -0.015em; }
.bl-shelf-h a { color: inherit; text-decoration: none; transition: color 0.15s; }
.bl-shelf-h a:hover { color: var(--accent); }
.bl-shelf-sub { grid-column: 1; margin-top: 10px; font-size: 1rem; line-height: 1.55; color: var(--text-2); max-width: 60ch; }
.bl-shelf-all {
    grid-column: 2; grid-row: 1 / span 2; align-self: end;
    font-size: var(--t-label); color: var(--ink); white-space: nowrap;
    text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 5px; text-decoration-thickness: 1px;
}
.bl-shelf-all::after { content: ' \2192'; content: ' \2192' / ''; }
.bl-shelf-all:hover { color: var(--accent); }

/* Integration guides by framework: the guides shelf's last row and the top
   of /blog/guides. Real destinations, so they are tappable chips. */
.bl-stacks { margin-top: 48px; }
.bl-stacks-h { font-size: var(--t-label); line-height: 1.4; color: var(--text-dim); }
.bl-stacks-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; list-style: none; }
.bl-stacks-list a {
    display: inline-flex; align-items: center; min-height: 36px; padding: 6px 14px;
    font-size: 0.75rem; color: var(--ink); text-decoration: none;
    border: 1px solid var(--line-2); border-radius: var(--r);
    transition: border-color 0.15s, color 0.15s;
}
.bl-stacks-list a:hover { border-color: var(--accent); color: var(--accent); }

/* ── 7. Hubs and the archive ────────────────────────────────────────────── */

.bl-crumbs { font-size: var(--t-label); color: var(--text-dim); }
.bl-crumbs a { color: inherit; text-decoration: none; }
.bl-crumbs a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); }
.bl-head .bl-crumbs + .bl-h1 { margin-top: 18px; }
.bl-note {
    margin-top: 20px; max-width: 74ch; padding-left: 16px;
    border-left: 2px solid var(--accent);
    font-size: 0.9375rem; line-height: 1.6; color: var(--text-2);
}
.bl-note strong { color: var(--ink); font-weight: 600; }
.bl-head-meta { display: flex; flex-wrap: wrap; gap: 4px 22px; margin-top: 22px; font-size: var(--t-label); color: var(--text-dim); }
.bl-head + .bl-tabs { margin-top: 40px; }
.bl-tabs + .bl-stacks { margin-top: 32px; }
.bl-tabs ~ .pc-grid, .bl-stacks ~ .pc-grid { margin-top: 48px; }

/* blog.js search: after the card layout, so the hidden state wins the tie */
.pc.is-hidden { display: none; }

/* /blog/all */
.bl-toolbar {
    display: flex; align-items: center; gap: 12px;
    margin-top: 32px; padding: 0 16px;
    background: #fff; border: 1px solid var(--field); border-radius: var(--r);
    color: var(--text-dim);
}
.bl-toolbar:focus-within { border-color: var(--accent); }
.bl-toolbar > svg { flex: none; }
.bl-search {
    flex: 1; min-width: 0; height: 52px; padding: 0;
    font-size: 1rem; color: var(--ink); background: none; border: 0;
}
.bl-search::placeholder { color: var(--text-dim); opacity: 1; }
.bl-count { flex-shrink: 0; font-size: var(--t-label); color: var(--text-dim); white-space: nowrap; }
.bl-month { margin-top: 72px; }
.bl-month.is-empty { display: none; }
.bl-month-h {
    margin-bottom: 32px; padding-bottom: 14px; border-bottom: 1px solid var(--line);
    font-size: 1.75rem; line-height: 1.2;
}
.bl-empty { padding: 48px 0; font-size: 1rem; color: var(--text-dim); }

/* ── 8. Resources ───────────────────────────────────────────────────────── */

.res-group {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
    gap: 24px 48px; margin-top: 88px; padding-top: 24px;
    border-top: 1px solid var(--line);
}
.bl-head + .res-group { margin-top: 64px; }
.res-group-h { font-size: 1.9rem; line-height: 1.1; letter-spacing: -0.015em; }
.res-group-sub { margin-top: 10px; font-size: 0.9375rem; line-height: 1.55; color: var(--text-2); max-width: 32ch; }
.res-list { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; align-content: start; }
.res-item {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; align-items: baseline;
    padding: 18px 0 19px; border-bottom: 1px solid var(--line);
    color: inherit; text-decoration: none;
}
.res-list li:nth-child(-n+2) .res-item { padding-top: 4px; }
.res-name {
    font: 400 1.1875rem/1.3 var(--display); color: var(--ink);
    text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; text-decoration-thickness: 1px;
    transition: text-decoration-color 0.15s;
}
.res-item:hover .res-name { text-decoration-color: var(--accent); }
.res-n { font-size: 0.75rem; color: var(--text-dim); white-space: nowrap; }
.res-desc { grid-column: 1 / -1; margin-top: 6px; font-size: 0.9375rem; line-height: 1.55; color: var(--text-2); }

/* ── 9. Post ────────────────────────────────────────────────────────────── */

/* Header: crumbs, then the title + byline (two thirds) beside the dek. */
header.post-head { padding: 56px 0 0; }
.post-head-inner { max-width: var(--shell); margin: 0 auto; padding: 0 var(--gutter); }
.post-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: var(--t-label); color: var(--text-dim); }
.post-crumbs a { color: inherit; text-decoration: none; }
.post-crumbs a:last-child {
    color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent);
    text-underline-offset: 4px; text-decoration-thickness: 1px;
}
.post-crumbs a:hover { color: var(--accent); }
.crumb-sep { color: var(--line-2); }
.post-head-grid {
    display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 24px 64px; align-items: end; margin-top: 28px;
}
.post-head-main { min-width: 0; }
h1.post-title { font-size: clamp(2.4rem, 4.8vw, 4.2rem); line-height: 1.04; letter-spacing: -0.02em; text-wrap: balance; }
p.post-dek { font-size: 1.25rem; line-height: 1.55; color: var(--text-2); text-wrap: pretty; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 28px; font-size: var(--t-label); line-height: 1.35; color: var(--text-dim); }
.post-meta-name { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; text-decoration-thickness: 1px; }
.post-meta-name:hover { color: var(--accent); }
.post-meta time, .post-meta > span { white-space: nowrap; }

/* The lead photo: the full shell width, credited underneath. */
.post-hero { max-width: var(--shell); margin: 48px auto 0; padding: 0 var(--gutter); }
.post-hero-frame { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r); background: var(--bg-2); }
.post-hero-frame img { width: 100%; height: 100%; object-fit: cover; }
.post-hero figcaption { margin-top: 12px; font-size: 0.75rem; line-height: 1.5; color: var(--text-dim); text-transform: none; letter-spacing: 0; }
.post-hero figcaption a { color: var(--text-2); text-decoration: underline; text-decoration-color: var(--text-dim); text-underline-offset: 3px; }
.post-hero figcaption a:hover { color: var(--ink); text-decoration-color: var(--accent); }

/* Layout: the article on the shell's left edge, under the title and the
   photo, and the TOC rail on its right edge at >= 1180; one column below. */
.post-layout {
    max-width: var(--shell);
    margin: 0 auto; padding: 64px var(--gutter) 0;
    display: grid; grid-template-columns: minmax(0, var(--measure)) var(--rail);
    justify-content: space-between; column-gap: 64px; align-items: start;
}
.post-layout > * { min-width: 0; }
article.post-body { grid-column: 1; }
aside.post-toc {
    grid-column: 2; grid-row: 1;
    position: sticky; top: calc(var(--nav-h) + 36px);
    max-height: calc(100vh - var(--nav-h) - 64px); overflow-y: auto; padding-bottom: 8px;
}
.post-toc .bl-tag { margin-bottom: 14px; color: var(--text-dim); }
.toc { list-style: none; }
.toc a {
    display: block; padding: 7px 0 7px 14px; border-left: 1px solid var(--line);
    font-size: var(--t-small); line-height: 1.4; color: var(--text-dim); text-decoration: none;
    transition: color 0.15s, border-color 0.15s;
}
.toc a:hover { color: var(--ink); }
.toc a.is-active { color: var(--ink); border-left: 2px solid var(--accent); padding-left: 13px; }
.toc-top { display: inline-block; margin-top: 18px; padding-left: 14px; font-size: 0.75rem; color: var(--text-dim); text-decoration: none; }
.toc-top:hover { color: var(--ink); }
.post-toc--inline {
    display: none; margin-bottom: 2.4rem; padding: 14px 20px;
    background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r);
}
.post-toc--inline summary {
    display: flex; align-items: center; gap: 10px; min-height: 30px;
    cursor: pointer; list-style: none; font-size: var(--t-label); color: var(--ink);
}
.post-toc--inline summary::-webkit-details-marker { display: none; }
.post-toc--inline summary::after {
    content: ''; margin-left: auto; width: 8px; height: 8px;
    border: solid var(--text-dim); border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg) translateY(-2px); transition: transform 0.2s var(--ease);
}
.post-toc--inline[open] summary::after { transform: rotate(225deg) translateY(-2px); }
.post-toc--inline .toc { margin-top: 10px; }
.post-body .toc { margin: 10px 0 0; padding-left: 0; }
.post-body .toc li + li { margin-top: 0; }
.post-body .toc a { color: var(--text-dim); text-decoration: none; }
.post-body .toc a:hover, .post-body .toc a.is-active { color: var(--ink); }
.post-toc--inline .toc-top { display: none; }

/* Body typography. */
.post-body { font-size: var(--t-body); line-height: 1.7; color: var(--text); }
.post-body > :first-child { margin-top: 0; }
.post-body h2 { margin: 3.4rem 0 1rem; scroll-margin-top: 104px; font-size: 2rem; line-height: 1.15; letter-spacing: -0.015em; text-wrap: balance; }
.post-body h3 { margin: 2.4rem 0 0.6rem; scroll-margin-top: 104px; font-size: 1.45rem; line-height: 1.25; }
.post-body h4 { margin: 1.8rem 0 0.5rem; font: 400 var(--t-label)/1.4 var(--label); text-transform: uppercase; letter-spacing: 0.02em; color: var(--ink); scroll-margin-top: 104px; }
.post-body p, .post-body ul, .post-body ol { margin-bottom: 1.4rem; }
.post-body strong { font-weight: 650; color: var(--ink); }
.post-body em { font-style: italic; }
.post-body p a, .post-body li a, .post-body td a, .post-body th a, .post-body dd a, .post-body dt a,
.post-body blockquote a, .post-body figcaption a, .post-body h2 a, .post-body h3 a, .post-body h4 a {
    color: var(--ink); text-decoration: underline;
    text-decoration-color: var(--accent); text-underline-offset: 4px; text-decoration-thickness: 1px;
    transition: color 0.15s;
}
.post-body p a:hover, .post-body li a:hover, .post-body td a:hover, .post-body dd a:hover,
.post-body blockquote a:hover, .post-body figcaption a:hover { color: var(--accent); }
.post-body ul, .post-body ol { padding-left: 1.35rem; }
.post-body li + li { margin-top: 0.5rem; }
.post-body ul li::marker { color: var(--accent); }
.post-body ol li::marker { font: 400 0.9em var(--label); color: var(--accent); }
.post-body li > ul, .post-body li > ol { margin: 0.5rem 0 0; }
.post-body blockquote {
    margin: 2.2rem 0; padding: 2px 0 2px 22px; border-left: 2px solid var(--accent);
    font: 400 1.45rem/1.4 var(--display); color: var(--ink); letter-spacing: -0.01em;
}
.post-body blockquote p { margin: 0; }
.post-body blockquote p + p { margin-top: 0.6rem; }
.post-body blockquote cite { display: block; margin-top: 0.7rem; font: 400 var(--t-label)/1.4 var(--label); font-style: normal; text-transform: uppercase; color: var(--text-dim); }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 3rem 0; }
.post-body code {
    font-family: var(--mono); font-size: max(0.75rem, 0.84em); font-weight: 450; font-variant-ligatures: none;
    padding: 0.12em 0.38em; border-radius: var(--r);
    background: var(--bg-3); color: #2b2c33; box-shadow: inset 0 0 0 1px var(--line);
}
.post-body small { font-size: var(--t-label); }
.post-body figcaption { font-size: var(--t-small); line-height: 1.5; color: var(--text-dim); }
.post-body kbd { font-family: var(--mono); font-size: 0.85em; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0.05em 0.4em; color: var(--ink); }

/* Long unbreakable tokens must break rather than widen a phone's layout. */
.post-body p, .post-body li, .post-body td, .post-body th, .post-body dd, .post-body dt,
.post-body h2, .post-body h3, .post-body figcaption, .post-body blockquote,
.pc-title, .pc-excerpt, .post-title, .post-dek, .bl-lead-title, .res-name, .res-desc { overflow-wrap: anywhere; }
.post-body code:not(pre code) { overflow-wrap: anywhere; word-break: break-word; }
.post-body pre code { white-space: pre; }
.post-body img, .post-body svg, .post-body video, .post-body iframe { max-width: 100%; height: auto; }
/* break-word, not anywhere, inside the table scroller: `anywhere` makes a
   one-character min-content and split "Residential" at 390px (measured). */
.post-table td, .post-table th { overflow-wrap: break-word; }

/* Code blocks. The copy button is in the HTML. */
.code {
    margin: 2rem 0; border-radius: var(--r); overflow: hidden;
    background: var(--code-bg); color: var(--code-fg); border: 1px solid var(--line);
}
.code-head {
    display: flex; justify-content: space-between; align-items: center;
    height: 40px; padding: 0 10px 0 16px;
    border-bottom: 1px solid var(--line);
}
.code-lang { font-size: 0.75rem; color: var(--code-dim); }
.code-copy {
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 28px; padding: 0 10px; cursor: pointer;
    border: 1px solid var(--line-2); border-radius: var(--r);
    background: transparent; color: var(--code-fg);
    font: 400 0.75rem/1 var(--label); text-transform: uppercase; letter-spacing: 0.02em;
    transition: border-color 0.15s, color 0.15s;
}
.code-copy:hover { border-color: var(--code-fg); }
/* 44px hit area around the 28px button */
.code .code-copy::after {
    content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 100%; height: 100%; min-width: 44px; min-height: 44px;
}
.code-copy.is-copied { border-color: rgba(170, 179, 246, 0.6); color: var(--code-accent); }
.code-copy::before {
    content: ''; display: none; width: 16px; height: 16px; flex-shrink: 0;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e6e5df' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='11' height='11' rx='2'/%3E%3Cpath d='M5 15V5a2 2 0 0 1 2-2h10'/%3E%3C/svg%3E");
}
.code-copy.is-copied::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23aab3f6' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E");
}
.code pre {
    margin: 0; padding: 18px 20px; overflow-x: auto; -webkit-overflow-scrolling: touch;
    tab-size: 2; font-family: var(--mono); font-size: 0.86rem; font-weight: 400; line-height: 1.65;
    font-variant-ligatures: none;   /* `===` must read as three characters, not a glyph */
    color: var(--code-fg); scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}
.code pre::-webkit-scrollbar { height: 6px; }
.code pre::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 3px; }
.code pre::-webkit-scrollbar-track { background: transparent; }
.code pre code {
    display: block; min-width: 0; white-space: pre;
    background: none; box-shadow: none; padding: 0; border-radius: 0;
    color: inherit; font-size: inherit; font-family: inherit; font-weight: inherit;
}

/* Tables: a raised box that scrolls; semantic colour never alone. */
.post-table {
    overflow-x: auto; margin: 2rem 0; -webkit-overflow-scrolling: touch;
    background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r);
    scrollbar-width: thin;
}
.post-table.is-scrollable {
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent);
}
.post-table table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 0.94rem; line-height: 1.5; }
.post-table caption { caption-side: top; text-align: left; padding: 14px 16px 0; font: 400 0.75rem/1.4 var(--label); text-transform: uppercase; color: var(--text-dim); }
.post-table th {
    text-align: left; padding: 12px 16px; white-space: nowrap;
    font: 400 0.75rem/1.4 var(--label); text-transform: uppercase; letter-spacing: 0.02em; color: var(--text-dim);
    border-bottom: 1px solid var(--line-2); background: var(--bg-1);
}
.post-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--text); }
.post-table tr:last-child td { border-bottom: 0; }
.post-table td:first-child { color: var(--ink); font-weight: 600; }
.post-table td[data-num] { font-family: var(--mono); font-size: 0.88em; font-variant-numeric: tabular-nums; }
.post-table td.fired { color: var(--ok); font-weight: 600; }
.post-table td.missed { color: var(--danger); font-weight: 600; }
.post-table td code { white-space: nowrap; }

/* Callouts: a raised box with an accent leading rule. */
.callout {
    margin: 2rem 0; padding: 18px 22px;
    font-size: 1rem; line-height: 1.65; color: var(--text);
    background: var(--bg-1); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r);
}
.callout > :last-child { margin-bottom: 0; }
.callout p { margin-bottom: 0.7rem; }
.callout-label { display: block; margin-bottom: 6px; font: 400 0.75rem/1.4 var(--label); text-transform: uppercase; letter-spacing: 0.02em; color: var(--accent); }
.callout--warn { background: #fffaf2; border-color: rgba(180, 83, 9, 0.25); border-left-color: var(--warn); }
.callout--warn .callout-label { color: var(--warn); }
.callout--warn code { background: rgba(242, 183, 91, 0.1); box-shadow: inset 0 0 0 1px rgba(242, 183, 91, 0.25); color: #7c3a06; }
/* An API-output excerpt. Signal spellings in it are the real API's
   (proxied, dch) — never renamed. */
.callout--verdict {
    background: var(--code-bg); color: var(--code-fg); border: 1px solid var(--line); border-left: 3px solid var(--code-accent);
    font-family: var(--mono); font-size: 0.86rem; line-height: 1.6;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.callout--verdict .callout-label { color: var(--code-accent); }
.callout--verdict pre { margin: 0; font: inherit; white-space: pre; color: inherit; }
.callout--verdict code { background: none; box-shadow: none; padding: 0; color: inherit; font-size: inherit; }
.callout--verdict a { color: var(--code-accent); text-decoration-color: rgba(170, 179, 246, 0.5); }

/* Figures: screenshots and the SVG diagrams, framed on a raised box. */
.post-figure { margin: 2.2rem 0; background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.post-figure img, .post-figure svg { display: block; width: 100%; height: auto; }
.post-figure figcaption { padding: 12px 16px; border-top: 1px solid var(--line); line-height: 1.5; }
.post-figure--tight { max-width: 560px; margin-left: auto; margin-right: auto; }

/* In short: the article's conclusions, first. */
.post-tldr {
    margin-bottom: 2.6rem; padding: 24px 28px 26px;
    background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r);
}
.post-tldr .bl-tag { color: var(--accent); }
.post-tldr ul { list-style: none; padding: 0; margin: 14px 0 0; }
.post-tldr li { position: relative; padding-left: 22px; margin: 0; font-size: 1.0625rem; line-height: 1.6; color: var(--ink); }
.post-tldr li + li { margin-top: 0.65rem; }
.post-tldr li::before { content: ''; position: absolute; left: 2px; top: 0.62em; width: 7px; height: 7px; background: var(--accent); }

/* Inline CTA: exactly one per post, between two rules, not a box. */
.post-cta-inline {
    display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 18px;
    margin: 2.8rem 0; padding: 20px 0;
    border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.post-cta-inline .bl-tag { flex-shrink: 0; color: var(--accent); }
.post-cta-inline p { flex: 1 1 260px; margin: 0; font-size: 1rem; line-height: 1.55; color: var(--text-2); }
.post-cta-inline .readlink { flex-shrink: 0; }

/* FAQ: always expanded; the answers are the indexable text. */
.post-faq { margin-top: 4.2rem; padding-top: 8px; border-top: 1px solid var(--line); }
.post-body .post-faq h2 { margin: 1.4rem 0 0.4rem; font-size: 1.75rem; }
.post-faq dl { margin: 0; }
.post-faq dt { padding: 22px 0 6px; font: 400 1.2rem/1.35 var(--display); color: var(--ink); }
.post-faq dd { margin: 0; padding-bottom: 22px; border-bottom: 1px solid var(--line); font-size: 1rem; line-height: 1.7; color: var(--text-2); }
.post-faq dd:last-child { border-bottom: 0; }

/* Author */
.post-author {
    display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 20px;
    margin-top: 3.2rem; padding: 28px 0; border-top: 1px solid var(--line);
}
.post-author-body { display: flex; flex-direction: column; gap: 4px; }
.post-author-body .bl-tag { color: var(--text-dim); margin-bottom: 4px; }
.post-author-name { font-size: 1.35rem; line-height: 1.2; text-decoration: none; }
.post-author-name:hover { color: var(--accent); }
.post-author-role { font-size: 0.75rem; color: var(--text-dim); }
.post-author-bio { margin: 10px 0 0; font-size: 1rem; line-height: 1.6; color: var(--text-2); }
.post-author-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 10px; }

/* Closing card. */
.post-cta {
    margin-top: 2.6rem; padding: clamp(32px, 5vw, 52px) clamp(24px, 4vw, 44px);
    background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r);
    text-align: left;
}
.post-body .post-cta h2 { margin: 0; max-width: 20ch; font-size: clamp(1.9rem, 3.4vw, 2.6rem); line-height: 1.08; letter-spacing: -0.02em; }
.post-cta h2 em { font-style: normal; color: var(--accent); }
.post-cta p { margin: 16px 0 0; max-width: 56ch; font-size: 1rem; line-height: 1.6; color: var(--text-2); }
.post-cta-btns { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* After the article: Keep reading, previous/next, newsletter. */
.post-foot { padding-bottom: 0; }
.post-related { margin-top: 112px; }
.post-related-h { font-size: var(--t-label); line-height: 1.3; color: var(--ink); }
.post-pagination {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
    margin-top: 72px;
}
.post-pag {
    display: flex; flex-direction: column; gap: 8px; min-width: 0;
    padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--r);
    color: inherit; text-decoration: none; transition: border-color 0.15s;
}
.post-pag:hover { border-color: var(--line-2); }
.post-pag--next { text-align: right; align-items: flex-end; }
.post-pag--next:only-child { grid-column: 2; }
.post-pag-dir { font-size: 0.75rem; color: var(--text-dim); }
.post-pag-title { font-size: 1.2rem; line-height: 1.25; overflow-wrap: anywhere; transition: color 0.15s; }
.post-pag:hover .post-pag-title { color: var(--accent); }
.post-foot .nl { margin-top: 88px; }

/* Mobile CTA bar: phones only (<=768), shown by blog.js after 35% scroll. */
.mob-cta-bar { display: none; }

/* ── 10. Responsive ─────────────────────────────────────────────────────── */

/* <=1179: the TOC leaves the rail. */
@media (max-width: 1179px) {
    .post-layout { display: block; }
    article.post-body { max-width: var(--measure); }
    aside.post-toc { display: none; }
    .post-toc--inline { display: block; }
}

/* <=1023: two columns; the heads stack; the featured photo comes first. */
@media (max-width: 1023px) {
    :root { --col-gap: 24px; --row-gap: 48px; }
    .pc-grid, .pc-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bl-head--index { grid-template-columns: minmax(0, 1fr); align-items: start; padding-top: 48px; }
    .bl-head--index .bl-h1 { max-width: 14ch; }
    .bl-lead { grid-template-columns: minmax(0, 1fr); margin-top: 40px; }
    .bl-lead-media { order: -1; }
    .bl-lead-dek { max-width: 60ch; }
    .mostread { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .res-group { grid-template-columns: minmax(0, 1fr); }
    .res-group-sub { max-width: 60ch; }
    .post-head-grid { grid-template-columns: minmax(0, 1fr); align-items: start; margin-top: 22px; }
    .post-head-main { display: contents; }
    h1.post-title { order: 1; }
    p.post-dek { order: 2; }
    .post-meta { order: 3; margin-top: 4px; }
    .post-hero { margin-top: 36px; }
}

@media (max-width: 980px) {
    .nl { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
    .nl-form { grid-column: 1; grid-row: auto; margin-top: 24px; }
    .nl-msg { grid-column: 1; margin-top: 10px; }
}

/* <=768: the mobile CTA bar. */
@media (max-width: 768px) {
    .mob-cta-bar {
        display: flex; align-items: center; gap: 10px; justify-content: space-between;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 950;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, 0.96);
        -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
        border-top: 1px solid var(--line);
        transform: translateY(110%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .mob-cta-bar.on { transform: none; }
    .mob-cta-txt { font-size: 0.75rem; color: var(--text-dim); line-height: 1.4; min-width: 0; flex: 1 1 auto; text-transform: none; letter-spacing: 0; font-family: var(--sans); }
    .mob-cta-txt strong { color: var(--ink); font-weight: 600; }
    .mob-cta-btn { flex: 0 1 auto; min-width: 0; min-height: 44px; }
    .mob-cta-close {
        flex-shrink: 0; width: 44px; height: 44px; margin-right: -8px;
        display: inline-flex; align-items: center; justify-content: center;
        background: transparent; border: 0; border-radius: 50%; color: var(--text-dim);
        font-size: 1.4rem; cursor: pointer;
    }
    .mob-cta-close:hover { color: var(--ink); background: rgba(20, 20, 19, 0.05); }
    body > main#main-content { padding-bottom: 72px; }
    .res-list { grid-template-columns: minmax(0, 1fr); }
    .res-list li:nth-child(2) .res-item { padding-top: 18px; }
}

/* <=1180: the tabs row scrolls sideways, bleeding to the screen edge (the
   Space Mono capitals need ~1120px for one row in English, ~1180 in German). */
@media (max-width: 1180px) {
    .bl-tabs { margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); }
    .section-nav {
        flex: 1 1 auto; flex-wrap: nowrap; overflow-x: auto; gap: 24px;
        padding: 0 var(--gutter); scrollbar-width: none; -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter);   /* snap to the gutter, not the screen edge */
        -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
        mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
    }
    .section-nav::-webkit-scrollbar { display: none; }
    .section-nav::after { content: ''; flex: 0 0 8px; }
    /* 6px of padding each side, cancelled by the margin: room for an inset focus ring */
    .chip { scroll-snap-align: start; flex-shrink: 0; padding: 14px 6px 13px; margin-inline: -6px; min-height: 48px; align-items: center; }
    .bl-rss { display: none; }
}

/* <=640: phone scale, one column. */
@media (max-width: 640px) {
    :root { --gutter: 20px; --row-gap: 44px; }
    .pc-grid, .pc-list { grid-template-columns: minmax(0, 1fr); }
    .pc-title { font-size: 1.4rem; }
    .bl-head { padding-top: 40px; }
    .bl-head--index { padding-top: 32px; gap: 16px; }
    .bl-head--index .bl-h1 { font-size: clamp(2.2rem, 10vw, 2.7rem); }
    .bl-head--index .bl-dek { font-size: 1rem; }
    .bl-discovery { margin-top: 18px; }
    .bl-h1 { font-size: clamp(2.2rem, 10vw, 2.8rem); }
    .bl-dek, .bl-lead-dek { font-size: 1.0625rem; }
    .bl-tabs { margin-top: 32px; }
    .bl-lead { margin-top: 32px; gap: 20px; }
    .bl-lead-title { font-size: clamp(1.9rem, 8.4vw, 2.4rem); margin-top: 14px; }
    .bl-crumbs a, .post-crumbs a { display: inline-block; padding: 12px 0; margin: -12px 0; }
    .bl-lead-kicker a { display: inline-block; padding: 12px 0; margin: -12px 0; }
    .bl-latest { margin-top: 72px; }
    .bl-mostread, .bl-shelf { margin-top: 80px; }
    .mostread { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .mostread a { padding: 16px 0; }
    .bl-shelf-head { grid-template-columns: minmax(0, 1fr); }
    .bl-shelf-all { grid-column: 1; grid-row: auto; display: inline-flex; align-items: center; min-height: 44px; margin-top: 4px; justify-self: start; }
    .bl-stacks-list a { min-height: 44px; }
    .post-toc--inline { padding: 0 20px; }
    .post-toc--inline summary { min-height: 48px; }
    .post-toc--inline[open] { padding-bottom: 14px; }
    .bl-month { margin-top: 56px; }
    .bl-search { height: 48px; }
    .res-group { margin-top: 64px; }
    .res-group-h { font-size: 1.6rem; }

    .nl { margin-top: 80px; padding: 28px 22px; }
    .nl-form { flex-direction: column; }
    .nl-form .btn, .nl-form .field { width: 100%; }

    header.post-head { padding-top: 32px; }
    .post-meta { gap: 6px 14px; }
    .post-meta .dot { display: none; }
    h1.post-title { font-size: clamp(2.1rem, 9.6vw, 2.6rem); line-height: 1.06; }
    p.post-dek { font-size: 1.0625rem; }
    .post-hero { margin-top: 28px; padding: 0; }
    .post-hero-frame { border-radius: 0; }
    .post-hero figcaption { padding: 0 var(--gutter); }
    .post-layout { padding-top: 36px; }
    .post-body { font-size: 1.0625rem; line-height: 1.7; }
    .post-body h2 { font-size: 1.65rem; margin-top: 2.8rem; }
    .post-body h3 { font-size: 1.3rem; }
    .post-body blockquote { font-size: 1.25rem; padding-left: 16px; }
    .post-tldr { padding: 20px 18px; }
    .code pre { padding: 14px; font-size: 0.8rem; }
    /* icon-only copy button: the label is clipped, the glyph shows */
    .code-copy { width: 40px; min-height: 40px; padding: 0; gap: 0; }
    .code-copy::before { display: block; }
    .code-copy-txt { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
    .callout { padding: 14px 16px; font-size: 0.97rem; }
    .callout--verdict { font-size: 0.8rem; }
    .post-table table { font-size: 0.9rem; }
    .post-table th, .post-table td { padding: 10px 12px; }
    .post-cta-btns { flex-direction: column; align-items: stretch; }
    .post-cta-btns .btn { width: 100%; white-space: normal; }
    .post-author { grid-template-columns: 48px minmax(0, 1fr); gap: 14px; }
    .post-author .avatar--64 { width: 48px; height: 48px; font-size: 0.95rem; }
    .post-related { margin-top: 80px; }
    .post-pagination { grid-template-columns: 1fr; margin-top: 56px; }
    .post-pag--next:only-child { grid-column: auto; }
    .post-pag--next { text-align: left; align-items: flex-start; }
}

@media (max-width: 374px) {
    .mob-cta-btn { white-space: normal; text-align: center; max-width: 58%; padding: 9px 12px; }
}

/* ── 11. Focus rings a11y.css cannot get right here ─────────────────── */
/* a11y.css (site-wide, loaded after) forces a 2px ultramarine ring with
   !important on every link, button and input. These places need a
   different one, so these are the sheet's only importance overrides, all
   on :focus-visible: a light ring on the dark code surface (ultramarine is
   ~2:1 there) and inset where a scroller would clip it, no second ring
   inside the search fields (their wrapper draws it). */
.code .code-copy:focus-visible, .code pre:focus-visible, .callout--verdict a:focus-visible, .callout--verdict:focus-visible {
    outline: 2px solid var(--code-accent) !important; outline-offset: -2px !important;
}
.post-body .post-table:focus-visible { outline-offset: -2px !important; }
.bl-discovery input:focus-visible, .bl-toolbar .bl-search:focus-visible { outline-color: transparent !important; }
@media (max-width: 1180px) {
    .section-nav .chip:focus-visible { outline-offset: -3px !important; }
}

/* ── 12. Motion, forced colours, print ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .mob-cta-bar, .post-toc--inline summary::after, .skip-link, .read-progress, .toc a, .chip, .btn, .readlink,
    .pc-title, .pc-media img, .bl-lead-media img, .bl-lead-title a, .bl-shelf-h a, .mostread-title, .res-name,
    .code-copy, .post-pag, .post-pag-title, .bl-stacks-list a, .bl-discovery button, .bl-rss { transition: none; }
    .pc:hover .pc-media img, .bl-lead:hover .bl-lead-media img { transform: none; }
}
@media (forced-colors: active) {
    .chip--current::after, .read-progress { background: CanvasText; }
    .bl-discovery button { border: 1px solid ButtonText; }
    .pc-media, .bl-lead-media, .post-hero-frame, .post-figure, .post-table, .nl, .post-tldr, .post-cta, .callout { border: 1px solid CanvasText; }
    .post-tldr li::before { forced-color-adjust: none; background: CanvasText; }
}
@media print {
    :root {
        --bg: #fff; --bg-1: #fff; --bg-2: #f3f3f3; --bg-3: #f3f3f3; --line: #ccc; --line-2: #999;
        --ink: #000; --text: #111; --text-2: #333; --text-dim: #555; --accent: #2733d9;
        --code-bg: #f5f5f5; --code-fg: #111; --code-dim: #555; --code-accent: #2733d9;
    }
    html, body { background: #fff; color: #000; }
    .mob-cta-bar, .nl, aside.post-toc, .post-toc--inline, .post-cta, .post-cta-inline, .read-progress, .bl-photo-credits { display: none; }
    .post-layout { display: block; padding-top: 24px; }
    .post-body code { color: #111; }
}
