/* ==========================================================================
   SamFolio — design system
   Styled after wise-store.ca: cool light canvas with soft blue/orange glows,
   navy ink, brand-blue pill buttons, Sora headings over Inter body text,
   borderless image tiles and dark gradient category tiles.
   ========================================================================== */

:root {
  /* Color tokens */
  --bg: #FAF9F6;                        /* warm off-white canvas */
  --bg-elevated: #FFFFFF;
  --bg-sunken: #F1EFE9;                 /* image placeholders: a step darker than --bg, same warm hue */
  --text-primary: #0E1A2B;              /* navy ink */
  --text-body: #242A31;                 /* article text: 14.5:1 on white */
  --code-bg: #F8F7F4;                   /* code blocks and inline code */
  /* Text colours are solid (no opacity tricks) and every one is >= 7:1 (WCAG 1.4.6 AAA)
     on the canvas, white and the tinted callout/code surfaces. */
  --text-secondary: #3A4555;            /* 9.2:1 on --bg */
  --text-muted: #424C5A;                /* 8.3:1 on --bg, 7.4:1 on tints */
  --border: #E4E1D9;                    /* warm hairlines: 1.24:1 on --bg */
  --border-strong: #CFCBC1;             /* 1.54:1 on --bg */
  --primary: #1C4B8C;
  --primary-hover: #123566;
  --primary-5: rgba(28, 75, 140, 0.05);
  --primary-10: rgba(28, 75, 140, 0.10);
  --primary-20: rgba(28, 75, 140, 0.20);
  --accent: #F5821F;
  --accent-dark: #8A4A0F;                /* amber for text/markers: 6.3:1 */
  --positive: #047857;

  /* Category tile hues (gradient from navy to each) */
  --tile-0: #1C4B8C;
  --tile-1: #0F766E;
  --tile-2: #2F7D3B;
  --tile-3: #A85C17;
  --tile-4: #6B52C8;
  --tile-5: #B4366B;

  /* Type */
  --font-heading: "Sora", "Inter", system-ui, sans-serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Shape */
  --radius-sm: 0.5rem;
  --radius: 0.75rem;
  --radius-lg: 1rem;
  --radius-pill: 9999px;

  /* Layout */
  --container: 1240px;
  --prose-fs: clamp(1rem, 0.94rem + 0.2vw, 1.0625rem);   /* article text: 16px phones -> 17px desktop */
  --prose: calc(var(--prose-fs) * 44);                    /* article column: 44em (~750px at 17px); lower the 44 to narrow the page */
  --gutter: clamp(20px, 5vw, 72px);
  --sheet-pad: clamp(1.25rem, 4vw, 2.5rem);   /* inner padding of the white article sheet */
  --sheet-inset: var(--sheet-pad);

}

