/* ==========================================================================
   Telehealth Montreal — clinical-modern health desk
   White + mist, deep teal ink, hairline rules, Plex numerals, journal serif.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* palette */
  --white: #fff;
  --mist: #F2F7F7;
  --mist-2: #E7F0F1;
  --teal: #0B4F5C;
  --teal-dark: #083B45;
  --mint: #2EC4A0;
  --mint-ink: #08755E;          /* mint darkened for text (5.2:1 on mist) */
  --mint-wash: #DDF5EE;
  --coral: #FF6B57;             /* fills, dots, rules only */
  --coral-ink: #B8402F;         /* coral darkened for text */
  --slate: #1E2A30;
  --slate-2: #33434B;
  --muted: #55656C;             /* 5.6:1 on mist */
  --faint: #8FA4AA;             /* decorative only */
  --hair: #D7E3E5;
  --hair-strong: #B7CACE;

  /* section accent (default for unknown sections; see §3) */
  --accent: #6B7C83;
  --accent-ink: #4E5E65;

  /* type */
  --serif: "Source Serif 4", "Source Serif Pro", "Iowan Old Style", Georgia, serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --fs-label: .7rem;
  --fs-meta: .8rem;
  --fs-body: clamp(1.0625rem, 1rem + .25vw, 1.125rem);
  --fs-lead: clamp(1.85rem, 1.25rem + 2.5vw, 2.9rem);
  --fs-h1: clamp(2.05rem, 1.45rem + 2.5vw, 3.2rem);
  --measure: 41rem;             /* ~70 characters of Plex at body size */

  /* layout */
  --wrap: 1220px;
  --gutter: clamp(1rem, 3.6vw, 2.5rem);
  --radius: 4px;
  --rail-top: 3px solid var(--teal);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--white);
  color: var(--slate);
  font: 400 1rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
main { flex: 1 0 auto; }
main:focus { outline: none; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
time, .meta, .num { font-variant-numeric: tabular-nums; }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 2px; }
@supports selector(:has(*)) {
  .card:has(.stretch:focus-visible) { outline: 2px solid var(--teal); outline-offset: 6px; border-radius: 2px; }
  .card .stretch:focus-visible { outline: none; }
}

.vh {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: var(--gutter); top: -200px; z-index: 50;
  padding: .75rem 1.1rem; background: var(--teal); color: var(--white);
  font-weight: 600; text-decoration: none; border-radius: var(--radius);
}
.skip:focus { top: .5rem; outline-color: var(--mint); }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* --------------------------------------------------------------------------
   3. Section accents — one per category, default above for new slugs
   -------------------------------------------------------------------------- */
