/* TriageCode MD: public stylesheet.
   Palette idea: navy ink on cool white, "blue pen" links, the five triage-level colours as the only
   decoration, and highlighter yellow for hover and "you are here". System fonts cover Amharic text. */

@font-face { font-family: "Atkinson Hyperlegible"; src: url(../fonts/atkinson-hyperlegible-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url(../fonts/atkinson-hyperlegible-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url(../fonts/literata-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Literata"; src: url(../fonts/literata-latin-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Literata"; src: url(../fonts/literata-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --t1: #D93636; --t2: #EE8A2B; --t3: #F2C230; --t4: #3E9E5B; --t5: #2F6FDE;

  --font-ui: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, "Noto Sans", "Noto Sans Ethiopic", Nyala, sans-serif;
  --font-read: "Literata", Georgia, "Noto Serif", "Noto Serif Ethiopic", Nyala, serif;
  --font-code: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", Menlo, monospace;

  --bg: #FAFBFB; --surface: #FFFFFF; --surface-2: #EDF1F3;
  --ink: #0D1B24; --ink-2: #44535E; --ink-3: #6B7A85;
  --rule: #D3DBE0; --link: #1650B8; --hl: #FFE45C; --hl-ink: #0D1B24; --focus: #0D1B24;
  --code-bg: #EDF1F3;
  --monitor: #0A1A22; --monitor-ink: #EAF2F5; --monitor-ink-2: #B4C4CC; --monitor-rule: #2A3C45;
  --c1-bg: #FDEDED; --c2-bg: #FDF1E3; --c3-bg: #FFF8D9; --c4-bg: #E8F5EC; --c5-bg: #E9F1FE;

  --measure: 40rem;
  --wrap: 72rem;
  --radius: 6px;

  /* one spacing scale; each step answers one kind of relationship */
  --space-1: .5rem;                      /* inside a component */
  --space-2: 1rem;                       /* a heading and what it introduces */
  --space-3: 1.5rem;                     /* a page head and its content; the foot of a list */
  --space-4: 2.5rem;                     /* blocks that follow each other on one page or article */
  --space-5: clamp(2.75rem, 6vw, 4rem);  /* page regions: header, sections, footer */
}
[data-theme="dark"] {
  --bg: #0B1419; --surface: #111D24; --surface-2: #17262F;
  --ink: #E8EFF2; --ink-2: #A9BAC3; --ink-3: #7F929D;
  --rule: #26373F; --link: #8DB4FF; --focus: #FFE45C;
  --code-bg: #0F1B22;
  --c1-bg: #2A1618; --c2-bg: #2B1E11; --c3-bg: #2A2511; --c4-bg: #11251B; --c5-bg: #121F34;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0B1419; --surface: #111D24; --surface-2: #17262F;
    --ink: #E8EFF2; --ink-2: #A9BAC3; --ink-3: #7F929D;
    --rule: #26373F; --link: #8DB4FF; --focus: #FFE45C;
    --code-bg: #0F1B22;
    --c1-bg: #2A1618; --c2-bg: #2B1E11; --c3-bg: #2A2511; --c4-bg: #11251B; --c5-bg: #121F34;
  }
}

*, *::before, *::after { box-sizing: border-box; }
/* The hidden attribute must always win, even over a rule that sets display on the same element. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1.5rem; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.6 var(--font-ui); -webkit-font-smoothing: antialiased; }
img, svg, video { max-width: 100%; height: auto; }
h1, h2, h3, h4 { text-wrap: balance; }
.prose p, .prose li, .lead-sum, .post-row-sum, .ft-desc, .notice p { text-wrap: pretty; }
a { color: var(--link); }
::selection { background: var(--hl); color: var(--hl-ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
main:focus { outline: none; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.js-only { display: none; }
.js .js-only { display: inline-flex; }
.skip { position: absolute; left: -999px; top: 0; z-index: 100; background: var(--hl); color: var(--hl-ink); padding: .75rem 1rem; font-weight: 700; }
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- triage colour system ---------- */
.t1 { fill: var(--t1); background: var(--t1); } .t2 { fill: var(--t2); background: var(--t2); }
.t3 { fill: var(--t3); background: var(--t3); } .t4 { fill: var(--t4); background: var(--t4); }
.t5 { fill: var(--t5); background: var(--t5); }
svg .t1, svg .t2, svg .t3, svg .t4, svg .t5 { background: none; }
.stripe { display: flex; height: 6px; }
.stripe i { flex: 1; display: block; }

/* ---------- announcement + header ---------- */
.announce { background: var(--hl); color: var(--hl-ink); font-size: .95rem; font-weight: 700; }
.announce .wrap { padding-block: .55rem; }
.announce a { color: inherit; }
.site-header { background: var(--bg); border-bottom: 1px solid var(--rule); }
.header-row { display: grid; grid-template-columns: 1fr auto auto; grid-template-areas: "brand subscribe toggle" "nav nav nav"; align-items: center; column-gap: .5rem; padding-block: .75rem .35rem; }
.brand { grid-area: brand; display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); justify-self: start; min-height: 44px; }
.mark { flex: none; display: block; }
.brand-name { font-weight: 700; font-size: 1.4rem; letter-spacing: -.01em; }
.brand-md { font-weight: 700; font-size: .78rem; background: var(--hl); color: var(--hl-ink); padding: .12rem .42rem; border-radius: 3px; margin-left: -.15rem; letter-spacing: .02em; }
.theme-toggle { grid-area: toggle; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; background: none; color: var(--ink); border-radius: 999px; cursor: pointer; }
.theme-toggle:hover { background: var(--surface-2); }
.icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: none; } [data-theme="dark"] .icon-sun { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .icon-moon { display: none; } :root:not([data-theme]) .icon-sun { display: block; } }
.nav { grid-area: nav; display: flex; gap: .25rem; margin-inline: -.5rem; overflow-x: auto; }
.nav a { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 .85rem; color: var(--ink); text-decoration: none; font-weight: 700; border-radius: var(--radius); white-space: nowrap; }
.nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.nav a[aria-current="page"] { background: var(--hl); color: var(--hl-ink); }
/* newsletter: a button beside the theme switch (from 360px up); on smaller screens it joins the menu row */
.site-header .subscribe-head { grid-area: subscribe; min-height: 44px; padding: .3rem .7rem; font-size: .95rem; white-space: nowrap; }
.nav .nav-subscribe { display: none; background: var(--ink); color: var(--bg); }
.nav .nav-subscribe:hover { background: var(--hl); color: var(--hl-ink); text-decoration: none; }
@media (max-width: 39.99rem) { .header-row { column-gap: .35rem; } .brand { gap: .4rem; } .brand-name { font-size: 1.2rem; } }
@media (max-width: 23.99rem) {
  .brand { gap: .35rem; } .brand-name { font-size: 1.1rem; }
  .site-header .subscribe-head { padding: .3rem .6rem; font-size: .9rem; }
}
@media (max-width: 22.49rem) {
  .site-header .subscribe-head { display: none; }
  .nav { flex-wrap: wrap; overflow: visible; }
  .nav .nav-subscribe { display: inline-flex; }
}
@media (min-width: 40rem) {
  .header-row { grid-template-columns: auto 1fr auto auto; grid-template-areas: "brand nav subscribe toggle"; column-gap: 1rem; padding-block: .6rem; }
  .nav { justify-self: end; margin-inline: 0; }
  .site-header .subscribe-head { padding: .35rem 1.1rem; font-size: 1rem; }
  .brand { gap: .6rem; } .brand-name { font-size: 1.4rem; }
}

/* ---------- buttons, tags, meta ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .55rem 1.15rem; border-radius: var(--radius); font: 700 1rem var(--font-ui); text-decoration: none; border: 2px solid transparent; cursor: pointer; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--hl); color: var(--hl-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--hl); color: var(--hl-ink); border-color: var(--hl); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--link); text-decoration: underline; cursor: pointer; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: .85rem 0 0; }
.tags a { display: inline-block; padding: .22rem .65rem; border-radius: 4px; background: var(--surface-2); color: var(--ink); font-size: .875rem; text-decoration: none; }
.tags a:hover { background: var(--hl); color: var(--hl-ink); }
.meta { display: flex; flex-wrap: wrap; align-items: center; margin: .5rem 0 0; font-size: .9rem; color: var(--ink-2); }
.meta > * + *::before { content: ""; display: inline-block; width: 1px; height: .9em; margin: 0 .7rem; background: currentColor; opacity: .45; vertical-align: -.1em; }
.avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 700; font-size: .95rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; }
.avatar-xl { width: 96px; height: 96px; font-size: 1.9rem; }
.avatar-photo { object-fit: cover; background: var(--surface-2); }
.author-links { display: flex; flex-wrap: wrap; gap: 0 1.25rem; list-style: none; margin: .5rem 0 0; padding: 0; }
.author-links a { display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; color: var(--ink); font-weight: 700; text-decoration: none; }
.author-links a span { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.author-links a:hover span { text-decoration-thickness: 2px; }
.author-links svg { flex: none; }
.meta-bio { color: var(--ink); font-weight: 700; text-underline-offset: 3px; }

/* ---------- sections and page heads ---------- */
/* sections only add space above themselves, so two sections in a row are one gap apart, and the footer adds the last one */
.section { padding-block: var(--space-5) 0; }
.section-title { font-size: clamp(1.4rem, 3.2vw, 1.7rem); line-height: 1.15; letter-spacing: -.012em; margin: 0 0 var(--space-3); font-weight: 700; }
* + .section-title { margin-top: var(--space-4); }
.page-head { margin-bottom: var(--space-3); }
.section > .prose, .section > .notice { max-width: var(--measure); }
.section > .prose h2 { font-size: 1.45rem; margin: 1.9em 0 .5em; }
.page-title { font-size: clamp(2rem, 6vw, 3rem); line-height: 1.1; letter-spacing: -.015em; margin: 0; font-weight: 700; }
.page-intro { font-family: var(--font-read); font-size: 1.15rem; color: var(--ink-2); margin: .75rem 0 0; max-width: var(--measure); }
.crumb { margin: 0 0 .5rem; font-size: .95rem; }
.empty-note { color: var(--ink-2); max-width: var(--measure); }
.author-head { display: flex; gap: var(--space-3); align-items: center; }
@media (max-width: 39.99rem) { .author-head { flex-direction: column; align-items: flex-start; gap: var(--space-2); } .avatar-xl { width: 80px; height: 80px; font-size: 1.6rem; } }
.founder-head { align-items: flex-start; }
.founder-name { margin: .75rem 0 0; font-size: 1.35rem; font-weight: 700; letter-spacing: -.005em; }
.founder-role { margin: .1rem 0 0; color: var(--ink-2); font-size: 1.05rem; }
.founder-text { max-width: var(--measure); }
.founder-text > p:first-child { font-size: 1.28rem; line-height: 1.65; }
.founder-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: var(--space-4) 0 0; }

