/* Design tokens — Signal Press. Every colour pair is checked by tests/design.test.mjs (WCAG AA), light and dark. */
@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-4-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-4-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-4-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/fonts/source-sans-3-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/fonts/source-sans-3-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("/assets/fonts/source-sans-3-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("/assets/fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #f6f1e7;
  --surface: #fffdf8;
  --sunken: #ebe4d6;
  --ink: #14110e;
  --muted: #5c564e;
  --line: #ddd4c5;
  --ctl-line: #7a7060;
  --control: #6b6254;
  /* Interactive accent = BAR signal-deep for AA on paper; brand signal stays on the mark. */
  --accent: #9a4318;
  --accent-hover: #7a3512;
  --on-accent: #ffffff;
  --mark: #ffe066;
  --on-mark: #14110e;
  --signal: #c45c26;

  --reads-fg: #1f6b4a;          --reads-bg: #dceee4;
  --cond-fg: #0b6a73;           --cond-bg: #d9f1f3;
  --config-fg: #8a4b00;         --config-bg: #fcebcb;
  --migration-fg: #43367a;      --migration-bg: #e4e0f2;
  --notread-fg: #8a2a30;        --notread-bg: #f5e0e2;
  --unverified-fg: #5c564e;     --unverified-bg: #ebe4d6;

  --font: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --s1: 0.25rem; --s2: 0.5rem; --s3: 0.75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem; --s8: 4.5rem;
  --r-card: 10px;
  --r-ctl: 8px;
  --measure: 70ch;
  --header-h: 3.75rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1612;
    --surface: #221e19;
    --sunken: #2a241e;
    --ink: #f6f1e7;
    --muted: #c4b8a8;
    --line: #3a342c;
    --ctl-line: #9a9080;
    --control: #a89f90;
    --accent: #e8956a;
    --accent-hover: #f0b090;
    --on-accent: #1a1612;
    --mark: #ffe066;
    --on-mark: #14110e;
    --signal: #e8956a;

    --reads-fg: #7fe0a4;        --reads-bg: #12301f;
    --cond-fg: #6fdce6;         --cond-bg: #0f2f33;
    --config-fg: #f6c36a;       --config-bg: #3a2a0e;
    --migration-fg: #bba8ff;    --migration-bg: #2a2250;
    --notread-fg: #ff9aa2;      --notread-bg: #3d1519;
    --unverified-fg: #c4b8a8;   --unverified-bg: #2a241e;
  }
}


*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--control) var(--bg); accent-color: var(--accent); }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink);
  font: 1rem/1.6 var(--font); font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--mark); color: var(--on-mark); }
img, svg { display: block; max-width: 100%; }

