:root {
  --brand-purple: #5e2781;
  --brand-purple-dark: #3c1755;
  --brand-green: #7eba29;
  --ink: #271d2c;
  --muted: #6c5f70;
  --paper: #f8f3e8;
  --paper-deep: #eee5d4;
  --surface: #fffaf1;
  --line: rgba(94, 39, 129, 0.18);
  --shadow: 0 18px 60px rgba(54, 30, 63, 0.12);
  --font-serif: Charter, "Bitstream Charter", "Iowan Old Style", Georgia, serif;
  --font-sans: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 9rem;
  background: var(--paper);
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 2%, rgba(126, 186, 41, 0.08), transparent 28rem),
    linear-gradient(180deg, #fbf7ee 0%, var(--paper) 55%, #f4ecdf 100%);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.66;
  text-rendering: optimizeLegibility;
}

a { color: var(--brand-purple); text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { color: var(--brand-green); }
img { display: block; max-width: 100%; height: auto; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  background: var(--brand-purple);
  color: white;
  padding: 0.7rem 1rem;
  border-radius: 0 0 0.5rem 0.5rem;
  font-family: var(--font-sans);
}
.skip-link:focus { top: 0; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 243, 232, 0.96);
  backdrop-filter: blur(14px);
}

.brand-row {
  width: min(1120px, calc(100% - 2.5rem));
  min-height: 4.5rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand { flex: 0 1 15rem; text-decoration: none; }
.brand img { width: 15rem; }
.series-label,
.category,
.byline,
.section-nav,
.article-image figcaption,
.evidence-table figcaption,
.contrast-figure figcaption,
.contrast-kicker,
.contrast-method,
.site-footer { font-family: var(--font-sans); }

.series-label {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  color: var(--brand-purple);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  white-space: nowrap;
}

.series-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
}

.section-nav {
  width: 100%;
  display: flex;
  gap: 1.2rem;
  padding: 0.55rem max(1.25rem, calc((100% - 1120px) / 2));
  overflow-x: auto;
  border-top: 1px solid rgba(94, 39, 129, 0.09);
  scrollbar-width: thin;
}