/* Reset ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
/* scroll-padding keeps anchors and keyboard focus clear of the sticky header (WCAG 2.2: focus not obscured). */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 8rem; }
small { font-size: inherit; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  /* Soft blue glow top-right, soft orange glow bottom-left, on cool grey. */
  background:
    radial-gradient(1200px 720px at 82% -160px, color-mix(in srgb, #1C4B8C 10%, transparent), transparent 60%),
    radial-gradient(1100px 800px at -10% 100%, color-mix(in srgb, #F5821F 8%, transparent), transparent 55%),
    var(--bg);
  background-repeat: no-repeat;
}
img, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4 { margin: 0; color: var(--text-primary); font-family: var(--font-heading); font-weight: 500; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
::selection { background: var(--primary-20); color: var(--text-primary); }
main:focus { outline: none; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 6px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--bg-elevated); color: var(--text-primary); border: 1px solid var(--border-strong);
  padding: 0.5rem 1rem; border-radius: var(--radius-pill); text-decoration: none; font-weight: 500;
}
.skip-link:focus { top: 0.75rem; }

/* Layout ------------------------------------------------------------------ */
.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: calc(var(--prose) + 2 * var(--gutter)); }
.section { padding-block: clamp(2rem, 5vw, 3.5rem); }
.section--tight { padding-block: 1rem clamp(3rem, 7vw, 6rem); }
.section__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1rem; margin-bottom: 1.75rem; }
.section__title { font-size: clamp(1.5rem, 3vw, 1.875rem); letter-spacing: -0.02em; line-height: 1.2; }
.section__title--spaced { margin-top: 3rem; margin-bottom: 1.25rem; }
.muted { color: var(--text-muted); }
.empty { color: var(--text-muted); font-size: 1.125rem; }
.empty a { color: var(--primary); }

/* Ghost link: brand-blue text with an arrow */
.section__link {
  display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.25rem;
  font-family: var(--font-heading); font-size: 0.9375rem; font-weight: 500; line-height: 1;
  color: var(--primary); text-decoration: none; transition: color 0.15s ease;
}
.section__link:hover { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 0.25em; }

/* Eyebrow: blue small-caps label with a short orange rule */
.eyebrow {
  display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem;
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary);
}
.eyebrow::before { content: ""; flex: none; width: 2rem; height: 1px; background: var(--accent); }
.eyebrow a { text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; text-underline-offset: 0.25em; }

/* Header ------------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 249, 246, 0.9);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.site-header__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding-block: 0.75rem; }

.wordmark { display: inline-flex; align-items: center; gap: 0.625rem; min-width: 0; color: var(--text-primary); text-decoration: none; white-space: nowrap; }
.wordmark__mark {
  display: grid; place-items: center; flex: none; width: 2.25rem; height: 2.25rem;
  border-radius: var(--radius); background: var(--primary); color: #fff;
  font-family: var(--font-heading); font-weight: 800; font-size: 0.875rem; letter-spacing: -0.01em;
}
.wordmark__text { font-family: var(--font-heading); font-weight: 700; font-size: 1.5rem; line-height: 1; letter-spacing: -0.02em; }
.site-header .wordmark { flex: 1; }

.site-search { order: 3; flex: 1 0 100%; min-width: 0; position: relative; }
.site-search__icon { position: absolute; left: 1rem; top: 50%; width: 1.1rem; height: 1.1rem; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.site-search__input,
.search-form__input {
  width: 100%; height: 2.75rem; padding: 0 1.1rem; border-radius: var(--radius-pill);
  border: 1px solid rgba(0, 0, 0, 0.15); background: var(--bg-elevated);
  font: inherit; font-size: 1rem; color: var(--text-primary); transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.site-search__input { padding-left: 2.75rem; }
.site-search__input::placeholder, .search-form__input::placeholder { color: var(--text-muted); }
.site-search__input:focus, .search-form__input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-20); }

.site-nav ul { display: flex; align-items: center; gap: 1.25rem; }
.site-nav a { display: inline-block; padding: 0.5rem 0; font-size: 1rem; color: var(--text-secondary); text-decoration: none; transition: color 0.15s ease; }
.site-nav a:hover { color: var(--primary); }
.site-nav a[aria-current="page"] { color: var(--primary); font-weight: 600; }

.nav-toggle { display: none; width: 2.75rem; height: 2.75rem; border: 0; border-radius: var(--radius-pill); background: transparent; cursor: pointer; position: relative; }
.nav-toggle:hover { background: var(--primary-5); }
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
  content: ""; position: absolute; left: 50%; width: 1.1rem; height: 1.5px; background: var(--text-primary);
  transform: translateX(-50%); transition: transform 0.2s ease;
}
.nav-toggle__bars { top: 50%; }
.nav-toggle__bars::before { top: -5px; }
.nav-toggle__bars::after { top: 5px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateX(-50%) translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateX(-50%) translateY(-5px) rotate(-45deg); }

@media (min-width: 900px) {
  .site-header__inner { flex-wrap: nowrap; gap: 1rem 1.5rem; }
  .site-header .wordmark { flex: none; }
  .site-search { order: 0; flex: 1 1 auto; max-width: 460px; margin-inline: auto; }
}
@media (max-width: 899px) {
  .js .nav-toggle { display: inline-block; }
  .js .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; padding: 0.5rem var(--gutter) 1.25rem; background: var(--bg); border-bottom: 1px solid var(--border); }
  .js .site-nav.is-open { display: block; }
  .js .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .js .site-nav a { display: block; padding: 0.85rem 0; font-size: 1.0625rem; }
  .site-nav ul { gap: 1rem; }
}

/* Buttons & pills ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.375rem;
  min-height: 2.75rem; padding: 0.75rem 1.5rem; border-radius: var(--radius-pill); border: 1px solid transparent;
  font-family: var(--font-heading); font-size: 0.875rem; font-weight: 500; line-height: 1; text-decoration: none; cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-hover); }
.btn--secondary { background: var(--bg-elevated); color: var(--text-primary); border-color: rgba(0, 0, 0, 0.15); }
.btn--secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn--small { min-height: 2.5rem; padding: 0.625rem 1.15rem; }
.btn.is-disabled { opacity: 0.4; pointer-events: none; }
.btn:active { opacity: 0.9; }

.pill-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pill {
  display: inline-block; padding: 0.5rem 1rem; border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong); background: var(--bg-elevated);
  font-size: 0.8125rem; font-weight: 500; color: var(--text-secondary); text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.pill:hover { border-color: var(--primary); color: var(--primary); }
.pill.is-active, .pill[aria-current="page"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.pill--large { padding: 0.65rem 1.35rem; font-size: 0.9375rem; }

/* Hero ---------------------------------------------------------------------- */
.hero { padding-block: clamp(2.5rem, 7vw, 6rem) clamp(1.5rem, 4vw, 3rem); }
.hero--compact { padding-block: clamp(3rem, 8vw, 6rem); }
.hero__title { font-size: clamp(2.25rem, 5.6vw, 4rem); line-height: 1.1; letter-spacing: -0.02em; }
.hero__subtitle { margin-top: 1.5rem; font-size: clamp(1rem, 1.6vw, 1.1875rem); line-height: 1.6; color: var(--text-secondary); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.hero .btn { min-height: 3rem; padding: 0.9rem 1.75rem; font-size: 0.9375rem; }

.page-header { padding-block: clamp(1.5rem, 4vw, 2.5rem) 0.5rem; }
.page-header__title { font-size: clamp(1.75rem, 4vw, 2.5rem); line-height: 1.15; letter-spacing: -0.02em; }
.page-header__intro { margin-top: 0.75rem; max-width: 68ch; font-size: 1rem; line-height: 1.6; color: var(--text-secondary); }
.chip-bar { margin-top: 1.5rem; }

/* Cards: borderless image tiles with a label, title and price-style meta ---- */
.post-grid { display: grid; gap: clamp(1.5rem, 2.4vw, 1.75rem); grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
/* Post cards are white panels. The image runs edge to edge (no padding or margin) and the card's
   rounded corners clip it; only the text block is padded. */
.card {
  position: relative; display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden;
  background: var(--bg-elevated); border-radius: var(--radius-lg);
  transition: transform 0.25s ease;
}
.card:hover { transform: translateY(-2px); }
.card__media { overflow: hidden; margin: 0; border-radius: 0; background: var(--bg-sunken); aspect-ratio: 16 / 10; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.card:hover .card__media img, .card:hover .tile-art::before { transform: scale(1.04); }
.card__body { display: flex; flex-direction: column; gap: 0.5rem; padding: 1.125rem 1.25rem 1.375rem; }
.card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; font-size: 0.75rem; color: var(--text-muted); }
.card__category { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--primary); }
.card__title { font-size: 1.25rem; line-height: 1.3; letter-spacing: -0.006em; transition: color 0.15s ease; }
.card:hover .card__title { color: var(--primary); }
.card__link { text-decoration: none; }
.card__link::after { content: ""; position: absolute; inset: 0; }
.card__link:focus-visible { outline: none; }
.card:has(.card__link:focus-visible) { outline: 2px solid var(--primary); outline-offset: 3px; }
.card__excerpt { font-size: 0.9375rem; line-height: 1.6; color: var(--text-secondary); }

/* Featured post: large image + text, like the "Why us" band */
.card--featured { display: grid; gap: 0; align-items: stretch; padding: 0; }
.card--featured .card__media { aspect-ratio: 16 / 10; }
.card--featured .card__body { gap: 0.875rem; padding: 1.5rem 1.5rem 1.75rem; justify-content: center; }
.card--featured .eyebrow { margin-bottom: 0; }
.card--featured .card__title { font-size: clamp(1.75rem, 3.4vw, 2.5rem); line-height: 1.15; letter-spacing: -0.02em; }
.card--featured .card__excerpt { font-size: 1.0625rem; max-width: 36rem; }
.card--featured .section__link { margin-top: 0.5rem; align-self: flex-start; }
@media (min-width: 900px) {
  .card--featured { grid-template-columns: 1.15fr 1fr; }
  /* the image fills the whole left half of the card, top to bottom */
  .card--featured .card__media { aspect-ratio: auto; height: 100%; min-height: 20rem; }
  .card--featured .card__body { padding: 2.5rem 3rem; }
}

/* Gradient tiles (category tiles, and covers for posts without an image) ---- */
.tile-art { position: relative; --tile: var(--tile-0); background: linear-gradient(135deg, #0E1A2B 0%, var(--tile) 100%); }
.tile-art::before {
  content: attr(data-initials); position: absolute; inset: 0; display: grid; place-items: center; padding-top: 10%;
  font-family: var(--font-heading); font-weight: 800; font-size: clamp(3rem, 9vw, 7.5rem); line-height: 1;
  color: rgba(255, 255, 255, 0.13); transition: transform 0.5s ease;
}
.tile-art--1 { --tile: var(--tile-1); } .tile-art--2 { --tile: var(--tile-2); } .tile-art--3 { --tile: var(--tile-3); }
.tile-art--4 { --tile: var(--tile-4); } .tile-art--5 { --tile: var(--tile-5); }

.tile-grid { display: grid; gap: 0.75rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .tile-grid { gap: 1.75rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); } }
.tile { position: relative; display: flex; flex-direction: column; justify-content: flex-end; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius); color: #fff; text-decoration: none; padding: 1rem; }
@media (min-width: 640px) { .tile { padding: 1.5rem; } }
.tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.2), transparent); }
.tile:hover::before { transform: scale(1.05); }
.tile__name, .tile__count { position: relative; z-index: 1; }
.tile__name { font-family: var(--font-heading); font-weight: 500; font-size: 1rem; line-height: 1.25; color: #fff; }
.tile__count { margin-top: 0.25rem; font-size: 0.75rem; color: rgba(255, 255, 255, 0.9); }
@media (min-width: 640px) { .tile__name { font-size: 1.25rem; } }
.tile:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }

