/* ==========================================================================
   Page-level styles for the three variations
   ========================================================================== */

/* Global nav */
.topnav {
  position: sticky; top: 0; z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
  transition: background .4s var(--ease);
}
.topnav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 40px;
  max-width: 1280px; margin: 0 auto;
}
.logo { display: flex; align-items: center; gap: 12px; font-family: var(--f-display); font-size: 18px; letter-spacing: -0.01em; }
.logo-mark {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent);
  position: relative;
  flex: none;
}
.logo-mark::after {
  content: ""; position: absolute; inset: 6px;
  border-radius: 50%;
  background: var(--bg);
}
.logo-mark::before {
  content: ""; position: absolute; inset: 11px;
  border-radius: 50%;
  background: var(--accent);
}
.topnav-links { display: flex; gap: 28px; align-items: center; font-size: 14px; }
.topnav-links a { color: var(--ink-muted); text-decoration: none; }
.topnav-links a:hover { color: var(--ink); }
.topnav-links a.active { color: var(--ink); font-weight: 500; }

/* Variation switcher */
.view-switch {
  display: inline-flex; border: 1px solid var(--rule); border-radius: 999px;
  padding: 3px; background: var(--surface);
}
.view-switch button {
  padding: 6px 14px; border-radius: 999px; border: none; background: transparent;
  font-family: var(--f-body); font-size: 12px; font-weight: 500; letter-spacing: 0.02em;
  color: var(--ink-muted); cursor: pointer; transition: all .2s var(--ease);
}
.view-switch button.active { background: var(--ink); color: var(--warm-cream); }

/* =========================  ARTICLE  ========================= */
.article { padding-bottom: 96px; }

.hero { padding: 80px 40px 48px; max-width: 1280px; margin: 0 auto; }
.hero-meta { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 48px; }
.hero-title { max-width: 18ch; margin-bottom: 32px; }
.hero-title em { font-style: italic; font-variation-settings: "opsz" 144, "SOFT" 100; color: var(--accent); }
.hero-sub { font-size: 21px; line-height: 1.45; max-width: 60ch; color: var(--ink-muted); margin-bottom: 56px; }
.hero-byline { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; padding-bottom: 56px; max-width: 800px; font-size: 14px; }
.hero-byline .eyebrow { margin-bottom: 4px; }
.hero-img { aspect-ratio: 3/2; margin-top: 16px; border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.hero-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Abstract row */
.abstract-row {
  display: grid; grid-template-columns: 280px 1fr; gap: 80px;
  padding: 72px 40px;
  max-width: 1280px; margin: 0 auto;
}
.abstract-label .eyebrow { margin-bottom: 6px; }
.abstract-id { color: var(--ink-soft); }
.abstract-body .lede {
  font-family: var(--f-display);
  font-size: 28px; line-height: 1.25;
  font-variation-settings: "opsz" 72, "SOFT" 50;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
  color: var(--ink);
}
.abstract-body p { font-size: 17px; max-width: 60ch; }

/* Stats */
.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px;
  padding: 32px 40px 72px;
  max-width: 1280px; margin: 0 auto;
}
.stat { border-top: 1px solid var(--ink); padding-top: 24px; }
.stat-k {
  font-family: var(--f-display);
  font-size: clamp(48px, 6vw, 84px);
  font-weight: 420;
  line-height: 1; letter-spacing: -0.04em;
  color: var(--accent);
  font-variation-settings: "opsz" 144, "SOFT" 30;
  margin-bottom: 16px;
}
.stat-l { font-size: 15px; color: var(--ink-muted); max-width: 34ch; line-height: 1.5; }

/* Chart section */
.chart-section { padding: 72px 40px; max-width: 1280px; margin: 0 auto; }
.chart-head { margin-bottom: 40px; max-width: 720px; }
.chart-head h2 { margin: 8px 0 16px; }
.chart-cap { font-size: 14px; color: var(--ink-muted); line-height: 1.55; }
.barchart { width: 100%; height: auto; color: var(--ink); }
.barchart .ax { font-family: var(--f-mono); font-size: 11px; fill: var(--ink-muted); }
.barchart .ax-num { font-family: var(--f-mono); font-size: 11px; fill: var(--ink); }