.section-nav a {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.section-nav a:hover { color: var(--brand-purple); }

main { display: block; }
.article-header { width: min(920px, calc(100% - 2.5rem)); margin: 0 auto; padding: 4rem 0 0; }
.series-intro {
  max-width: 760px;
  margin: 0 0 1.4rem;
}

.category {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.5rem;
  color: var(--brand-green);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.category .series-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.series-description {
  max-width: 660px;
  margin: 0;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  line-height: 1.55;
}

h1 {
  max-width: 880px;
  margin: 0;
  color: var(--brand-purple-dark);
  font-family: var(--font-sans);
  font-size: clamp(2.25rem, 4vw, 3.4rem);
  font-weight: 750;
  letter-spacing: -0.038em;
  line-height: 1.04;
}

.lead {
  max-width: 760px;
  margin: 2rem 0 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.72;
}

.byline {
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}
.byline strong { color: var(--brand-purple); font-weight: 700; }

.hero-figure {
  position: relative;
  width: min(1120px, calc(100vw - 2.5rem));
  margin: 3rem 0 4rem;
  margin-left: 50%;
  transform: translateX(-50%);
  overflow: hidden;
  border: 1px solid rgba(94, 39, 129, 0.14);
  border-radius: 1.35rem;
  box-shadow: var(--shadow);
  background: var(--paper-deep);
}
.hero-figure img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.article-body {
  width: min(740px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding-bottom: 4rem;
  font-family: var(--font-serif);
  font-size: 18px;
}
.article-body p,
.article-body li { font-size: 18px; line-height: 1.72; }
.article-body p { margin: 0 0 1.15rem; }
.article-body > figure {
  width: min(930px, calc(100vw - 2.5rem));
  margin: 1.7rem 0 2.2rem;
  margin-left: 50%;
  transform: translateX(-50%);
}
.article-body > figure img {
  width: 100%;
  border-radius: 1rem;
  box-shadow: 0 14px 45px rgba(45, 26, 53, 0.14);
}
.article-body > figure figcaption {
  max-width: 740px;
  margin: 0.75rem auto 0;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  line-height: 1.5;
}
.article-body h2 {
  margin: 3.2rem 0 1.15rem;
  color: var(--brand-purple-dark);
  font-family: var(--font-sans);
  font-size: clamp(1.8rem, 4.6vw, 2.45rem);
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.13;
}
.article-body h3 {
  margin: 2rem 0 0.8rem;
  color: var(--brand-purple-dark);
  font-family: var(--font-sans);
  font-size: 1.2rem;
  font-weight: 750;
  line-height: 1.3;
}
.article-body h2::before {
  content: "";
  display: block;
  width: 3.4rem;
  height: 0.24rem;
  margin-bottom: 1rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-green), var(--brand-purple));
}
.article-body ul,
.article-body ol { margin: 0.4rem 0 1.35rem; padding-left: 1.4rem; }
.article-body li { margin: 0.55rem 0; padding-left: 0.25rem; }
.article-body li::marker { color: var(--brand-green); font-weight: 700; }

.citation { margin-left: 0.08em; font-family: var(--font-sans); font-size: 0.68em; font-weight: 750; line-height: 0; }
.citation a { padding: 0.05em 0.1em; color: var(--brand-purple); text-decoration: none; }
.citation a:focus-visible,
.citation a:hover { color: var(--brand-green); text-decoration: underline; }

.article-image {
  width: min(930px, calc(100vw - 2.5rem));
  margin: 1.7rem 0 2.2rem;
  margin-left: 50%;
  transform: translateX(-50%);
}
.article-image img {
  width: 100%;
  max-height: 44rem;
  object-fit: cover;
  border-radius: 1rem;
  box-shadow: 0 14px 45px rgba(45, 26, 53, 0.14);
}
.article-image figcaption {
  max-width: 740px;
  margin: 0.75rem auto 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.evidence-table,
.contrast-figure {
  width: min(930px, calc(100vw - 2.5rem));
  margin: 2rem 0 2.4rem;
  margin-left: 50%;
  transform: translateX(-50%);
}
.evidence-table figcaption,
.contrast-figure figcaption {
  margin-bottom: 0.65rem;
  color: var(--brand-purple);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: rgba(255, 250, 241, 0.86);
  box-shadow: 0 10px 35px rgba(50, 31, 55, 0.07);
}
table { width: 100%; border-collapse: collapse; font-family: var(--font-sans); font-size: 0.86rem; line-height: 1.45; }
th, td { padding: 0.85rem 0.95rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { background: var(--brand-purple); color: white; font-weight: 750; }
tbody th { width: 29%; color: var(--brand-purple-dark); font-weight: 700; }
tbody tr:last-child th,
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: rgba(126, 186, 41, 0.055); }

.contrast-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(255, 250, 241, 0.9);
  box-shadow: 0 10px 35px rgba(50, 31, 55, 0.07);
}
.contrast-grid section { padding: 1.4rem 1.5rem; }
.contrast-grid section + section { border-left: 1px solid var(--line); }
.contrast-grid p { margin: 0 0 0.8rem; }
.contrast-kicker { color: var(--brand-purple); font-size: 1rem !important; font-weight: 800; }
.contrast-method { color: var(--muted); font-size: 0.82rem !important; font-weight: 650; }
.contrast-grid strong { display: block; margin-top: 1.1rem; color: var(--brand-purple-dark); font-family: var(--font-sans); font-size: 0.85rem; text-transform: uppercase; }
.contrast-grid ul { margin-bottom: 0; }

.clinical-note {
  margin: 2rem 0;
  padding: 1.25rem 1.35rem;
  border: 1px solid rgba(126, 186, 41, 0.42);
  border-left: 0.32rem solid var(--brand-green);
  border-radius: 0.8rem;
  background: rgba(255, 250, 241, 0.92);
}
.clinical-note h3 { margin-top: 0; }
.clinical-note p:last-child { margin-bottom: 0; }

.references { padding-top: 1rem; }
.references-list { padding-left: 1.55rem; list-style: decimal outside; }
.references-list li {
  margin: 0 0 1rem;
  padding-left: 0.35rem;
  color: #534656;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  line-height: 1.52;
}
.references-list li::marker { color: var(--brand-purple); font-weight: 800; }
.references-list a { overflow-wrap: anywhere; }
.reference-link {
  color: inherit;
  text-decoration: none;
}
.reference-link:hover {
  color: var(--brand-purple);
  text-decoration: underline;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.18em;
}
.reference-link:focus-visible {
  border-radius: 0.2rem;
  outline: 2px solid var(--brand-green);
  outline-offset: 0.18rem;
}
.backref { margin-left: 0.3rem; color: var(--brand-green); font-size: 0.9em; text-decoration: none; }

.reader-tools,
.comments {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.reader-tools h2,
.comments h2 { margin-top: 0.35rem; }
.reader-tools h2::before,
.comments h2::before { display: none; }
.engagement-kicker {
  margin: 0;
  color: var(--brand-green);
  font-family: var(--font-sans);
  font-size: 0.76rem !important;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.follow-links,
.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.follow-links { margin-top: 1.2rem; }
.follow-links a,
.share-actions a,
.share-actions button,
.comment-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  min-height: 2.75rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--brand-purple);
  border-radius: 999px;
  background: transparent;
  color: var(--brand-purple);
  font-family: var(--font-sans);
  font-size: 0.79rem;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}
.follow-links a:hover,
.share-actions a:hover,
.share-actions button:hover { border-color: var(--brand-green); color: var(--brand-green); }
.share-tools { margin-top: 2rem; }
.share-tools h3 { margin-top: 0; }
.share-status { min-height: 1.5em; margin: 0.55rem 0 0 !important; color: var(--muted); font-family: var(--font-sans); font-size: 0.78rem !important; }
.comments-caution {
  padding: 0.8rem 0.95rem;
  border-left: 0.25rem solid var(--brand-green);
  background: rgba(126, 186, 41, 0.08);
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.82rem !important;
  line-height: 1.55 !important;
}
.comments-form {
  display: grid;
  gap: 0.65rem;
  margin-top: 1.4rem;
  font-family: var(--font-sans);
}
.comments-form label { color: var(--brand-purple-dark); font-size: 0.82rem; font-weight: 700; }
.comments-form label span { color: var(--muted); font-weight: 400; }
.comments-form input,
.comments-form textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}
.comments-form textarea { min-height: 9rem; resize: vertical; }
.comments-form input:focus,
.comments-form textarea:focus { border-color: var(--brand-purple); outline: 3px solid rgba(94, 39, 129, 0.12); }
.comment-submit {
  width: fit-content;
  margin-top: 0.35rem;
  border-color: var(--brand-purple);
  background: var(--brand-purple);
  color: white;
}
.comment-submit:hover { border-color: var(--brand-green); background: var(--brand-green); color: var(--brand-purple-dark); }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.confirmation-page { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.confirmation-card { width: min(620px, 100%); padding: clamp(1.5rem, 5vw, 3rem); border: 1px solid var(--line); border-radius: 1rem; background: var(--surface); box-shadow: var(--shadow); }
.confirmation-card > img { width: 12rem; margin-bottom: 2rem; }
.confirmation-card h1 { margin: 0.35rem 0 1rem; font-size: clamp(2rem, 7vw, 3rem); }
.confirmation-card .comment-submit { margin-top: 0.7rem; }

.site-footer {
  width: min(1120px, calc(100% - 2.5rem));
  margin: 0 auto 2rem;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border-top: 1px solid var(--line);
}
.site-footer img { width: 11rem; }
.site-footer p { margin: 0.6rem 0 0; color: var(--muted); font-size: 0.78rem; }
.social-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--brand-purple);
  border-radius: 999px;
  color: var(--brand-purple);
  font-size: 0.86rem;
  text-decoration: none;
  white-space: nowrap;
}
.social-cta:hover { border-color: var(--brand-green); color: var(--brand-green); }