/* ---------- home masthead ---------- */
.masthead { background: var(--monitor); color: var(--monitor-ink); }
.masthead :focus-visible, .site-footer :focus-visible { outline-color: var(--hl); }
.masthead-grid { display: grid; gap: 2.25rem; padding-block: 2.75rem 3rem; align-items: center; }
.masthead-title { font-size: clamp(2.25rem, 8.5vw, 4.25rem); line-height: 1.04; letter-spacing: -.02em; margin: 0; max-width: 15ch; font-weight: 700; }
.masthead-lede { font-family: var(--font-read); font-size: 1.15rem; line-height: 1.6; color: var(--monitor-ink-2); max-width: 34rem; margin: 1.25rem 0 0; }
.masthead-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.75rem 0 0; }
.masthead .btn-primary { background: var(--hl); color: var(--hl-ink); }
.masthead .btn-primary:hover { background: #fff; }
.masthead .btn-ghost { color: var(--monitor-ink); border-color: var(--monitor-ink-2); }
.masthead .btn-ghost:hover { background: var(--hl); color: var(--hl-ink); border-color: var(--hl); }
.flow { width: 100%; max-width: 22rem; justify-self: start; }
.flow-node { fill: none; stroke: var(--monitor-ink); stroke-width: 2; }
.flow-node-text { fill: var(--monitor-ink); font: 700 16px var(--font-ui); }
.flow-line { fill: none; stroke: var(--monitor-ink-2); stroke-width: 2; stroke-linejoin: round; }
.flow-bar { background: none; }
.flow-label { fill: var(--monitor-ink); font: 400 15px var(--font-ui); }
.flow-num { font-weight: 700; }
@media (min-width: 52rem) {
  .masthead-grid { grid-template-columns: minmax(0, 1fr) 22rem; gap: 3rem; padding-block: 4rem; }
  .flow { justify-self: end; }
}

/* ---------- post lists ---------- */
.lead { display: grid; gap: 1.25rem; }
.lead-media { display: block; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); aspect-ratio: 16 / 9; }
.lead-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lead-title { font-size: clamp(1.65rem, 5vw, 2.4rem); line-height: 1.13; letter-spacing: -.012em; margin: 0; font-weight: 700; }
.lead-sum { font-family: var(--font-read); font-size: 1.1rem; color: var(--ink-2); margin: .75rem 0 0; }
@media (min-width: 52rem) { .lead:has(.lead-media) { grid-template-columns: 1.15fr 1fr; gap: 2rem; align-items: center; } }
.lead-title a, .post-row-title a, .result-title a { color: inherit; text-decoration: none; background-image: linear-gradient(var(--hl), var(--hl)); background-repeat: no-repeat; background-position: 0 92%; background-size: 0 .38em; }
.lead-title a:hover, .post-row-title a:hover, .result-title a:hover, .lead-title a:focus-visible, .post-row-title a:focus-visible, .result-title a:focus-visible { background-size: 100% .38em; }
@media (prefers-reduced-motion: no-preference) {
  .lead-title a, .post-row-title a, .result-title a { transition: background-size .18s ease-out; }
}
.post-list { margin-top: var(--space-3); }
.post-row { display: grid; gap: 1rem; padding: 1.4rem 0; border-top: 1px solid var(--rule); }
.post-row.has-thumb { grid-template-columns: minmax(0, 1fr) 6.75rem; align-items: start; }
.post-row-title { font-size: 1.3rem; line-height: 1.2; margin: 0; font-weight: 700; letter-spacing: -.005em; }
.post-row-sum { font-family: var(--font-read); color: var(--ink-2); margin: .5rem 0 0; font-size: 1rem; line-height: 1.55; }
.post-row-thumb { display: block; aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.post-row-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (min-width: 40rem) { .post-row.has-thumb { grid-template-columns: minmax(0, 1fr) 11rem; gap: 1.75rem; } .post-row-thumb { aspect-ratio: 4 / 3; } .post-row-title { font-size: 1.5rem; } }
.more { margin: var(--space-3) 0 0; }
.topic-cloud, .topic-list { list-style: none; padding: 0; margin: 0; }
.topic-cloud { display: flex; flex-wrap: wrap; gap: .5rem; }
.topic-cloud a { display: inline-flex; align-items: center; gap: .55rem; min-height: 44px; padding: 0 .95rem; border-radius: 999px; border: 1px solid var(--rule); color: var(--ink); text-decoration: none; font-weight: 700; background: var(--surface); }
.topic-cloud a:hover { background: var(--hl); color: var(--hl-ink); border-color: var(--hl); }
.count { font-weight: 400; color: var(--ink-2); font-size: .875rem; }
a:hover > .count { color: var(--hl-ink); }
.topic-list li { border-top: 1px solid var(--rule); }
.topic-list a { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 1rem 0; text-decoration: none; color: var(--ink); }
.topic-name { font-size: 1.3rem; font-weight: 700; }
.topic-list a:hover .topic-name { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 5px; text-decoration-color: var(--hl); }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.pager a { font-weight: 700; display: inline-flex; min-height: 44px; align-items: center; }
.pager-now { color: var(--ink-2); font-size: .95rem; }

/* ---------- article ---------- */
.article-head { padding-top: var(--space-4); }
.tags-head { margin: 0 0 1rem; }
.article-title { font-size: clamp(2rem, 6.2vw, 3.5rem); line-height: 1.07; letter-spacing: -.02em; margin: 0; max-width: 20ch; font-weight: 700; text-wrap: balance; }
.article-sub { font-family: var(--font-read); font-style: italic; font-size: clamp(1.15rem, 3vw, 1.4rem); line-height: 1.45; color: var(--ink-2); margin: 1rem 0 0; max-width: 36rem; }
.byline { display: flex; align-items: center; gap: .85rem; margin-top: 1.6rem; }
.byline-name { margin: 0; font-weight: 700; }
.byline-name a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.byline-name a:hover { text-decoration-thickness: 2px; }
.byline .meta { margin-top: .1rem; }
.article-cover { margin-block: var(--space-4) 0; }
.article-cover img { width: 100%; max-height: 32rem; object-fit: cover; border-radius: var(--radius); display: block; }
.article-grid { display: block; padding-top: var(--space-4); }
.article-main { min-width: 0; max-width: var(--measure); }
.article-main > * + * { margin-top: var(--space-4); }
@media (min-width: 64rem) {
  .article-grid { display: grid; grid-template-columns: 14.5rem minmax(0, var(--measure)); column-gap: 3.5rem; }
  .article-grid:not(.has-toc) .article-main { grid-column: 2; }
  .article-grid .pathway { position: sticky; top: 1.5rem; align-self: start; max-height: calc(100vh - 3rem); overflow-y: auto; }
}

/* the pathway: contents drawn as a route; nodes fill in as you read */
.pathway { margin: 0 0 1.75rem; font-size: .95rem; }
.pathway summary { cursor: pointer; font-weight: 700; padding: .65rem 0; min-height: 44px; display: flex; align-items: center; list-style: none; }
.pathway summary::-webkit-details-marker { display: none; }
.pathway summary::after { content: ""; margin-left: .6rem; width: .5rem; height: .5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.pathway details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.pathway-list { --pw: 0px; list-style: none; margin: .25rem 0 0; padding: 0 0 0 1.5rem; position: relative; }
.pathway-list::before, .pathway-list::after { content: ""; position: absolute; left: 5px; top: 1rem; width: 2px; }
.pathway-list::before { bottom: 1rem; background: var(--rule); }
.pathway-list::after { height: var(--pw); background: var(--ink); max-height: calc(100% - 2rem); }
.pathway-list li { position: relative; }
.pathway-list li::before { content: ""; position: absolute; left: -1.5rem; top: .85rem; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--ink-3); z-index: 1; }
.pathway-list li.is-read::before { background: var(--ink); border-color: var(--ink); }
.pathway-list li.is-current::before { background: var(--hl); border-color: var(--ink); }
.pathway-list a { display: block; padding: .4rem .5rem; margin-left: -.5rem; color: var(--ink-2); text-decoration: none; line-height: 1.35; border-radius: 4px; }
.pathway-list a:hover { color: var(--ink); text-decoration: underline; }
.pathway-list li.is-read a { color: var(--ink); }
.pathway-list li.is-current a { background: var(--hl); color: var(--hl-ink); font-weight: 700; }

/* reading text */
.prose { font-family: var(--font-read); font-size: 1.125rem; line-height: 1.72; }
@media (min-width: 48rem) { .prose { font-size: 1.1875rem; } }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose pre, .prose figure, .prose blockquote, .prose .table-wrap { margin-block: 0 1.3em; }
.prose a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; overflow-wrap: anywhere; }
.prose a:hover { text-decoration-thickness: 2px; background: var(--hl); color: var(--hl-ink); }
.prose h2, .prose h3, .prose h4 { font-family: var(--font-ui); line-height: 1.2; letter-spacing: -.01em; font-weight: 700; scroll-margin-top: 1.25rem; }
.prose h2 { font-size: 1.7rem; margin: 2.3em 0 .7em; }
.prose h3 { font-size: 1.3rem; margin: 1.9em 0 .55em; }
.prose h4 { font-size: 1.08rem; margin: 1.6em 0 .4em; }
.prose .anchor { margin-left: .45em; font-weight: 400; text-decoration: none; opacity: 0; color: var(--ink-3); }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose .anchor:focus { opacity: 1; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin-block: .35em; }
.prose li > ul, .prose li > ol { margin-block: .3em 0; }
.prose strong { font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }
.prose blockquote { border-left: 3px solid var(--ink); padding: .1em 0 .1em 1.1rem; font-style: italic; color: var(--ink-2); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose :not(pre) > code { font-family: var(--font-code); font-size: .85em; background: var(--code-bg); padding: .12em .38em; border-radius: 4px; overflow-wrap: anywhere; }
.prose-plain { font-size: 1.05rem; max-width: var(--measure); }

.codeblock { margin-block: 1.6rem; background: var(--code-bg); border-left: 4px solid var(--t5); border-radius: 0 var(--radius) var(--radius) 0; overflow: hidden; }
.codebar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .3rem .5rem .3rem 1.1rem; border-bottom: 1px solid var(--rule); font: 400 .8rem var(--font-ui); color: var(--ink-2); }
.copy-btn { min-height: 32px; padding: 0 .75rem; border: 1px solid var(--rule); border-radius: 4px; background: var(--surface); color: var(--ink); font: 700 .8rem var(--font-ui); cursor: pointer; }
.copy-btn:hover { background: var(--hl); color: var(--hl-ink); border-color: var(--hl); }
.codeblock pre { margin: 0; overflow-x: auto; padding: 1rem 1.1rem; font: 400 .875rem/1.6 var(--font-code); tab-size: 2; }
.codeblock code { font: inherit; background: none; padding: 0; }