.cat-virtual-care  { --accent: #2EC4A0; --accent-ink: #08755E; }  /* mint */
.cat-seniors       { --accent: #5E8794; --accent-ink: #456B77; }  /* slate-teal */
.cat-mental-health { --accent: #FF6B57; --accent-ink: #B8402F; }  /* coral */
.cat-health-system { --accent: #0B4F5C; --accent-ink: #0B4F5C; }  /* deep teal */
.cat-research      { --accent: #1F8CA3; --accent-ink: #16707F; }  /* lab cyan */

/* --------------------------------------------------------------------------
   4. Shared atoms: labels, kicker, meta, pill, arrows, stretched links
   -------------------------------------------------------------------------- */
.label, .rail-h, .kicker, .latest-cat, .rel-cat, .row-date, .feature-date, .stat dt, .foot-h {
  font-family: var(--sans);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: .11em;
  line-height: 1.3;
  text-transform: uppercase;
}
.label { color: var(--muted); }

.kicker {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: .5rem;
  padding-block: .35rem;
  color: var(--accent-ink);
  text-decoration: none;
}
.kicker::before { content: ""; width: .95rem; height: 3px; background: var(--accent); border-radius: 1px; }
.kicker:hover { text-decoration: underline; text-underline-offset: .25em; }

.meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .7rem;
  font-size: var(--fs-meta); color: var(--muted);
}
.meta > * + * { padding-left: .7rem; border-left: 1px solid var(--hair-strong); }
.meta > .pill { border-left: 0; padding-left: .55rem; }

.pill {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .22rem .6rem .22rem .5rem;
  background: var(--mint-wash); color: var(--teal);
  border-radius: 3px;
  font: 500 .75rem/1.3 var(--sans); font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pill::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: var(--mint); }

.arrow {
  display: inline-block; width: .7em; height: .7em; margin-left: .45em;
  border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-.1em, .1em);
  transition: transform .2s var(--ease);
}
.arrow-back { margin: 0 .45em 0 0; transform: rotate(-135deg) translate(-.1em, .1em); }
a:hover > .arrow:not(.arrow-back) { transform: rotate(45deg) translate(.1em, -.1em); }

.arrow-link {
  display: inline-flex; align-items: center; min-height: 44px;
  font-weight: 500; font-size: .9rem; color: var(--teal);
  text-decoration: none;
}
.arrow-link:hover { text-decoration: underline; text-decoration-color: var(--mint); text-decoration-thickness: 2px; text-underline-offset: .3em; }

.card { position: relative; }
.stretch { text-decoration: none; }
.stretch::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.card:hover .stretch {
  text-decoration: underline; text-decoration-color: var(--accent);
  text-decoration-thickness: 2px; text-underline-offset: .18em;
}

/* rail headings: small caps label with a teal rule above */
.rail-h {
  display: flex; align-items: center; gap: .6rem;
  padding-top: .9rem; margin-bottom: .35rem;
  border-top: var(--rail-top);
  color: var(--teal);
}
.rail-pulse { width: 30px; height: 15px; flex: none; color: var(--teal); }
.rail-pulse .pulse-dot { fill: var(--coral); }
.live { position: relative; width: .55rem; height: .55rem; border-radius: 50%; background: var(--mint); flex: none; }
.live::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1.5px solid var(--mint); opacity: 0;
  animation: ping 2.4s var(--ease) infinite;
}
@keyframes ping { 0% { transform: scale(.4); opacity: .9; } 70%, 100% { transform: scale(1.25); opacity: 0; } }

/* --------------------------------------------------------------------------
   5. Media frames + designed placeholder (ECG paper)
   -------------------------------------------------------------------------- */
.media {
  position: relative; overflow: hidden;
  aspect-ratio: 3 / 2;
  background: var(--mist);
  border-radius: var(--radius);
}
.media img { width: 100%; height: 100%; object-fit: cover; transition: opacity .25s; }
.card:hover .media img { opacity: .9; }

.ph {
  position: absolute; inset: 0;
  display: flex; align-items: flex-end; padding: .75rem;
  background-color: color-mix(in srgb, var(--accent) 7%, var(--mist));
  background-image:
    linear-gradient(color-mix(in srgb, var(--accent) 16%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 16%, transparent) 1px, transparent 1px);
  background-size: 18px 18px;
  background-position: -1px -1px;
}
.ph-trace {
  position: absolute; left: 0; top: 50%; width: 100%; height: 46%;
  transform: translateY(-50%);
  fill: none; stroke: var(--accent); stroke-width: 2;
  stroke-linejoin: round; stroke-linecap: round;
}
.ph-trace path { vector-effect: non-scaling-stroke; }
.ph-label {
  position: relative;
  padding: .35rem .55rem; border-radius: 2px;
  background: var(--white); color: var(--accent-ink);
  font: 600 .66rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   6. Masthead: utility bar, wordmark, section nav
   -------------------------------------------------------------------------- */
.util { background: var(--mist); border-bottom: 1px solid var(--hair); font-size: .78rem; color: var(--muted); }
.util-in { display: flex; align-items: center; gap: .25rem 1.25rem; min-height: 2.25rem; flex-wrap: wrap; }
.util-place {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: var(--fs-label); font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--teal);
}
.util-place::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 3px var(--mint-wash); }
.util-date { font-variant-numeric: tabular-nums; padding-left: 1.25rem; border-left: 1px solid var(--hair-strong); }
.util-links { display: none; margin: 0 0 0 auto; padding: 0; list-style: none; gap: 1.25rem; }
.util-links a { text-decoration: none; color: var(--slate-2); font-weight: 500; }
.util-links a:hover, .util-links a[aria-current] { color: var(--teal); text-decoration: underline; text-underline-offset: .25em; }

.brand {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding-block: clamp(1.1rem, 2.6vw, 1.9rem);
}
.wordmark {
  display: inline-flex; align-items: center; gap: .65rem;
  color: var(--teal); text-decoration: none;
}
.wm-pulse { width: clamp(34px, 4.4vw, 50px); height: auto; flex: none; color: var(--teal); }
.wm-pulse .pulse-dot { fill: var(--coral); }
.wm-a { font: 600 clamp(1.75rem, 1.2rem + 2.2vw, 2.65rem)/1 var(--serif); letter-spacing: -.02em; }
.wm-b {
  align-self: center;
  margin-left: .1rem; padding: .3rem 0 .3rem .75rem;
  border-left: 1px solid var(--hair-strong);
  font: 500 clamp(.68rem, .6rem + .35vw, .82rem)/1 var(--sans);
  letter-spacing: .26em; text-transform: uppercase; color: var(--slate-2);
}
.wordmark:hover .wm-a { text-decoration: underline; text-decoration-color: var(--mint); text-decoration-thickness: 2px; text-underline-offset: .15em; }
.brand-tag { display: none; max-width: 36ch; font-size: .85rem; line-height: 1.45; color: var(--muted); text-align: right; text-wrap: balance; }

.sections { border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); background: var(--white); }
.sections-list {
  display: flex; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); list-style: none;
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  /* scroll shadows: only visible when there is more to scroll */
  background:
    linear-gradient(90deg, var(--white) 30%, rgba(255,255,255,0)) left / 2.5rem 100% no-repeat local,
    linear-gradient(270deg, var(--white) 30%, rgba(255,255,255,0)) right / 2.5rem 100% no-repeat local,
    linear-gradient(90deg, rgba(11,79,92,.14), rgba(11,79,92,0)) left / .8rem 100% no-repeat scroll,
    linear-gradient(270deg, rgba(11,79,92,.14), rgba(11,79,92,0)) right / .8rem 100% no-repeat scroll;
}
.sections-list::-webkit-scrollbar { display: none; }
.sections-list li { flex: none; }
.sections-list a {
  position: relative;
  display: flex; align-items: center; gap: .55rem;
  min-height: 48px; padding: 0 .85rem;
  font-size: .9rem; font-weight: 500; color: var(--slate);
  text-decoration: none; white-space: nowrap;
}
.sections-list li:first-child a { padding-left: 0; }
.sections-list a::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); flex: none; }
.sections-list .nav-extra a::before { border-radius: 1px; background: var(--hair-strong); }
.sections-list a::after {
  content: ""; position: absolute; left: .85rem; right: .85rem; bottom: 0; height: 3px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .22s var(--ease);
}
.sections-list li:first-child a::after { left: 0; }
.sections-list a:hover::after, .sections-list a[aria-current]::after { transform: scaleX(1); }
.sections-list a[aria-current] { color: var(--teal); font-weight: 600; }
.sections-list a:focus-visible { outline-offset: -2px; }