@media (max-width: 700px) {
  html { scroll-padding-top: 8.5rem; }
  body { font-size: 18px; }
  .brand-row { width: min(100% - 2rem, 1120px); min-height: 4rem; }
  .brand,
  .brand img { width: 10.5rem; }
  .series-label { gap: 0.35rem; font-size: 0.66rem; letter-spacing: 0.08em; }
  .series-label .series-icon { width: 1rem; height: 1rem; }
  .series-description { font-size: 0.82rem; }
  .section-nav { padding-inline: 1rem; gap: 1rem; }
  .article-header { width: min(100% - 2rem, 920px); padding-top: 2.6rem; }
  h1 { font-size: clamp(2rem, 8.7vw, 2.5rem); line-height: 1.06; }
  .lead { margin-top: 1.4rem; }
  .hero-figure { width: calc(100vw - 2rem); margin-top: 2.2rem; margin-bottom: 3rem; border-radius: 0.85rem; }
  .article-body { width: min(100% - 2rem, 740px); }
  .article-body h2 { margin-top: 2.7rem; }
  .article-image,
  .article-body > figure,
  .evidence-table,
  .contrast-figure { width: calc(100vw - 2rem); }
  .article-image img { border-radius: 0.75rem; }
  th, td { min-width: 10rem; padding: 0.75rem; }
  tbody th { min-width: 12rem; }
  .contrast-grid { grid-template-columns: 1fr; }
  .contrast-grid section + section { border-left: 0; border-top: 1px solid var(--line); }
  .follow-links,
  .share-actions { align-items: stretch; flex-direction: column; }
  .follow-links a,
  .share-actions a,
  .share-actions button { width: 100%; }
  .site-footer { width: calc(100% - 2rem); padding: 1.5rem 0; flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

@media print {
  .site-header,
  .site-footer,
  .skip-link { display: none; }
  body { background: white; color: black; font-size: 11pt; }
  .article-header,
  .article-body { width: 100%; }
  h1 { color: black; font-size: 34pt; }
  .hero-figure,
  .article-image,
  .evidence-table,
  .contrast-figure { width: 100%; margin-left: 0; transform: none; break-inside: avoid; }
}