.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.table-wrap table { width: 100%; min-width: 28rem; border-collapse: collapse; font: 400 .95rem/1.45 var(--font-ui); }
.table-wrap th, .table-wrap td { padding: .65rem .85rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.table-wrap th { background: var(--surface-2); font-weight: 700; }
.table-wrap tr:last-child td { border-bottom: 0; }

.prose figure { margin: 2rem 0; }
.prose figure img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.prose figcaption, .article-cover figcaption { font: 400 .9rem/1.45 var(--font-ui); color: var(--ink-2); margin-top: .6rem; }
.prose figcaption .credit, .article-cover figcaption .credit { display: block; font-size: .85rem; margin-top: .15rem; }
.prose img { height: auto; border-radius: var(--radius); }

/* callouts: one per triage level; the label carries the meaning, the bar carries the level */
.callout { margin-block: 1.8rem; padding: 1rem 1.2rem 1rem 1.3rem; border-left: 6px solid var(--c); background: var(--cbg); border-radius: 0 var(--radius) var(--radius) 0; font-size: 1rem; line-height: 1.6; }
.callout > :last-child { margin-bottom: 0; }
.callout p { margin-block: 0 .8em; }
.callout-title { font: 700 .98rem var(--font-ui); margin: 0 0 .4rem; color: var(--ink); }
.callout--redflag { --c: var(--t1); --cbg: var(--c1-bg); }
.callout--pitfall { --c: var(--t2); --cbg: var(--c2-bg); }
.callout--key { --c: var(--t3); --cbg: var(--c3-bg); }
.callout--pearl { --c: var(--t4); --cbg: var(--c4-bg); }
.callout--note { --c: var(--t5); --cbg: var(--c5-bg); }

.embed { margin-block: 2rem; aspect-ratio: 16 / 9; position: relative; background: var(--monitor); border-radius: var(--radius); overflow: hidden; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed-poster { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; padding: 1rem; text-align: center; color: var(--monitor-ink); text-decoration: none !important; font-family: var(--font-ui); }
.embed-poster:hover { background: none !important; color: var(--monitor-ink) !important; }
.embed-play { width: 4rem; height: 4rem; border-radius: 999px; background: var(--hl); position: relative; }
.embed-play::after { content: ""; position: absolute; left: 1.45rem; top: 1.1rem; border-left: 1.25rem solid var(--hl-ink); border-top: .9rem solid transparent; border-bottom: .9rem solid transparent; }
.embed-title { font-weight: 700; font-size: 1.05rem; }
.embed-note { font-size: .85rem; color: var(--monitor-ink-2); }

/* videos: the shape follows the choice made in the editor, wide (16:9, YouTube size) or tall (9:16, phone) */
.prose .video { margin: 2rem 0; }
.video-frame, .video .embed { position: relative; margin: 0; background: var(--monitor); border-radius: var(--radius); overflow: hidden; }
.video--landscape .video-frame, .video--landscape .embed { aspect-ratio: 16 / 9; }
.video--portrait .video-frame, .video--portrait .embed { aspect-ratio: 9 / 16; }
.prose .video--portrait { width: min(100%, 22rem, calc(80vh * 9 / 16)); margin: 2rem auto; }
.video-frame video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; background: var(--monitor); }
.video-frame video a { color: var(--monitor-ink); }
.video-missing { margin-block: 2rem; padding: 1rem 1.15rem; border: 1px dashed var(--ink-3); border-radius: var(--radius); color: var(--ink-2); font: 400 .95rem var(--font-ui); }

/* podcast audio and downloadable documents */
.prose .audio { margin: 2rem 0; }
.audio-card { padding: .9rem 1.1rem 1rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.audio-title { display: flex; align-items: center; gap: .6rem; margin: 0 0 .65rem; font: 700 1rem/1.3 var(--font-ui); color: var(--ink); }
.audio-icon { flex: none; width: 1.7rem; height: 1.7rem; border-radius: 999px; background: var(--ink); position: relative; }
.audio-icon::before { content: ""; position: absolute; left: .62rem; top: .42rem; width: .36rem; height: .62rem; border-radius: .18rem; background: var(--bg); }
.audio-icon::after { content: ""; position: absolute; left: .45rem; top: .74rem; width: .6rem; height: .34rem; border: 2px solid var(--bg); border-top: 0; border-radius: 0 0 .4rem .4rem; box-sizing: border-box; }
.audio-card audio { display: block; width: 100%; height: 44px; }
.audio-dl { margin: .5rem 0 0; font: 400 .9rem var(--font-ui); }
.audio-dl a { display: inline-flex; align-items: center; min-height: 32px; color: var(--ink-2); }
.audio-missing, .file-missing { margin-block: 2rem; padding: 1rem 1.15rem; border: 1px dashed var(--ink-3); border-radius: var(--radius); color: var(--ink-2); font: 400 .95rem var(--font-ui); }
.file-card { display: flex; align-items: center; gap: 1rem; margin-block: 2rem; padding: .9rem 1.1rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); font-family: var(--font-ui); }
.file-badge { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 3.2rem; height: 3.2rem; padding: 0 .4rem; border-radius: var(--radius); background: var(--ink); color: var(--bg); font: 700 .78rem/1 var(--font-ui); letter-spacing: .03em; }
.file-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.file-title { font-weight: 700; font-size: 1.02rem; line-height: 1.3; color: var(--ink); overflow-wrap: anywhere; }
.file-desc { font-size: .92rem; line-height: 1.4; color: var(--ink-2); }
.file-meta { font-size: .85rem; color: var(--ink-2); }
.file-dl { flex: none; min-height: 44px; }
@media (max-width: 30rem) {
  .file-card { flex-wrap: wrap; }
  .file-body { flex-basis: calc(100% - 4.4rem); }
  .file-dl { width: 100%; }
}

/* references (Vancouver): superscript numbers in the text, a numbered list at the end, only when something is cited */
.cite { font: 700 .72rem/0 var(--font-ui); vertical-align: super; white-space: nowrap; margin-left: .08em; }
.cite a { text-decoration: none; padding: .15em .12em; border-radius: 2px; }
.cite a:hover { background: var(--hl); color: var(--hl-ink); }
.references { margin-top: 3rem; padding-top: 1.1rem; border-top: 1px solid var(--rule); font-size: .95rem; line-height: 1.55; }
.prose .references h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
.reflist { padding-left: 2em; margin: 0; }
.reflist li { margin-block: 0 .55rem; padding-left: .2em; overflow-wrap: anywhere; }
.reflist li::marker { font-weight: 700; color: var(--ink-2); }
.reflist li:target { background: var(--hl); color: var(--hl-ink); border-radius: 3px; }
.reflist li:target a { color: var(--hl-ink); }
.refback { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 24px; margin-left: .15em; font-size: .9em; text-decoration: none; vertical-align: middle; }
sup:target, .cite:target { background: var(--hl); color: var(--hl-ink); border-radius: 3px; }

.notice { margin: 0; padding: 1rem 1.15rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); color: var(--ink-2); font-size: .92rem; line-height: 1.55; }
.notice p { margin: 0; }
* + .notice { margin-top: var(--space-4); }
.share-title, .author-card-name, .subscribe-title { font-size: 1.2rem; line-height: 1.25; letter-spacing: -.005em; margin: 0; font-weight: 700; }
.share-title { margin-bottom: .25rem; }
/* the Share button by the author's name: the phone's own share sheet on touch screens, a small menu on computers */
.byline { flex-wrap: wrap; }
.share-pop { position: relative; margin-left: auto; }
.share-btn { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: 0 1rem; border: 2px solid var(--ink); border-radius: var(--radius); background: transparent; color: var(--ink); font: 700 1rem var(--font-ui); text-decoration: none; cursor: pointer; }
.share-btn:hover, .share-btn[aria-expanded="true"] { background: var(--hl); color: var(--hl-ink); border-color: var(--hl); }
.share-panel { position: absolute; z-index: 20; top: calc(100% + .4rem); right: 0; width: min(17rem, calc(100vw - 2rem)); padding: .35rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(13, 27, 36, .2); }
.share-panel[hidden] { display: none; }
.share-panel ul { list-style: none; margin: 0; padding: 0; }
.share-panel a, .share-panel button { display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 44px; padding: 0 .75rem; border: 0; border-radius: 4px; background: none; color: var(--ink); font: 700 1rem var(--font-ui); text-align: left; text-decoration: none; cursor: pointer; }
.share-panel a:hover, .share-panel button:hover { background: var(--hl); color: var(--hl-ink); }
.share-panel .ic { flex: none; }
@media (max-width: 39.99rem) { .share-pop { flex-basis: 100%; margin-left: 0; } .share-panel { left: 0; right: auto; } }