/* --------------------------------------------------------------------------
   7. Home — lead + health desk
   -------------------------------------------------------------------------- */
.front { display: grid; gap: 2rem; padding-block: clamp(1.25rem, 3vw, 2.25rem) clamp(2rem, 4vw, 3rem); }

.lead-media { aspect-ratio: 3 / 2; }
.lead-body { display: grid; gap: .6rem; align-content: start; padding-top: 1.1rem; }
.lead-body .kicker { justify-self: start; }
.lead-title {
  font: 600 var(--fs-lead)/1.07 var(--serif);
  letter-spacing: -.02em; text-wrap: balance;
}
.lead-title a { color: var(--slate); }
.lead-sum { max-width: 60ch; font-size: clamp(1.02rem, .95rem + .3vw, 1.15rem); line-height: 1.55; color: var(--slate-2); text-wrap: pretty; }
.lead .meta { margin-top: .35rem; }

.desk {
  align-self: start;
  padding: 0 1.25rem .4rem;
  background: var(--mist);
  border-radius: 0 0 var(--radius) var(--radius);
}
.desk .rail-h { margin-inline: -1.25rem; padding-inline: 1.25rem; }
.desk-list { margin: 0; padding: 0; list-style: none; }
.desk-item {
  display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); gap: .75rem;
  padding: 1rem 0 1.1rem;
  border-top: 1px solid var(--hair);
}
.desk-item:first-child { border-top: 0; }
.desk-n {
  font: 500 1.75rem/1 var(--sans); font-variant-numeric: tabular-nums;
  letter-spacing: -.02em; color: var(--teal);
  padding-top: .3rem;
}
.desk-z { color: var(--faint); }
.desk-text { display: grid; gap: .3rem; justify-items: start; align-content: start; }
.desk-title { font: 600 1.16rem/1.24 var(--serif); letter-spacing: -.005em; text-wrap: pretty; }
.desk-title a { color: var(--slate); }

/* --------------------------------------------------------------------------
   8. Home — section rows + latest rail
   -------------------------------------------------------------------------- */
.home-body { display: grid; gap: 2.5rem; padding-bottom: clamp(3rem, 6vw, 5rem); }

.srow {
  padding: 0 0 0 clamp(1rem, 2.2vw, 1.6rem);
  border-left: 4px solid var(--accent);
}
.srow + .srow { margin-top: clamp(2.25rem, 4vw, 3.25rem); }
.srow-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: .2rem 1rem;
  padding-bottom: .9rem; margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--hair);
}
.srow-title { font: 600 clamp(1.35rem, 1.15rem + .8vw, 1.7rem)/1.15 var(--serif); letter-spacing: -.012em; }
.srow-title a { color: var(--slate); text-decoration: none; }
.srow-title a:hover { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: .18em; }
.srow-more {
  margin-left: auto;
  display: inline-grid; place-items: center;
  width: 44px; height: 44px;
  border: 1px solid var(--hair); border-radius: var(--radius);
  color: var(--accent-ink); text-decoration: none;
}
.srow-more .arrow { margin: 0; }
.srow-more-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.srow-more:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--white)); }
.srow-desc { flex-basis: 100%; font-size: .88rem; color: var(--muted); }

.srow-body { display: grid; gap: 1.25rem 2rem; }
.srow-body.is-pair .sfeat + .sfeat { padding-top: 1.25rem; border-top: 1px solid var(--hair); }
.sfeat { display: grid; gap: .9rem; align-content: start; }
.sfeat-text { display: grid; gap: .5rem; align-content: start; }
.sfeat-title { font: 600 clamp(1.2rem, 1.1rem + .45vw, 1.38rem)/1.2 var(--serif); letter-spacing: -.008em; text-wrap: pretty; }
.sfeat-title a, .slist-title a { color: var(--slate); }
.sfeat-sum { font-size: .95rem; line-height: 1.55; color: var(--slate-2); text-wrap: pretty; }

