/* ==========================================================================
   Wellness body (the hero is styled only from wellness-hero.css).
   1. The six doors, on the page's one butter field: white cards with the picture running to the card's top edge and
      the copy on white below it (Neko's cards on lemon). Three photos (bright, a light grade, tight crops on what is
      in focus) and three readouts drawn in code: blood pressure bars, a growth curve, an EEG on a night screen.
      Desktop: four doors, then the two specialty doors wide (picture left, copy right). Tablet: two columns.
      Phone: image-led rows, the two specialty doors as full cards.
   2. The reading list: copy beside two data cards (Function's data cards): guides per shelf as bars, guides per
      publisher as meters, each under its big counted number.
   3. The directory: ONE card. A crisp photo per door that cross-fades with the selected tab (pure CSS :has(), so
      the photo follows aria-selected however the tab was chosen), line tabs with a sliding teal rule, the shelf's
      title with its big count, and every guide in two ruled columns. Phone: segmented tabs on top of the photo.
   4. The general shelf: a night band, its guides beside the NHS stop-smoking timeline.
   Tokens only. Extends components.css (.tag, .arrow-badge, .finding, .chart, .meter, .card, .link) and the motion
   primitives (data-reveal, data-reveal-stagger, data-count, the tabs' crossfade).
   ========================================================================== */

/* ---------- 0. Photo crops: object-position picks the window, --zoom (a transform, so the reveal's translate and
   the hover's scale stay free) tightens it on --focus. Every crop stays at or below the photo's own resolution ---------- */
.door-photo > img {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none;
  object-fit: cover; object-position: var(--pos, 50% 50%);
  transform: scale(var(--zoom, 1)); transform-origin: var(--focus, 50% 50%);
  filter: saturate(1.05) contrast(1.04);
  transition: scale 0.9s var(--ease-out);
}
.p-women   { --pos: 58% 50%; --focus: 58% 34%; --zoom: 1.18; }     /* the doctor and her patient, faces in the light */
.p-seniors { --pos: 88% 50%; --focus: 82% 42%; --zoom: 1.3; }      /* her face and the hands held across the desk */

/* ---------- 1. Doors ---------- */
.doors-head {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: var(--space-5) var(--grid-gap); align-items: end;
}
.doors-head .display-2 { max-width: 11ch; }
.doors-head > .lede { margin: 0; max-width: 40ch; justify-self: end; }

