/* ==========================================================================
   Silent Expiry — canonical reference site
   Single stylesheet. No framework, no external requests, no JavaScript.
   Layers, in order: 1 tokens · 2 reset · 3 base type · 4 layout · 5 components
                     6 utilities · 7 small screens · 8 print · 9 dark scheme
   Palette: NBSM v1.0 (ink / cream / red / grey / line / deep / pale).
   Red is reserved for findings — never for decoration or links.
   ========================================================================== */

/* 1 · Tokens ------------------------------------------------------------- */
:root {
  color-scheme: light dark;

  --ink:   #15161A;
  --cream: #F0EDE6;
  --red:   #CD232F;
  --grey:  #6E7178;   /* decorative only: fails AA on cream for body text */
  --line:  #C9CCD2;
  --deep:  #3A3D44;   /* 9.3:1 on cream — secondary text */
  --pale:  #9A9EA6;

  --bg:      var(--cream);
  --fg:      var(--ink);     /* 14.6:1 on cream */
  --fg-2:    var(--deep);
  --rule:    var(--line);
  --surface: #E8E4DB;
  --accent:  var(--red);     /* 4.6:1 on cream — findings only */

  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua",
           "Times New Roman", Times, serif;
  --sans:  Arial, Helvetica, "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --mono:  ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --fs:      clamp(1rem, 0.94rem + 0.3vw, 1.125rem);
  --lh:      1.6;
  --measure: 38rem;   /* ≈ 72 characters of Georgia at 17px */
  --wide:    56rem;   /* header, main and footer share it, so their edges align */

  --s1: .5rem; --s2: 1rem; --s3: 1.5rem; --s4: 2.5rem; --s5: 4rem;
}

/* 1b · Brand wordmark face ------------------------------------------------
   NBSM III-M11: the wordmark face is IBM Plex Sans SemiBold tracked caps, and no
   substitution is permitted. Self-hosted and subset to the fourteen characters of
   the wordmark — 928 bytes, one request, allowed by the existing `font-src 'self'`.
   It is used for the wordmark only; body typography stays on the system stack. */
@font-face {
  font-family: "Plex Wordmark";
  src: url("/fonts/plex-sans-semibold-wordmark.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
  unicode-range: U+0020, U+0045, U+0049, U+004C, U+004E, U+0050, U+0052, U+0053,
                 U+0054, U+0058, U+0059;
}

/* 2 · Reset (minimal) ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
/* Content images and content SVGs shrink to their container. The brand mark is chrome,
   not content: it is excluded here so that a generic rule can never size it. */
img, svg:not(.brand__mark) { max-width: 100%; height: auto; }
table { border-collapse: collapse; }

/* 3 · Base typography ---------------------------------------------------- */
body {
  background: var(--bg);
  color: var(--fg);
  font: var(--fs) / var(--lh) var(--serif);
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 {
  font-family: var(--sans);
  line-height: 1.25;
  margin: 0 0 var(--s2);
  overflow-wrap: anywhere;
}
h1 { font-size: 1.9rem; font-weight: 700; letter-spacing: -.01em; margin-top: 0; }
h2 { font-size: 1.35rem; font-weight: 700; margin-top: var(--s4); padding-top: var(--s3);
     border-top: 1px solid var(--rule); }
h3 { font-size: 1.1rem;  font-weight: 700; margin-top: var(--s3); }
h4 { font-size: 1rem;    font-weight: 700; margin-top: var(--s3); }
p, ul, ol, dl, blockquote, pre, table, figure { margin: 0 0 var(--s2); }
ul, ol { padding-left: 1.4em; }
li { margin-bottom: .35em; }
li > ul, li > ol { margin-top: .35em; }
strong { font-weight: 700; }
em { font-style: italic; }
hr { border: 0; border-top: 1px solid var(--rule); margin: var(--s4) 0; }
small { font-size: .875em; }
abbr[title] { text-decoration: underline dotted; text-underline-offset: .18em; }

a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px;
    text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
/* NBSM VIII-M6: focus = 2 px red outline, offset 2 px. Signal Red measures 4.6:1 on
   cream and 3.3:1 on ink, so the indicator clears the 3:1 non-text floor on every
   ground the site uses, including the ink top bar. */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--red); outline-offset: 2px; border-radius: 0; }

code, kbd, samp { font-family: var(--mono); font-size: .92em; }
dl.meta code { overflow-wrap: anywhere; }
pre { font-family: var(--mono); font-size: .9rem; line-height: 1.45; padding: var(--s2);
      border: 1px solid var(--rule); background: var(--surface); overflow-x: auto; }
pre code { font-size: inherit; }