/* Pagination ---------------------------------------------------------------- */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 3rem; }
.pagination__pages { display: none; align-items: center; gap: 0.25rem; color: var(--text-muted); }
.pagination__page { display: inline-grid; place-items: center; min-width: 2.5rem; height: 2.5rem; padding-inline: 0.5rem; border-radius: var(--radius-pill); text-decoration: none; font-family: var(--font-heading); font-weight: 500; font-size: 0.875rem; }
a.pagination__page:hover { background: var(--primary-10); color: var(--primary); }
.pagination__page.is-current { background: var(--primary); color: #fff; }
@media (min-width: 640px) { .pagination__pages { display: flex; } }

/* Search -------------------------------------------------------------------- */
.search-form { display: flex; gap: 0.75rem; margin-top: 1.5rem; max-width: 36rem; }
.search-form__input { flex: 1; height: 3rem; padding: 0 1.4rem; font-size: 1rem; }
.search-summary { margin-bottom: 1.75rem; color: var(--text-muted); }
.result-list { display: grid; gap: 0.75rem; font-size: 1.0625rem; }
.result-list a { color: var(--primary); font-weight: 500; }

/* Post / article ------------------------------------------------------------- */
.post-header { padding-bottom: clamp(1.25rem, 3vw, 2rem); }
.post-title { font-size: clamp(1.625rem, 3.4vw, 2.375rem); line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; }
.post-subtitle { margin-top: 1.25rem; font-size: clamp(1.0625rem, 2vw, 1.3125rem); line-height: 1.55; color: var(--text-secondary); text-wrap: pretty; }
.post-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 0.6rem; align-items: center; margin-top: 1.5rem; font-size: 0.875rem; color: var(--text-muted); }
.post-meta__author { color: var(--text-primary); font-weight: 600; }
.post-reader { display: flex; flex-wrap: wrap; gap: 0.35rem 1.5rem; margin: 0.75rem 0 0; font-size: 0.875rem; color: var(--text-muted); }
.post-reader > div { display: flex; gap: 0.4rem; }
.post-reader dt { font-weight: 600; color: var(--text-primary); }
.post-reader dt::after { content: ":"; }
.post-reader dd { margin: 0; }
.post-cover { margin-bottom: clamp(1.75rem, 3vw, 2.5rem); }
.post-cover figure { margin: 0; }
.post-cover__credit { margin-top: 0.6rem; text-align: right; font-size: 0.75rem; color: var(--text-muted); }
.post-cover__credit a { color: inherit; }
.post-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); background: var(--bg-sunken); }

.post-layout { display: grid; grid-template-columns: minmax(0, 1fr); padding-block: clamp(1.25rem, 4vw, 3rem) clamp(3rem, 6vw, 5rem); }
.post-main { width: 100%; max-width: var(--prose); margin-inline: auto; min-width: 0; }
/* The article: a white sheet. Its text keeps the --prose measure; the sheet adds padding around it. */
.post-sheet {
  max-width: calc(var(--prose) + 2 * var(--sheet-inset)); padding: var(--sheet-inset);
  background: var(--bg-elevated); border-radius: var(--radius-lg);
}
/* On phones the sheet runs edge to edge so the text keeps the full width. */
@media (max-width: 639px) {
  .post-sheet { --sheet-inset: var(--gutter); max-width: none; margin-inline: calc(-1 * var(--gutter)); width: auto; border-radius: 0; }
}
@media (min-width: 1440px) {
  .post-layout { grid-template-columns: minmax(0, 1fr) minmax(0, calc(var(--prose) + 2 * var(--sheet-inset))) minmax(0, 1fr); column-gap: 2rem; }
  .post-main { grid-column: 2; grid-row: 1; }
  .toc--aside { grid-column: 3; grid-row: 1; }
}