.doors { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--grid-gap); }
.door {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr;
  border-radius: var(--r-lg); overflow: hidden;
  background: var(--surface); color: var(--ink);
  transition: transform var(--dur-3) var(--ease-out), box-shadow var(--dur-3) var(--ease-out);
}
.door-media { position: relative; grid-row: 1; grid-column: 1; aspect-ratio: 5 / 4; overflow: hidden; background: var(--mist); }
.door-copy { grid-row: 2; grid-column: 1; display: flex; flex-direction: column; padding: var(--space-5) var(--card-pad) var(--card-pad); }
.door-meta { display: flex; align-items: center; gap: var(--space-3); min-height: 40px; padding-right: 48px; margin-bottom: var(--space-1); }
.door-meta .tag { min-height: 0; align-self: center; color: var(--teal-700); }
.door-n { display: inline-flex; align-items: center; gap: var(--space-3); font-size: var(--fs-small); line-height: 1.2; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.door-n::before { content: ""; width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.door-title { font-size: var(--fs-h3); line-height: 1.06; letter-spacing: -0.018em; color: var(--ink); }
.door-text { margin-top: var(--space-3); font-size: var(--fs-card); line-height: 1.5; color: var(--ink-2); max-width: 34ch; }
/* the action mark sits on the meta row, top right of the copy */
.door-badge {
  grid-row: 2; grid-column: 1; justify-self: end; align-self: start;
  margin: var(--space-5) var(--space-5) 0 0;
  background: var(--tint);
}
@media (hover: hover) {
  .door:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
  .door:hover .door-photo > img, .door:hover .skin-frame { scale: 1.05; }
}
.door:focus-visible { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.door:active { transform: translateY(-1px); transition-duration: var(--dur-1); }

/* the specialty doors: picture left, copy right, the badge top right */
.door-wide { grid-column: span 2; grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr); grid-template-rows: minmax(0, 1fr); }
.door-wide .door-media { grid-row: 1; grid-column: 1; aspect-ratio: auto; min-height: clamp(280px, 12rem + 9vw, 380px); }
.door-wide .door-copy { grid-row: 1; grid-column: 2; justify-content: flex-end; padding: var(--card-pad); }
.door-wide .door-badge { grid-row: 1; grid-column: 2; margin: var(--card-pad) var(--card-pad) 0 0; }
.door-wide .door-meta { margin-top: auto; }

/* readouts drawn in code: a clean aqua screen (Men, Children) and a night monitor (Mind) */
.door-viz { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-5) var(--space-5) var(--space-4); background: var(--mist); color: var(--fg); }
.viz-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.viz-label { font-size: var(--fs-small); font-weight: var(--fw-ui); line-height: 1.3; color: var(--fg-2); }
.door-viz .finding { min-height: 28px; background: var(--surface); }
.viz-value {
  display: flex; align-items: baseline; gap: 2px;
  font-family: var(--font-display); font-weight: var(--fw-display);
  font-size: var(--fs-stat-sm); line-height: 1; letter-spacing: -0.03em;
  font-variant-numeric: lining-nums tabular-nums; color: var(--fg);
}
.viz-value > span { color: var(--fg-2); }
.viz-value > small { margin-left: var(--space-2); font-family: var(--font-sans); font-size: var(--fs-small); font-weight: var(--fw-ui); letter-spacing: 0; color: var(--fg-3); }
.viz-chart { margin-top: auto; --chart-h: clamp(56px, 1.5rem + 3vw, 96px); --chart-gutter: 36px; --chart-bar-gap: 5px; }
.viz-chart .chart-plot { margin-right: 4px; }

/* the EEG: four channels drawn left to right on a night screen, a slow sweep passing over them */
.door-eeg { gap: var(--space-4); padding: var(--card-pad); background: var(--wash-night); }
.door-eeg .finding { background: var(--state-in-bg); }
.eeg {
  position: relative; flex: 1 1 auto;
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: repeat(4, minmax(0, 1fr));
  column-gap: var(--space-4); min-height: 160px;
}
.eeg-ch { grid-column: 1; align-self: center; font-size: var(--fs-eyebrow); line-height: 1; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.eeg-screen {
  position: relative; grid-column: 2; grid-row: 1 / -1; overflow: hidden;
  background:
    linear-gradient(var(--line-night), var(--line-night)) 0 25% / 100% 1px no-repeat,
    linear-gradient(var(--line-night), var(--line-night)) 0 50% / 100% 1px no-repeat,
    linear-gradient(var(--line-night), var(--line-night)) 0 75% / 100% 1px no-repeat;
}
.eeg-plot { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.eeg-plot path { fill: none; stroke: var(--teal-300); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.eeg-sweep {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, var(--halo-faint) 0%, var(--halo-faint) 72%, var(--halo-mid) 97%, var(--teal-300) 99.6%, var(--halo-faint) 100%);
  translate: -100% 0;
}
@media (prefers-reduced-motion: no-preference) {
  html.js .eeg:not(.is-in) .eeg-plot { clip-path: inset(-4px 100% -4px 0); }
  html.js .eeg .eeg-plot { transition: clip-path 1.5s var(--ease-in-out) 0.15s; }
  .eeg-sweep { animation: eeg-sweep 5.2s linear 1.6s infinite; }
}
@keyframes eeg-sweep { from { translate: -100% 0; } to { translate: 0 0; } }

/* the skin door: the photo keeps its own 4:3 shape inside a frame moved to the moles, so the pins stay on them at any crop */
.p-skin { background: var(--canvas-2); }
.skin-frame {
  position: absolute; left: 50%; top: 50%;
  width: var(--skin-w, 150%); aspect-ratio: 4 / 3;
  translate: calc(-1 * var(--fx, 47%)) calc(-1 * var(--fy, 45%));
  transform-origin: var(--fx, 47%) var(--fy, 45%);
  transition: scale 0.9s var(--ease-out);
}
.skin-frame > img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; filter: saturate(1.04) contrast(1.05); }
.skin-pin { position: absolute; z-index: 1; width: 0; height: 0; }
.pin-a { left: 53%; top: 27.7%; }
.pin-b { left: 38.3%; top: 63.3%; }
.skin-pin > i {
  position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--surface); box-shadow: var(--halo);
}
.skin-pin > b {
  position: absolute; left: 20px; top: -14px;
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 12px;
  border-radius: var(--r-pill); white-space: nowrap;
  background: var(--glass-dark); border: 1px solid var(--glass-line); color: var(--on-photo);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  font-size: var(--fs-eyebrow); font-weight: var(--fw-ui); line-height: 1.2;
}
@media (prefers-reduced-motion: no-preference) {
  html.js .doors:not(.is-in) .skin-pin { opacity: 0; scale: 0.6; }
  html.js .doors .skin-pin { transition: opacity var(--dur-3) var(--ease-out) 0.9s, scale var(--dur-3) var(--ease-spring) 0.9s; }
  html.js .doors .pin-b { transition-delay: 1.1s; }
  .pin-a > i::after {
    content: ""; position: absolute; inset: -1.5px; border-radius: 50%; border: 1.5px solid var(--surface);
    animation: pin-pulse 2.6s var(--ease-out) 2s infinite;
  }
}
@keyframes pin-pulse { from { scale: 1; opacity: 0.9; } to { scale: 2.4; opacity: 0; } }

/* ---------- 2. The reading list ---------- */
.reading {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: var(--stack) clamp(2rem, 0.5rem + 4.5vw, 6.5rem); align-items: center;
}
.reading-copy .display-2 { max-width: 10ch; }
.reading-copy .lede { margin-top: var(--space-5); max-width: 38ch; }
.reading-cards { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr); gap: var(--grid-gap); align-items: stretch; }
.rc { display: flex; flex-direction: column; gap: var(--space-4); margin: 0; padding: var(--card-pad); }
.rc-cap { font-size: var(--fs-small); line-height: 1.45; color: var(--fg-2); max-width: 30ch; }
.rc-cap b { font-weight: var(--fw-ui); color: var(--fg-link); }
.rc-value {
  font-family: var(--font-display); font-weight: var(--fw-display);
  font-size: var(--fs-stat); line-height: 0.88; letter-spacing: -0.04em;
  font-variant-numeric: lining-nums tabular-nums; color: var(--fg);
}
/* guides per shelf: five bars on a baseline, the value above, the door under */
.rc-bars {
  --bar-max: clamp(96px, 3rem + 6vw, 168px);
  list-style: none; flex: 1 1 auto; min-height: calc(var(--bar-max) + 3.5rem); padding-top: var(--space-5);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); gap: var(--space-2);
}
/* the bars fill the card's height, so the two data cards end on one line */
.rc-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: var(--space-2); min-width: 0; height: 100%; }
.rc-bar > b { font-family: var(--font-display); font-weight: var(--fw-title); font-size: var(--fs-row); line-height: 1; color: var(--fg); font-variant-numeric: lining-nums tabular-nums; }
.rc-bar > i {
  display: block; width: 100%; height: calc(var(--h, 1) * (100% - 3.4rem));
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--teal-400), var(--teal-600));
  transform-origin: 50% 100%;
}
.rc-bar.is-general > i { background: var(--teal-200); }
.rc-bar > span { font-size: var(--fs-eyebrow); line-height: 1.2; color: var(--fg-2); white-space: nowrap; }
.h-12 { --h: 1; }
.h-8 { --h: 0.667; }
.h-6 { --h: 0.5; }
@media (prefers-reduced-motion: no-preference) {
  html.js .rc-bars:not(.is-in) .rc-bar > i { scale: 1 0; }
  html.js .rc-bars .rc-bar > i { transition: scale 1s var(--ease-out); }
  html.js .rc-bars .rc-bar:nth-child(2) > i { transition-delay: 70ms; }
  html.js .rc-bars .rc-bar:nth-child(3) > i { transition-delay: 140ms; }
  html.js .rc-bars .rc-bar:nth-child(4) > i { transition-delay: 210ms; }
  html.js .rc-bars .rc-bar:nth-child(5) > i { transition-delay: 280ms; }
}
/* guides per publisher */
.pubs-list { list-style: none; display: grid; gap: var(--space-4); margin-top: auto; padding-top: var(--space-5); }
.pub .meter-head { align-items: flex-end; }
.pub-name { font-size: var(--fs-small); line-height: 1.3; color: var(--fg-2); }
.pub .meter-value { font-size: var(--fs-row); }
.pubs-rest { padding-top: var(--space-4); border-top: 1px solid var(--rule-2); font-size: var(--fs-small); line-height: 1.5; color: var(--fg-2); }
.pubs-rest b { font-weight: var(--fw-ui); color: var(--fg); }