.slist { margin: 0; padding: 0; list-style: none; }
.slist li { display: grid; gap: .4rem; padding: .95rem 0; border-top: 1px solid var(--hair); }
.slist-title { font: 600 1.06rem/1.28 var(--serif); text-wrap: pretty; }

.latest { align-self: start; }
.latest-list { margin: 0; padding: 0; list-style: none; }
.latest-item {
  display: grid; grid-template-columns: 4.1rem minmax(0, 1fr); gap: .8rem;
  padding: .85rem 0; border-top: 1px solid var(--hair);
}
.latest-item:first-child { border-top: 0; }
.latest-item time { padding-top: .12rem; font-size: .78rem; font-weight: 500; color: var(--teal); }
.latest-item > div { display: grid; gap: .3rem; justify-items: start; align-content: start; }
.latest-title { font-size: .95rem; font-weight: 500; line-height: 1.38; color: var(--slate); }
.latest-cat { display: inline-flex; align-items: center; gap: .4rem; font-size: .64rem; color: var(--accent-ink); }
.latest-cat::before { content: ""; width: .4rem; height: .4rem; border-radius: 50%; background: var(--accent); }

/* --------------------------------------------------------------------------
   9. Section page: header band, feature, table-of-contents rows, pager
   -------------------------------------------------------------------------- */