.toc { font-size: 0.875rem; }
.toc ol { display: grid; gap: 0.1rem; }
.toc a { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 0.5rem; padding: 0.3rem 0; color: var(--text-muted); text-decoration: none; line-height: 1.5; }
.toc a:hover { color: var(--primary); }
.toc__num { min-width: 1.5em; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-secondary); }
.toc a:hover .toc__num { color: inherit; }
.toc__item--h3 { padding-left: 1rem; }
/* Section titles of the two side columns: real headings (h2) in the site's heading face. */
.toc__title, .rail-section__title { margin-bottom: 0.75rem; font-family: var(--font-heading); font-size: 1.0625rem; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; color: var(--text-primary); }
.toc--aside { display: none; }
@media (min-width: 1180px) {
  .toc--aside { display: block; align-self: start; position: sticky; top: 7rem; max-height: calc(100vh - 9rem); overflow-y: auto; max-width: 15rem; padding-right: 1.5rem; border-right: 1px solid var(--border); }
  .toc--inline { display: none; }
}
.toc--inline { margin-bottom: 2.5rem; padding: 1rem 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.toc--inline summary { cursor: pointer; font-family: var(--font-heading); font-weight: 500; color: var(--text-primary); }
.toc--inline ol { margin-top: 0.75rem; }

/* Article page: "On this page" on the left, the sheet in the middle, tags + related reading on the right.
   The sheet gives up width before the side columns drop below 13rem; under 1180px the columns collapse. */
@media (min-width: 1180px) {
  .post-layout--article { max-width: calc(1440px + 2 * var(--gutter)); align-items: start; }
  .post-layout.post-layout--article { grid-template-columns: minmax(13rem, 1fr) minmax(0, calc(var(--prose) + 2 * var(--sheet-inset))) minmax(13rem, 1fr); column-gap: 2rem; }
  .post-layout--article .toc--aside { grid-column: 1; grid-row: 1; justify-self: end; width: 100%; }
  .post-layout--article .post-main { grid-column: 2; grid-row: 1; }
  .post-layout--article .post-rail { grid-column: 3; grid-row: 1; justify-self: start; }
  .post-layout--article .post-footer { display: none; }   /* the tags live in the right-hand column here */
}

/* Right column: Tags and Related notes take what they need up to 1/4 of the column's height each; Related articles
   takes what is left. A section with nothing to show is not rendered, and nothing is padded out to fill the column. */
.post-rail { display: flex; flex-direction: column; gap: 1.25rem; font-size: 0.875rem; }
.rail-section { display: flex; flex-direction: column; min-height: 0; }
.rail-section__more {
  align-self: flex-start; margin-top: 0.25rem; padding: 0.125rem 0.625rem; border: 1px solid var(--border-strong); border-radius: var(--radius-pill);
  background: var(--bg-elevated); font: inherit; font-weight: 600; line-height: 1.4; color: var(--text-secondary); cursor: pointer;
}
.rail-section__more:hover { border-color: var(--primary); color: var(--primary); }
.rail-more__close, .rail-section__more[aria-expanded="true"] .rail-more__open { display: none; }
.rail-section__more[aria-expanded="true"] .rail-more__close { display: inline; }
.pill-list--small { gap: 0.375rem; }
.pill-list--small .pill { padding: 0.25rem 0.625rem; font-size: 0.75rem; }
.rail-list { display: grid; gap: 0.625rem; }
.rail-list a { display: block; color: var(--text-secondary); text-decoration: none; line-height: 1.4; }
.rail-list a:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 0.2em; }
/* Related articles: the title is the thing to scan, so it is bold. */
.rail-list--articles a { font-weight: 600; color: var(--text-primary); }
.rail-list--articles a:hover { color: var(--primary); }
.rail-list time { display: block; margin-top: 0.125rem; font-size: 0.75rem; color: var(--text-muted); }
.rail-list a.note-link { display: flex; align-items: baseline; gap: 0.45em; overflow-wrap: break-word; }   /* ID beside the title, which wraps on its own */
.rail-list a.note-link > span:last-child { min-width: 0; }
.rail-list .note-id { flex: none; font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.rail-list a:hover .note-id { color: inherit; }

@media (min-width: 1180px) {
  .post-rail {
    --rail-h: calc(100vh - 9rem);
    position: sticky; top: 7rem; width: 100%; max-width: 17rem; max-height: var(--rail-h); gap: 1rem;
    padding-left: 1.5rem; border-left: 1px solid var(--border);
  }
  /* Content height, capped: tags and notes at 1/4 of the column; articles shrink to whatever is left. A body that is cut off
     fades out and gets the "…" button (shown by site.js only when something is hidden). */
  .rail-section--tags, .rail-section--notes { flex: 0 0 auto; max-height: calc(var(--rail-h) / 4); }
  .rail-section--articles { flex: 0 1 auto; }
  .rail-section__body { flex: 0 1 auto; min-height: 0; overflow: hidden; }
  .rail-section.is-clipped .rail-section__body { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.5rem), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 1.5rem), transparent); }
  /* Expanded: this section takes the column (scrolling inside if needed); the others fold to their headings. */
  .post-rail.has-expanded { height: var(--rail-h); }
  .post-rail.has-expanded .rail-section:not(.is-expanded) { flex: 0 0 auto; max-height: none; }
  .post-rail.has-expanded .rail-section:not(.is-expanded) .rail-section__body,
  .post-rail.has-expanded .rail-section:not(.is-expanded) .rail-section__more { display: none; }
  .post-rail.has-expanded .rail-section:not(.is-expanded) .rail-section__title { margin-bottom: 0; }
  .rail-section.is-expanded { flex: 1 1 0; max-height: none; }
  .rail-section.is-expanded .rail-section__body { overflow-y: auto; -webkit-mask-image: none; mask-image: none; padding-right: 0.25rem; }
}
/* Narrower screens: tags and related articles already appear in the footer / "Keep reading", so only the notes follow the article. */
@media (max-width: 1179px) {
  .post-rail { width: 100%; max-width: calc(var(--prose) + 2 * var(--sheet-inset)); margin: 1.5rem auto 0; padding: 1.25rem 1.5rem; background: var(--bg-elevated); border-radius: var(--radius-lg); }
  .rail-section--tags, .rail-section--articles, .rail-section__more { display: none; }
  .post-rail--no-notes { display: none; }
}
@media (max-width: 639px) { .post-rail { max-width: none; } }