/* reactions at the end of an article (JavaScript only) */
.js .react.js-only { display: block; }
.react { padding-top: var(--space-3); border-top: 1px solid var(--rule); }
.react-title { font-size: 1.2rem; line-height: 1.25; letter-spacing: -.005em; margin: 0 0 .75rem; font-weight: 700; }
.react-btns { display: flex; flex-wrap: wrap; gap: .6rem; }
.react-btn { display: inline-flex; align-items: center; gap: .55rem; min-height: 48px; padding: 0 1.15rem; border: 2px solid var(--ink); border-radius: 999px; background: var(--surface); color: var(--ink); font: 700 1rem var(--font-ui); cursor: pointer; }
.react-btn:hover { background: var(--hl); color: var(--hl-ink); border-color: var(--hl); }
.react-btn .ic-on { display: none; }
.react-btn[aria-pressed="true"] { background: var(--hl); color: var(--hl-ink); border-color: var(--hl-ink); }
.react-btn[aria-pressed="true"] .ic-on { display: block; }
.react-btn[aria-pressed="true"] .ic-off { display: none; }
.react-btn[data-kind="love"][aria-pressed="true"] .ic-on { color: var(--t1); }
.react-btn[aria-disabled="true"] { opacity: .7; cursor: progress; }
.react-count { min-width: 1ch; font-variant-numeric: tabular-nums; }
.react-count[hidden] { display: none; }
.react-note { min-height: 1.5em; margin: .6rem 0 0; color: var(--ink-2); font-size: .92rem; }
/* ---------- the ad box: small, labelled, quiet (see Ads). Drawn only when an ad is switched on. ---------- */
.ad { max-width: 36rem; }
.ad-top { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 1.6rem; margin-bottom: .3rem; }
.ad-label { margin: 0; font-size: .75rem; line-height: 1.2; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; color: var(--ink-2); }
.ad-by { text-transform: none; letter-spacing: 0; font-weight: 400; }
.ad-toggle { min-height: 26px; padding: 0 .65rem; border: 1px solid var(--rule); border-radius: 999px; background: transparent; color: var(--ink-2); font: 700 .75rem var(--font-ui); cursor: pointer; }
.ad-toggle[hidden] { display: none; }
.ad-toggle:hover { color: var(--ink); border-color: var(--ink); }
.ad-card { position: relative; display: flex; gap: .9rem; align-items: center; padding: .65rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.ad-media { position: relative; flex: none; width: 6.5rem; aspect-ratio: 4 / 3; border-radius: 4px; overflow: hidden; background: var(--surface-2); }
.ad-slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility 0s linear .6s; }
.ad-slide.is-on { opacity: 1; visibility: visible; transition: opacity .6s ease; }
.ad-dots { position: absolute; left: 0; right: 0; bottom: .3rem; display: flex; justify-content: center; gap: .25rem; }
.ad-dot { width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, .55); box-shadow: 0 0 0 1px rgba(13, 27, 36, .35); }
.ad-dot.is-on { background: #fff; }
.ad-body { min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.ad-head { margin: 0; font-weight: 700; font-size: .98rem; line-height: 1.3; overflow-wrap: anywhere; }
.ad-text { margin: 0; color: var(--ink-2); font-size: .88rem; line-height: 1.45; overflow-wrap: anywhere; }
.ad-more { margin: .25rem 0 0; font-size: .88rem; font-weight: 700; }
.ad-link { color: var(--link); text-underline-offset: 3px; }
.ad-link::after { content: ""; position: absolute; inset: 0; }   /* the whole box is the link */
.ad-link:focus-visible { outline: none; }
.ad-link:focus-visible::after { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--radius); }
.ad-card:hover .ad-link { text-decoration-thickness: 2px; }
@media (min-width: 40rem) { .ad-media { width: 8.5rem; } .ad-head { font-size: 1.02rem; } }
@media (prefers-reduced-motion: reduce) { .ad-slide, .ad-slide.is-on { transition: none; } }
.ad-preview { margin-top: var(--space-2); }
.ad-slot { margin-top: var(--space-4); }
.share ul { display: flex; flex-wrap: wrap; gap: .25rem 1.1rem; list-style: none; padding: 0; margin: 0; }
.share a, .share button { display: inline-flex; min-height: 44px; align-items: center; font-weight: 700; }
.author-card { display: flex; gap: var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--rule); }
.author-card-title { margin: .1rem 0 0; color: var(--ink-2); font-size: .95rem; }
.author-card-bio { margin: .6rem 0 0; font-family: var(--font-read); font-size: 1rem; line-height: 1.6; }
.prevnext { display: grid; gap: var(--space-2); margin-top: var(--space-5); }
.pn { display: block; padding: 1rem 1.1rem; border: 1px solid var(--rule); border-radius: var(--radius); text-decoration: none; color: var(--ink); background: var(--surface); }
.pn:hover { background: var(--hl); color: var(--hl-ink); border-color: var(--hl); }
.pn-dir { display: block; font-size: .875rem; color: var(--ink-2); }
.pn:hover .pn-dir { color: var(--hl-ink); }
.pn-title { display: block; font-weight: 700; font-size: 1.1rem; line-height: 1.25; margin-top: .15rem; }
@media (min-width: 40rem) { .prevnext { grid-template-columns: 1fr 1fr; } .pn-next { text-align: right; grid-column: 2; } .pn-prev { grid-column: 1; } }
.preview-bar { background: var(--hl); color: var(--hl-ink); font-size: .95rem; }
.preview-bar .wrap { padding-block: .6rem; }
.preview-bar a { color: inherit; font-weight: 700; margin-left: .5rem; }
.related .post-row { padding-block: 1.1rem; }

