/* =========================================================
   Male Wellness — shared design system
   ========================================================= */

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --text: #1b1e22;
  --muted: #5c636d;
  --faint: #8b919a;
  --border: #e5e2d9;
  --border-strong: #d6d2c6;

  --accent: #1f6f5c;
  --domain: var(--accent);

  --note: #1f6f5c;
  --tip: #2d5fb4;
  --warn: #a05200;
  --danger: #b3261e;
  --good: #2e7d32;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 20, 10, .04), 0 6px 20px rgba(20, 20, 10, .05);
  --shadow-hover: 0 2px 4px rgba(20, 20, 10, .05), 0 12px 32px rgba(20, 20, 10, .09);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-display: ui-serif, "New York", "Iowan Old Style", "Charter", Georgia, serif;

  --page: 1240px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131518;
    --surface: #1b1e22;
    --surface-2: #202328;
    --text: #e9e7e2;
    --muted: #a6abb3;
    --faint: #7d838c;
    --border: #2c3036;
    --border-strong: #3a3f46;
    --accent: #6cc4a7;
    --note: #6cc4a7;
    --tip: #82aaf0;
    --warn: #f0ae63;
    --danger: #f28b82;
    --good: #81c784;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, .35), 0 12px 32px rgba(0, 0, 0, .35);
  }
}