.cathead, .profile {
  position: relative; overflow: hidden;
  background: var(--mist);
  border-bottom: 1px solid var(--hair);
}
.cathead {
  background-image:
    linear-gradient(color-mix(in srgb, var(--accent) 9%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 9%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
}
.cathead-trace {
  position: absolute; left: 0; bottom: 0; width: 100%; height: 72px;
  fill: none; stroke: var(--accent); stroke-width: 2; opacity: .55;
  stroke-linejoin: round; stroke-linecap: round;
}
.cathead-trace path { vector-effect: non-scaling-stroke; }
.cathead-in {
  position: relative;
  display: grid; gap: 1.25rem;
  margin-block: clamp(1.5rem, 4vw, 2.75rem) clamp(2.75rem, 6vw, 4.25rem);
  padding-left: clamp(1rem, 2.4vw, 1.75rem);
  border-left: 6px solid var(--accent);
}
.cathead-text { display: grid; gap: .55rem; }
.cathead-title { font: 600 var(--fs-h1)/1.05 var(--serif); letter-spacing: -.022em; color: var(--slate); }
.cathead-desc { max-width: 52ch; font-size: clamp(1rem, .95rem + .25vw, 1.12rem); line-height: 1.5; color: var(--slate-2); }

.stats { display: flex; gap: 0; margin: 0; align-self: end; }
.stat { padding: .2rem 1.25rem 0; border-left: 1px solid var(--hair-strong); }
.stat:first-child { padding-left: 0; border-left: 0; }
.stat dt { color: var(--muted); }
.stat dd {
  margin: .25rem 0 0;
  font: 500 clamp(2rem, 1.6rem + 1.6vw, 2.9rem)/1 var(--sans); font-variant-numeric: tabular-nums;
  letter-spacing: -.02em; color: var(--accent-ink);
}
.stat-of { font-size: .5em; color: var(--muted); margin-left: .1em; }

.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; list-style: none; }
.crumbs li { display: flex; align-items: center; }
.crumbs li + li::before {
  content: ""; width: .38rem; height: .38rem; margin: 0 .7rem 0 .55rem;
  border-top: 1.5px solid var(--faint); border-right: 1.5px solid var(--faint); transform: rotate(45deg);
}
.crumbs a {
  display: inline-flex; align-items: center; min-height: 32px;
  font-size: .8rem; font-weight: 500; color: var(--muted); text-decoration: none;
}
.crumbs a:hover { color: var(--teal); text-decoration: underline; text-underline-offset: .25em; }
.crumbs a[aria-current] { color: var(--slate); }

.listing { padding-block: clamp(1.75rem, 4vw, 3rem) clamp(3rem, 6vw, 5rem); }
.list-h { margin-bottom: .5rem; }

.feature {
  display: grid; gap: 1.1rem;
  padding-bottom: clamp(1.5rem, 3vw, 2.25rem); margin-bottom: .5rem;
  border-bottom: 1px solid var(--hair);
}
.feature-media { aspect-ratio: 16 / 10; }
.feature-text { display: grid; gap: .65rem; align-content: center; justify-items: start; }
.feature-date { color: var(--accent-ink); }
.feature-title { font: 600 clamp(1.6rem, 1.2rem + 1.7vw, 2.35rem)/1.1 var(--serif); letter-spacing: -.018em; text-wrap: balance; }
.feature-title a { color: var(--slate); }
.feature-sum { max-width: 56ch; font-size: 1.02rem; line-height: 1.55; color: var(--slate-2); }

.toc { margin: 0; padding: 0; list-style: none; }
.row + .row { border-top: 1px solid var(--hair); }
.row-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 6.25rem;
  grid-template-areas: "date media" "text media";
  gap: .35rem 1rem;
  padding-block: 1.15rem;
}
.row-date { grid-area: date; display: flex; flex-wrap: wrap; gap: .2rem .7rem; color: var(--accent-ink); }
.row-min { color: var(--muted); font-weight: 500; letter-spacing: .06em; }
.row-text { grid-area: text; display: grid; gap: .35rem; justify-items: start; align-content: start; }
.row-title { font: 600 clamp(1.08rem, 1rem + .5vw, 1.42rem)/1.22 var(--serif); letter-spacing: -.008em; text-wrap: pretty; }
.row-title a { color: var(--slate); }
.row-sum {
  font-size: .94rem; line-height: 1.55; color: var(--slate-2);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.row-by { font-size: var(--fs-meta); color: var(--muted); }
.row-media { grid-area: media; aspect-ratio: 1; align-self: start; }
.row-card:hover .row-title a, .card:hover .row-title a {
  text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: .18em;
}

.pager {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-top: 2rem; padding-top: 1.25rem; border-top: 2px solid var(--slate);
}
.pager-btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem;
  border: 1px solid var(--hair-strong); border-radius: var(--radius);
  font-size: .9rem; font-weight: 500; color: var(--teal); text-decoration: none;
}
a.pager-btn:hover { border-color: var(--teal); background: var(--mist); }
.pager-btn.is-off { color: var(--faint); border-color: var(--hair); }
.pager-n { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   10. Article
   -------------------------------------------------------------------------- */
.art-grid .crumbs, .wrap > .crumbs { padding-top: 1rem; }
.art-grid { display: grid; gap: 3rem; padding-block: .75rem clamp(3rem, 6vw, 5rem); }
.art { min-width: 0; max-width: 47rem; }
.art-head { display: grid; gap: .9rem; justify-items: start; }
.art-title { font: 600 var(--fs-h1)/1.07 var(--serif); letter-spacing: -.022em; color: var(--slate); text-wrap: balance; }
.standfirst {
  font: 400 clamp(1.15rem, 1.05rem + .45vw, 1.38rem)/1.45 var(--serif);
  color: var(--slate-2); text-wrap: pretty;
}
.dateline {
  font-family: var(--sans); font-size: .8em; font-weight: 600;
  letter-spacing: .07em; text-transform: uppercase; color: var(--teal);
}
/* owner rule: nothing inside article prose renders bold, the run-in dateline included */
.article-body .dateline { font-weight: 400; letter-spacing: .09em; }

.byline {
  justify-self: stretch;
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem;
  margin-top: .5rem; padding-block: .9rem;
  border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair);
}
.avatar {
  display: inline-grid; place-items: center; flex: none;
  width: 2.75rem; height: 2.75rem;
  background: var(--teal); color: var(--white);
  border-radius: var(--radius);
  font: 600 .88rem/1 var(--sans); letter-spacing: .06em;
  box-shadow: inset 0 -3px 0 var(--mint);
}
.avatar-lg { width: 4rem; height: 4rem; font-size: 1.15rem; }
.avatar-xl { width: clamp(4.5rem, 3.5rem + 4vw, 6.5rem); height: clamp(4.5rem, 3.5rem + 4vw, 6.5rem); font-size: clamp(1.3rem, 1rem + 1.2vw, 1.9rem); box-shadow: inset 0 -5px 0 var(--mint); }
.byline-text { display: grid; gap: .1rem; min-width: 0; flex: 1 1 14rem; }
.byline-name { font-size: .92rem; color: var(--slate-2); }
.byline-name a { font-weight: 600; color: var(--slate); text-decoration: underline; text-decoration-color: var(--mint); text-decoration-thickness: 2px; text-underline-offset: .2em; }
.byline-name a:hover { color: var(--teal); }
.byline-role { margin-left: .6rem; padding-left: .6rem; border-left: 1px solid var(--hair-strong); color: var(--muted); font-size: .85rem; }
.byline-dates { display: flex; flex-wrap: wrap; gap: 0 .7rem; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.byline-dates span + span { padding-left: .7rem; border-left: 1px solid var(--hair-strong); }

.art-cover { margin: 1.75rem 0 2.25rem; }
.art-media { aspect-ratio: 16 / 9; }
.art-cover figcaption {
  margin-top: .65rem; padding-left: .7rem;
  border-left: 2px solid var(--mint);
  font-size: .78rem; line-height: 1.45; color: var(--muted);
}
.art-cover figcaption a { color: inherit; text-underline-offset: .2em; }
.art-cover figcaption a:hover { color: var(--teal); }
.art-band { position: relative; height: 5.5rem; margin: 1.75rem 0 2.25rem; overflow: hidden; border-radius: var(--radius); }
.art-band .ph { align-items: center; }

/* prose (article + static pages) — never bold inside the text */
.article-body {
  max-width: var(--measure);
  font-size: var(--fs-body); line-height: 1.72; color: var(--slate);
}
.article-body > * { margin: 0 0 1.25em; }
.article-body > :last-child { margin-bottom: 0; }
.article-body p, .article-body li { text-wrap: pretty; }
.article-body strong, .article-body b { font-weight: inherit; }
.article-body a {
  font-weight: inherit; color: var(--teal);
  text-decoration: underline; text-decoration-color: var(--mint);
  text-decoration-thickness: 2px; text-underline-offset: .2em;
  transition: background-color .15s;
}
.article-body a:hover { background: var(--mint-wash); text-decoration-color: var(--teal); }
.article-body h2 {
  margin: 2.1em 0 .65em;
  font: 600 clamp(1.4rem, 1.2rem + .8vw, 1.72rem)/1.2 var(--serif);
  letter-spacing: -.012em; color: var(--slate);
}
.article-body h2::before { content: ""; display: block; width: 2.25rem; height: 3px; margin-bottom: .85rem; background: var(--mint); border-radius: 1px; }
.article-body h3 { margin: 1.8em 0 .5em; font: 600 1.08em/1.3 var(--sans); color: var(--teal); }
.article-body ul, .article-body ol { padding: 0; list-style: none; }
.article-body li { position: relative; margin: .45em 0; }
.article-body ul > li { padding-left: 1.5rem; }
.article-body ul > li::before {
  content: ""; position: absolute; left: .2rem; top: .7em;
  width: .42rem; height: .42rem; background: var(--mint); border-radius: 1px;
}
.article-body ol { counter-reset: n; }
.article-body ol > li { counter-increment: n; padding-left: 2.4rem; }
.article-body ol > li::before {
  content: counter(n, decimal-leading-zero);
  position: absolute; left: 0; top: 0;
  font-size: .82em; line-height: calc(1.72em / .82); font-weight: 600;
  font-variant-numeric: tabular-nums; color: var(--teal);
}
.article-body blockquote {
  margin: 2em 0; padding: .2rem 0 .2rem 1.4rem;
  border-left: 4px solid var(--mint);
  font: italic 400 clamp(1.18rem, 1.08rem + .5vw, 1.42rem)/1.48 var(--serif);
  color: var(--teal);
}
.article-body blockquote p { margin: 0 0 .6em; }
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body table {
  width: 100%; margin: 1.75em 0; border-collapse: collapse;
  font-size: .88rem; line-height: 1.45; font-variant-numeric: tabular-nums;
}
.article-body th {
  padding: .55rem .75rem .55rem 0; text-align: left; vertical-align: bottom;
  border-bottom: 2px solid var(--teal);
  font-size: .68rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--teal);
}
.article-body td { padding: .6rem .75rem .6rem 0; border-bottom: 1px solid var(--hair); vertical-align: top; }
.article-body tbody tr:hover td { background: var(--mist); }
.article-body figure { margin: 2em 0; }
.article-body img { width: 100%; border-radius: var(--radius); }
.article-body figcaption {
  margin-top: .6rem; padding-left: .7rem; border-left: 2px solid var(--mint);
  font-size: .8rem; line-height: 1.5; color: var(--muted);
}
.article-body hr { border: 0; border-top: 1px solid var(--hair); margin: 2em 0; }