/* ---------- people, search, errors ---------- */
.people { list-style: none; padding: 0; margin: 0; max-width: var(--measure); }
.person { display: flex; gap: 1rem; padding: 1.1rem 0; border-top: 1px solid var(--rule); }
.person-name { margin: 0; font-weight: 700; font-size: 1.15rem; }
.person-title { margin: .1rem 0 0; color: var(--ink-2); }
.person-bio { margin: .5rem 0 0; font-family: var(--font-read); }
.search-form { margin-bottom: var(--space-3); max-width: var(--measure); }
.search-form label { display: block; font-weight: 700; margin-bottom: .4rem; }
.search-row { display: flex; gap: .6rem; }
.search-row input { flex: 1; min-width: 0; min-height: 44px; padding: 0 .85rem; font: 400 1.05rem var(--font-ui); color: var(--ink); background: var(--surface); border: 2px solid var(--ink-3); border-radius: var(--radius); }
.search-count { color: var(--ink-2); margin: 0 0 .5rem; }
.results { list-style: none; padding: 0; margin: 0; }
.result { padding: 1.2rem 0; border-top: 1px solid var(--rule); max-width: var(--measure); }
.result-title { font-size: 1.3rem; margin: 0; line-height: 1.2; }
.result-snip { font-family: var(--font-read); color: var(--ink-2); margin: .45rem 0 0; }
.notfound .page-title { max-width: 18ch; }

