/* Health Sense — layout modeled on autonomymag.com:
   header + menu, a three-column top (What's new | lead | Explainers),
   a four-across photo strip, then three side-by-side topic lists.
   Visual treatment borrows from ibm.com (Carbon): IBM Plex Sans, light large headlines,
   square corners, light-gray bands, one blue accent, arrow links.
   Health Sense keeps one addition: an evidence badge on every story. */

html { -webkit-text-size-adjust: 100%; }
img { max-width: 100%; }
[hidden] { display: none !important; }

:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #5b6166;
  --line: #e6e8ea;
  --accent: #0f5fd7;          /* links, CTA, active menu */
  --band: #f4f5f7;            /* IBM-style light gray band */
  --dot: #e0453a;             /* logo dot only */
  --ev-early: #8a5f00;   --ev-early-bg: #fbf1d9;
  --ev-trial: #2559a8;   --ev-trial-bg: #e5edf9;
  --ev-approved: #1b7346; --ev-approved-bg: #e0f2e8;
  --ev-consensus: #5f43a6; --ev-consensus-bg: #ede7f8;
  --tint-1: #d7e9e6; --tint-2: #f4ddd3; --tint-3: #dde5f3; --tint-4: #e8e1f2; --tint-5: #f2eacd;
  --font: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --wrap: 1210px;
  color-scheme: light;   /* light by default; readers switch with the header button (theme.js) */
}
:root[data-theme="dark"] {
  --bg: #111416; --ink: #eef1f2; --muted: #a3abb0; --line: #2a3034; --accent: #78a9ff; --band: #1b2024; --dot: #ff6a5f;
  --ev-early: #f0c35a; --ev-early-bg: #3a2e12;
  --ev-trial: #8fb6ff; --ev-trial-bg: #1b2a44;
  --ev-approved: #6fd8a0; --ev-approved-bg: #143325;
  --ev-consensus: #c2a8ff; --ev-consensus-bg: #2a2142;
  --tint-1: #1d3b3a; --tint-2: #43281f; --tint-3: #1f2c47; --tint-4: #2d2444; --tint-5: #3b331a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg); color: var(--ink);
  font: 400 15px/1.55 var(--font);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.wrap { max-width: var(--wrap); margin-inline: auto; }
a { color: inherit; text-decoration: none; }
a:hover .title { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { list-style: none; padding: 0; }
.title { font-weight: 600; letter-spacing: 0; text-wrap: balance; line-height: 1.3; }

/* Header */
.site-header { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; padding-block: 26px 0; }
.menu, .brand { min-width: 0; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 48px; height: 48px; border-radius: 0; background: var(--ink); color: var(--bg);
  display: grid; place-items: center; font-weight: 600; font-size: 19px; letter-spacing: -0.02em; position: relative; }
.brand-mark::after { content: ""; position: absolute; right: 9px; top: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--dot); }
.brand-name { font-weight: 600; font-size: clamp(24px, 3.4vw, 32px); letter-spacing: -0.03em; line-height: 1; }
.brand-tag { color: var(--muted); font-size: 13px; margin-top: 4px; }
.menu { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.menu ul { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.menu a { display: block; padding: 14px 14px; font-size: 14px; font-weight: 400; white-space: nowrap; }
.menu a:first-child { padding-left: 0; }
.menu a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); font-weight: 600; }
.menu a:hover { background: var(--band); }
.menu-cta { font-weight: 400; font-size: 14px; white-space: nowrap; background: var(--accent); color: #fff; padding: 10px 16px; }

/* Section label (the Autonomy look: small, bold, uppercase) */
.label { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid var(--ink); display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.label a { font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--accent); }
.label a::after, .arrow::after { content: " \2192"; }

/* Evidence badge (Health Sense addition) */
.ev { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; padding: 4px 7px; border-radius: 0; white-space: nowrap; line-height: 1; }
.ev::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ev-early { color: var(--ev-early); background: var(--ev-early-bg); }
.ev-trial { color: var(--ev-trial); background: var(--ev-trial-bg); }
.ev-approved { color: var(--ev-approved); background: var(--ev-approved-bg); }
.ev-consensus { color: var(--ev-consensus); background: var(--ev-consensus-bg); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 12.5px; color: var(--muted); }

/* Image placeholders */
.img { aspect-ratio: 16 / 10; max-width: 100%; position: relative; overflow: hidden; border-radius: 0;
  background:
    radial-gradient(circle at 78% 30%, color-mix(in srgb, var(--bg) 55%, transparent) 0 18%, transparent 19%),
    radial-gradient(circle at 18% 88%, color-mix(in srgb, var(--bg) 35%, transparent) 0 26%, transparent 27%),
    var(--tint, var(--tint-1)); }
.img span { position: absolute; left: 8px; bottom: 6px; font-size: 10px; font-weight: 700; letter-spacing: .05em; color: var(--muted); }
.t1 { --tint: var(--tint-1); } .t2 { --tint: var(--tint-2); } .t3 { --tint: var(--tint-3); } .t4 { --tint: var(--tint-4); } .t5 { --tint: var(--tint-5); }

main { display: grid; gap: 48px; padding-block: 30px 56px; }

/* Row 1: three columns */
.top { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 2fr) minmax(0, 1.08fr); gap: 0; }
.top > * { min-width: 0; padding-inline: 20px; }
.top > *:first-child { padding-left: 0; }
.top > *:last-child { padding-right: 0; }
.top > * + * { border-left: 1px solid var(--line); }

.list > li { border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list a { display: grid; gap: 6px; padding-block: 14px; }
.list .title { font-size: 15px; }
.list p { font-size: 13.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.lead > a { display: grid; gap: 12px; padding-top: 14px; }
.lead .img { aspect-ratio: 3 / 2; }
.lead h1 { font-size: clamp(28px, 3.2vw, 40px); line-height: 1.15; font-weight: 300; letter-spacing: -0.01em; text-wrap: balance; }
.lead .dek { font-size: 16px; color: var(--muted); }
.lead .more { margin-top: 16px; border-top: 1px solid var(--line); }

.thumbs > li { border-bottom: 1px solid var(--line); }
.thumbs > li:last-child { border-bottom: 0; }
.thumbs a { display: grid; grid-template-columns: minmax(0, 1fr) 72px; gap: 12px; padding-block: 14px; align-items: start; }
.thumbs .img { aspect-ratio: 1; }
.thumbs .title { font-size: 14.5px; }
.thumbs .meta { margin-top: 6px; }

/* Row 2: photo strip */
.strip { background: var(--band); padding: 24px; }
.strip-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; padding-top: 16px; }
.strip-grid a { display: grid; gap: 10px; align-content: start; }
.strip-grid .title { font-size: 17px; }
.strip-grid p { font-size: 13.5px; color: var(--muted); }

/* Row 3: three topic lists */
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.row3 > * { min-width: 0; }

/* Evidence key band */
.key { display: grid; grid-template-columns: minmax(0, 1.1fr) repeat(4, minmax(0, 1fr)); gap: 24px; padding-block: 28px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.key h2 { font-size: 22px; font-weight: 300; line-height: 1.25; }
.key div { display: grid; gap: 8px; align-content: start; }
.key p { font-size: 13px; color: var(--muted); }

/* Newsletter */
.news { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: center; background: var(--ink); color: var(--bg); padding: 32px; border-radius: 0; }
.news h2 { font-size: 30px; font-weight: 300; line-height: 1.2; }
.news p { opacity: .8; font-size: 14px; margin-top: 6px; }
.news form { display: flex; gap: 8px; flex-wrap: wrap; }
.news input { flex: 1 1 200px; min-width: 0; font: inherit; padding: 13px 14px; border-radius: 0; border: 0; border-bottom: 2px solid var(--muted); background: var(--bg); color: var(--ink); }
.news button { font: 400 14px/1 var(--font); border: 0; border-radius: 0; padding: 14px 24px; background: var(--accent); color: #fff; cursor: pointer; }
.news .fine { font-size: 12px; opacity: .7; flex-basis: 100%; }

/* Footer */
footer { border-top: 1px solid var(--line); padding-block: 28px 40px; display: grid; gap: 22px; font-size: 13.5px; color: var(--muted); }
.foot-cols { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 24px; }
.foot-cols h4 { margin: 0 0 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink); }
.foot-cols ul { display: grid; gap: 6px; }
.disclaimer { max-width: 85ch; }
.mock { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 1000px) {
  .top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); row-gap: 28px; }
  .top .lead { grid-column: 1 / -1; order: -1; padding: 0; border: 0; }
  .top > *:nth-child(2) { padding-left: 0; border-left: 0; }
  .strip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .key { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .key h2 { grid-column: 1 / -1; }
  .news { grid-template-columns: minmax(0, 1fr); }
  .foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .top, .row3, .strip-grid, .key, .foot-cols { grid-template-columns: minmax(0, 1fr); }
  .top > * { padding-inline: 0 !important; border-left: 0 !important; }
  .menu-cta, .brand-tag { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Level 2: section pages ---------- */
.crumbs { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--accent); }
.crumbs span[aria-hidden] { color: var(--line); }
.sec-hero { background: var(--band); padding: 32px 28px; display: grid; gap: 10px; }
.sec-hero h1 { font-size: clamp(32px, 4.4vw, 52px); font-weight: 300; line-height: 1.1; letter-spacing: -0.01em; }
.sec-hero p { max-width: 62ch; color: var(--muted); font-size: 16px; }
.sec-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 40px; }
.sec-top > * { min-width: 0; }
.feature { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.feature .img { aspect-ratio: 4 / 3; }
.feature h2 { font-size: clamp(24px, 2.6vw, 32px); font-weight: 300; line-height: 1.18; text-wrap: balance; }
.feature > div { display: grid; gap: 10px; }
.feature p { color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 24px; padding-top: 16px; }
.cards a { display: grid; gap: 10px; align-content: start; }
.cards .title { font-size: 17px; }
.cards p { font-size: 13.5px; color: var(--muted); }

/* ---------- Level 3: article page ---------- */
.article { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; }
.article > * { min-width: 0; }
.art-head { display: grid; gap: 14px; max-width: 760px; }
.art-head h1 { font-size: clamp(30px, 4vw, 48px); font-weight: 300; line-height: 1.12; letter-spacing: -0.01em; text-wrap: balance; }
.art-head .dek { font-size: 19px; color: var(--muted); line-height: 1.45; }
.byline { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; color: var(--muted); padding-block: 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.byline strong { color: var(--ink); font-weight: 600; }
.art-img { margin: 22px 0 6px; }
.art-img .img { aspect-ratio: 16 / 9; }
.art-img figcaption { font-size: 12.5px; color: var(--muted); padding-top: 8px; }
.ev-box { border-left: 3px solid currentColor; padding: 14px 16px; display: grid; gap: 6px; margin-block: 20px; font-size: 14px; }
.ev-box p { color: var(--ink); }
.takeaways { background: var(--band); padding: 20px 22px; margin-block: 20px; }
.takeaways h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.takeaways ul { list-style: disc; padding-left: 20px; display: grid; gap: 6px; }
.prose { max-width: 680px; font-size: 17.5px; line-height: 1.7; display: grid; gap: 18px; }
.prose h2 { font-size: 24px; font-weight: 400; line-height: 1.25; margin-top: 12px; }
.prose .sample { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.sources { max-width: 680px; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 28px; font-size: 13.5px; color: var(--muted); display: grid; gap: 8px; }
.sources h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--ink); }
.sources ol { list-style: decimal; padding-left: 20px; display: grid; gap: 4px; }
.aside { display: grid; gap: 28px; align-content: start; }

@media (max-width: 1000px) {
  .sec-top, .article { grid-template-columns: minmax(0, 1fr); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aside { position: static; }
}
@media (max-width: 620px) {
  .feature, .cards { grid-template-columns: minmax(0, 1fr); }
  .sec-hero { padding: 24px 18px; }
  .prose { font-size: 16.5px; }
}

/* ---------- Masthead logo (concept 05, no red square; MAGAZINE sits under the name) ---------- */
.brand { align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.logo { display: grid; justify-items: start; line-height: 1; color: var(--ink); }
.logo-kicker { order: 2; font: 400 11px/1 var(--font); letter-spacing: .42em; text-transform: uppercase; margin: 8px 0 0 3px; }
.logo-word { font-family: "DM Serif Display", "Libre Caslon Display", Georgia, "Times New Roman", serif; font-weight: 400;
  font-size: clamp(34px, 5vw, 52px); letter-spacing: -0.025em; line-height: .95; }
.brand .brand-tag { margin: 0 0 4px; padding-left: 18px; border-left: 1px solid var(--line); max-width: 30ch; }
.logo-sm .logo-kicker { font-size: 9px; margin-top: 6px; }
.logo-sm .logo-word { font-size: 28px; }
@media (max-width: 620px) { .brand .brand-tag { display: none; } }

/* ---------- Light/dark switch ---------- */
.menu-tools { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.theme-toggle { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--line);
  background: transparent; color: var(--ink); cursor: pointer; }
.theme-toggle:hover { background: var(--band); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: block; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }

/* ---------- Real photos, credits, sample labels ---------- */
.img.has-photo { background: var(--band); }
.img.has-photo img, .art-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.art-img img { height: auto; aspect-ratio: 16 / 9; }
.art-img .credit { color: var(--muted); }
.art-img .credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.sample-tag { font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); padding: 2px 5px; margin-left: 8px; }
.prose a, .sources a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.prose ul { list-style: disc; padding-left: 22px; display: grid; gap: 6px; }

/* ---------- About, Privacy and form pages ---------- */
.info { display: grid; gap: 14px; max-width: 760px; font-size: 16.5px; line-height: 1.65; }
.info .lede { font-size: 19px; font-weight: 300; line-height: 1.5; }
.info h2 { font-size: 22px; font-weight: 400; margin-top: 18px; scroll-margin-top: 24px; }
.info ul { list-style: disc; padding-left: 22px; display: grid; gap: 8px; }
.info a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.info .note { font-size: 14px; color: var(--muted); border-left: 3px solid var(--line); padding-left: 12px; }
.form-page { max-width: none; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 48px; align-items: start; }
.form-page > div { display: grid; gap: 14px; }
.hs-form { display: grid; gap: 6px; background: var(--band); padding: 24px; }
.hs-form label { font-size: 13px; font-weight: 600; margin-top: 10px; }
.hs-form label:first-child { margin-top: 0; }
.hs-form .req { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 4px; }
.hs-form input, .hs-form select, .hs-form textarea { font: inherit; font-size: 15px; color: var(--ink); background: var(--bg);
  border: 0; border-bottom: 2px solid var(--muted); padding: 11px 12px; border-radius: 0; width: 100%; min-width: 0; }
.hs-form input:focus-visible, .hs-form select:focus-visible, .hs-form textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-bottom-color: var(--accent); }
.hs-form textarea { resize: vertical; }
.hs-form button { justify-self: start; margin-top: 16px; font: 400 15px/1 var(--font); border: 0; border-radius: 0; padding: 14px 22px; background: var(--accent); color: #fff; cursor: pointer; }
.hs-form button:disabled { opacity: .6; cursor: wait; }
.form-status { font-size: 14px; min-height: 1.4em; margin-top: 8px; }
.form-status.ok { color: var(--ev-approved); }
.form-status.err { color: var(--dot); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
@media (max-width: 860px) { .form-page { grid-template-columns: minmax(0, 1fr); gap: 24px; } .hs-form { padding: 18px; } }
.cf-turnstile { margin-top: 14px; min-height: 65px; }

/* ---------- Status label: clinical tag + progress bar (replaces the .ev pill) ---------- */
.chip { --c: var(--ink); display: inline-flex; align-items: stretch; border: 1px solid var(--line); background: var(--bg);
  border-radius: 3px; overflow: hidden; line-height: 1.2; vertical-align: middle; }
.chip.ev-approved { --c: var(--ev-approved); }
.chip.ev-trial { --c: var(--ev-trial); }
.chip.ev-consensus { --c: var(--ev-consensus); }
.chip.ev-early { --c: var(--ev-early); }
.chip .band { width: 20px; display: grid; place-items: center; background: var(--c); color: var(--bg); font-size: 11px; font-weight: 600; }
.chip .txt { display: grid; gap: 2px; padding: 4px 8px 5px; }
.chip b { font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--ink); }
.chip i { font-style: normal; font-size: 10.5px; color: var(--muted); }
.chip .bar { display: flex; gap: 2px; margin-top: 2px; }
.chip .bar span { flex: 1; min-width: 10px; height: 3px; border-radius: 1px; background: var(--line); }
.chip .bar span.on { background: var(--c); }
.chip.full .band { width: 26px; font-size: 13px; }
.chip.full .txt { padding: 6px 11px 7px; gap: 3px; }
.chip.full b { font-size: 12.5px; }
.chip.full i { font-size: 11.5px; }
.chip.full .bar span { min-width: 16px; height: 4px; }
.chip .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ev-box .meta { margin-bottom: 2px; }
.key .key-legend { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 18px; font-size: 12.5px; color: var(--muted); margin: 0; }