/* Spectrum diagram (view A) */
.spectrum-svg { width: 100%; height: auto; color: var(--ink); margin-top: 8px; }
.spectrum-svg .sx-head { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.14em; fill: var(--ink-muted); }
.spectrum-svg .sx-head.accent { fill: var(--accent); }
.spectrum-svg .sx-label { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.08em; fill: var(--ink-muted); text-transform: uppercase; }
.spectrum-svg .sx-pole { font-family: var(--f-serif); font-size: 16px; fill: var(--ink); font-style: italic; }
.spectrum-svg .sx-pole.accent { fill: var(--accent); }

/* Chapters */
.chapters { padding: 80px 40px; max-width: 1280px; margin: 0 auto; }
.chapters-head { margin-bottom: 40px; }
.chapters-head h2 { margin-top: 8px; max-width: 20ch; }
.chapter-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.chapter {
  display: grid; grid-template-columns: 80px 1fr 40px; gap: 32px;
  padding: 32px 0; border-bottom: 1px solid var(--rule);
  cursor: pointer; transition: padding .25s var(--ease);
}
.chapter:hover { padding-left: 12px; padding-right: 0; }
.chapter:hover .ch-arrow { transform: translateX(4px); }
.ch-n { color: var(--ink-soft); font-size: 14px; padding-top: 6px; }
.ch-body h3 { margin-bottom: 6px; }
.ch-body p { color: var(--ink-muted); margin: 0; font-size: 15px; }
.ch-body .ch-meta { color: var(--ink-soft); font-size: 11px; letter-spacing: 0.08em; margin-top: 8px; text-transform: uppercase; }
.ch-arrow { align-self: center; color: var(--ink-soft); font-size: 20px; transition: transform .25s var(--ease); }

/* Pull quote */
.pullquote {
  padding: 96px 40px;
  max-width: 980px; margin: 0 auto;
  text-align: center; position: relative;
}
.pull-mark {
  font-family: var(--f-display);
  font-style: italic;
  font-size: 140px;
  line-height: 0.6;
  color: var(--accent);
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  margin-bottom: 32px;
}
.pullquote blockquote {
  font-family: var(--f-display);
  font-size: clamp(26px, 3.2vw, 40px);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 auto 24px;
  max-width: 26ch;
  font-variation-settings: "opsz" 144, "SOFT" 50;
  color: var(--ink);
}
.pullquote cite {
  font-family: var(--f-body); font-style: normal;
  font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-muted);
}

/* Case vignette */
.case { padding: 72px 40px; max-width: 1280px; margin: 0 auto; }
.case-meta { display: flex; justify-content: space-between; margin-bottom: 32px; align-items: baseline; }
.eyebrow.terracotta { color: var(--terracotta); }
.case-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; align-items: start; }
.case-title { margin-bottom: 28px; }
.case-title { font-style: italic; font-variation-settings: "opsz" 144, "SOFT" 100; }
.case-body p { max-width: 50ch; font-size: 16px; }
.case-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.tag {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.04em;
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--rule);
  color: var(--ink-muted);
}
.case-img { aspect-ratio: 4/5; min-height: 360px; }

/* Course CTA */
.course-cta {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 80px;
  padding: 80px 40px;
  max-width: 1280px; margin: 0 auto;
  background: var(--surface);
  border-radius: var(--r-lg);
  align-items: center;
}
.course-cta .cta-sub { font-size: 17px; color: var(--ink-muted); max-width: 46ch; margin: 20px 0 32px; }
.course-cta h2 { margin-top: 12px; }
.cta-actions { display: flex; gap: 12px; }
.cta-right { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; border-left: 1px solid var(--rule); padding-left: 48px; }
.cta-fact .eyebrow { margin-bottom: 4px; }
.cta-fact { font-size: 15px; }

/* =========================  COURSE  ========================= */
.course { padding-bottom: 96px; }
.course-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 40px; max-width: 1280px; margin: 0 auto;
  font-size: 14px;
}
.course-bar .dot { color: var(--ink-soft); padding: 0 8px; }
.course-bar-left, .course-bar-right { display: flex; align-items: center; gap: 8px; }
.course-bar-right .eyebrow { margin-right: 4px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: var(--warm-cream);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
}