/* ---------- footer ---------- */
.site-footer { background: var(--monitor); color: var(--monitor-ink-2); margin-top: var(--space-5); }
.site-footer a { color: var(--monitor-ink); }
.footer-grid { display: grid; gap: var(--space-3); padding-block: var(--space-4) var(--space-3); }
.footer-brand { display: flex; align-items: center; gap: .6rem; margin: 0; font-weight: 700; font-size: 1.15rem; color: var(--monitor-ink); }
.footer-tag { margin: .4rem 0 0; font-family: var(--font-read); font-style: italic; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; }
.footer-nav ul { list-style: none; margin: 0; padding: 0; }
.footer-nav a { display: inline-flex; min-height: 36px; align-items: center; }
.author-card-more { margin: .5rem 0 0; font-size: .95rem; }
.social { display: flex; flex-wrap: wrap; gap: .6rem; list-style: none; margin: 1.1rem 0 0; padding: 0; }
.social a { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1.5px solid var(--monitor-ink-2); border-radius: 50%; }
.social a:hover { background: var(--hl); border-color: var(--hl); color: var(--hl-ink); }
.social svg { display: block; width: 20px; height: 20px; }
.footer-note { margin: 0; font-size: .875rem; line-height: 1.55; max-width: 44rem; }
.footer-legal { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem var(--space-3); padding-top: var(--space-2); border-top: 1px solid var(--monitor-rule); font-size: .875rem; }
.footer-legal p { margin: 0; }
.legal-links { display: flex; flex-wrap: wrap; gap: 0 var(--space-3); list-style: none; margin: 0; padding: 0; }
.legal-links a { display: inline-flex; min-height: 36px; align-items: center; }
@media (min-width: 52rem) { .footer-grid { grid-template-columns: 1fr auto; } .footer-note, .footer-legal { grid-column: 1 / -1; } }