/* ---------- Domain colours (set data-domain on <body>) ---------- */
[data-domain="sexual"]     { --domain: #c2185b; }
[data-domain="fertility"]  { --domain: #7b4fb0; }
[data-domain="hormones"]   { --domain: #b26a00; }
[data-domain="heart"]      { --domain: #c62828; }
[data-domain="metabolic"]  { --domain: #d35400; }
[data-domain="fitness"]    { --domain: #2e7d32; }
[data-domain="nutrition"]  { --domain: #5d8a1f; }
[data-domain="mind"]       { --domain: #3f51b5; }
[data-domain="sleep"]      { --domain: #4a3fa8; }
[data-domain="urology"]    { --domain: #00838f; }
[data-domain="skin"]       { --domain: #8d5b3f; }
[data-domain="substances"] { --domain: #546e7a; }
[data-domain="prevention"] { --domain: #1565c0; }
[data-domain="gut"]        { --domain: #8d6e00; }
[data-domain="style"]      { --domain: #00796b; }

@media (prefers-color-scheme: dark) {
  [data-domain="sexual"]     { --domain: #f06292; }
  [data-domain="fertility"]  { --domain: #b39ddb; }
  [data-domain="hormones"]   { --domain: #ffb74d; }
  [data-domain="heart"]      { --domain: #ef7a7a; }
  [data-domain="metabolic"]  { --domain: #ff9e5e; }
  [data-domain="fitness"]    { --domain: #81c784; }
  [data-domain="nutrition"]  { --domain: #aed581; }
  [data-domain="mind"]       { --domain: #9fa8da; }
  [data-domain="sleep"]      { --domain: #a99cf0; }
  [data-domain="urology"]    { --domain: #4dd0e1; }
  [data-domain="skin"]       { --domain: #d7a184; }
  [data-domain="substances"] { --domain: #a3b8c2; }
  [data-domain="prevention"] { --domain: #7fb2f0; }
  [data-domain="gut"]        { --domain: #e2c044; }
  [data-domain="style"]      { --domain: #4db6ac; }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 18px/1.75 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--domain); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

::selection { background: color-mix(in srgb, var(--domain) 25%, transparent); }

/* ---------- Top bar & progress ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 48px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand::before {
  content: "";
  width: 12px; height: 12px;
  border-radius: 4px;
  background: var(--accent);
  transform: rotate(45deg);
}
.topbar-link {
  font-size: 15px;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.topbar-link:hover { color: var(--text); border-color: var(--border-strong); }

.progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: var(--domain);
  z-index: 30;
  transition: width .08s linear;
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1200px 400px at 85% -10%, color-mix(in srgb, var(--domain) 16%, transparent), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--domain) 7%, var(--bg)), var(--bg));
  border-bottom: 1px solid var(--border);
}
.hero-inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 44px clamp(20px, 4vw, 48px) 44px;
}
.back {
  display: inline-block;
  font-size: 15px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 22px;
}
.back:hover { color: var(--text); }

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--domain);
  background: color-mix(in srgb, var(--domain) 11%, transparent);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.08;
  letter-spacing: -.015em;
  margin: 0 0 14px;
  max-width: 900px;
}
.lede {
  font-size: clamp(18px, 1.6vw, 21px);
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 20px;
  max-width: 820px;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}
.meta span {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}

/* ---------- Two-column layout ---------- */
.layout {
  max-width: var(--page);
  margin: 0 auto;
  padding: 40px clamp(20px, 4vw, 48px) 40px;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 64px;
}
.sidebar {
  position: sticky;
  top: 80px;
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.content { max-width: 800px; min-width: 0; }

/* ---------- Table of contents ---------- */
.toc { font-size: 14.5px; line-height: 1.45; }
.toc > strong {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 10px;
}
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.toc li { margin: 0; }
.toc a {
  display: block;
  padding: 6px 0 6px 14px;
  margin-left: -2px;
  border-left: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
}
.toc a:hover { color: var(--text); }
.toc a.active {
  color: var(--domain);
  border-left-color: var(--domain);
  font-weight: 600;
}

@media (max-width: 1020px) {
  .layout { grid-template-columns: 1fr; gap: 8px; padding-top: 24px; }
  .sidebar { position: static; max-height: none; overflow: visible; }
  .toc {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
  }
  .toc ol { columns: 2 240px; column-gap: 28px; border-left: 0; }
  .toc a { padding: 4px 0; margin: 0; border: 0; }
  .toc li { break-inside: avoid; }
}

/* ---------- Typography in content ---------- */
.content > :first-child { margin-top: 0; }

h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 2.6vw, 32px);
  line-height: 1.2;
  letter-spacing: -.01em;
  margin: 72px 0 16px;
  scroll-margin-top: 80px;
}
h2::before {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--domain);
  margin-bottom: 18px;
}
.content > h2:first-child { margin-top: 8px; }

h3 {
  font-size: 20px;
  line-height: 1.35;
  margin: 36px 0 10px;
  scroll-margin-top: 80px;
}
h4 { font-size: 17px; margin: 20px 0 6px; }

p { margin: 0 0 16px; }
ul, ol { padding-left: 24px; margin: 0 0 18px; }
li { margin: 6px 0; }
li::marker { color: var(--domain); }
strong { font-weight: 650; }

.updated, .small { color: var(--muted); font-size: 14px; }

/* ---------- Key facts ---------- */
.key-facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 14px;
  margin: 20px 0 28px;
}
.fact {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.fact-num {
  display: block;
  font-family: var(--font-display);
  font-size: 30px;
  white-space: nowrap;
  font-weight: 700;
  line-height: 1.1;
  color: var(--domain);
  margin-bottom: 6px;
}
.fact-title { display: block; font-weight: 650; font-size: 16px; margin-bottom: 4px; }
.fact-text { display: block; font-size: 15px; line-height: 1.55; color: var(--muted); }

/* ---------- Callouts ---------- */
.note, .tip, .warn, .danger {
  --c: var(--note);
  position: relative;
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--c) 22%, transparent);
  border-left: 4px solid var(--c);
  background: color-mix(in srgb, var(--c) 7%, var(--surface));
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 16.5px;
  line-height: 1.65;
}
.tip    { --c: var(--tip); }
.warn   { --c: var(--warn); }
.danger { --c: var(--danger); }
.note > strong:first-child,
.tip > strong:first-child,
.warn > strong:first-child,
.danger > strong:first-child { color: var(--c); }
.note p:last-child, .tip p:last-child, .warn p:last-child, .danger p:last-child,
.note ul:last-child, .tip ul:last-child, .warn ul:last-child, .danger ul:last-child { margin-bottom: 0; }

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
  margin: 20px 0 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.55; }
.table-wrap table { margin: 0; }
th, td { text-align: left; padding: 12px 16px; vertical-align: top; border-bottom: 1px solid var(--border); }
th {
  background: var(--surface-2);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, tr:hover td { background: color-mix(in srgb, var(--domain) 4%, transparent); }
td:first-child { font-weight: 550; }

/* ---------- Numbered steps ---------- */
ol.steps { counter-reset: step; list-style: none; padding-left: 0; }
ol.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 46px;
  margin: 14px 0;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 1px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--domain) 13%, var(--surface));
  color: var(--domain);
  font-size: 14px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- Cards (exercise / info) ---------- */
.ex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 20px 0 28px;
}
.ex {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--domain);
  border-radius: var(--radius);
  padding: 18px 22px 10px;
  box-shadow: var(--shadow);
}
.ex h4 { margin-top: 0; font-size: 18px; }
.ex .dose {
  display: inline-block;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--domain);
  background: color-mix(in srgb, var(--domain) 10%, transparent);
  padding: 2px 10px;
  border-radius: 999px;
  margin: 0 0 10px;
}
.ex ol, .ex ul, .ex p { font-size: 16px; }

.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 28px;
}

/* ---------- Checklist ---------- */
.checklist { list-style: none; padding-left: 0; }
.checklist li { position: relative; padding-left: 32px; }
.checklist li::before {
  content: "";
  position: absolute;
  left: 0; top: 6px;
  width: 18px; height: 18px;
  border: 2px solid var(--domain);
  border-radius: 5px;
}

/* ---------- References ---------- */
sup a { text-decoration: none; font-size: 12px; font-weight: 700; padding: 0 1px; }
.refs { padding-left: 26px; }
.refs li { font-size: 15px; line-height: 1.6; margin: 10px 0; color: var(--muted); }
.refs li:target { background: color-mix(in srgb, var(--domain) 10%, transparent); border-radius: 6px; }

/* ---------- Footer ---------- */
.site-footer, footer {
  max-width: var(--page);
  margin: 40px auto 0;
  padding: 26px clamp(20px, 4vw, 48px) 60px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  right: 22px; bottom: 22px;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 20px;
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.to-top.show { opacity: 1; pointer-events: auto; }

/* =========================================================
   Visual components: diagrams, charts, flows, timelines
   ========================================================= */

/* ---------- Hero art (domain icon) ---------- */
.hero { position: relative; overflow: hidden; }
.hero::after {
  content: "";
  position: absolute;
  top: 50%;
  right: max(clamp(20px, 4vw, 48px), calc((100vw - var(--page)) / 2 + 48px));
  width: 230px; height: 230px;
  transform: translateY(-50%) rotate(-8deg);
  background: var(--domain);
  opacity: .13;
  -webkit-mask: var(--icon) center / contain no-repeat;
          mask: var(--icon) center / contain no-repeat;
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; }
.hub-hero::after { display: none; }
@media (max-width: 900px) {
  .hero::after { width: 130px; height: 130px; top: 24px; transform: rotate(-8deg); opacity: .09; }
}

/* ---------- Figures with inline SVG diagrams ---------- */
figure.diagram {
  margin: 30px 0 34px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px 16px;
  cursor: zoom-in;
}
figure.diagram .fig-title {
  display: block;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 14px;
}
figure.diagram svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 560px;
  font-family: var(--font);
  overflow: visible;
}
figure.diagram figcaption {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--muted);
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
figure.diagram figcaption strong { color: var(--text); }
figure.diagram.zoomed {
  position: fixed;
  inset: 3vh 3vw;
  z-index: 100;
  margin: 0;
  overflow: auto;
  cursor: zoom-out;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .55);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
figure.diagram.zoomed svg { max-height: 78vh; }

/* SVG paint classes — theme-aware, work in dark mode */
.diagram svg text { fill: var(--text); font-size: 13px; }
.diagram .t-muted  { fill: var(--muted); }
.diagram .t-faint  { fill: var(--faint); }
.diagram .t-domain { fill: var(--domain); }
.diagram .t-on     { fill: #fff; }
.diagram .t-danger { fill: var(--danger); }
.diagram .t-good   { fill: var(--good); }
.diagram .t-warn   { fill: var(--warn); }
.diagram .t-sm  { font-size: 11px; }
.diagram .t-md  { font-size: 15px; }
.diagram .t-lg  { font-size: 18px; font-weight: 700; }
.diagram .t-xl  { font-size: 26px; font-weight: 700; font-family: var(--font-display); }
.diagram .t-b   { font-weight: 700; }
.diagram .t-mid { text-anchor: middle; }
.diagram .t-end { text-anchor: end; }

.diagram .f-domain  { fill: var(--domain); }
.diagram .f-soft    { fill: color-mix(in srgb, var(--domain) 18%, var(--surface)); }
.diagram .f-faint   { fill: color-mix(in srgb, var(--domain) 7%, var(--surface)); }
.diagram .f-surface { fill: var(--surface-2); }
.diagram .f-bg      { fill: var(--surface); }
.diagram .f-muted   { fill: var(--faint); }
.diagram .f-border  { fill: var(--border); }
.diagram .f-text    { fill: var(--text); }
.diagram .f-good    { fill: var(--good); }
.diagram .f-warn    { fill: var(--warn); }
.diagram .f-danger  { fill: var(--danger); }
.diagram .f-tip     { fill: var(--tip); }
.diagram .f-good-soft   { fill: color-mix(in srgb, var(--good) 16%, var(--surface)); }
.diagram .f-warn-soft   { fill: color-mix(in srgb, var(--warn) 16%, var(--surface)); }
.diagram .f-danger-soft { fill: color-mix(in srgb, var(--danger) 16%, var(--surface)); }
.diagram .f-tip-soft    { fill: color-mix(in srgb, var(--tip) 16%, var(--surface)); }
.diagram .f-none    { fill: none; }

.diagram .s-domain { stroke: var(--domain); }
.diagram .s-border { stroke: var(--border-strong); }
.diagram .s-text   { stroke: var(--text); }
.diagram .s-muted  { stroke: var(--faint); }
.diagram .s-good   { stroke: var(--good); }
.diagram .s-warn   { stroke: var(--warn); }
.diagram .s-danger { stroke: var(--danger); }
.diagram .s-tip    { stroke: var(--tip); }
.diagram .s-bg     { stroke: var(--surface); }
.diagram .sw1 { stroke-width: 1; }
.diagram .sw2 { stroke-width: 2; }
.diagram .sw3 { stroke-width: 3; }
.diagram .sw5 { stroke-width: 5; }
.diagram .dash  { stroke-dasharray: 5 5; }
.diagram .round { stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Bar charts (HTML; widths set by site.js from data-value) ---------- */
.bars { margin: 6px 0 4px; }
.bar {
  display: grid;
  grid-template-columns: minmax(110px, 34%) 1fr auto;
  align-items: center;
  gap: 14px;
  margin: 10px 0;
  font-size: 15px;
  line-height: 1.35;
}
.bar-label { color: var(--text); }
.bar-track {
  height: 14px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  overflow: hidden;
}
.bar-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--domain);
  transition: width .7s cubic-bezier(.2, .7, .2, 1);
}
.bar.is-alt  .bar-fill { background: var(--faint); }
.bar.is-good .bar-fill { background: var(--good); }
.bar.is-warn .bar-fill { background: var(--warn); }
.bar.is-bad  .bar-fill { background: var(--danger); }
.bar-value { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--domain); min-width: 3.5em; text-align: right; }
.bar.is-alt .bar-value { color: var(--muted); }
.bar.is-bad .bar-value { color: var(--danger); }
.bar.is-good .bar-value { color: var(--good); }
@media (max-width: 560px) {
  .bar { grid-template-columns: 1fr auto; gap: 4px 10px; }
  .bar-track { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- Process flow ---------- */
ol.flow {
  list-style: none;
  padding: 0;
  margin: 24px 0 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px 34px;
  counter-reset: flow;
}
ol.flow > li {
  counter-increment: flow;
  position: relative;
  flex: 1 1 150px;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--domain);
  border-radius: var(--radius-sm);
  padding: 14px 16px 12px;
  box-shadow: var(--shadow);
  font-size: 15px;
  line-height: 1.5;
}
ol.flow > li::before {
  content: counter(flow);
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--domain);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 8px;
}
ol.flow > li:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -24px; top: 50%;
  width: 14px; height: 14px;
  border-top: 2.5px solid var(--domain);
  border-right: 2.5px solid var(--domain);
  transform: translateY(-50%) rotate(45deg);
  opacity: .7;
}
ol.flow > li strong { display: block; font-size: 16px; margin-bottom: 2px; }
ol.flow > li span { color: var(--muted); }
@media (max-width: 700px) {
  ol.flow { flex-direction: column; gap: 26px; }
  ol.flow > li:not(:last-child)::after { right: auto; left: 50%; top: auto; bottom: -21px; transform: translateX(-50%) rotate(135deg); }
}

/* ---------- Timeline ---------- */
ol.timeline {
  list-style: none;
  margin: 24px 0 30px;
  padding: 0 0 0 30px;
  position: relative;
}
ol.timeline::before {
  content: "";
  position: absolute;
  left: 8px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--domain), color-mix(in srgb, var(--domain) 20%, transparent));
}
ol.timeline > li { position: relative; margin: 0 0 22px; }
ol.timeline > li::before {
  content: "";
  position: absolute;
  left: -28px; top: 7px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--domain);
}
ol.timeline .when {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--domain);
  margin-bottom: 2px;
}
ol.timeline strong { display: block; font-size: 17px; }
ol.timeline p { margin: 4px 0 0; font-size: 16px; color: var(--muted); }

/* ---------- Do / Avoid comparison ---------- */
.compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 22px 0 28px;
}
.compare > div {
  --c: var(--good);
  background: color-mix(in srgb, var(--c) 6%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--c) 25%, var(--border));
  border-radius: var(--radius);
  padding: 16px 20px 8px;
}
.compare > .dont { --c: var(--danger); }
.compare h4 { margin: 0 0 8px; color: var(--c); font-size: 15px; letter-spacing: .06em; text-transform: uppercase; }
.compare ul { list-style: none; padding: 0; margin: 0 0 8px; }
.compare li { position: relative; padding-left: 28px; font-size: 16px; line-height: 1.55; }
.compare li::before {
  position: absolute; left: 0; top: 0;
  font-weight: 800; color: var(--c);
}
.compare .do li::before   { content: "✓"; }
.compare .dont li::before { content: "✕"; }

/* ---------- Range scale (e.g. blood pressure bands) ---------- */
.scale {
  display: flex;
  margin: 22px 0 8px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.scale > div {
  --c: var(--good);
  flex: 1 1 0;
  padding: 12px 12px 10px;
  background: color-mix(in srgb, var(--c) 14%, var(--surface));
  border-top: 5px solid var(--c);
  font-size: 13.5px;
  line-height: 1.4;
  min-width: 0;
}
.scale > div + div { border-left: 1px solid var(--surface); }
.scale > .is-ok   { --c: var(--tip); }
.scale > .is-warn { --c: var(--warn); }
.scale > .is-bad  { --c: var(--danger); }
.scale b { display: block; color: var(--c); font-size: 14px; }
.scale span { color: var(--muted); }
@media (max-width: 600px) { .scale { flex-direction: column; } .scale > div + div { border-left: 0; } }

/* ---------- Insight / did-you-know ---------- */
.insight {
  position: relative;
  margin: 28px 0;
  padding: 20px 22px 18px 64px;
  border-radius: var(--radius);
  background:
    radial-gradient(400px 120px at 0% 0%, color-mix(in srgb, var(--domain) 14%, transparent), transparent 70%),
    var(--surface);
  border: 1px solid color-mix(in srgb, var(--domain) 30%, var(--border));
  font-size: 16.5px;
  line-height: 1.65;
}
.insight::before {
  content: "!";
  position: absolute;
  left: 20px; top: 20px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--domain);
  color: #fff;
  font: 800 16px/30px var(--font);
  text-align: center;
}
.insight > strong:first-child { display: block; color: var(--domain); margin-bottom: 2px; }
.insight p:last-child { margin-bottom: 0; }

/* ---------- FAQ accordion ---------- */
details.faq {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin: 10px 0;
  box-shadow: var(--shadow);
}
details.faq > summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 48px 14px 18px;
  font-weight: 650;
  font-size: 16.5px;
  line-height: 1.45;
  position: relative;
}
details.faq > summary::-webkit-details-marker { display: none; }
details.faq > summary::after {
  content: "+";
  position: absolute;
  right: 18px; top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  font-weight: 400;
  color: var(--domain);
}
details.faq[open] > summary::after { content: "–"; }
details.faq[open] > summary { border-bottom: 1px solid var(--border); }
details.faq > div { padding: 12px 18px 4px; font-size: 16px; line-height: 1.65; }

/* ---------- Previous / next topic ---------- */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 64px 0 0;
}
.pager a {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.pager a:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.pager small { display: block; color: var(--muted); font-size: 13px; margin-bottom: 2px; }
.pager strong { font-family: var(--font-display); font-size: 18px; }
.pager .next { text-align: right; grid-column: 2; }
@media (max-width: 600px) { .pager { grid-template-columns: 1fr; } .pager .next { grid-column: 1; } }

/* =========================================================
   Hub page
   ========================================================= */
.hub-hero .hero-inner { padding-top: 64px; padding-bottom: 52px; }
.hub-hero h1 { font-size: clamp(40px, 6vw, 64px); }

.search {
  margin-top: 26px;
  max-width: 560px;
  position: relative;
}
.search input {
  width: 100%;
  font: inherit;
  font-size: 17px;
  padding: 14px 18px 14px 46px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  outline: none;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.search::before {
  content: "";
  position: absolute;
  left: 18px; top: 50%;
  width: 14px; height: 14px;
  border: 2px solid var(--faint);
  border-radius: 50%;
  transform: translateY(-62%);
}
.search::after {
  content: "";
  position: absolute;
  left: 31px; top: 58%;
  width: 7px; height: 2px;
  background: var(--faint);
  transform: rotate(45deg);
}

.hub {
  max-width: var(--page);
  margin: 0 auto;
  padding: 24px clamp(20px, 4vw, 48px) 20px;
}
.hub-section { margin: 36px 0 12px; }
.hub-section > h2 { margin: 0 0 6px; font-size: 26px; }
.hub-section > h2::before { display: none; }
.hub-section > p { color: var(--muted); margin: 0 0 16px; }

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}
.topic-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.topic-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--domain);
}
.topic-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--domain) 40%, var(--border)); }
.topic-card .tag {
  align-self: flex-start;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--domain);
  background: color-mix(in srgb, var(--domain) 11%, transparent);
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.topic-card .title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 8px;
}
.topic-card .desc { color: var(--muted); font-size: 15.5px; line-height: 1.55; flex: 1; }
.topic-card .go {
  margin-top: 16px;
  font-size: 14px;
  font-weight: 650;
  color: var(--domain);
}
.no-results { display: none; color: var(--muted); padding: 30px 0; }

/* ---------- Hub: stats, filter chips, card icons ---------- */
.hub-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}
.hub-stats div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  box-shadow: var(--shadow);
  font-size: 14px;
  color: var(--muted);
  line-height: 1.3;
}
.hub-stats b {
  display: block;
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--text);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 4px; }
.chip {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.chip:hover { color: var(--text); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }

.hub-section > h2 { display: flex; align-items: baseline; gap: 12px; }
.hub-section > h2 .count { font-family: var(--font); font-size: 14px; font-weight: 600; color: var(--faint); }

.topic-card::after {
  content: "";
  position: absolute;
  top: 18px; right: 18px;
  width: 40px; height: 40px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--domain) 11%, transparent);
}
.topic-card .ico {
  position: absolute;
  top: 26px; right: 26px;
  width: 24px; height: 24px;
  background: var(--domain);
  -webkit-mask: var(--icon) center / contain no-repeat;
          mask: var(--icon) center / contain no-repeat;
  z-index: 1;
}
.topic-card .title { padding-right: 44px; }
.topic-card .card-meta {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--faint);
}
.topic-card .go { margin-top: 10px; }
.topic-card.new .tag::after {
  content: "New";
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--domain);
  color: #fff;
  font-size: 10.5px;
}