.withfiles {
  max-width: var(--measure); margin-top: 2rem; padding-top: 1rem;
  border-top: 1px solid var(--hair);
  font-size: .85rem; color: var(--muted);
}

.authorbox {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .9rem 1.1rem;
  max-width: var(--measure); margin-top: 2.5rem; padding: 1.3rem 1.3rem .5rem;
  background: var(--mist); border-top: var(--rail-top); border-radius: 0 0 var(--radius) var(--radius);
}
.authorbox-head { display: grid; gap: .15rem; }
.authorbox-name { font: 600 1.3rem/1.2 var(--serif); }
.authorbox-bio, .authorbox-link { grid-column: 1 / -1; }
.authorbox-bio { font-size: .95rem; line-height: 1.6; color: var(--slate-2); }
.authorbox-link { justify-self: start; }

.art-aside { min-width: 0; align-self: start; }
.on-wide { display: none; }
.rel-list { margin: 0; padding: 0; list-style: none; }
.rel {
  display: grid; grid-template-columns: minmax(0, 1fr) 5.5rem; gap: 1rem;
  padding: 1rem 0; border-top: 1px solid var(--hair);
}
.rel:first-child { border-top: 0; }
.rel-text { display: grid; gap: .35rem; align-content: start; justify-items: start; }
.rel-cat { display: inline-flex; align-items: center; gap: .4rem; font-size: .64rem; color: var(--accent-ink); }
.rel-cat::before { content: ""; width: .4rem; height: .4rem; border-radius: 50%; background: var(--accent); }
.rel-title { font: 600 1.02rem/1.3 var(--serif); text-wrap: pretty; }
.rel-title a { color: var(--slate); }
.rel-media { aspect-ratio: 1; }
.rel-more { margin-top: .25rem; border-top: 1px solid var(--hair); width: 100%; color: var(--accent-ink); }

/* --------------------------------------------------------------------------
   11. Author profile
   -------------------------------------------------------------------------- */