.course-hero {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 80px;
  padding: 72px 40px; max-width: 1280px; margin: 0 auto;
  align-items: start;
}
.ch-title { margin: 16px 0 28px; }
.ch-title em { color: var(--accent); }
.ch-sub { font-size: 18px; color: var(--ink-muted); max-width: 46ch; margin-bottom: 40px; }
.progress-row { margin-bottom: 32px; }
.progress-track { height: 6px; background: var(--rule-soft); border-radius: 999px; overflow: hidden; margin-bottom: 10px; }
.progress-fill { height: 100%; background: var(--accent); }
.progress-meta { display: flex; justify-content: space-between; color: var(--ink-muted); font-size: 12px; }
.ch-actions { display: flex; gap: 12px; }
.ch-right { display: flex; flex-direction: column; gap: 24px; }
.course-cover { aspect-ratio: 2/3; border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.course-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ch-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 24px; background: var(--surface); border-radius: var(--r-md); border: 1px solid var(--rule); font-size: 14px; }
.ch-facts .eyebrow { margin-bottom: 4px; }

/* Module list */
.modules { padding: 72px 40px; max-width: 1280px; margin: 0 auto; }
.modules-head { margin-bottom: 40px; }
.modules-head h2 { margin-top: 8px; }
.module-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.module {
  display: grid; grid-template-columns: 56px 1fr 180px 100px; gap: 32px;
  align-items: center; padding: 28px 8px;
  border-bottom: 1px solid var(--rule);
  transition: background .2s var(--ease);
}
.module:hover { background: var(--surface); }
.module.locked { opacity: 0.55; }
.m-n { color: var(--ink-soft); font-size: 14px; }
.m-body h3 { margin-bottom: 6px; }
.m-body p { color: var(--ink-muted); margin: 0; font-size: 14px; max-width: 60ch; }
.m-meta { margin-top: 10px; font-size: 12px; color: var(--ink-soft); display: flex; align-items: center; gap: 4px; }
.m-meta .dot { padding: 0 6px; }
.m-prog { display: flex; flex-direction: column; gap: 6px; min-width: 180px; }
.m-prog-track { height: 4px; background: var(--rule-soft); border-radius: 999px; overflow: hidden; }
.m-prog-fill { height: 100%; background: var(--accent); }
.m-prog-pct { font-size: 11px; color: var(--ink-muted); }
.m-lock { color: var(--ink-soft); font-size: 11px; }
.m-go {
  padding: 10px 16px; border-radius: 999px; border: 1px solid var(--rule);
  background: transparent; color: var(--ink); font-family: var(--f-body); font-size: 13px; font-weight: 500;
  cursor: pointer;
}
.m-go:hover:not(:disabled) { background: var(--ink); color: var(--warm-cream); border-color: var(--ink); }
.m-go:disabled { cursor: not-allowed; color: var(--ink-soft); }

/* Compare table */
.compare { padding: 72px 40px; max-width: 1280px; margin: 0 auto; }
.compare-head { margin-bottom: 32px; max-width: 720px; }
.compare-head h2 { margin: 8px 0 12px; }
.compare-sub { color: var(--ink-muted); font-size: 15px; }
.compare-table { border-top: 1px solid var(--ink); }
.compare-row {
  display: grid; grid-template-columns: 1fr 1.2fr 1fr 1fr; gap: 24px;
  padding: 20px 0; border-bottom: 1px solid var(--rule);
  font-size: 15px;
}
.compare-row--head {
  font-family: var(--f-body); text-transform: uppercase; letter-spacing: 0.1em;
  font-size: 11px; color: var(--ink-muted); font-weight: 600;
  border-bottom: 1px solid var(--rule);
}

/* Instructor */
.instructor {
  display: grid; grid-template-columns: 1fr 1.4fr; gap: 64px;
  padding: 80px 40px; max-width: 1280px; margin: 0 auto;
  align-items: center;
}
.instr-photo { 
  aspect-ratio: 3/4; 
  border-radius: var(--r-md); 
  overflow: hidden;
  background: var(--surface);
}
.instr-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.88);
}
.instr-body h2 { margin: 8px 0 20px; }
.instr-body em { color: var(--accent); font-style: italic; font-variation-settings: "opsz" 72, "SOFT" 80; }
.instr-role { font-size: 15px; color: var(--ink-muted); margin-bottom: 20px !important; }
.placeholder-note { color: var(--ink-soft); font-size: 13px; padding: 12px 14px; border: 1px dashed var(--rule); border-radius: var(--r-sm); background: var(--bg); }
.instr-body p { max-width: 52ch; color: var(--ink-muted); }