.post-footer { margin-top: 3rem; padding-top: 1.75rem; border-top: 1px solid var(--border); }
.author-box { display: flex; gap: 1.25rem; align-items: center; margin-top: 2rem; padding: 1.5rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.author-box__photo { width: 4rem; height: 4rem; border-radius: 50%; object-fit: cover; flex: none; }
.author-box__name { font-family: var(--font-heading); font-weight: 500; font-size: 1.0625rem; color: var(--text-primary); }
.author-box__bio { margin-top: 0.25rem; font-size: 0.9375rem; line-height: 1.6; color: var(--text-secondary); }
.related { border-top: 1px solid var(--border); }

/* Prose (long-form body) ---------------------------------------------------- */
/* 16px on phones to 17px on desktop. Leading follows the measure: 1.65 on short mobile lines, 1.75 on long desktop lines. */
.prose { font-size: var(--prose-fs); line-height: 1.65; color: var(--text-body); overflow-wrap: break-word; }
@media (min-width: 720px) { .prose { line-height: 1.75; } }   /* a longer line needs more leading */
.prose p { text-wrap: pretty; }
.prose > * + * { margin-top: 1.5em; }
.prose p { margin: 0; }
/* Links are underlined in the link colour, so they never rely on colour alone (WCAG 1.4.1). */
.prose a { color: var(--primary); text-decoration: underline; text-decoration-thickness: 0.075em; text-underline-offset: 0.2em; text-decoration-color: currentColor; transition: color 0.15s ease; }
.prose a:hover { color: var(--primary-hover); text-decoration-thickness: 0.125em; }
.prose strong { color: var(--text-primary); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.5em; display: block; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { padding-left: 0.25em; }
.prose li + li { margin-top: 0.5em; }
.prose li::marker { color: var(--accent-dark); }
.prose sup, .prose sub { line-height: 0; }

.prose-heading { position: relative; scroll-margin-top: 7rem; margin-top: 2.5em !important; text-wrap: balance; letter-spacing: -0.02em; }
.prose-heading + * { margin-top: 0.85em !important; }
h2.prose-heading { font-size: clamp(1.5rem, 3vw, 1.875rem); line-height: 1.25; }
h3.prose-heading { font-size: clamp(1.25rem, 2.4vw, 1.5rem); line-height: 1.3; margin-top: 2em !important; }
h4.prose-heading { font-size: 1.125rem; line-height: 1.35; font-weight: 600; }
.prose-heading__anchor { position: absolute; left: -1.1em; top: 0; width: 1em; text-align: center; font-family: var(--font-sans); font-size: 0.75em; color: var(--primary); text-decoration: none !important; opacity: 0; transition: opacity 0.15s ease; }
.prose-heading:hover .prose-heading__anchor, .prose-heading__anchor:focus-visible { opacity: 1; }

.prose :not(pre) > code {
  font-family: var(--font-mono); font-size: 0.85em; padding: 0.15em 0.4em;
  background: var(--code-bg); border: 1px solid var(--border); border-radius: 6px; color: var(--primary-hover);
  overflow-wrap: anywhere;
}

.prose-rule { border: 0; height: 1px; background: var(--border-strong); margin-block: 3em !important; max-width: 6rem; margin-inline: auto; }

/* Figures */
.figure { margin-inline: 0; }
.figure img { width: 100%; height: auto; border-radius: var(--radius); background: var(--bg-sunken); }
.figure figcaption, .math-block figcaption { margin-top: 0.85rem; text-align: center; font-size: 0.875rem; line-height: 1.5; color: var(--text-muted); }
/* Wide images bleed into the sheet's padding, never outside the white sheet. */
.figure--wide { margin-inline: calc(-0.6 * var(--sheet-inset)); }

/* Quote: light italic, centred, with a short orange rule (like a testimonial) */
.pullquote { margin-inline: auto; padding: 0; max-width: 36rem; text-align: center; }
.pullquote::before { content: ""; display: block; width: 2rem; height: 2px; margin: 0 auto 1.5rem; background: var(--accent); }
.pullquote blockquote { margin: 0; font-family: var(--font-sans); font-size: clamp(1.375rem, 2.8vw, 1.75rem); line-height: 1.35; font-style: italic; font-weight: 400; color: var(--text-primary); }
.pullquote figcaption { margin-top: 1rem; font-size: 0.9375rem; color: var(--text-muted); }

/* Callout */
.callout { padding: 1.25rem 1.5rem; border-radius: var(--radius); border: 1px solid var(--primary-20); background: var(--primary-5); font-size: 0.95em; line-height: 1.65; }
.callout--tip { background: rgba(16, 185, 129, 0.08); border-color: rgba(16, 185, 129, 0.28); }
.callout--warning { background: rgba(245, 130, 31, 0.10); border-color: rgba(245, 130, 31, 0.38); }
.callout__title { margin-bottom: 0.5rem; font-family: var(--font-heading); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--primary-hover); }
.callout--tip .callout__title { color: #064E3B; }
.callout--warning .callout__title { color: #6E3A0A; }
.callout__body > * + * { margin-top: 0.75em; }

/* Table */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elevated); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; line-height: 1.55; }
.table-wrap caption { padding: 0.9rem 1.1rem; text-align: left; font-size: 0.8125rem; color: var(--text-muted); caption-side: bottom; }
.table-wrap th, .table-wrap td { padding: 0.8rem 1.1rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.table-wrap thead th { font-family: var(--font-heading); font-weight: 500; color: var(--text-primary); background: var(--primary-5); white-space: nowrap; }
.table-wrap tbody th { font-weight: 600; color: var(--text-primary); }
.table-wrap tbody tr:last-child > * { border-bottom: 0; }

/* Math & embeds */
.math-block { margin-inline: 0; }
.math-block__expr { overflow-x: auto; overflow-y: hidden; padding: 1rem 0.5rem; text-align: center; font-size: 1.1em; }
.math-block__expr:not(:has(.katex)) { font-family: var(--font-mono); font-size: 0.875rem; color: var(--text-muted); white-space: pre-wrap; }
.katex-display { margin: 0; }
/* Mermaid diagrams: the source shows until the browser has drawn it. */
.diagram { margin-inline: 0; }
.diagram__canvas { overflow-x: auto; padding: 1.25rem 1rem; border-radius: var(--radius); background: #FFFFFF; text-align: center; }
.diagram__source { margin: 0; font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.5; color: var(--text-muted); text-align: left; white-space: pre-wrap; }
.diagram__source.is-rendered { font-family: inherit; white-space: normal; text-align: center; }
.diagram__source svg { max-width: 100%; height: auto; }
.diagram figcaption { margin-top: 0.85rem; text-align: center; font-size: 0.875rem; line-height: 1.5; color: var(--text-muted); }
.embed { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--bg-sunken); }
.embed iframe { max-width: 100%; border: 0; }
.embed .responsive-object { position: relative; }
.embed .responsive-object iframe, .embed .responsive-object object, .embed .responsive-object embed { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Code */
.code-block { margin-inline: 0; background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.code-block__bar { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.75rem 0.5rem 1.1rem; background: var(--code-bg); border-bottom: 1px solid var(--border); font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); }
.code-block__label { color: var(--text-primary); font-weight: 500; }
.code-block__lang { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.6875rem; }
.code-block__copy { margin-left: auto; min-height: 2rem; padding: 0.3rem 0.9rem; border: 1px solid rgba(0, 0, 0, 0.15); border-radius: var(--radius-pill); background: var(--bg-elevated); font-family: var(--font-heading); font-size: 0.75rem; font-weight: 500; cursor: pointer; color: var(--text-secondary); transition: border-color 0.15s ease, color 0.15s ease; }
.code-block__copy:hover { border-color: var(--primary); color: var(--primary); }
.code-block pre { margin: 0; padding: 1.1rem 1.25rem; overflow-x: auto; font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.7; color: var(--text-primary); tab-size: 4; -moz-tab-size: 4; }
.code-block pre code { font-family: inherit; font-size: inherit; background: none; border: 0; padding: 0; }

/* Footer -------------------------------------------------------------------- */
.site-footer { margin-top: clamp(2rem, 5vw, 4rem); padding-block: 3rem 2rem; color: var(--text-muted); }
.site-footer__inner { display: grid; gap: 2rem; grid-template-columns: 1fr 1fr; }
.site-footer__brand { grid-column: 1 / -1; }
.site-footer__brand p { margin-top: 0.75rem; max-width: 22rem; font-size: 0.8125rem; line-height: 1.6; }
.site-footer__label { margin-bottom: 0.9rem; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.site-footer__links { display: grid; gap: 0.5rem; font-size: 0.875rem; }
.site-footer__links a { display: inline-block; padding: 0.25rem 0; }
.site-footer__links a { color: var(--text-primary); text-decoration: none; }
.site-footer__links a:hover { color: var(--primary); text-decoration: underline; text-underline-offset: 0.2em; }
.site-footer__legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 1.5rem; margin-top: 2.5rem; padding-top: 1.75rem; border-top: 1px solid var(--border); font-size: 0.75rem; }
.site-footer__legal a { color: var(--text-muted); text-decoration: none; }
.site-footer__legal a:hover { color: var(--primary); }
.site-footer__legal ul { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
@media (min-width: 800px) {
  .site-footer__inner { grid-template-columns: 1.6fr 1fr 1fr 1fr; }
  .site-footer__brand { grid-column: auto; }
}

/* Subscribe: the sign-up band, form controls and the small subscription pages ---------- */
.site-nav a.btn { color: #fff; padding: 0.625rem 1.15rem; font-size: 0.9375rem; }
.site-nav a.btn:hover { color: #fff; }
@media (max-width: 899px) { .js .site-nav a.btn { display: inline-flex; margin-top: 0.5rem; } }

.input {
  width: 100%; height: 3rem; padding: 0 1.4rem; border-radius: var(--radius-pill);
  border: 1px solid rgba(0, 0, 0, 0.15); background: var(--bg-elevated);
  font: inherit; font-size: 1rem; color: var(--text-primary); transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input::placeholder { color: var(--text-muted); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-20); }
.input[aria-invalid="true"] { border-color: #9B2C22; }

.subscribe { padding-block: clamp(2rem, 5vw, 3.5rem) 0; }
.subscribe__panel { max-width: 44rem; margin-inline: auto; padding: clamp(1.5rem, 4vw, 2.5rem); text-align: center; background: var(--bg-elevated); border-radius: var(--radius-lg); }
.subscribe__title { font-size: clamp(1.375rem, 3vw, 1.75rem); letter-spacing: -0.02em; line-height: 1.2; }
.subscribe__lead { margin-top: 0.5rem; color: var(--text-secondary); font-size: 1rem; }
.subscribe__form { margin-top: 1.5rem; text-align: left; }
.subscribe__panel .subscribe__form { max-width: 34rem; margin-inline: auto; }
.subscribe__row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.subscribe__field { flex: 1 1 14rem; min-width: 0; }
.subscribe__row .btn { flex: 0 0 auto; min-height: 3rem; padding-inline: 1.75rem; }
@media (max-width: 479px) { .subscribe__row .btn { flex: 1 1 100%; } }
.subscribe__choices { display: flex; flex-wrap: wrap; gap: 0 1.75rem; margin: 0.75rem 0 0; padding: 0; border: 0; }
.subscribe__panel .subscribe__choices { justify-content: center; }
.subscribe__choices--stack { flex-direction: column; margin-bottom: 1.5rem; }
.subscribe__choices legend { padding: 0; margin-bottom: 0.5rem; font-family: var(--font-heading); font-weight: 500; color: var(--text-primary); }
.check { display: flex; align-items: flex-start; gap: 0.6rem; min-height: 2.75rem; padding-block: 0.6rem; cursor: pointer; font-size: 1rem; color: var(--text-body); }
.check input { flex: none; width: 1.25rem; height: 1.25rem; margin: 0.15rem 0 0; accent-color: var(--primary); cursor: pointer; }
.check small { display: block; font-size: 0.875rem; color: var(--text-muted); }
.subscribe__fine { margin-top: 0.75rem; font-size: 0.8125rem; line-height: 1.6; color: var(--text-muted); text-align: center; }
.subscribe__fine a { color: var(--primary); text-decoration: underline; text-underline-offset: 0.2em; }
/* Feature version of the band: navy-to-blue panel with benefits, form and illustration ------ */
.subscribe__panel--feature {
  position: relative; isolation: isolate; overflow: hidden; max-width: none; margin-inline: 0; text-align: left;
  display: grid; gap: 2rem; align-items: center; padding: clamp(1.5rem, 5vw, 3.5rem);
  color: #fff; border: 0; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #0E1A2B 0%, #123566 55%, #1C4B8C 100%);
}
/* soft glows, like the page background */
.subscribe__panel--feature::before, .subscribe__panel--feature::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; pointer-events: none; }
.subscribe__panel--feature::before { width: 28rem; height: 28rem; left: -9rem; bottom: -14rem; background: radial-gradient(closest-side, rgba(245, 130, 31, 0.28), transparent); }
.subscribe__panel--feature::after { width: 30rem; height: 30rem; right: -8rem; top: -12rem; background: radial-gradient(closest-side, rgba(110, 160, 235, 0.32), transparent); }
.subscribe__panel--feature .subscribe__title { color: #fff; font-size: clamp(1.75rem, 3.4vw, 2.5rem); line-height: 1.12; text-wrap: balance; }
.subscribe__panel--feature .subscribe__lead { margin-top: 0.875rem; max-width: 34rem; font-size: 1.0625rem; line-height: 1.6; color: #E8EEF6; }
.eyebrow--light { margin-bottom: 1rem; color: #fff; }

.subscribe__benefits { display: grid; gap: 0.875rem; margin-top: 1.5rem; padding: 0; list-style: none; }
.subscribe__benefits li { display: flex; align-items: flex-start; gap: 0.875rem; font-size: 0.9375rem; line-height: 1.5; color: #E8EEF6; }
.subscribe__desc { display: block; }
.subscribe__benefits strong { display: block; font-family: var(--font-heading); font-weight: 600; font-size: 1rem; color: #fff; }
@media (max-width: 479px) { .subscribe__desc { display: none; } .subscribe__benefits li { align-items: center; } }
.subscribe__icon { flex: none; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 0.75rem; color: #fff; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); }
.subscribe__icon svg { width: 1.25rem; height: 1.25rem; }

.subscribe__panel--feature .subscribe__form { max-width: 34rem; margin: 1.75rem 0 0; }
.subscribe__panel--feature .subscribe__choices { justify-content: flex-start; }
.subscribe__panel--feature .input { border-color: transparent; }
.subscribe__panel--feature .input:focus { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.45); border-color: #fff; }
.subscribe__panel--feature .btn--primary { background: var(--accent); color: #0E1A2B; font-weight: 600; }
.subscribe__panel--feature .btn--primary:hover { background: #FF9440; }
.subscribe__panel--feature .check { color: #fff; }
.subscribe__panel--feature .check input { accent-color: var(--accent); }
.subscribe__panel--feature .subscribe__fine { text-align: left; color: #E8EEF6; }
.subscribe__panel--feature .subscribe__fine a { color: #fff; }
.subscribe__panel--feature .form-error { color: #FFD1C9; }
.subscribe__panel--feature :focus-visible { outline-color: #fff; }

.subscribe__art { display: grid; place-items: center; }
.subscribe__svg { width: 100%; max-width: 30rem; height: auto; }
.subscribe__float { animation: subscribe-float 6s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
.subscribe__float--b { animation-delay: -3s; }
@keyframes subscribe-float { from { transform: translateY(0); } to { transform: translateY(-7px); } }
@media (prefers-reduced-motion: reduce) { .subscribe__float { animation: none !important; } }

/* Phones: illustration first and compact; desktop: content left, art right */
.subscribe__art { order: -1; }
.subscribe__svg { max-width: 15rem; }
@media (min-width: 640px) { .subscribe__svg { max-width: 20rem; } }
@media (min-width: 960px) {
  .subscribe__panel--feature { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 3rem; }
  .subscribe__art { order: 0; }
  .subscribe__svg { max-width: 30rem; }
}

/* /subscribe/ page: the same feature panel, with room around it */
.subscribe--page { padding-block: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 3vw, 2rem); }

/* Check-your-inbox page: illustration banner, numbered steps, help ----------------------- */
.art-panel {
  position: relative; isolation: isolate; overflow: hidden; display: grid; place-items: center;
  margin: 0 0 1.75rem; padding: 1.25rem 1rem; border-radius: var(--radius);
  background: linear-gradient(135deg, #0E1A2B 0%, #123566 55%, #1C4B8C 100%);
}
.art-panel::before { content: ""; position: absolute; z-index: -1; width: 18rem; height: 18rem; left: -6rem; bottom: -10rem; border-radius: 50%; background: radial-gradient(closest-side, rgba(245, 130, 31, 0.28), transparent); }
.art-panel::after { content: ""; position: absolute; z-index: -1; width: 20rem; height: 20rem; right: -6rem; top: -9rem; border-radius: 50%; background: radial-gradient(closest-side, rgba(110, 160, 235, 0.32), transparent); }
.art-panel__svg { width: 100%; max-width: 21rem; height: auto; }

.steps { counter-reset: step; display: grid; gap: 1.125rem; margin: 1.75rem 0 0; padding: 0; list-style: none; }
.steps li { counter-increment: step; display: flex; align-items: flex-start; gap: 1rem; }
.steps li::before {
  content: counter(step); flex: none; display: grid; place-items: center; width: 2.25rem; height: 2.25rem; margin-top: 0.1rem;
  border-radius: 50%; background: var(--primary); color: #fff; font-family: var(--font-heading); font-weight: 600; font-size: 1rem;
}
.steps strong { display: block; font-family: var(--font-heading); font-weight: 500; font-size: 1.0625rem; color: var(--text-primary); }
.steps span { display: block; margin-top: 0.15rem; font-size: 1rem; line-height: 1.55; color: var(--text-secondary); }
.steps em { font-style: normal; font-weight: 600; color: var(--text-primary); }

.subscribe__actions--row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.help { margin-top: 2rem; padding: 1.25rem 1.5rem; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--border); }
.help__title { font-size: 1.0625rem; }
.help ul { display: grid; gap: 0.5rem; margin: 0.75rem 0 0; padding-left: 1.25rem; list-style: disc; font-size: 1rem; line-height: 1.55; color: var(--text-secondary); }
.help li::marker { color: var(--accent-dark); }
.help a { color: var(--primary); text-decoration: underline; text-underline-offset: 0.2em; }

.subscribe__page { margin-top: 1.5rem; }
.subscribe__page .subscribe__form { margin-top: 0; }
.subscribe__page .subscribe__fine { text-align: left; }
.subscribe__actions { margin-top: 1.5rem; }
.subscribe__actions--divided { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.subscribe__actions--divided p { margin-bottom: 0.75rem; color: var(--text-secondary); }
.form-error { margin-top: 0.6rem; font-size: 0.9375rem; font-weight: 500; color: #9B2C22; }
.form-success { margin: 0 0 1.25rem; padding: 0.75rem 1rem; border-radius: var(--radius-sm); background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.28); color: #064E3B; font-weight: 500; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Small pages (subscribe, confirm, preferences…) use a compact sheet */
.post-sheet.sheet--compact { max-width: 38rem; }
@media (max-width: 639px) { .post-sheet.sheet--compact { max-width: none; } }

/* More contrast, when the OS asks for it ---------------------------------------- */
@media (prefers-contrast: more) {
  :root {
    --text-body: #0E1A2B; --text-secondary: #0E1A2B; --text-muted: #1B2638;
    --border: #5E6773; --border-strong: #3A4555; --primary: #123566; --primary-hover: #0E1A2B;
  }
  .site-header { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom: 1px solid var(--border); }
  .card__media, .figure img, .post-cover img { outline: 1px solid var(--border); }
  /* no border or shadow by default; outline the white shapes for people who ask for more contrast */
  .card, .post-sheet, .subscribe__panel { outline: 1px solid var(--border); outline-offset: -1px; }
}

/* Reduced motion ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .card:hover .card__media img, .card:hover .tile-art::before, .tile:hover::before { transform: none; }
}

/* Notes ---------------------------------------------------------------------
   Small explanatory pages that articles link to (see notes/). */
.note-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.note-card {
  position: relative; display: flex; flex-direction: column; gap: 0.5rem;
  padding: 1.25rem 1.375rem 1.375rem; background: var(--bg-elevated); border-radius: var(--radius-lg);
  transition: transform 0.25s ease;
}
.note-card:hover { transform: translateY(-2px); }
.note-card__title { font-size: 1.125rem; line-height: 1.3; letter-spacing: -0.006em; transition: color 0.15s ease; }
.note-card:hover .note-card__title { color: var(--primary); }
.note-card__link { text-decoration: none; }
.note-card__link::after { content: ""; position: absolute; inset: 0; }   /* the whole card is the link */
.note-card__link:focus-visible { outline: none; }
.note-card:has(.note-card__link:focus-visible) { outline: 2px solid var(--primary); outline-offset: 3px; }
.note-card__lead { font-size: 0.9375rem; line-height: 1.6; color: var(--text-secondary); }

/* A link inside an article that opens a note: dotted accent underline and a small "i" marker.
   The marker is decoration only (empty alt text), the link text itself is unchanged. */
.prose a.note-link { text-decoration-style: dotted; text-decoration-color: var(--accent); text-decoration-thickness: 0.12em; }
.prose a.note-link:hover { text-decoration-style: solid; }
.prose a.note-link::after {
  content: "i" / ""; display: inline-grid; place-items: center; width: 1.05em; height: 1.05em; margin-left: 0.25em;
  border: 1px solid currentColor; border-radius: 50%; vertical-align: 0.1em;
  font: italic 600 0.65em/1 var(--font-heading); text-decoration: none;
}
/* The link the reader just came back to (see site.js). */
.note-link.is-returned, .note-link:target { animation: note-flash 2.4s ease-out; border-radius: 0.2em; }
@keyframes note-flash { from { background: color-mix(in srgb, var(--accent) 35%, transparent); } to { background: transparent; } }

/* A note uses the article layout, so its sheet, text column and type are exactly the article's. The column holds the
   Back bar above the sheet; the sheet fills it (on phones it runs edge to edge, as articles do). */
.note-column { max-width: calc(var(--prose) + 2 * var(--sheet-inset)); }
.note-column > .post-sheet { max-width: none; margin-inline: 0; }
@media (max-width: 639px) { .note-column > .post-sheet { margin-inline: calc(-1 * var(--gutter)); } }
.note .post-footer { display: block; }   /* article pages hide this at wide widths (their tags are in the side column); notes keep theirs */
.note-return { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.25rem; margin-bottom: 1rem; }
.note-return .btn { line-height: 1.3; text-align: left; }
.note-return__more { font-size: 0.875rem; color: var(--text-muted); }
.note-return__more:hover { color: var(--primary); }
.note-done { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.5rem; padding-top: 1.75rem; border-top: 1px solid var(--border); }
.post-footer + .note-done { margin-top: 1.75rem; }

/* The note's ID, exactly as a writer types it in an article ([#12]). */
.note-id { font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0; color: var(--text-muted); }
.eyebrow .note-id { margin-left: 0.25rem; }
.note-card .note-id { margin-bottom: -0.25rem; }