.profile-in {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.25rem 1.5rem; align-items: start;
  padding-block: clamp(1.75rem, 4vw, 3rem);
}
.profile-text { display: grid; gap: .45rem; }
.profile-name { font: 600 var(--fs-h1)/1.05 var(--serif); letter-spacing: -.022em; }
.profile-bio { max-width: 60ch; font-size: clamp(1rem, .95rem + .25vw, 1.12rem); line-height: 1.55; color: var(--slate-2); }
.profile .stats { grid-column: 1 / -1; }
.profile .stat dd { color: var(--teal); }

/* --------------------------------------------------------------------------
   12. Static pages
   -------------------------------------------------------------------------- */
.pg { display: grid; gap: 2rem; padding-block: clamp(1.75rem, 4vw, 3rem) clamp(3rem, 6vw, 5rem); }
.pg-main { min-width: 0; }
.pg-head { padding-bottom: 1.25rem; margin-bottom: 1.75rem; border-bottom: 1px solid var(--hair); max-width: 68ch; }
.pg-title { font: 600 var(--fs-h1)/1.06 var(--serif); letter-spacing: -.022em; }
.pg-nav { align-self: start; padding: 0 1.1rem .5rem; background: var(--mist); border-top: var(--rail-top); border-radius: 0 0 var(--radius) var(--radius); }
.pg-nav .label { padding-top: .9rem; color: var(--teal); }
.pg-nav ul { margin: .35rem 0 0; padding: 0; list-style: none; }
.pg-nav li + li { border-top: 1px solid var(--hair); }
.pg-nav a {
  display: flex; align-items: center; gap: .55rem; min-height: 44px;
  font-size: .92rem; font-weight: 500; color: var(--slate-2); text-decoration: none;
}
.pg-nav a::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; border: 1.5px solid var(--hair-strong); flex: none; }
.pg-nav a[aria-current] { color: var(--teal); font-weight: 600; }
.pg-nav a[aria-current]::before { background: var(--mint); border-color: var(--mint); }
.pg-nav a:hover { color: var(--teal); }

/* --------------------------------------------------------------------------
   13. 404
   -------------------------------------------------------------------------- */
.nf { padding-block: clamp(2.25rem, 6vw, 4.5rem) clamp(3rem, 6vw, 5rem); }
.nf-hero { display: grid; gap: .9rem; justify-items: start; max-width: 40rem; }
.nf-trace { width: min(100%, 420px); height: auto; margin-bottom: .5rem; fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.nf-beat { stroke: var(--teal); }
.nf-flat { stroke: var(--hair-strong); stroke-dasharray: 6 7; }
.nf-trace circle { fill: var(--coral); stroke: none; }
.nf-code { font: 500 .8rem/1 var(--sans); letter-spacing: .3em; color: var(--coral-ink); font-variant-numeric: tabular-nums; }
.nf-title { font: 600 var(--fs-h1)/1.05 var(--serif); letter-spacing: -.022em; }
.nf-text { font-size: 1.1rem; color: var(--slate-2); }
.btn {
  display: inline-flex; align-items: center; min-height: 48px; margin-top: .5rem; padding: 0 1.25rem;
  background: var(--teal); color: var(--white);
  border-radius: var(--radius);
  font-weight: 500; text-decoration: none;
  transition: background-color .15s;
}
.btn:hover { background: var(--teal-dark); }
.nf-latest { margin-top: clamp(2.5rem, 6vw, 4rem); }
.minis { display: grid; gap: 0 2rem; margin: 0; padding: 0; list-style: none; }
.mini { border-top: 1px solid var(--hair); }
.mini:first-child { border-top: 0; }
.mini-card { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 1rem; padding: 1rem 0; }
.mini-media { aspect-ratio: 1; }
.mini-text { display: grid; gap: .3rem; justify-items: start; align-content: start; }
.mini-title { font: 600 1.02rem/1.3 var(--serif); }
.mini-title a { color: var(--slate); }

/* --------------------------------------------------------------------------
   14. Footer
   -------------------------------------------------------------------------- */
.foot {
  position: relative;
  margin-top: auto;
  background: var(--mist);
  border-top: 2px solid var(--teal);
  font-size: .9rem; color: var(--slate-2);
}
.foot-beat {
  position: absolute; top: -13px; left: max(var(--gutter), calc((100% - var(--wrap)) / 2));
  width: 52px; height: 26px; padding: 0 4px;
  background: linear-gradient(var(--white) 0 50%, var(--mist) 50%); color: var(--teal);
}
.foot-beat .pulse-dot { fill: var(--coral); }
.foot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem 1.5rem; padding-block: 2.75rem 2rem; }
.foot-brand { grid-column: 1 / -1; }
.foot-name a { font: 600 1.45rem/1.1 var(--serif); letter-spacing: -.015em; color: var(--teal); text-decoration: none; }
.foot-desc { max-width: 42ch; margin-top: .6rem; line-height: 1.55; color: var(--muted); }
.foot-h { margin-bottom: .4rem; color: var(--teal); }
.foot-col ul { margin: 0; padding: 0; list-style: none; }
.foot-col a {
  display: inline-flex; align-items: center; gap: .55rem; min-height: 44px;
  color: var(--slate-2); text-decoration: none;
}
.foot-col a:hover { color: var(--teal); text-decoration: underline; text-underline-offset: .25em; }
.foot-cat::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); flex: none; }
.foot-base {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem;
  padding-block: 1.1rem 1.5rem; border-top: 1px solid var(--hair);
  font-size: .8rem; color: var(--muted);
}
.foot-note { color: var(--slate-2); }