/* ---------- 3. The directory ---------- */
.dir-head .display-2 { max-width: 15ch; }
.dir-head .lede { max-width: 46ch; }

.library {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  padding: 0; overflow: hidden; isolation: isolate;
  min-height: clamp(640px, 30rem + 12vw, 780px);
}
.dir-media { position: relative; overflow: hidden; background: var(--canvas-2); }
.dir-img {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none;
  object-fit: cover; object-position: var(--pos, 50% 50%);
  filter: saturate(1.04) contrast(1.04);
  opacity: 0; scale: 1.06;
  transition: opacity var(--dur-4) var(--ease-out), scale 1.6s var(--ease-out);
}
.dir-img.is-women    { --pos: 44% 50%; }     /* her profile, the ring light beside her */
.dir-img.is-men      { --pos: 50% 24%; }
.dir-img.is-children { --pos: 44% 50%; }     /* the calm room: the bed and the screen */
.dir-img.is-seniors  { --pos: 30% 50%; }     /* the doctor and her patient, the scan between them */
/* the photo follows the selected tab, however it was chosen (click, keys, a link to #men, an arrival) */
.library:has(#women[aria-selected="true"]) .dir-img.is-women,
.library:has(#men[aria-selected="true"]) .dir-img.is-men,
.library:has(#children[aria-selected="true"]) .dir-img.is-children,
.library:has(#seniors[aria-selected="true"]) .dir-img.is-seniors { opacity: 1; scale: 1; }

.dir-body { display: flex; flex-direction: column; min-width: 0; padding: clamp(1.5rem, 0.4rem + 3.4vw, 4.5rem); }

/* line tabs: serif names, the count beside, one teal rule that slides under the selected door */
.dir-tabs {
  --k: 0;
  position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--rule-2);
  margin-bottom: clamp(2rem, 1rem + 2.4vw, 3.5rem);
}
.dir-tabs:has(#men[aria-selected="true"]) { --k: 1; }
.dir-tabs:has(#children[aria-selected="true"]) { --k: 2; }
.dir-tabs:has(#seniors[aria-selected="true"]) { --k: 3; }
.dir-tabs::after {
  content: ""; position: absolute; left: 0; bottom: -1px; width: 25%; height: 2px; border-radius: 2px;
  background: var(--fg-mark);
  translate: calc(var(--k) * 100%) 0;
  transition: translate var(--dur-3) var(--ease-out);
}
.dir-tab {
  display: flex; align-items: baseline; gap: var(--space-2);
  min-height: 56px; padding: var(--space-2) var(--space-3) var(--space-4) 0;
  text-align: left; color: var(--fg-3);
  transition: color var(--dur-2) var(--ease-out);
}
.dir-tab-name { font-family: var(--font-display); font-weight: var(--fw-title); font-size: var(--fs-title); line-height: 1.1; letter-spacing: -0.012em; }
.dir-tab-n { font-size: var(--fs-small); line-height: 1; font-variant-numeric: tabular-nums; }
.dir-tab[aria-selected="true"] { color: var(--fg); }
.dir-tab[aria-selected="true"] .dir-tab-n { color: var(--fg-link); }
.dir-tab:focus-visible { outline-offset: -2px; border-radius: var(--r-sm); }
@media (hover: hover) { .dir-tab:hover { color: var(--fg); } }

.dir-stage { flex: 1 1 auto; }
.shelf-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-4) var(--space-6); align-items: start; }
.shelf-title {
  font-family: var(--font-display); font-weight: var(--fw-title);
  font-size: var(--fs-h2); line-height: 1.04; letter-spacing: -0.02em;
  max-width: 13ch; color: var(--fg);
}
.shelf-count { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-2); text-align: right; }
.shelf-count b {
  font-family: var(--font-display); font-weight: var(--fw-display);
  font-size: var(--fs-stat); line-height: 0.8; letter-spacing: -0.045em;
  font-variant-numeric: lining-nums tabular-nums; color: var(--fg-em);
}
.shelf-count span { max-width: 15ch; font-size: var(--fs-small); line-height: 1.35; color: var(--fg-3); }
.shelf-copy { margin-top: var(--space-4); max-width: 44ch; font-size: var(--fs-card); line-height: 1.55; color: var(--fg-2); }

/* every guide: two ruled columns, the title, its publisher and the drawn arrow on the right */
.shelf-links {
  list-style: none; margin-top: clamp(1.5rem, 0.8rem + 1.6vw, 2.5rem);
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(1.5rem, 0.5rem + 2vw, 3rem);
}
.shelf-links > li { border-bottom: 1px solid var(--rule-2); }
.shelf-links > li:nth-child(-n + 2) { border-top: 1px solid var(--rule-2); }
.shelf-links .link {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; column-gap: var(--space-3);
  min-height: 56px; padding: var(--space-3) 0;
  font-size: var(--fs-card); font-weight: 400; line-height: 1.35;
  color: var(--fg); text-decoration: none;
}
.g-src { font-size: var(--fs-small); line-height: 1.2; color: var(--fg-3); white-space: nowrap; }
.shelf-links .link::after { background-color: var(--fg-mark); }
@media (hover: hover) {
  .shelf-links .link:hover { color: var(--fg-link); }
  .shelf-links .link:hover .g-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.24em; }
}
/* a shelf's own moment when it opens: its guides come in, one row after another (wellness.js sets .is-shelving) */
@media (prefers-reduced-motion: no-preference) {
  .shelf.is-shelving .shelf-links > li { animation: shelf-in var(--dur-4) var(--ease-out) both; animation-delay: calc(120ms + var(--n, 0) * 35ms); }
  .shelf-links > li:nth-child(2) { --n: 1; }  .shelf-links > li:nth-child(3) { --n: 2; }  .shelf-links > li:nth-child(4) { --n: 3; }
  .shelf-links > li:nth-child(5) { --n: 4; }  .shelf-links > li:nth-child(6) { --n: 5; }  .shelf-links > li:nth-child(7) { --n: 6; }
  .shelf-links > li:nth-child(8) { --n: 7; }  .shelf-links > li:nth-child(9) { --n: 8; }  .shelf-links > li:nth-child(10) { --n: 9; }
  .shelf-links > li:nth-child(11) { --n: 10; } .shelf-links > li:nth-child(12) { --n: 11; }
}
@keyframes shelf-in { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }

/* ---------- 4. The general shelf: a night band, copy left, the stop-smoking timeline right ---------- */
.general {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: var(--space-9) clamp(2rem, 0.5rem + 4.5vw, 6.5rem); align-items: center;
  padding: clamp(1.75rem, 0.6rem + 3.6vw, 5rem);
  border-radius: var(--r-lg);
  background: var(--wash-night); color: var(--on-night);
  overflow: hidden; isolation: isolate;
}
.general-head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-5); }
.general .tag { min-height: 0; align-self: center; }
.general-count { font-size: var(--fs-small); line-height: 1.3; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.general-count::before { content: ""; display: inline-block; vertical-align: middle; width: 3px; height: 3px; margin: -2px var(--space-3) 0 0; border-radius: 50%; background: currentColor; }
.general-title {
  font-family: var(--font-display); font-weight: var(--fw-display);
  font-size: var(--fs-display-2); line-height: var(--lh-tight); letter-spacing: var(--tracking-display-2);
  max-width: 12ch; color: var(--fg);
}
.general-text { margin-top: var(--space-5); max-width: 44ch; font-size: var(--fs-card); line-height: 1.55; color: var(--fg-2); }
.general-links {
  list-style: none; margin-top: var(--space-8);
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-7);
}
.general-links > li { border-bottom: 1px solid var(--rule); }
.general-links > li:nth-child(-n + 2) { border-top: 1px solid var(--rule); }
.general-links .link {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; column-gap: var(--space-3);
  min-height: 56px; padding: var(--space-3) 0;
  font-size: var(--fs-card); font-weight: 400; line-height: 1.35; color: var(--fg); text-decoration: none;
}
.general-links .link::after { background-color: var(--fg-mark); }
@media (hover: hover) { .general-links .link:hover { color: var(--fg-link); } }