/* =========================  RESEARCH  ========================= */
.research { padding-bottom: 96px; }
.research-strip {
  display: flex; justify-content: space-between;
  padding: 14px 40px; max-width: 1280px; margin: 0 auto;
  font-size: 12px; color: var(--ink-muted);
}

.research-hero {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 80px;
  padding: 72px 40px; max-width: 1280px; margin: 0 auto;
  align-items: end;
}
.rh-left .eyebrow { margin-bottom: 20px; display: block; }
.rh-title { max-width: 18ch; }
.rh-deck { font-size: 17px; color: var(--ink-muted); margin-bottom: 24px; max-width: 40ch; }
.rh-dl { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 0; font-size: 14px; border-top: 1px solid var(--rule); padding-top: 16px; }
.rh-dl > div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; }
.rh-dl dt { color: var(--ink-muted); font-weight: 500; }
.rh-dl dd { margin: 0; }

/* Findings */
.findings { padding: 72px 40px; max-width: 1280px; margin: 0 auto; }
.findings-head { margin-bottom: 40px; }
.findings-head h2 { margin-top: 8px; }
.findings-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.findings-list li { display: grid; grid-template-columns: 48px 1fr; gap: 20px; padding: 24px 0; border-top: 1px solid var(--ink); }
.f-n { color: var(--accent); font-size: 14px; padding-top: 4px; }
.findings-list h3 { margin-bottom: 6px; font-size: 1.15rem; }
.findings-list p { margin: 0; color: var(--ink-muted); font-size: 14px; }

/* Charts side by side */
.charts-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
  padding: 32px 40px 72px; max-width: 1280px; margin: 0 auto;
}
.chart-card {
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 32px;
  background: var(--surface);
}
.chart-card-head { margin-bottom: 20px; }
.chart-card-head h3 { margin-top: 6px; font-size: 1.15rem; }
.donut { width: 100%; max-width: 280px; display: block; margin: 16px auto 8px; }
.donut-big { font-family: var(--f-display); font-size: 36px; fill: var(--ink); font-variation-settings: "opsz" 72; }
.donut-sm { font-family: var(--f-mono); font-size: 11px; fill: var(--ink-muted); letter-spacing: 0.05em; }
.linechart { width: 100%; color: var(--ink); }
.linechart .ax { font-family: var(--f-mono); font-size: 10px; fill: var(--ink-muted); }
.legend { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--ink-muted); }
.legend li { display: flex; align-items: center; gap: 10px; }
.legend .tnum { margin-left: auto; color: var(--ink); }
.sw { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }

/* Protocol */
.protocol { padding: 72px 40px; max-width: 1280px; margin: 0 auto; }
.protocol-head { margin-bottom: 40px; max-width: 720px; }
.protocol-head h2 { margin: 8px 0 12px; }
.protocol-sub { color: var(--ink-muted); }
.protocol-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.p-col { padding: 32px; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--surface); }
.p-badge { display: inline-block; padding: 4px 10px; border-radius: 4px; background: var(--ink); color: var(--warm-cream); font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.05em; margin-bottom: 20px; }
.p-col h3 { margin-bottom: 10px; }
.p-col > p { color: var(--ink-muted); font-size: 15px; margin-bottom: 20px; }
.p-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.p-list li { padding: 12px 0; border-bottom: 1px solid var(--rule-soft); font-size: 14px; }
.p-list li:last-child { border-bottom: none; }
/* Quoted clinician phrases — roman, not italic */
.p-list em { 
  font-style: normal !important; 
  font-family: var(--f-body); 
  font-variation-settings: normal;
  font-size: 15px; 
  line-height: 1.5; 
  color: var(--ink); 
  font-weight: 500;
}