/* --------------------------------------------------------------------------
   15. Breakpoints (mobile first)
   -------------------------------------------------------------------------- */
@media (min-width: 640px) {
  .srow-body.has-list { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .slist li:first-child { padding-top: 0; border-top: 0; }
  .srow-body.is-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .srow-body.is-pair .sfeat + .sfeat { padding-top: 0; border-top: 0; }
  .srow-body.is-solo .sfeat { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; }
  .srow-more { display: inline-flex; align-items: center; width: auto; height: auto; min-height: 36px; padding: 0 .75rem; font-size: .82rem; font-weight: 500; border-color: transparent; }
  .srow-more .arrow { margin-left: .45em; }
  .srow-more-l { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .row-card { grid-template-columns: minmax(0, 1fr) 11rem; gap: .4rem 1.5rem; }
  .row-media { aspect-ratio: 3 / 2; }
  .minis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini:nth-child(2) { border-top: 0; }
  .profile .stats { grid-column: auto; }
  .profile-in { grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; }
}

@media (min-width: 760px) {
  .util-links { display: flex; }
  .sections-list .nav-extra { display: none; }
  .brand-tag { display: block; }
  .front { grid-template-columns: minmax(0, 1fr); }
  .desk-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; }
  .desk-item:nth-child(2) { border-top: 0; }
  .latest-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; }
  .latest-item:nth-child(2) { border-top: 0; }
  .lead-media { aspect-ratio: 16 / 9; }
  .row-card {
    grid-template-columns: 8.5rem minmax(0, 1fr) 13rem;
    grid-template-areas: "date text media";
    gap: 1.5rem; padding-block: 1.5rem;
  }
  .row-date { flex-direction: column; padding-top: .3rem; }
  .feature { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 2rem; }
  .cathead-in { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
}

@media (min-width: 1024px) {
  .front { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 2.5rem; }
  .front-solo { grid-template-columns: minmax(0, 1fr); }
  .desk { align-self: stretch; display: flex; flex-direction: column; }
  .desk-list { flex: 1; display: flex; flex-direction: column; }
  .desk-item { flex: 1 1 auto; align-content: start; }
  .desk-item:nth-child(2) { border-top: 1px solid var(--hair); }
  /* Latest rail beside the first two section rows only; the rows after it take the full width, so the right
     column never runs empty under a short rail. The stack wrapper dissolves into the grid. */
  .home-body { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: clamp(2.25rem, 4vw, 3.25rem) 2.5rem; align-items: start; }
  .home-body-solo { grid-template-columns: minmax(0, 1fr); }
  .home-body > .stack { display: contents; }
  .home-body .srow { grid-column: 1; }
  .home-body .srow + .srow { margin-top: 0; }
  .home-body .srow-wide { grid-column: 1 / -1; }
  .home-body .latest { grid-column: 2; grid-row: 1 / span 2; }
  .srow-wide .srow-body.has-list { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 1.25rem 2.5rem; }
  .srow-wide .srow-body > .sfeat { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 1.5rem; }
  .srow-wide .srow-body.is-solo > .sfeat { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 2.5rem; }
  .latest-list { display: block; }
  .latest-item:nth-child(2) { border-top: 1px solid var(--hair); }
  .art-grid { grid-template-columns: minmax(0, 1fr) 18.5rem; gap: clamp(3rem, 5vw, 5rem); }
  .art-aside { position: sticky; top: 1.25rem; }
  .on-wide { display: inline; }
  .on-narrow { display: none; }
  .pg { grid-template-columns: 15rem minmax(0, 1fr); gap: clamp(3rem, 5vw, 5rem); }
  .pg-nav { position: sticky; top: 1.25rem; order: 0; }
  .minis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mini:nth-child(3) { border-top: 0; }
  .foot-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; }
  .foot-brand { grid-column: auto; }
  .foot-col a { min-height: 34px; }
}

@media (max-width: 759px) {
  .pg-nav { order: 2; }
  .lead-title { font-size: clamp(1.7rem, 1.2rem + 2.6vw, 2.2rem); }
}

@media (max-width: 479px) {
  .article-body table { display: block; overflow-x: auto; }
  .util-date { padding-left: 0; border-left: 0; }
  .wm-b { letter-spacing: .2em; }
  .row-sum { -webkit-line-clamp: 2; }
  .byline .pill { order: 3; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
  .util, .sections, .art-aside, .foot, .skip { display: none; }
  .article-body { max-width: none; }
}