/* ---------- Domain icons (used in hero art and hub cards) ---------- */
[data-domain="sexual"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='12' r='5.5'/%3E%3Ccircle cx='15' cy='12' r='5.5'/%3E%3C/svg%3E"); }
[data-domain="fertility"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='16' cy='7.5' r='3.5'/%3E%3Cpath d='M13.6 10c-2.2 2-1 4.2-3.2 6.2s-4.2.8-6.4 3.3'/%3E%3C/svg%3E"); }
[data-domain="hormones"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2.8l7.5 4.3v8.6L12 20l-7.5-4.3V7.1z'/%3E%3Ccircle cx='12' cy='11.4' r='2.6'/%3E%3C/svg%3E"); }
[data-domain="heart"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20.5s-7.6-4.6-9.4-9C1.3 8 3.6 4.6 7.2 4.6c2 0 3.6 1.1 4.8 2.8 1.2-1.7 2.8-2.8 4.8-2.8 3.6 0 5.9 3.4 4.6 6.9-1.8 4.4-9.4 9-9.4 9z'/%3E%3Cpath d='M3.5 12.5h4.2l1.8-2.8 3 5.4 1.9-2.6h6'/%3E%3C/svg%3E"); }
[data-domain="metabolic"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2.8s6.4 6.8 6.4 11.6a6.4 6.4 0 0 1-12.8 0C5.6 9.6 12 2.8 12 2.8z'/%3E%3Cpath d='M9 14.5a3 3 0 0 0 3 3'/%3E%3C/svg%3E"); }
[data-domain="fitness"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 7.5v9M17.5 7.5v9M3.5 9.8v4.4M20.5 9.8v4.4M6.5 12h11'/%3E%3C/svg%3E"); }
[data-domain="nutrition"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 19.5C4.6 11 10 4.5 20 4.5c0 10-6 15.5-14.5 15'/%3E%3Cpath d='M5 19.5c3-4.2 6.4-7.4 10.5-9.5'/%3E%3C/svg%3E"); }
[data-domain="mind"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5.2a3.1 3.1 0 0 0-5.8 1.3A3.2 3.2 0 0 0 4.6 12a3.2 3.2 0 0 0 2.2 5.4A3.1 3.1 0 0 0 12 19z'/%3E%3Cpath d='M12 5.2a3.1 3.1 0 0 1 5.8 1.3 3.2 3.2 0 0 1 1.6 5.5 3.2 3.2 0 0 1-2.2 5.4A3.1 3.1 0 0 1 12 19z'/%3E%3C/svg%3E"); }
[data-domain="sleep"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 14.6A8.2 8.2 0 1 1 9.4 4a6.6 6.6 0 0 0 10.6 10.6z'/%3E%3Cpath d='M15.5 4.5h3l-3 3.5h3'/%3E%3C/svg%3E"); }
[data-domain="urology"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5c2-2 4.2-2 6.2 0s4.2 2 6.2 0 4.6-2 4.6-2M3.5 13c2-2 4.2-2 6.2 0s4.2 2 6.2 0 4.6-2 4.6-2M3.5 17.5c2-2 4.2-2 6.2 0s4.2 2 6.2 0 4.6-2 4.6-2'/%3E%3C/svg%3E"); }
[data-domain="skin"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2.5v2.8M12 18.7v2.8M2.5 12h2.8M18.7 12h2.8M5.3 5.3l2 2M16.7 16.7l2 2M5.3 18.7l2-2M16.7 7.3l2-2'/%3E%3C/svg%3E"); }
[data-domain="substances"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M6 6l12 12'/%3E%3C/svg%3E"); }
[data-domain="prevention"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2.8l7.5 3.2v6c0 4.6-3.2 7.8-7.5 9.2-4.3-1.4-7.5-4.6-7.5-9.2V6z'/%3E%3Cpath d='M8.6 12.1l2.4 2.4 4.6-4.9'/%3E%3C/svg%3E"); }
[data-domain="gut"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.5 2.8v3.6c0 2-3.6 2.2-3.6 6.8a6.1 6.1 0 0 0 12.2 0c0-3.2-2-4.6-4.2-4.6s-3.1 1.3-3.1 3.1 1.4 2.6 2.6 2.6'/%3E%3C/svg%3E"); }


/* ---------- Hub: emergency panel ---------- */
.emergency {
  margin: 44px 0 8px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--border));
  background: color-mix(in srgb, var(--danger) 5%, var(--surface));
  padding: 22px 26px 12px;
  box-shadow: var(--shadow);
}
.emergency h2 { margin: 0 0 4px; font-size: 24px; color: var(--danger); }
.emergency h2::before { display: none; }
.emergency > p { color: var(--muted); margin: 0 0 12px; font-size: 15.5px; }
.emergency ul {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 4px 28px;
}
.emergency li { font-size: 15.5px; line-height: 1.5; padding-left: 20px; position: relative; }
.emergency li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.emergency li a { color: var(--muted); font-size: 14px; }
.pager .prev { grid-column: 1; }

/* ---------- Hub: hero icon mosaic ---------- */
.hub-art {
  position: absolute;
  right: clamp(20px, 4vw, 48px);
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  grid-template-columns: repeat(4, 56px);
  gap: 12px;
}
.hub-hero .lede, .hub-hero .chips { max-width: 760px; }
.hub-art span {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--domain) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--domain) 22%, transparent);
  box-shadow: var(--shadow);
  position: relative;
}
.hub-art span:nth-child(4n+2) { transform: translateY(18px); }
.hub-art span:nth-child(4n+3) { transform: translateY(-10px); }
.hub-art span::after {
  content: "";
  position: absolute;
  inset: 15px;
  background: var(--domain);
  -webkit-mask: var(--icon) center / contain no-repeat;
          mask: var(--icon) center / contain no-repeat;
}
@media (max-width: 1240px) { .hub-art { display: none; } }

[data-domain="style"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8.5 3.2L3.5 6l2 4.2 2-1V20.8h9V9.2l2 1L20.5 6l-5-2.8c-.6 1.6-1.9 2.6-3.5 2.6S9.1 4.8 8.5 3.2z'/%3E%3C/svg%3E"); }

/* ---------- Print ---------- */
@media print {
  .topbar, .progress, .sidebar, .to-top, .search { display: none !important; }
  .layout { display: block; }
  body { background: #fff; font-size: 12pt; }
  .hero { background: none; }
  .hero::after, .pager { display: none; }
  figure.diagram, .fact, .table-wrap { box-shadow: none; break-inside: avoid; }
}