/* References */
.references { padding: 72px 40px; max-width: 1280px; margin: 0 auto; }
.ref-head { margin-bottom: 32px; }
.ref-head h2 { margin-top: 8px; }
.ref-list { list-style: none; padding: 0; margin: 0; max-width: 900px; }
.ref-list li { padding: 16px 0; border-top: 1px solid var(--rule); font-size: 14px; color: var(--ink-muted); display: grid; grid-template-columns: 48px 1fr; gap: 16px; }
.ref-list li em { color: var(--ink); }
.ref-list li .mono { color: var(--ink-soft); }
.toolkit-note { margin-top: 28px; color: var(--ink-soft); font-family: var(--f-serif); font-style: italic; font-size: 16px; max-width: 900px; }

/* Protocol "don't" variant */
.p-col.dont { background: var(--warm-cream); border-color: color-mix(in oklab, var(--accent) 35%, var(--rule)); }
.p-col.dont .p-badge { background: var(--accent); color: var(--warm-cream); }
.p-col.dont .p-list li { color: var(--ink-muted); }

/* Intervention quad (2x2) */
.quad { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--r-md); overflow: hidden; margin-top: 8px; }
.quad-cell { padding: 24px; background: var(--surface); min-height: 150px; display: flex; flex-direction: column; gap: 8px; }
.quad-cell h4 { font-family: var(--f-serif); font-size: 22px; font-weight: 500; margin: 4px 0; letter-spacing: -0.01em; }
.quad-cell p { color: var(--ink-muted); font-size: 14px; line-height: 1.5; margin: 0; }
.quad-cell.tone-sage { border-top: 3px solid var(--sage); }
.quad-cell.tone-warm { border-top: 3px solid var(--warm-grey); }
.quad-cell.tone-accent { border-top: 3px solid var(--accent); }
.quad-cell.tone-terracotta { border-top: 3px solid var(--terracotta); }

/* Loss features list */
.loss-feats { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; }
.loss-feats li { display: grid; grid-template-columns: 180px 1fr; gap: 24px; padding: 20px 0; border-top: 1px solid var(--rule); align-items: baseline; }
.loss-feats li:last-child { border-bottom: 1px solid var(--rule); }
.lf-k { display: flex; flex-direction: column; gap: 4px; }
.lf-k .mono { font-size: 11px; color: var(--ink-soft); letter-spacing: 0.08em; }
.lf-k em { font-family: var(--f-serif); font-style: italic; font-size: 24px; color: var(--accent); font-weight: 500; }
.lf-d { color: var(--ink-muted); font-size: 15px; line-height: 1.55; }

/* =========================  TWEAKS PANEL  ========================= */
.tweaks-panel {
  position: fixed; bottom: 24px; right: 24px;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  box-shadow: 0 10px 40px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.06);
  padding: 20px;
  z-index: 100;
  font-size: 13px;
}
.tweaks-panel h4 {
  font-family: var(--f-body); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-muted);
  margin: 0 0 16px; font-weight: 600;
}
.tweaks-row { margin-bottom: 16px; }
.tweaks-row:last-child { margin-bottom: 0; }
.tweaks-label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 8px; font-weight: 600; }
.tweaks-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tweaks-seg.three { grid-template-columns: 1fr 1fr 1fr; }
.tweaks-seg button {
  padding: 8px; border-radius: 6px; border: 1px solid var(--rule);
  background: transparent; color: var(--ink); font-family: var(--f-body);
  font-size: 12px; cursor: pointer; transition: all .15s var(--ease);
}
.tweaks-seg button.on { background: var(--ink); color: var(--warm-cream); border-color: var(--ink); }
.accent-dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; vertical-align: middle; margin-right: 6px; }

/* Responsive */
@media (max-width: 900px) {
  .hero-byline, .stats, .findings-list, .protocol-grid, .charts-2 { grid-template-columns: 1fr; }
  .abstract-row, .case-grid, .course-cta, .cta-right, .course-hero, .instructor, .research-hero { grid-template-columns: 1fr; gap: 40px; }
  .module { grid-template-columns: 40px 1fr; }
  .quad { grid-template-columns: 1fr; }
  .loss-feats li { grid-template-columns: 1fr; gap: 8px; }
  .m-prog, .m-go { grid-column: 2; }
  .cta-right { border-left: none; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 32px; }
}