blockquote { margin: var(--s3) 0; padding: var(--s2) var(--s3);
             border-left: 3px solid var(--fg); background: var(--surface); }
blockquote p:last-child { margin-bottom: 0; }

table { width: 100%; font-size: .95rem; line-height: 1.45; }
caption { text-align: left; font-family: var(--sans); font-weight: 700; margin-bottom: var(--s1); }
th, td { border-top: 1px solid var(--rule); padding: .55rem .75rem; text-align: left;
         vertical-align: top; }
thead th { font-family: var(--sans); font-size: .85rem; letter-spacing: .03em;
           border-top: 0; border-bottom: 2px solid var(--fg); }
tbody th { font-family: var(--sans); font-weight: 700; white-space: nowrap; }
tbody tr:last-child > * { border-bottom: 1px solid var(--rule); }
td > time, th > time { white-space: nowrap; }

dl.meta { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1.25rem; }
dl.meta dt { font-family: var(--sans); font-size: .85rem; letter-spacing: .04em;
             text-transform: uppercase; color: var(--fg-2); padding-top: .15em; }
dl.meta dd { margin: 0; }

/* 4 · Layout ------------------------------------------------------------- */
.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: var(--s2); top: var(--s2); z-index: 10; background: var(--bg);
              padding: var(--s1) var(--s2); outline: 2px solid var(--fg); }

.site-header { border-bottom: 1px solid var(--rule); }
.site-header__inner, .site-footer__inner {
  max-width: var(--wide); margin: 0 auto; padding: var(--s2) var(--s3);
}

/* The ink top bar — NBSM VIII-M1. Carries the Register Mark, the wordmark and the
   version/status qualifier, right-aligned. The bar is ink in both colour schemes:
   it is the surface-recognition device, and it must not change with the reader's
   system preference. The mark uses the compact lockup (icon + wordmark, NBSM III),
   the variant the manual specifies for interfaces. */
.site-topbar { background: var(--ink); color: var(--cream);
               border-bottom: 1px solid transparent; --mark-line: var(--cream); }
.site-topbar__inner {
  max-width: var(--wide); margin: 0 auto; padding: var(--s2) var(--s3);
  min-height: 64px; display: flex; align-items: center; justify-content: space-between;
  gap: var(--s2) var(--s3); flex-wrap: wrap;
}
.site-topbar__qualifier { margin: 0; font-family: var(--sans); font-size: .78rem;
                          letter-spacing: .04em; color: var(--pale); }
.brand { display: inline-flex; align-items: center; gap: .9rem; text-decoration: none;
         color: var(--cream); }
.brand__name { font-family: "Plex Wordmark", var(--sans); font-weight: 600;
               font-size: .95rem; letter-spacing: .3em; text-transform: uppercase;
               margin-right: -.3em; }
.brand:hover .brand__name { text-decoration: underline; text-underline-offset: .35em; }
/* Icon master geometry, reverse variant. 26 px clears the 16 px icon floor (III-M3);
   the .9rem gap clears one module — the square side at this size (III-M2). */
.brand__mark { display: block; width: 26px; height: 26px; flex: none; }
.site-header__inner { display: flex; flex-direction: column; gap: var(--s2); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap;
               gap: .35rem var(--s2); font-family: var(--sans); font-size: .92rem; }
.site-nav li { margin: 0; }
.site-nav a { text-decoration: none; padding: .25em 0; display: inline-block; }
.site-nav a:hover { text-decoration: underline; text-underline-offset: .35em; }
.site-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: .35em;
                                   text-decoration-thickness: 2px; font-weight: 700; }
/* The case book is set in italic — subtle emphasis that is also the correct
   typographic treatment for a book title. No rule or colour: the nav wraps at
   common widths and any divider would read as a stray mark on the second line. */
.site-nav__book a { font-style: italic; }

main { max-width: var(--wide); margin: 0 auto; padding: var(--s4) var(--s3) var(--s5); }
.prose { max-width: var(--measure); }
/* Pages built around a table: the container widens, running text keeps its measure */
.prose--wide { max-width: var(--wide); }
.prose--wide > p, .prose--wide > ul, .prose--wide > ol, .prose--wide > dl,
.prose--wide > section > p, .prose--wide > section > ul, .prose--wide > section > ol,
.prose--wide > section > dl, .prose--wide > blockquote { max-width: var(--measure); }
.prose > h2:first-child, .prose > h1 + h2 { margin-top: var(--s3); }

.site-footer { border-top: 1px solid var(--rule); font-family: var(--sans);
               font-size: .85rem; line-height: 1.5; color: var(--fg-2); }