/* Type */
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; margin: 0 0 var(--s3); }
h1 { font-size: clamp(1.875rem, 1.4rem + 1.9vw, 2.625rem); letter-spacing: -0.03em; overflow-wrap: anywhere; }
h2 { font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem); margin-top: var(--s7); }
h3 { font-size: 1.0625rem; letter-spacing: -0.012em; }
p { margin: 0 0 var(--s4); }
.lead { font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem); line-height: 1.55; color: var(--muted); max-width: 44rem; text-wrap: pretty; }
.muted { color: var(--muted); font-size: 0.875rem; }
.block { display: block; }
code, pre, kbd { font-family: var(--mono); font-size: 0.88em; font-weight: 400; }
code { background: var(--sunken); border-radius: 6px; padding: 0.1em 0.38em; overflow-wrap: anywhere; }
pre { background: var(--sunken); border: 1px solid var(--line); border-radius: var(--r-ctl); padding: var(--s4); overflow: auto; white-space: pre-wrap; line-height: 1.5; margin: 0; }
pre code { background: none; padding: 0; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 1.1em; height: 1.1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Links */
a { color: var(--accent); text-decoration-thickness: 0.08em; text-underline-offset: 0.2em; transition: color 0.15s var(--ease), text-decoration-color 0.15s var(--ease); }
a:hover { color: var(--accent-hover); text-decoration-thickness: 0.14em; }

/* Focus: one visible ring everywhere */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* Layout */
/* The physical properties come first for engines that lack the logical ones (Safari before 14.1, Chrome and Edge before 87). */
.wrap { width: 100%; max-width: 72rem; margin-left: auto; margin-right: auto; margin-inline: auto; padding-left: var(--s4); padding-right: var(--s4); padding-inline: var(--s4); }
@media (min-width: 48rem) { .wrap { padding-left: var(--s6); padding-right: var(--s6); padding-inline: var(--s6); } }
main { flex: 1; padding-top: var(--s6); padding-bottom: var(--s8); }
@media (min-width: 48rem) { main { padding-top: var(--s7); } }
/* Anchored headings clear the header where it is sticky. */
@media (min-width: 48rem) { [id] { scroll-margin-top: calc(var(--header-h) + var(--s3)); } }
main > .lead { margin-bottom: var(--s5); }

.skip { position: absolute; left: var(--s4); top: -4rem; z-index: 20; background: var(--ink); color: var(--bg); padding: var(--s2) var(--s4); border-radius: var(--r-ctl); font-weight: 650; transition: top 0.15s var(--ease); }
.skip:focus, .skip:hover { top: var(--s3); color: var(--bg); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line); background: var(--bg); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s1) var(--s5); min-height: var(--header-h); padding-top: var(--s2); padding-bottom: var(--s2); }
.brand { display: inline-flex; align-items: center; gap: var(--s3); color: var(--ink); text-decoration: none; font-family: var(--serif); font-weight: 600; font-size: 1.25rem; letter-spacing: -0.02em; padding: var(--s1) 0; }
.brand:hover { color: var(--ink); }
.mark { width: 1.6rem; height: 1.6rem; transition: transform 0.25s var(--ease); }
.brand:hover .mark { transform: rotate(-6deg); }
.mark .m-bg { fill: var(--ink); }
.mark .m-line { fill: var(--bg); }
.mark .m-hi { fill: var(--signal); }
.site-header nav { display: flex; flex-wrap: wrap; max-width: 100%; gap: var(--s1); margin-left: calc(var(--s2) * -1); }
.site-header nav a { color: var(--muted); text-decoration: none; font-weight: 560; font-size: 0.9375rem; white-space: nowrap; padding: 0.4rem var(--s3); border-radius: var(--r-ctl); transition: background-color 0.15s var(--ease), color 0.15s var(--ease); }
.site-header nav a:hover { color: var(--ink); background: var(--sunken); }
/* The current link keeps the same weight, so marking it never changes the width of the nav. */
.site-header nav a[aria-current="page"] { color: var(--ink); background: var(--sunken); box-shadow: inset 0 -2px 0 var(--signal); }
@media (max-width: 30rem) { .site-header nav { gap: 0; margin-left: calc(var(--s2) * -0.75); } .site-header nav a { font-size: 0.875rem; padding: var(--s2) 0.375rem; } }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--sunken); padding: var(--s6) 0 var(--s5); color: var(--muted); font-size: 0.875rem; }
.footer-grid { display: grid; gap: var(--s6); grid-template-columns: 1fr; }
@media (min-width: 40rem) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; gap: var(--s7); } }
.footer-brand .brand { margin-bottom: var(--s3); }
.footer-brand p { max-width: 34ch; margin: 0; }
.footer-brand p + p { margin-top: var(--s3); }
.site-footer h2 { font-size: 0.875rem; font-weight: 700; letter-spacing: 0; margin: 0 0 var(--s3); color: var(--ink); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s1); }
.site-footer a:not(.brand) { color: var(--muted); display: inline-block; padding: var(--s1) 0; text-decoration-color: transparent; }
.site-footer a:not(.brand):hover { color: var(--ink); text-decoration-color: currentColor; }

