/* Element defaults carry the reading layout; islands add the route, topics and question sheet. */
:root {
  color-scheme: light;
  --purple: #990ffa;
  --pink: #e60076;
  --ink: #111827;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --sweep: linear-gradient(112deg, var(--purple), var(--pink));
  --quiet: #f8eefb;
  --fine: 0.75rem;
  --caption: 0.875rem;
  --body: 1rem;
  --lead: 1.125rem;
  --h3: 1.5rem;
  --h2: 1.875rem;
  --h1: 2.25rem;
  --body-face: 'Montserrat', Arial, sans-serif;
  --display-face: 'Space Grotesk', 'Arial', sans-serif;
  --mono-face: 'JetBrains Mono', 'Courier New', monospace;
}

* { box-sizing: border-box; }
html { scroll-padding-block-start: 24px; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 400 var(--body)/1.75 var(--body-face);
  -webkit-font-smoothing: antialiased;
}
::selection { color: var(--ink); background: #efd6ff; }
[hidden] { display: none !important; }
main { max-width: 1200px; margin: 0 auto; padding: 0 32px 64px; outline: none; }
h1, h2, h3, legend { font-family: var(--display-face); line-height: 1.2; letter-spacing: -0.035em; }
h1 { font-size: var(--h1); font-weight: 700; margin: 0 0 24px; max-width: 25ch; }
h2 { font-size: var(--h2); font-weight: 600; margin: 48px 0 16px; max-width: 34ch; }
h3 { font-size: var(--h3); font-weight: 600; margin: 0 0 16px; }
p { margin: 0 0 16px; max-width: 65ch; }
ul, ol { padding-left: 24px; }
li { margin-bottom: 8px; }
dl { margin: 24px 0; }
dt { font-weight: 700; }
dd { margin: 0 0 24px; }
a { color: var(--purple); text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { color: var(--purple); text-decoration-color: var(--pink); }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 5px;
}
a, button, summary, label { -webkit-tap-highlight-color: #efd6ff; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: 0.7; }
input { accent-color: var(--purple); font: inherit; }
fieldset { min-width: 0; padding: 24px; margin: 0 0 32px; border: 1px solid var(--purple); }
legend { padding: 0 8px; font-size: var(--h3); font-weight: 600; }
strong { font-weight: 650; }
.eyebrow { font-size: 1rem; line-height: 1.5; font-weight: 600; margin: 0 0 16px; letter-spacing: 0.01em; }
.lead { font-size: var(--lead); line-height: 1.7; }
.skip-link {
  position: absolute; left: 24px; top: 0; padding: 16px 24px;
  background: #fff; color: var(--purple); z-index: 50; transform: translateY(-120%);
}
.skip-link:focus { transform: translateY(0); }

/* Topic clusters use native disclosure, including when scripting is absent. */
.site-header { max-width: 1200px; margin: 0 auto; padding: 24px 32px 0; position: relative; z-index: 10; }
.masthead { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 16px; }
.masthead p { font-size: 1rem; margin: 0; }
.wordmark { display: inline-flex; align-items: center; gap: 16px; min-height: 48px; color: var(--ink); font: 600 24px/1.2 var(--display-face); text-decoration: none; }
.wordmark:hover { color: var(--purple); }
.brand-mark { display: block; width: 40px; height: 40px; border-radius: 50%; background: var(--sweep); position: relative; flex: 0 0 40px; }
.brand-mark::before { content: ''; position: absolute; inset: 8px; border: 3px solid #fff; border-radius: 50%; }
.brand-mark::after { content: ''; position: absolute; width: 12px; height: 12px; background: #fff; border-radius: 3px; bottom: 1px; right: 0; }
.topic-nav { display: grid; grid-template-columns: repeat(3, 1fr); position: relative; gap: 16px; border-bottom: 1px solid #decce9; padding-bottom: 16px; }
.topic { position: relative; }
.topic summary { min-height: 48px; padding: 8px 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; list-style: none; cursor: pointer; border: 1px solid transparent; border-radius: 8px; background: var(--quiet); font-weight: 600; }
.topic summary::-webkit-details-marker { display: none; }
.topic summary::after { content: '+'; font: 400 24px/1 var(--mono-face); color: var(--purple); }
.topic[open] summary::after { content: '−'; }
.topic summary:hover { border-color: var(--purple); }
.topic[open] summary, .topic-current summary { border-color: var(--purple); }
.topic ul { position: absolute; top: 100%; left: 0; width: 100%; min-width: 280px; padding: 8px; margin: 8px 0 0; list-style: none; border: 2px solid var(--purple); border-radius: 8px; background: #fff; box-shadow: 0 16px 32px #41145c1a; }
.topic li { margin: 0; }
/* Reserve the arrow column while allowing even the active, bold label to wrap. */
.topic a { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; min-height: 56px; padding: 8px 16px; gap: 16px; color: var(--ink); text-decoration: none; border-radius: 4px; }
.topic-label { min-width: 0; overflow-wrap: anywhere; }
.topic a:hover { color: var(--purple); background: var(--quiet); }
.topic a[aria-current='page'] { font-weight: 700; background: var(--quiet); text-decoration: underline; text-decoration-color: var(--purple); }

/* The saturated route is abstract decoration. It does not encode health outcomes. */
.route-art { position: relative; isolation: isolate; overflow: hidden; min-height: 344px; width: 100%; border-radius: 8px 96px 8px 8px; background: var(--sweep); color: #fff; box-shadow: 16px 16px 0 #f6eaff; }
.art-grid { position: absolute; inset: 0; background-image: linear-gradient(#ffffff18 1px, transparent 1px), linear-gradient(90deg, #ffffff18 1px, transparent 1px); background-size: 32px 32px; }
.art-ring { position: absolute; display: block; border-radius: 50%; border: 24px solid #ffffff36; aspect-ratio: 1; }
.ring-outer { width: min(320px, 100%); right: 0; top: -88px; }
.ring-inner { width: 192px; left: 40px; bottom: -72px; border-width: 16px; }
.art-path { position: absolute; height: 208px; width: 232px; left: 72px; top: 80px; border: 2px solid #fff; border-left: 0; border-bottom: 0; border-radius: 0 88px 0 0; transform: rotate(-20deg); }
.art-block { position: absolute; height: 80px; width: 80px; left: 48px; top: 48px; border: 2px solid #ffffffa6; border-radius: 16px; transform: rotate(-20deg); background: #ffffff0d; }
.art-dot { position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 8px #ffffff20; }
.dot-start { left: 40px; top: 128px; }
.dot-end { right: 48px; bottom: 64px; }
.art-tag { position: absolute; font: 500 16px/1.5 var(--body-face); border-radius: 24px; padding: 8px 16px; background: #111827; color: #fff; box-shadow: 0 8px 24px #4d075733; }
.tag-care { left: 24px; top: 160px; }
.tag-proof { top: 48px; right: 32px; }
.tag-questions { bottom: 24px; left: 96px; }
.route-art-small { min-height: 216px; border-radius: 8px 64px 8px 8px; box-shadow: none; }
.route-art-small .ring-outer { width: min(240px, 100%); }
.route-art-small .ring-inner { width: 144px; }
.route-art-small .art-path { top: 64px; left: 48px; width: 144px; height: 120px; }
.route-art-small .art-block { width: 48px; height: 48px; top: 24px; left: 24px; }
.route-art-small .dot-start { left: 24px; top: 104px; }
.route-art-small .dot-end { right: 24px; bottom: 32px; }
.route-art-small .tag-care { top: 128px; left: 16px; }
.route-art-small .tag-proof { top: 16px; right: 16px; }
.route-art-small .tag-questions { left: 88px; bottom: 16px; }

/* Home islands keep the headline and route choices distinct from the reading area. */
.home-hero { display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 64px; padding: 48px 0 64px; }
.home-hero h1, .page-top h1 { color: var(--purple); }
.hero-copy .eyebrow { color: var(--purple); }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px 24px; margin-top: 24px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 56px; padding: 16px 24px; gap: 24px; color: #fff; background: var(--purple); border: 0; border-radius: 8px; text-decoration: none; font-weight: 600; line-height: 1.5; box-shadow: 0 8px 24px #990ffa20; }
.button:hover { color: #fff; background: #7f0cd0; }
.button:active { transform: translateY(1px); box-shadow: none; }
.text-action { display: inline-flex; align-items: center; min-height: 48px; padding: 8px 0; gap: 16px; font-weight: 600; }
.opening-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 64px; align-items: start; padding: 0 0 48px; }
.opening-grid h2 { margin-top: 0; }
.key-fact { padding: 24px; border: 2px solid var(--purple); border-radius: 8px; background: var(--quiet); }
.key-fact p:last-child { margin-bottom: 0; }
.key-fact h2 { margin-top: 0; font-size: var(--h3); }
.route-picker { border-top: 2px solid transparent; border-image: var(--sweep) 1; padding-top: 40px; }
.route-picker h2 { margin-top: 0; }
.route-pairs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 32px; }
.route-pairs section { min-width: 0; }
.route-pairs h3 { font-size: var(--h3); font-weight: 600; font-family: var(--body-face); letter-spacing: 0; margin-bottom: 8px; }
.route-link { display: flex; justify-content: space-between; gap: 16px; padding: 24px 0; border-bottom: 1px solid #d9c5e7; color: var(--ink); text-decoration: none; }
.route-link strong { display: block; color: var(--purple); font: 600 24px/1.25 var(--display-face); letter-spacing: -0.025em; margin-bottom: 8px; }
.route-link > span > span { display: block; font-size: 16px; line-height: 1.6; }
.route-link:hover strong { color: var(--pink); text-decoration: underline; text-underline-offset: 4px; }
.route-arrow { font: 400 24px/1.3 var(--mono-face); color: var(--purple); }
.plain-section { max-width: 720px; margin-top: 48px; }

/* Articles inherit element-based type; the aside and evidence notes are small islands. */
.page-top { padding: 48px 0 24px; max-width: 800px; }
.page-top .eyebrow { color: var(--purple); }
.scenario { padding: 24px 32px; border-left: 4px solid var(--purple); background: var(--quiet); margin-bottom: 40px; border-radius: 0 8px 8px 0; }
.scenario .eyebrow { margin-bottom: 8px; }
.scenario p:last-child { margin: 0; }
.reading-grid { display: grid; grid-template-columns: minmax(0, 720px) minmax(240px, 1fr); gap: 64px; align-items: start; }
.reading-grid article > h2:first-child { margin-top: 0; }
.route-aside { min-width: 0; }
.route-aside nav ul { list-style: none; padding: 0; margin: 0 0 32px; border-top: 1px solid #d9c5e7; }
.route-aside nav li { margin: 0; }
.route-aside nav a { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 56px; padding: 8px 0; border-bottom: 1px solid #d9c5e7; text-decoration: none; }
.route-aside nav a:hover { text-decoration: underline; }
.aside-note { background: var(--quiet); border-radius: 8px; padding: 24px; margin-bottom: 24px; }
.aside-note h2 { font-size: var(--h3); margin: 0 0 16px; }
.aside-note p { margin-bottom: 0; }
.care-options { padding: 24px; background: var(--quiet); border: 2px solid transparent; border-radius: 8px; }
.care-options dt { font: 600 24px/1.3 var(--display-face); margin-bottom: 8px; }
.care-options dd:last-child { margin-bottom: 0; }
.source-action { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 16px 24px; border: 2px solid var(--purple); background: #fff; border-radius: 8px; font-weight: 600; text-decoration: none; margin: 24px 0; }
.source-action:hover { background: var(--quiet); }
.study-slice { margin: 24px 0; padding: 24px; border-left: 4px solid var(--purple); background: var(--quiet); border-radius: 0 8px 8px 0; }
.study-slice p:last-child { margin-bottom: 0; }
.flag-list { margin: 24px 0; padding: 8px 24px; border: 2px solid var(--purple); background: var(--quiet); border-radius: 8px; }
.flag-list section { padding: 24px 0; }
.flag-list section + section { border-top: 1px solid #d9c5e7; }
.flag-list h3 { padding-left: 24px; position: relative; }
.flag-list h3::before { content: ''; position: absolute; left: 0; top: 8px; width: 8px; height: 16px; border-radius: 2px; background: var(--amber); }
.flag-list p { margin-bottom: 0; }
.urgent-note { padding: 24px; border-left: 4px solid var(--red); background: #fff2f6; border-radius: 0 8px 8px 0; }
.urgent-note p:last-child { margin-bottom: 0; }
.quote-list { border: 2px solid var(--purple); background: #fff; border-radius: 8px; padding: 0 24px; }
.quote-list > div { display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 24px; padding: 24px 0; }
.quote-list > div + div { border-top: 1px solid #dfd5e9; }
.quote-list dt { font: 600 16px/1.75 var(--mono-face); }
.quote-list dd { margin: 0; }
.next-route { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 24px; margin-top: 48px; border: 2px solid var(--purple); border-radius: 8px; background: var(--quiet); text-decoration: none; color: var(--ink); }
.next-route > span > span, .next-route strong { display: block; }
.next-route .eyebrow { margin-bottom: 8px; }
.next-route strong { font: 600 24px/1.3 var(--display-face); color: var(--purple); margin-bottom: 8px; }
.next-route:hover strong { color: var(--pink); text-decoration: underline; }
.next-arrow { font: 400 30px/1 var(--mono-face); color: var(--purple); }
.note-marker { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; padding: 0 8px; font: 600 16px/1 var(--mono-face); border: 1px solid #dfc2f2; border-radius: 50%; margin: 0 0 0 4px; text-decoration: none; vertical-align: baseline; }
.note-marker:hover { background: var(--quiet); border-color: var(--pink); }
.footnotes { margin: 48px 0 0; padding: 32px 0 0; border-top: 2px solid transparent; border-image: var(--sweep) 1; max-width: 720px; }
.footnotes h2 { font-size: var(--h3); margin: 0 0 16px; }
.footnotes ol { margin: 0; padding-left: 24px; }
.footnotes li::marker { color: var(--purple); font: 600 16px var(--mono-face); }
.footnotes a { display: inline-flex; min-width: 40px; min-height: 48px; max-width: 100%; align-items: center; gap: 8px; line-height: 1.6; padding: 8px 0; }
.footnotes a > span:first-child, .route-link > span:first-child, .next-route > span:first-child, .checklist label > span { min-width: 0; }
.footnotes a > span[aria-hidden], .route-arrow, .next-arrow { flex-shrink: 0; }
.footnotes p { margin: 0 0 16px; font-size: 16px; }

/* The checklist is a native local worksheet, with no submission or stored answers. */
.print-tools { margin-bottom: 32px; }
.print-tools p { margin: 16px 0 0; }
.print-context { margin-bottom: 40px; }
.checklist fieldset { border: 2px solid var(--purple); background: #fff; border-radius: 8px; }
.checklist label { display: flex; align-items: flex-start; min-height: 64px; gap: 16px; padding: 16px 0; font-size: 16px; line-height: 1.6; cursor: pointer; }
.checklist label + label { border-top: 1px solid #dfd5e9; }
.checklist input { width: 44px; height: 44px; margin: 0; flex: 0 0 44px; cursor: pointer; }
.checklist label:has(input:checked) { font-weight: 600; }
.checklist label:has(input:checked) span::after { content: ''; width: 8px; height: 8px; display: inline-block; border-radius: 50%; background: var(--green); margin-left: 8px; }
.writing-lines { height: 160px; background: repeating-linear-gradient(transparent, transparent 31px, #d9c5e7 31px, #d9c5e7 32px); }
.site-footer { position: relative; overflow: hidden; margin: 0; padding: 40px max(32px, calc((100vw - 1136px) / 2)); background: var(--quiet); border-top: 2px solid transparent; border-image: var(--sweep) 1; }
.site-footer > div { max-width: 800px; position: relative; z-index: 1; }
.site-footer p { font-size: 16px; }
.site-footer a { display: inline-flex; align-items: center; min-height: 48px; padding: 8px 0; margin-right: 32px; gap: 16px; font-size: 16px; }
.footer-route { position: absolute; width: min(240px, 100%); height: 240px; border: 32px solid #990ffa12; border-radius: 50%; right: 0; bottom: -128px; }
.error-page { max-width: 720px; padding: 64px 0; }
.error-page .route-art { max-width: 360px; margin-top: 48px; }

@media (max-width: 1023px) {
  .home-hero, .opening-grid { gap: 32px; }
  .reading-grid { grid-template-columns: minmax(0, 1fr) 240px; gap: 32px; }
  .quote-list > div { grid-template-columns: 1fr; gap: 8px; }
  .route-pairs { gap: 24px; }
}
@media (max-width: 767px) {
  main { padding: 0 24px 48px; }
  .site-header { padding: 16px 24px 0; }
  .masthead { display: block; margin-bottom: 16px; }
  .masthead p { margin-top: 8px; }
  .wordmark { min-height: 48px; }
  .topic-nav { gap: 8px; }
  .topic { position: static; min-width: 0; }
  .topic summary { padding: 8px; gap: 4px; font-size: 16px; min-height: 56px; line-height: 1.4; }
  .topic summary::after { font-size: 18px; }
  .topic ul { top: calc(100% - 16px); left: 0; min-width: 0; width: 100%; }
  .topic:nth-child(2) ul { z-index: 2; }
  .topic:nth-child(3) ul { z-index: 3; }
  .home-hero { display: block; padding: 32px 0 48px; }
  .home-hero .route-art { margin-top: 32px; min-height: 256px; border-radius: 8px 80px 8px 8px; box-shadow: 8px 8px 0 #f6eaff; }
  .home-hero .art-path { top: 64px; height: 144px; width: 200px; }
  .home-hero .tag-care { top: 144px; }
  .home-hero .tag-questions { bottom: 16px; left: 96px; }
  .hero-actions { display: grid; justify-items: start; gap: 8px; }
  .button { max-width: 100%; gap: 16px; padding: 16px; }
  h1 { font-size: 36px; line-height: 1.15; max-width: 100%; }
  h2 { font-size: 30px; }
  .opening-grid { display: block; padding-bottom: 32px; }
  .opening-grid > div:first-child { margin-bottom: 32px; }
  .route-picker { padding-top: 32px; }
  .route-pairs { display: block; margin-top: 24px; }
  .route-pairs section + section { margin-top: 32px; }
  .route-link { padding: 24px 0; }
  .page-top { padding: 32px 0 16px; }
  .scenario { padding: 24px; margin-bottom: 32px; }
  .reading-grid { display: block; }
  .route-aside { margin-top: 48px; }
  .route-aside .route-art { display: none; }
  .key-fact, .study-slice, .care-options, .urgent-note, .next-route { padding: 24px; }
  .next-route { align-items: flex-start; gap: 16px; }
  .flag-list { padding: 0 24px; }
  .footnotes a { overflow-wrap: anywhere; }
  .checklist fieldset { padding: 16px; }
  .checklist label { gap: 16px; }
  .site-footer { padding: 32px 24px; }
  .site-footer a { display: flex; margin: 0; gap: 16px; }
}
@media (max-width: 359px) {
  main, .site-header { padding-left: 16px; padding-right: 16px; }
  .topic summary { display: block; }
  .topic summary::after { margin-left: 4px; }
}
@media (prefers-reduced-motion: no-preference) {
  .button, .route-link strong, .topic summary { transition: color 120ms ease, border-color 120ms ease, transform 120ms ease; }
}
@media (forced-colors: active) {
  .home-hero h1, .page-top h1 { -webkit-text-fill-color: CanvasText; background: none; }
  .button { border: 2px solid ButtonText; }
  .route-art { display: none; }
  .note-marker, .key-fact, .checklist fieldset, .next-route, .quote-list, .source-action, .flag-list { border-color: CanvasText; }
}
@media print {
  @page { size: A4; margin: 16mm; }
  body { font: 400 12pt/1.4 var(--body-face); color: #000; background: #fff; }
  .site-header, .skip-link, .scenario, .route-aside, .print-tools, .site-footer a, .footer-route { display: none; }
  main { max-width: none; padding: 0; }
  .page-top { padding: 0 0 16px; }
  .page-top h1 { color: #000; background: none; -webkit-text-fill-color: #000; font-size: 24pt; margin-bottom: 16px; }
  .page-top .eyebrow { color: #000; }
  .page-top p, .print-context p { font-size: 12pt; }
  .reading-grid { display: block; }
  .key-fact { padding: 16px; background: none; border: 1px solid #000; }
  .print-context { margin-bottom: 24px; }
  .checklist fieldset { background: none; border: 1px solid #000; border-radius: 0; padding: 8px 16px; margin-bottom: 16px; break-inside: avoid; }
  .checklist legend { font-size: 16pt; }
  .checklist label { min-height: 0; padding: 8px 0; font-size: 12pt; gap: 12px; break-inside: avoid; }
  .checklist label + label { border-color: #999; }
  .checklist label:has(input:checked) span::after { display: none; }
  .checklist input { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .answer-space { break-inside: avoid; }
  .answer-space h2 { margin-top: 24px; font-size: 16pt; }
  .writing-lines { height: 96px; background: none; border-bottom: 1px solid #888; border-top: 1px solid #888; }
  .note-marker { min-width: 24px; min-height: 24px; border: 1px solid #000; color: #000; font-size: 12pt; }
  .footnotes { margin-top: 24px; padding-top: 16px; border-image: none; border-top: 1px solid #000; break-inside: avoid; }
  .footnotes h2 { font-size: 16pt; }
  .footnotes li::marker, .footnotes a { color: #000; }
  .footnotes a { min-height: 0; padding: 0; display: inline; }
  .site-footer { padding: 16px 0 0; margin-top: 24px; background: none; border-image: none; border-top: 1px solid #000; }
  .site-footer p { margin: 0; font-size: 12pt; }
  a { color: #000; }
}