.site-footer p { margin: 0 0 .4rem; }
.site-footer__book { font-size: .95em; }
.site-footer ul { list-style: none; margin: 0 0 .4rem; padding: 0; display: flex;
                  flex-wrap: wrap; gap: .25rem var(--s2); }
.site-footer li { margin: 0; }
.site-footer__hublabel { font-size: .95em; margin: .6rem 0 .2rem; color: var(--fg-2); }
/* No mark in the footer: NBSM III-M10 allows one mark per surface, and the ink top bar
   carries it. The footer's brand presence is the wordmark in text and the hub list. */

/* Breadcrumb — the reader's position inside the knowledge hub.
   NBSM VIII-M5: the breadcrumb is drawn as a process line with the current node as a
   filled square — the mark's own grammar doing the wayfinding. The square is ink, not
   red: VIII-P3 reserves red for findings and forbids it as interface chrome. */
.crumbs { font-family: var(--sans); font-size: .85rem; color: var(--fg-2);
          margin: 0 0 var(--s3); max-width: var(--wide); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap;
             align-items: center; gap: .1rem .55rem; }
.crumbs li { margin: 0; display: inline-flex; align-items: center; }
.crumbs li + li::before { content: ""; display: inline-block; width: 1.5em; height: 2px;
                          background: var(--rule); margin-right: .55rem; flex: none; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; text-underline-offset: .25em; }
.crumbs [aria-current="page"] { color: var(--fg); display: inline-flex; align-items: center; }
.crumbs [aria-current="page"]::before { content: ""; display: inline-block;
                                        width: .5em; height: .5em; background: var(--fg);
                                        margin-right: .5rem; flex: none; }

/* 5 · Components --------------------------------------------------------- */
.kicker { font-family: var(--sans); font-size: .85rem; letter-spacing: .06em;
          text-transform: uppercase; color: var(--fg-2); margin: 0 0 var(--s1); }
.lede { font-size: 1.08em; }

/* Document header, RFC / W3C style */
.docmeta { border: 1px solid var(--rule); background: var(--surface);
           padding: var(--s2) var(--s3); margin: var(--s3) 0 var(--s4); font-size: .95rem; }
.docmeta dl.meta { margin: 0; }

/* Table of contents */
.toc { border: 1px solid var(--rule); padding: var(--s2) var(--s3); margin: 0 0 var(--s4);
       font-family: var(--sans); font-size: .93rem; max-width: var(--measure); }
.toc h2 { border: 0; padding: 0; margin: 0 0 var(--s1); font-size: .85rem; letter-spacing: .06em;
          text-transform: uppercase; color: var(--fg-2); }