/* the timeline: a rule that draws down through five milestones, the time in the display serif */
.quit { margin: 0; padding: var(--panel-pad); border-radius: var(--r-lg); background: var(--night-2); box-shadow: inset 0 0 0 1px var(--line-night); }
.quit-head { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-6); }
.quit-title { font-family: var(--font-display); font-weight: var(--fw-title); font-size: var(--fs-h3); line-height: 1.1; letter-spacing: -0.015em; color: var(--fg); }
.quit-title em { font-style: italic; color: var(--fg-em); }
.quit-src { font-size: var(--fs-small); line-height: 1.4; color: var(--fg-3); }
.quit-line { list-style: none; position: relative; display: grid; grid-template-columns: max-content minmax(0, 1fr); column-gap: var(--space-5); }
.quit-line > li {
  position: relative;
  grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: baseline;   /* every time on one column line */
  padding: var(--space-3) 0 var(--space-3) var(--space-8);
}
/* the rule runs from each milestone's dot to the next one's, so it starts and stops on a dot */
.quit-line > li:not(:last-child)::after {
  content: ""; position: absolute; left: 6.5px; width: 2px;
  top: calc(var(--space-3) + 0.55em + 7.5px); bottom: calc(-1 * (var(--space-3) + 0.55em + 7.5px));
  background: var(--teal-300); transform-origin: 50% 0;
}
.quit-line > li::before {
  content: ""; position: absolute; z-index: 1; left: 0; top: calc(var(--space-3) + 0.55em);
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--night-2); box-shadow: inset 0 0 0 2px var(--teal-300);
}
.quit-line > li:last-child::before { background: var(--teal-300); box-shadow: 0 0 0 5px var(--halo-mid); }
.quit-line b {
  font-family: var(--font-display); font-weight: var(--fw-display);
  font-size: var(--fs-h3); line-height: 1.1; letter-spacing: -0.02em; white-space: nowrap;
  color: var(--fg); font-variant-numeric: lining-nums;
}
.quit-line span { font-size: var(--fs-card); line-height: 1.45; color: var(--fg-2); }
@media (prefers-reduced-motion: no-preference) {
  html.js .quit:not(.is-in) .quit-line > li::after { scale: 1 0; }
  html.js .quit .quit-line > li::after { transition: scale 0.45s var(--ease-in-out); }
  html.js .quit .quit-line > li:nth-child(1)::after { transition-delay: 0.3s; }
  html.js .quit .quit-line > li:nth-child(2)::after { transition-delay: 0.45s; }
  html.js .quit .quit-line > li:nth-child(3)::after { transition-delay: 0.6s; }
  html.js .quit .quit-line > li:nth-child(4)::after { transition-delay: 0.75s; }
  html.js .quit:not(.is-in) .quit-line > li { opacity: 0; translate: 0 10px; }
  html.js .quit .quit-line > li { transition: opacity 0.6s var(--ease-out), translate 0.6s var(--ease-out); }
  html.js .quit .quit-line > li:nth-child(1) { transition-delay: 0.15s; }
  html.js .quit .quit-line > li:nth-child(2) { transition-delay: 0.25s; }
  html.js .quit .quit-line > li:nth-child(3) { transition-delay: 0.35s; }
  html.js .quit .quit-line > li:nth-child(4) { transition-delay: 0.45s; }
  html.js .quit .quit-line > li:nth-child(5) { transition-delay: 0.55s; }
}