/* very narrow phones: give the words room */
@media (max-width: 22.49rem) {
  .post-row.has-thumb { grid-template-columns: minmax(0, 1fr) 5rem; gap: .75rem; }
  .meta { column-gap: 1rem; }
  .meta > * + *::before { display: none; }
}

/* ---------- print (handouts) ---------- */
@media print {
  .stripe, .site-header, .site-footer, .pathway, .share, .share-pop, .react, .subscribe-card, .prevnext, .related, .announce, .skip, .copy-btn, .theme-toggle, .preview-bar, .ad { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .prose { font-size: 11pt; }
  .prose a { color: #000; }
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; }
  .article-grid { display: block; }
  .callout { break-inside: avoid; }
  .video-frame, .video .embed { display: none !important; }
  .video::before { content: "Video: watch it on the website"; display: block; font: 700 .9rem var(--font-ui); }
  .audio audio, .audio-dl, .file-dl { display: none !important; }
  .audio-card, .file-card { break-inside: avoid; border-color: #000; }
  .audio-title::after { content: " (audio: listen on the website)"; font-weight: 400; }
  .references { break-inside: avoid-page; }
  .prose .cite a::after { content: none !important; }
}
@media (prefers-contrast: more) { :root { --rule: #7F8C94; } }
@media (forced-colors: active) { .callout, .notice, .pn, .audio-card, .file-card, .share-panel, .ad-card { border: 1px solid CanvasText; } .react-btn[aria-pressed="true"] { border-width: 4px; } .file-badge, .audio-icon { forced-color-adjust: none; background: ButtonText; color: ButtonFace; } }

/* ---------- featured topics, newsletter box, legal pages ---------- */
.featured-topics { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3) var(--space-4); }
@media (min-width: 40rem) { .featured-topics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.featured-topics a { display: flex; flex-direction: column; gap: .4rem; height: 100%; padding-top: 1rem; border-top: 3px solid var(--ink); color: var(--ink); text-decoration: none; }
.ft-name { font-size: 1.35rem; font-weight: 700; line-height: 1.2; letter-spacing: -.005em; }
.featured-topics a:hover .ft-name, .featured-topics a:focus-visible .ft-name { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--hl); text-underline-offset: 5px; }
.ft-desc { font-family: var(--font-read); color: var(--ink-2); line-height: 1.5; }
.ft-count { font-size: .875rem; color: var(--ink-2); margin-top: auto; }
.subscribe-card { background: var(--monitor); color: var(--monitor-ink); border: 1px solid var(--monitor-rule); border-radius: var(--radius); padding: var(--space-3); }
.subscribe-card :focus-visible { outline-color: var(--hl); }
.subscribe-text { margin: .5rem 0 1rem; color: var(--monitor-ink-2); max-width: 32rem; }
.subscribe-card p:last-child { margin-bottom: 0; }
.subscribe-card .btn-primary { background: var(--hl); color: var(--hl-ink); }
.subscribe-card .btn-primary:hover { background: #fff; }
.legal-more { margin-top: var(--space-4); color: var(--ink-2); }