.toc ol { margin: 0; padding-left: 1.3em; }
.toc li { margin-bottom: .2em; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* The canonical short-form definition */
.canon { font-size: 1.12em; border-left-width: 3px; }
.canon p { margin: 0; }

/* Section anchor marks: shown on hover / focus, like a specification */
.anchor { font-family: var(--sans); font-weight: 400; font-size: .75em; text-decoration: none;
          color: var(--fg-2); margin-left: .45em; opacity: 0; }
h1:hover .anchor, h2:hover .anchor, h3:hover .anchor, h4:hover .anchor, .anchor:focus { opacity: 1; }
:target { scroll-margin-top: var(--s3); }
section:target > h2, section:target > h3, p:target, li:target, blockquote:target { background: var(--surface); }
p:target, li:target { outline: 1px solid var(--rule); outline-offset: 4px; }

/* Findings — the one legitimate use of red */
.finding { color: var(--accent); font-family: var(--sans); font-weight: 700; font-size: .82rem;
           letter-spacing: .05em; text-transform: uppercase; }

/* Status marks (revision table). Not findings; no red. */
.status { display: inline-block; font-family: var(--sans); font-size: .78rem; letter-spacing: .05em;
          text-transform: uppercase; border: 1px solid currentColor; padding: .08em .45em;
          border-radius: 2px; white-space: nowrap; }
.status--current { font-weight: 700; }
.status--superseded { color: var(--fg-2); }
.status--planned { color: var(--fg-2); border-style: dashed; }

/* Buttons. Outline is the default and stays quiet; --primary is filled and is used
   at most once per page, only where continuing to the case book is the next step.
   Neither uses --accent: red stays reserved for findings. */
.button { display: inline-block; font-family: var(--sans); font-size: .95rem; border: 1px solid var(--fg);
          padding: .5em 1em; text-decoration: none; border-radius: 2px; }
.button:hover { background: var(--fg); color: var(--bg); text-decoration: none; }
.button--primary { background: var(--fg); color: var(--bg); }
.button--primary:hover { background: transparent; color: var(--fg); }

/* The case book — hero on /the-norwood-files/ */
.book-hero { display: grid; grid-template-columns: 17rem 1fr; gap: var(--s3) var(--s4);
             align-items: start; margin: 0 0 var(--s4); }
.book-hero__text > h1 { margin-top: 0; }
.book-hero__text > .lede { color: var(--fg-2); margin-bottom: var(--s2); }
.book-hero__text > p:last-child { margin-bottom: 0; }
.book-cover { display: block; width: 100%; height: auto; border: 1px solid var(--rule); }

/* Multi-column plain list (readership) */
.cols { columns: 2; column-gap: var(--s4); }
.cols li { break-inside: avoid; }

/* Permanent URL / citation blocks */
.permalink { font-family: var(--mono); font-size: .9rem; border: 1px dashed var(--rule);
             padding: .55rem .75rem; overflow-wrap: anywhere; background: var(--surface); }
.cite { border: 1px solid var(--rule); padding: var(--s2) var(--s3); background: var(--surface); }
.cite pre { margin: var(--s1) 0 0; border: 0; padding: 0; background: transparent; }

/* Article structure (The Premise Test) */
.article-meta { font-family: var(--sans); font-size: .9rem; color: var(--fg-2);
                margin: 0 0 var(--s3); display: flex; flex-wrap: wrap; gap: .25rem var(--s3); }
.article-meta dt { display: inline; }
.article-meta dt::after { content: ": "; }
.article-meta dd { display: inline; margin: 0; color: var(--fg); }
.article-meta div { display: inline; }

/* Example entries and the three-condition check */
.example { margin: 0 0 var(--s4); }
.check { font-family: var(--sans); font-size: .9rem; margin-top: var(--s2); }
.check th { width: 11rem; }
.check tbody th { font-weight: 400; }

/* Link lists on the home page */
.links { list-style: none; padding: 0; }
.links li { margin-bottom: .55em; }
.links a { font-family: var(--sans); }
.links .desc { color: var(--fg-2); }

.table-wrap { overflow-x: auto; margin: 0 0 var(--s2); }
.note { font-size: .93em; color: var(--fg-2); }

/* 6 · Utilities ---------------------------------------------------------- */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden;
                   clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* 7 · Small screens ------------------------------------------------------ */
@media (max-width: 40rem) {
  .site-header__inner, .site-footer__inner, main { padding-left: var(--s2); padding-right: var(--s2); }
  main { padding-top: var(--s3); }
  h1 { font-size: 1.55rem; }
  h2 { font-size: 1.2rem; }
  dl.meta { grid-template-columns: 1fr; gap: .1rem; }
  dl.meta dd { margin-bottom: .6rem; }
  .anchor { opacity: 1; }
  table { font-size: .9rem; }
  th, td { padding: .45rem .5rem; }
  .book-hero { grid-template-columns: 1fr; }
  .book-hero__cover { max-width: 15rem; }
  .cols { columns: 1; }
}

/* 8 · Print -------------------------------------------------------------- */
@media print {
  :root { --bg: #fff; --fg: #000; --fg-2: #333; --rule: #999; --surface: #fff; --accent: #000; }
  body { font-size: 11pt; line-height: 1.45; }
  .skip, .site-nav, .anchor, .site-footer ul, .button, .crumbs,
  .site-footer__hublabel, .site-footer__book, .book-hero__cover { display: none; }
  /* The mark prints as the monochrome variant on white — NBSM III: all-ink, square
     still filled. The ink field is a screen device and does not print. */
  .site-topbar { background: #fff; color: #000; --mark-line: #000; border-bottom: 1px solid #999; }
  .site-topbar__inner { min-height: 0; padding-bottom: var(--s1); }
  .site-topbar__qualifier, .brand { color: #000; }
  main { max-width: none; padding: 0; }
  .prose { max-width: none; }
  a { text-decoration: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; }
  h2, h3 { break-after: avoid; }
  blockquote, table, pre, .docmeta, .cite { break-inside: avoid; }
  .site-header { border-bottom: 1px solid #000; }
  .site-footer { border-top: 1px solid #000; }
}

/* 9 · Dark scheme (system preference only; no toggle, no script) --------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:      var(--ink);
    --fg:      var(--cream);   /* 15.5:1 on ink */
    --fg-2:    var(--pale);    /* 6.2:1 on ink */
    --rule:    var(--deep);
    --surface: #1E2026;
    --accent:  #E0555F;        /* 4.6:1 on ink */
  }
  /* The ink bar sits on an ink page in dark mode: a hairline keeps the edge readable. */
  .site-topbar { border-bottom-color: var(--deep); }
}