/* Controls */
button, .btn { font: inherit; font-size: 0.9375rem; font-weight: 620; line-height: 1.2; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 2.75rem; padding: 0.5rem var(--s4); border: 1px solid var(--ctl-line); border-radius: var(--r-ctl); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.15s var(--ease); }
button:hover, .btn:hover { background: var(--sunken); color: var(--ink); }
button:active, .btn:active { transform: translateY(1px); }
button:disabled { cursor: not-allowed; opacity: 0.6; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
input[type=text], input[type=email], input[type=search], textarea { width: 100%; padding: 0.6rem var(--s3); border: 1px solid var(--control); border-radius: var(--r-ctl); background: var(--surface); color: var(--ink); font: inherit; transition: border-color 0.15s var(--ease); }
textarea { resize: vertical; line-height: 1.5; }
input:hover, textarea:hover { border-color: var(--ink); }
input:disabled { opacity: 0.6; cursor: not-allowed; }
input[type=checkbox], input[type=radio] { width: 1.15rem; height: 1.15rem; margin: 0; flex: none; }
label { font-weight: 620; }
.check { min-width: 0; overflow-wrap: anywhere; display: flex; align-items: flex-start; gap: var(--s3); font-weight: 500; margin: var(--s2) 0; padding: var(--s1) 0; cursor: pointer; }
.notice .ic { margin-top: 0.2em; }
.notice { display: flex; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-ctl); background: var(--config-bg); color: var(--config-fg); font-weight: 560; }
.nl-form { max-width: 32rem; display: grid; gap: var(--s3); margin: var(--s5) 0; padding: var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.nl-form p { margin: 0; }

/* Prose pages: About, Privacy, Legal, Sponsors, Newsletter */
.prose { max-width: var(--measure); }
/* Long URLs in the content, linked or not, break instead of widening the page. */
.prose { overflow-wrap: break-word; }
.prose a, .prose code { overflow-wrap: anywhere; }
.prose h2 { margin-top: var(--s7); }
.prose h3 { margin-top: var(--s5); }
.prose h1 { margin-bottom: var(--s4); }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin: var(--s2) 0; }
.prose li::marker { color: var(--muted); }
.prose table { border-collapse: collapse; width: 100%; }
.prose th, .prose td { text-align: left; border-bottom: 1px solid var(--line); padding: var(--s2) var(--s3) var(--s2) 0; vertical-align: top; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-delay: 0s !important; scroll-behavior: auto !important; }
  .mark, .brand:hover .mark, button:active, .btn:active { transform: none; }
}