/* ---------- responsive ---------- */
@media (max-width: 1279px) {
  .door-wide { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .quit-line > li { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-1); }
}
@media (max-width: 980px) {
  .doors-head { grid-template-columns: 1fr; }
  .doors-head > .lede { justify-self: start; }
  .doors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .door-media { aspect-ratio: 16 / 11; }
  .door-wide { grid-column: 1 / -1; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
  .door-wide .door-media { min-height: 300px; }

  .reading { grid-template-columns: 1fr; }
  .reading-copy .display-2 { max-width: 14ch; }
  .reading-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* the directory: the photo becomes a banner across the card's top */
  .library { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .dir-media { aspect-ratio: 16 / 9; }
  .dir-img.is-women { --pos: 46% 34%; }
  .dir-img.is-men { --pos: 50% 18%; }
  .dir-body { padding: var(--panel-pad); }
  .dir-stage { min-height: 0; }

  .general { grid-template-columns: 1fr; }
  .quit-line > li { grid-template-columns: subgrid; row-gap: 0; }
}
/* phones: the four audience doors become image-led rows (Neko's scan list); the specialty doors stay full cards */
@media (max-width: 640px) {
  .doors { grid-template-columns: 1fr; gap: var(--space-3); }
  .door:not(.door-wide) { grid-template-columns: 128px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); min-height: 156px; }
  .door:not(.door-wide) .door-media { grid-row: 1; grid-column: 1; aspect-ratio: auto; }
  .door:not(.door-wide) .door-copy { grid-row: 1; grid-column: 2; padding: var(--space-4); justify-content: center; }
  .door:not(.door-wide) .door-badge { grid-row: 1; grid-column: 2; width: 36px; height: 36px; margin: var(--space-3) var(--space-3) 0 0; }
  .door:not(.door-wide) .door-meta { min-height: 28px; padding-right: 40px; }
  .door-title { font-size: var(--fs-title); }
  .door-text { margin-top: var(--space-2); font-size: var(--fs-small); line-height: 1.5; }
  .door:not(.door-wide) .door-n { display: none; }
  /* the readouts shrink to their number and their line */
  .door:not(.door-wide) .door-viz { padding: var(--space-3); gap: var(--space-2); justify-content: center; }
  .door:not(.door-wide) .viz-label, .door:not(.door-wide) .finding { display: none; }
  .door:not(.door-wide) .viz-value { flex-wrap: wrap; font-size: var(--fs-h3); row-gap: 0; }
  .door:not(.door-wide) .viz-value > small { flex-basis: 100%; margin: 2px 0 0; font-size: var(--fs-eyebrow); }
  .door:not(.door-wide) .viz-chart { --chart-h: 48px; --chart-gutter: 0px; --chart-bar-gap: 3px; margin-top: var(--space-2); }
  .door:not(.door-wide) .viz-chart :is(.chart-x, .chart-grid b) { display: none; }
  .p-women { --pos: 60% 50%; --focus: 64% 40%; --zoom: 1.4; }
  .p-seniors { --pos: 86% 50%; --focus: 86% 40%; --zoom: 1.45; }

  .door-wide { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; }
  .door-wide .door-media { grid-row: 1; grid-column: 1; min-height: 0; aspect-ratio: 16 / 11; }
  .door-wide .door-copy { grid-row: 2; grid-column: 1; padding: var(--space-5) var(--card-pad) var(--card-pad); }
  .door-wide .door-badge { grid-row: 2; grid-column: 1; margin: var(--space-5) var(--space-5) 0 0; }
  .door-wide .door-meta { margin-top: 0; }
  .door-wide .door-title { font-size: var(--fs-h3); }
  .eeg { min-height: 132px; }

  .reading-cards { grid-template-columns: 1fr; }

  /* the directory: segmented tabs on top, the photo, then the shelf */
  .library { display: flex; flex-direction: column; }
  .dir-body { display: contents; }
  .dir-tabs {
    order: -1; margin: var(--space-3); padding: 4px; border: 0;
    border-radius: var(--r-pill); background: var(--canvas-2);
  }
  .dir-tabs::after {
    left: 4px; top: 4px; bottom: 4px; height: auto; width: calc((100% - 8px) / 4);
    border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--shadow-sm);
  }
  .dir-tab { position: relative; z-index: 1; align-items: center; justify-content: center; min-height: 44px; padding: 0 var(--space-1); }
  .dir-tab-name { font-family: var(--font-sans); font-weight: var(--fw-ui); font-size: var(--fs-small); letter-spacing: 0; }
  .dir-tab-n { display: none; }
  .dir-tab:focus-visible { border-radius: var(--r-pill); }
  .dir-media { aspect-ratio: 4 / 3; margin-inline: var(--space-3); border-radius: var(--r-sm); }
  .dir-img.is-women { --pos: 44% 40%; }
  .dir-stage { padding: var(--space-6) var(--space-5) var(--space-5); }
  /* the count becomes the shelf's kicker, one line above its title */
  .shelf-head { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-3); }
  .shelf-count { order: -1; flex-direction: row; align-items: baseline; gap: var(--space-3); text-align: left; }
  .shelf-title { font-size: var(--fs-h3); }
  .shelf-count b { font-size: var(--fs-stat-sm); line-height: 0.9; }
  .shelf-count span { max-width: none; font-size: var(--fs-small); }
  .shelf-copy { font-size: var(--fs-small); line-height: 1.5; }
  .shelf-links { grid-template-columns: 1fr; margin-top: var(--space-5); }
  .shelf-links > li:nth-child(2) { border-top: 0; }
  .shelf-links .link { min-height: 52px; }

  .general-links { grid-template-columns: 1fr; }
  .general-links > li:nth-child(2) { border-top: 0; }
  .quit-line > li { grid-template-columns: minmax(0, 1fr); row-gap: var(--space-1); }
}