/* Digest: item cards, week page, archive */
.items, .archive { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s4); }
.item, .issue { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s4) var(--s5); transition: border-color 0.2s var(--ease); }
.item p, .issue p { margin: 0; }
.item .item-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); font-size: 0.9375rem; color: var(--muted); font-weight: 560; margin-bottom: var(--s3); }
.item-top time { color: var(--ink); font-weight: 680; margin-right: var(--s1); }
.item-title { font-size: 1.0625rem; line-height: 1.35; margin: 0 0 var(--s2); }
.item-text { color: var(--ink); max-width: 60ch; }
.item-text .muted { font-weight: 560; }
.item .item-foot { margin-top: var(--s4); font-size: 0.9375rem; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: center; }
.item-figure { color: var(--muted); font-weight: 600; }
.src { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 620; text-decoration: none; background-image: linear-gradient(currentColor, currentColor); background-size: 0 0.08em; background-position: 0 100%; background-repeat: no-repeat; transition: background-size 0.25s var(--ease), color 0.15s var(--ease); }
.src:hover { background-size: 100% 0.08em; }
.src .ic { width: 0.95em; height: 0.95em; }
.tag { display: inline-flex; align-items: center; padding: 0.1rem 0.6rem; border-radius: 999px; background: var(--sunken); color: var(--ink); font-size: 0.8125rem; font-weight: 640; line-height: 1.5; white-space: nowrap; }
.tag-quiet { background: none; color: var(--muted); border: 1px solid var(--line); }
.tag-mark { background: var(--mark); color: var(--on-mark); }
.count { display: inline-block; margin-left: var(--s1); font-size: 0.9375rem; font-weight: 640; color: var(--muted); vertical-align: 0.15em; }
.summary { max-width: var(--measure); }
/* Editorial blocks of an issue: In short, Versions this week, Instruction files this week. They only repeat item fields. */
.in-short, .versions, .instruction-files { margin: var(--s6) 0; }
.in-short ul { max-width: var(--measure); margin: 0; padding-left: 1.25rem; display: grid; gap: var(--s2); }
.in-short li::marker { color: var(--muted); }
.versions-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.versions-table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; }
.versions-table th, .versions-table td { text-align: left; vertical-align: top; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.versions-table tbody tr:last-child > * { border-bottom: 0; }
.versions-table thead th { background: var(--sunken); color: var(--muted); font-size: 0.8125rem; font-weight: 650; }
.versions-table td:nth-child(2) { white-space: nowrap; }
@media (min-width: 30.01rem) { .versions-table td:last-child { min-width: 8rem; } }
.versions-table .src { display: inline; }
/* An inline link: the icon flows with the text and stays on the line of the last word (labelWithIcon). */
.versions-table .src .ic { display: inline-block; vertical-align: -0.125em; margin-left: var(--s1); }
.nowrap { white-space: nowrap; }
@media (max-width: 30rem) { .versions-table th, .versions-table td { padding: var(--s2); font-size: 0.875rem; } }
.instruction-files q { quotes: "\201C" "\201D"; }
/* A digest links to one cell of the matrix: the cell is outlined when it is the target of the address. */
.matrix td:target { box-shadow: inset 0 0 0 3px var(--accent); scroll-margin-top: 4rem; scroll-margin-left: 11rem; }
.back { margin-top: var(--s7); }

@media (min-width: 52rem) {
  .items-rail .item { display: grid; grid-template-columns: 11rem minmax(0, 1fr); column-gap: var(--s6); }
  .items-rail .item .item-top { grid-column: 1; grid-row: 1 / span 3; flex-direction: column; align-items: flex-start; align-self: start; margin: 0; }
  .items-rail .item-title, .items-rail .item-text, .items-rail .item-foot { grid-column: 2; }
}

/* Archive */
.archive { grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); margin: var(--s6) 0; }
.issue { display: flex; flex-direction: column; gap: var(--s2); }
.issue:hover, .item:hover { border-color: var(--control); }
.issue-week { color: var(--muted); font-size: 0.9375rem; font-weight: 560; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); align-items: center; }
.issue-week time { color: var(--ink); }
.issue-title { font-size: 1.125rem; margin: 0; }
.issue-title a { color: var(--ink); text-decoration: none; }
.stretch::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; border-radius: var(--r-card); }
.stretch:focus-visible { outline: none; }
.stretch:focus-visible::after { outline: 3px solid var(--accent); outline-offset: 3px; }
.issue .issue-tools { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: auto; padding-top: var(--s3); }
.nw { white-space: nowrap; }

/* Status badges (colour, icon and text) */
.badge { display: inline-flex; align-items: center; gap: 0.4em; padding: 0.15rem 0.65rem 0.15rem 0.5rem; border-radius: 999px; font-size: 0.8125rem; font-weight: 680; line-height: 1.5; white-space: nowrap; border: 1px solid transparent; }
.badge .ic { width: 1em; height: 1em; stroke-width: 2.4; }
.badge-reads { background: var(--reads-bg); color: var(--reads-fg); }
.badge-reads-conditionally { background: var(--cond-bg); color: var(--cond-fg); }
.badge-configurable { background: var(--config-bg); color: var(--config-fg); }
.badge-migration-only { background: var(--migration-bg); color: var(--migration-fg); }
.badge-not-read { background: var(--notread-bg); color: var(--notread-fg); }
.badge-unverified { background: var(--unverified-bg); color: var(--unverified-fg); border: 1px dashed currentColor; }

/* Home */
.hero { display: grid; gap: var(--s6) var(--s8); align-items: end; padding: 0 0 var(--s5); }
@media (min-width: 52rem) { .hero { grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr); padding-top: var(--s5); } }
.hero h1 { font-size: clamp(2.2rem, 1.2rem + 4.6vw, 3.55rem); line-height: 1.08; letter-spacing: -0.03em; font-weight: 600; margin-bottom: var(--s4); max-width: 14ch; }
.hero .lead { margin-bottom: var(--s5); }
.cta { display: flex; flex-wrap: wrap; gap: var(--s3); margin: 0; }
.cta .btn { min-height: 3rem; padding-left: var(--s4); padding-right: var(--s4); padding-inline: var(--s4); }
.cta .btn-primary .ic { transition: transform 0.2s var(--ease); }
.cta .btn-primary:hover .ic { transform: translateX(3px); }

.specimen { display: grid; gap: var(--s3); padding: var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); color: var(--muted); text-decoration: none; transition: border-color 0.2s var(--ease); }
.specimen:hover { border-color: var(--control); color: var(--muted); }
.specimen-heads, .specimen-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: var(--s2); }
.specimen-heads { grid-auto-flow: column; font-size: 0.75rem; font-weight: 650; line-height: 1.25; color: var(--muted); }
.specimen-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.specimen-foot { font-size: 0.875rem; margin-top: var(--s1); }
.tile { display: grid; place-items: center; height: 2.1rem; border-radius: 8px; animation: tile-in 0.5s var(--ease) backwards; }
.tile .ic { width: 1.05rem; height: 1.05rem; stroke-width: 2.4; }
.tile-reads { background: var(--reads-bg); color: var(--reads-fg); }
.tile-reads-conditionally { background: var(--cond-bg); color: var(--cond-fg); }
.tile-configurable { background: var(--config-bg); color: var(--config-fg); }
.tile-migration-only { background: var(--migration-bg); color: var(--migration-fg); }
.tile-not-read { background: var(--notread-bg); color: var(--notread-fg); }
.tile-unverified { background: var(--unverified-bg); color: var(--unverified-fg); outline: 1px dashed currentColor; outline-offset: -1px; }
.c1 { animation-delay: 0.07s; } .c2 { animation-delay: 0.14s; } .c3 { animation-delay: 0.21s; } .c4 { animation-delay: 0.28s; } .c5 { animation-delay: 0.35s; }
/* The entry effect only moves the tiles. It never sets opacity, so a frozen or skipped animation leaves all 36 visible. */
@keyframes tile-in { from { transform: translateY(6px) scale(0.9); } }

.home-section { margin-top: var(--s7); }
@media (min-width: 48rem) { .home-section { margin-top: var(--s8); } }
.home-section > h2 { margin-top: 0; }
.items-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr)); margin-bottom: var(--s5); }
.items-grid .item { display: flex; flex-direction: column; }
.items-grid .item .item-foot { margin-top: auto; padding-top: var(--s4); }
.section-link { font-weight: 640; }
.status-counts { list-style: none; margin: var(--s4) 0 var(--s5); padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); }
.status-counts li { display: inline-flex; align-items: center; gap: var(--s2); }
.status-count { font-weight: 700; }
.home-section p { max-width: var(--measure); }
.callout { padding: var(--s5) var(--s5) var(--s2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
@media (min-width: 48rem) { .callout { padding: var(--s6) var(--s6) var(--s4); } }
@media (prefers-reduced-motion: reduce) { .tile { animation: none; } .cta .btn-primary:hover .ic { transform: none; } }

.home-digest-filters { display: none; margin: var(--s4) 0 var(--s3); }
.js .home-digest-filters { display: block; }
.home-digest-filters .chips { align-items: center; }
.home-generator > p:first-child { margin-top: 0; font-weight: 650; }



/* Signal Press home chrome */
.issue-band {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--s3); padding: var(--s3) 0; margin: 0 0 var(--s2);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 0.8rem; font-weight: 500; color: var(--muted);
}
.issue-band strong { color: var(--ink); font-weight: 600; }
.issue-band a { font-weight: 600; }
.hero-side {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: var(--s5); display: grid; gap: var(--s3); align-content: start;
}
.hero-side h2 { font-size: 1.15rem; margin: 0; }
.hero-side p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.hero-side .btn { width: 100%; }
.trust-strip {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; margin: var(--s5) 0 0;
  padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  overflow: hidden; font-size: 0.875rem; font-weight: 600; line-height: 1.35; max-width: none;
}
.trust-strip > div { padding: var(--s4); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.trust-strip > div:nth-child(2n) { border-right: 0; }
.trust-strip > div:nth-last-child(-n+2) { border-bottom: 0; }
@media (min-width: 48rem) {
  .trust-strip { grid-template-columns: repeat(4, 1fr); }
  .trust-strip > div { border-bottom: 0; }
  .trust-strip > div:nth-child(2n) { border-right: 1px solid var(--line); }
  .trust-strip > div:last-child { border-right: 0; }
}
.trust-strip b { display: block; font-family: var(--serif); font-size: 1.45rem; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
.trust-strip span { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 0.15rem; font-weight: 600; }
.rythme { margin: 0; font-weight: 500; font-family: var(--mono); font-size: 0.8rem; }
.home-band {
  margin-top: var(--s7); border: 1px solid var(--line); border-radius: 12px;
  padding: var(--s5); background: var(--surface);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s5); align-items: center;
}
.home-band h2 { margin: 0 0 var(--s2); font-size: 1.35rem; }
.home-band p { margin: 0; max-width: 36rem; }
.home-band.nl-band { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.home-band.nl-band h2 { color: var(--bg); }
.home-band.nl-band .lead, .home-band.nl-band p, .home-band.nl-band .muted { color: #d9d0c2; }
.home-band.nl-band a { color: var(--bg); }
.home-band.nl-band .nl-form {
  background: transparent; border: 0; padding: 0; margin: 0; max-width: 28rem;
}
.home-band.nl-band input[type=email] {
  border-color: #3a342c; background: #1c1814; color: var(--bg);
}
@media (prefers-color-scheme: dark) {
  .home-band.nl-band { background: var(--surface); color: var(--ink); border-color: var(--line); }
  .home-band.nl-band h2, .home-band.nl-band a { color: var(--ink); }
  .home-band.nl-band .lead, .home-band.nl-band p, .home-band.nl-band .muted { color: var(--muted); }
  .home-band.nl-band input[type=email] { border-color: var(--control); background: var(--bg); color: var(--ink); }
}
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: var(--s3); margin: 0 0 var(--s4); }
.section-head h2 { margin: 0; }
.tag { font-family: var(--mono); font-size: 0.75rem; font-weight: 500; }
.item-top time { font-family: var(--mono); font-size: 0.78rem; }

/* Matrix page */
[hidden] { display: none !important; }
.intro { max-width: var(--measure); color: var(--muted); }
.filters { display: none; gap: var(--s4) var(--s6); padding: var(--s4); margin: var(--s5) 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.js .filters { display: grid; }
/* The count is written by matrix.js; its line is reserved so filling it moves nothing. */
#matrix-count { min-height: 1.5em; }
@media (min-width: 48rem) { .filters { grid-template-columns: auto 1fr; } .filter-foot { grid-column: 1 / -1; } }
.filter-group { border: 0; padding: 0; margin: 0; min-width: 0; }
.filter-group legend { padding: 0; margin-left: 0; margin-bottom: var(--s2); font-size: 0.9375rem; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { white-space: nowrap; min-height: 2.25rem; padding: 0.3rem 0.8rem; border-radius: 999px; font-size: 0.875rem; font-weight: 620; background: var(--surface); }
.chip .ic { width: 1em; height: 1em; stroke-width: 2.4; }
.chip-count { font-weight: 700; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip[aria-pressed="true"]:hover { background: var(--ink); color: var(--bg); }
.chip[aria-pressed="true"] .chip-count { color: inherit; }
.filter-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); border-top: 1px solid var(--line); padding-top: var(--s3); }
.filter-foot p { margin: 0; }
.btn-quiet { border-color: transparent; background: none; color: var(--accent); min-height: 2.5rem; }
.btn-quiet:hover { background: var(--sunken); color: var(--accent-hover); }
.btn-quiet:disabled { opacity: 0.5; }

.scroll-hint { margin: 0 0 var(--s2); }
@media (min-width: 62rem) { .scroll-hint { display: none; } }
.table-wrap { max-height: 64rem; max-height: min(82vh, 64rem); max-height: min(82dvh, 64rem); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overscroll-behavior: contain; }
.table-wrap:focus-visible { outline-offset: 2px; border-radius: var(--r-card); }
table.matrix { border-collapse: separate; border-spacing: 0; width: 100%; }
.matrix th, .matrix td { text-align: left; vertical-align: top; padding: var(--s3) var(--s4); font-size: 0.9375rem; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.matrix tr > :last-child { border-right: 0; }
.matrix tbody tr:last-child > * { border-bottom: 0; }
.matrix thead th { position: sticky; top: 0; z-index: 2; background: var(--sunken); font-size: 0.875rem; white-space: nowrap; }
.matrix thead th a { font-weight: 700; }
.matrix thead th .muted { font-weight: 500; white-space: normal; font-size: 0.8125rem; max-width: 18rem; }
.matrix tbody th { position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 10.25rem; max-width: 14rem; }
.matrix thead th:first-child { left: 0; z-index: 3; }
.matrix tbody th code { background: none; padding: 0; font-weight: 650; font-size: 0.875rem; display: block; margin-bottom: var(--s1); }
.matrix tbody th .muted { font-size: 0.8125rem; font-weight: 500; line-height: 1.4; }
.matrix td { min-width: 14rem; }
/* Reference pages: one row per tool, so only the note needs room. Rows are separated by lines only. */
.ref td { min-width: 0; }
.ref th, .ref td { border-right: 0; }
.ref thead th { color: var(--muted); font-weight: 650; font-size: 0.8125rem; }
.ref td.note-col { min-width: 18rem; }
.ref td.file-col code { white-space: nowrap; }
/* A citation line carries a long URL that cannot wrap on a narrow screen without a break opportunity. */
#cite ~ p { overflow-wrap: anywhere; }
.ref time { white-space: nowrap; }
.file-links { list-style: none; margin: 0 0 var(--s4); padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.file-links a { display: inline-flex; max-width: 100%; min-height: 2.25rem; align-items: center; padding: 0 var(--s3); border: 1px solid var(--ctl-line); border-radius: 999px; background: var(--surface); text-decoration: none; }
.file-links a:hover { border-color: var(--control); }
.file-links code { min-width: 0; background: none; padding: 0; overflow-wrap: anywhere; }
.file-links .seg { white-space: nowrap; }
.matrix tbody tr:hover > * { background: var(--sunken); }
.cell p { margin: 0; }
.cell .cell-status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-bottom: var(--s3); }
.cell .note { font-size: 0.9375rem; line-height: 1.5; margin-bottom: var(--s3); }
.cell-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s3); font-size: 0.875rem; }
/* WCAG 2.5.8: the Source links are at least 24 by 24 CSS pixels, in the matrix and on the digest cards. */
.cell-foot .src, .item-foot .src { min-width: 24px; min-height: 24px; }
.stale { display: inline-flex; align-items: center; gap: var(--s1); color: var(--config-fg); background: var(--config-bg); border-radius: 999px; padding: 0 0.6rem; font-size: 0.8125rem; }
td.is-off { background: var(--bg); text-align: center; vertical-align: middle; }
td.is-off > * { display: none; }
td.is-off::before { content: "–"; content: "–" / ""; color: var(--muted); font-weight: 700; }
@media (max-width: 47.99rem) { .matrix th, .matrix td { padding: var(--s3); } .matrix tbody th code { font-size: 0.8125rem; } }
@media (min-width: 62rem) { .matrix tbody th { min-width: 11rem; } }

.legend { list-style: none; margin: var(--s4) 0 0; padding: 0; display: grid; gap: var(--s2) var(--s6); grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr)); }
.legend li { display: grid; grid-template-columns: 11.5rem minmax(0, 1fr); gap: var(--s3); align-items: start; padding: var(--s3) 0; border-top: 1px solid var(--line); font-size: 0.875rem; color: var(--muted); }
.legend .badge { justify-self: start; }
.legend-box { margin: 0 0 var(--s4); border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
.legend-box summary { cursor: pointer; padding: var(--s3) var(--s4); font-weight: 650; font-size: 0.9375rem; }
.legend-box .legend { margin: 0; padding: 0 var(--s4) var(--s2); }

/* Matrix controls: search, notes toggle */
.filter-search { grid-column: 1 / -1; display: grid; gap: var(--s1); }
.filter-search label { font-size: 0.9375rem; font-weight: 700; }
.filter-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.cell-tool { display: none; }
.notes-off .note { display: none; }
.notes-off .cell .cell-status { margin-bottom: var(--s2); }

/* Below 48rem the matrix is a list of cards, one per file, so nothing scrolls sideways.
   The column headers stay readable by screen readers, and each cell shows its tool name. */
@media (max-width: 47.99rem) {
  .scroll-hint { display: none; }
  .table-wrap.matrix-wrap { max-height: none; overflow: visible; background: none; border: 0; }
  .matrix-wrap .matrix, .matrix-wrap tbody, .matrix-wrap tr, .matrix-wrap th, .matrix-wrap td { display: block; }
  .matrix-wrap thead tr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); }
  .matrix-wrap tbody tr { display: grid; grid-template-columns: minmax(0, 1fr); margin-bottom: var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
  .matrix-wrap .notes-off tbody tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .matrix-wrap tbody th { grid-column: 1 / -1; position: static; min-width: 0; max-width: none; background: var(--sunken); border-right: 0; }
  .matrix-wrap td { min-width: 0; border-right: 0; }
  .matrix-wrap .notes-off td:nth-child(odd) { border-left: 1px solid var(--line); }
  .matrix-wrap tbody tr:last-child > * { border-bottom: 1px solid var(--line); }
  .matrix-wrap tbody tr > :last-child { border-bottom: 0; }
  .matrix-wrap td.is-off { display: none; }
  .matrix-wrap tbody tr:hover > * { background: var(--surface); }
  .matrix-wrap tbody tr:hover > th { background: var(--sunken); }
  .cell-tool { display: block; margin: 0 0 var(--s2); font-weight: 700; font-size: 0.875rem; }
  .matrix-wrap .badge { white-space: normal; }
}
@media (max-width: 30rem) { .legend li { grid-template-columns: 1fr; gap: var(--s2); } }

/* Generator */
.gen { display: grid; gap: var(--s6); margin-top: var(--s5); align-items: start; }
@media (min-width: 62rem) { .gen { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: var(--s7); } .gen-out { position: sticky; top: calc(var(--header-h) + var(--s4)); max-height: calc(100vh - 6rem); max-height: calc(100dvh - 6rem); overflow: auto; } }
.gen-form { display: grid; gap: var(--s4); }
fieldset { border: 1px solid var(--line); border-radius: var(--r-card); margin: 0; padding: var(--s4) var(--s5) var(--s5); background: var(--surface); min-width: 0; }
legend { font-weight: 720; font-size: 1.0625rem; padding: 0 var(--s2); margin-left: calc(var(--s2) * -1); }
.field { margin: var(--s4) 0 0; }
.field label { display: block; margin-bottom: var(--s1); }
.field .muted { margin-bottom: var(--s2); font-size: 0.875rem; }
fieldset > .muted { margin: var(--s3) 0; }
::placeholder { color: var(--muted); opacity: 1; }
.gen-presets { display: grid; gap: var(--s2); padding: var(--s4) var(--s5); background: var(--sunken); border-radius: var(--r-card); }
.gen-presets > span { font-weight: 650; font-size: 0.9375rem; }
.gen-opt { margin: 0 0 var(--s3) 1.9rem; padding-left: var(--s3); border-left: 2px solid var(--line); }
.gen-opt.field { margin-top: 0; }
.gen-steps { margin: 0 0 var(--s4); padding-left: 1.3rem; font-size: 0.9375rem; color: var(--muted); }
.gen-steps li { margin: var(--s1) 0; }
.gen-out { padding: 0; }
.gen-out > h2 { margin-top: 0; font-size: 1.35rem; }
#gen-output { display: grid; gap: var(--s4); }
.gen-file { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s4) var(--s5) var(--s5); display: grid; gap: var(--s3); }
.gen-file h3 { margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.gen-file h3 code { background: none; padding: 0; font-size: 0.95rem; font-weight: 700; }
.gen-file p { margin: 0; }
.gen-file pre { max-height: 22rem; }
.gen-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
noscript p { padding: var(--s3) var(--s4); border-radius: var(--r-ctl); background: var(--config-bg); color: var(--config-fg); }
noscript a { color: inherit; }
