/* ==========================================================================
   Claude track — AI-enabled drug discovery, final report site
   Self-contained stylesheet. No imports, no remote fonts, no third-party CSS.
   Light and dark themes, both authored to exceed WCAG AA on body text.
   ========================================================================== */

:root {
  color-scheme: light dark;

  --font-body: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia,
    "Songti SC", "Noto Serif CJK SC", serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", "Microsoft YaHei", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas,
    "Liberation Mono", monospace;

  --measure: 41rem;
  --radius: 6px;
  --rule-width: 1px;

  /* Light theme (default) */
  --bg: #fbfaf7;
  --bg-alt: #f2efe8;
  --surface: #ffffff;
  --surface-sunken: #f6f4ef;
  --ink: #13171e;
  --ink-soft: #3a434f;
  --muted: #4d5661;
  --rule: #ded9d0;
  --rule-strong: #c3bcae;
  --accent: #8f5310;
  --accent-soft: #f4e7d4;
  --affirm: #14532d;
  --affirm-soft: #dcece1;
  --caution: #7b4708;
  --caution-soft: #f8ecd7;
  --danger: #8a1c1c;
  --danger-soft: #f6e0e0;
  --shadow: 0 1px 2px rgba(19, 23, 30, 0.06), 0 6px 18px rgba(19, 23, 30, 0.06);
  --focus: #0b4f9e;
}

[data-theme="dark"] {
  --bg: #0f1319;
  --bg-alt: #141a22;
  --surface: #161d26;
  --surface-sunken: #121821;
  --ink: #e9edf3;
  --ink-soft: #c3ccd8;
  --muted: #a6b1bf;
  --rule: #27313d;
  --rule-strong: #3a4655;
  --accent: #e5a95f;
  --accent-soft: #2c2418;
  --affirm: #7fd4a2;
  --affirm-soft: #14261c;
  --caution: #e8b671;
  --caution-soft: #29200f;
  --danger: #f09b9b;
  --danger-soft: #2a1618;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.38);
  --focus: #7db8ff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* --- Focus, links, skip navigation ------------------------------------- */

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

a {
  color: var(--accent);
  text-underline-offset: 0.16em;
  text-decoration-thickness: from-font;
}

a:hover {
  color: var(--ink);
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -100vh;
  z-index: 100;
  padding: 0.65rem 1rem;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--focus);
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
}

/* --- Header ------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: var(--rule-width) solid var(--rule);
}

.header-inner {
  max-width: 78rem;
  margin: 0 auto;
  padding: 0.7rem 1.25rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
}

.wordmark {
  min-width: 0;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.2;
}

.wordmark span {
  display: block;
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: var(--rule-width) solid var(--rule-strong);
  border-radius: var(--radius);
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.nav-toggle {
  display: none;
}

/* --- Layout ------------------------------------------------------------- */

.layout {
  max-width: 78rem;
  margin: 0 auto;
  padding: 0 1.25rem 5rem;
  display: grid;
  grid-template-columns: 15.5rem minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

.toc {
  position: sticky;
  top: 5.25rem;
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
  padding: 1.25rem 0 1rem;
  font-family: var(--font-ui);
}

.toc h2 {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.6rem;
  font-weight: 700;
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--rule);
}

.toc a {
  display: block;
  padding: 0.34rem 0.75rem;
  margin-left: -2px;
  border-left: 2px solid transparent;
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--muted);
  text-decoration: none;
}

.toc a:hover {
  color: var(--ink);
  background: var(--surface-sunken);
}

.toc a[aria-current="true"] {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

main {
  min-width: 0;
  padding-top: 1rem;
}

/* --- Typography --------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  font-family: var(--font-ui);
  line-height: 1.22;
  color: var(--ink);
  letter-spacing: -0.012em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 1.4rem + 2.4vw, 3.1rem);
  margin: 0 0 0.65rem;
  font-weight: 800;
}

h2 {
  font-size: clamp(1.45rem, 1.2rem + 1vw, 1.95rem);
  margin: 0 0 0.4rem;
  font-weight: 700;
}

h3 {
  font-size: 1.16rem;
  margin: 2rem 0 0.5rem;
  font-weight: 700;
}

h4 {
  font-size: 1rem;
  margin: 1.5rem 0 0.4rem;
  font-weight: 700;
  color: var(--ink-soft);
}

p,
li {
  max-width: var(--measure);
}

p {
  margin: 0 0 1.05rem;
}

ul,
ol {
  padding-left: 1.35rem;
}

li {
  margin-bottom: 0.5rem;
}

strong {
  font-weight: 700;
  color: var(--ink);
}

.lede {
  font-size: 1.12em;
  color: var(--ink-soft);
}

.section-kicker {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.35rem;
}

.section {
  padding: 3rem 0 0.5rem;
  border-top: var(--rule-width) solid var(--rule);
  margin-top: 2.5rem;
}

.section:first-of-type {
  border-top: 0;
  margin-top: 0;
}

.section > p:first-of-type {
  margin-top: 0.9rem;
}

/* --- Hero --------------------------------------------------------------- */

.hero {
  padding: 2.75rem 0 0.5rem;
}

.hero-meta {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
}

.hero-meta b {
  color: var(--accent);
  font-weight: 700;
}

.hero-verdict {
  font-size: 1.2em;
  line-height: 1.5;
  border-left: 4px solid var(--accent);
  padding-left: 1.1rem;
  margin: 1.5rem 0 2rem;
  max-width: 44rem;
}

.headline-figure {
  background: var(--surface);
  border: var(--rule-width) solid var(--rule);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem 1.1rem;
  box-shadow: var(--shadow);
  margin: 2rem 0;
}

.headline-figure figcaption {
  font-family: var(--font-ui);
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 0.9rem;
  max-width: 46rem;
}

.headline-figure svg {
  display: block;
  width: 100%;
  height: auto;
}

/* --- Claim labels and citations ---------------------------------------- */

.claim {
  display: inline-block;
  font-family: var(--font-ui);
  /* These six chips carry the fact / estimate / scenario / recommendation
     distinction. At 0.68rem they rendered at 10.9px — too small for the one
     signal a reader must not miss. */
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.12rem 0.42rem;
  border-radius: 3px;
  border: 1px solid currentColor;
  vertical-align: 0.12em;
  margin-right: 0.35rem;
  white-space: nowrap;
}

.claim-f {
  color: var(--affirm);
  background: var(--affirm-soft);
}

.claim-cr {
  color: var(--caution);
  background: var(--caution-soft);
}

.claim-e {
  color: var(--accent);
  background: var(--accent-soft);
}

.claim-i {
  color: var(--ink-soft);
  background: var(--surface-sunken);
}

.claim-s {
  color: var(--muted);
  background: var(--bg-alt);
}

.claim-r {
  color: var(--danger);
  background: var(--danger-soft);
}

.citation {
  font-family: var(--font-mono);
  /* Relative to the surrounding text, but floored: a bare `em` compounded down
     to 9.4px inside .meta and 10.4px inside table cells, which is below the
     legibility floor this report sets for itself. */
  font-size: max(0.78rem, 0.72em);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 3px;
  padding: 0.06em 0.32em;
  margin-left: 0.18em;
  white-space: nowrap;
}

.citation:hover,
.citation:focus-visible {
  background: var(--accent);
  color: var(--bg);
}

.capped {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--danger);
  border: 1px dashed currentColor;
  border-radius: 3px;
  padding: 0.04em 0.3em;
  margin-left: 0.25em;
  white-space: nowrap;
  /* If the flag ever does wrap (see the narrow-viewport rule below), both
     fragments must keep the dashed border that carries its meaning. */
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* --- Callouts ----------------------------------------------------------- */

.callout {
  border: var(--rule-width) solid var(--rule-strong);
  border-left: 5px solid var(--accent);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.15rem 1.3rem 0.4rem;
  margin: 1.8rem 0;
  box-shadow: var(--shadow);
}

.callout > :last-child {
  margin-bottom: 1rem;
}

.callout h3 {
  margin-top: 0;
  font-size: 1.02rem;
}

.callout-title {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.callout--assume {
  border-left-color: var(--danger);
}

.callout--assume .callout-title {
  color: var(--danger);
}

.callout--against {
  border-left-color: var(--danger);
  background: var(--danger-soft);
}

.callout--against .callout-title {
  color: var(--danger);
}

.callout--quiet {
  border-left-color: var(--rule-strong);
  box-shadow: none;
  background: var(--surface-sunken);
}

.callout--quiet .callout-title {
  color: var(--muted);
}

/* --- Tables ------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: var(--rule-width) solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  line-height: 1.45;
}

caption {
  caption-side: top;
  text-align: left;
  font-family: var(--font-ui);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.75rem 0.9rem 0.55rem;
  border-bottom: var(--rule-width) solid var(--rule);
}

th,
td {
  padding: 0.6rem 0.9rem;
  text-align: left;
  vertical-align: top;
  border-bottom: var(--rule-width) solid var(--rule);
}

thead th {
  background: var(--surface-sunken);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

tbody tr:last-child td,
tbody tr:last-child th {
  border-bottom: 0;
}

tbody th {
  font-weight: 700;
  white-space: nowrap;
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* --- Expandable technical sections -------------------------------------- */

details.tech {
  border: var(--rule-width) solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 1.25rem 0;
  box-shadow: var(--shadow);
}

details.tech[open] {
  border-color: var(--rule-strong);
}

details.tech > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.95rem 1.15rem;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

details.tech > summary::-webkit-details-marker {
  display: none;
}

details.tech > summary::before {
  content: "▸";
  color: var(--accent);
  font-size: 0.85em;
  transition: transform 160ms ease;
  display: inline-block;
}

details.tech[open] > summary::before {
  transform: rotate(90deg);
}

details.tech > summary:hover {
  color: var(--accent);
}

details.tech > summary .summary-note {
  margin-left: auto;
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: right;
}

.tech-body {
  padding: 0.25rem 1.15rem 1rem;
  border-top: var(--rule-width) solid var(--rule);
}

/* Subsections inside a disclosure are h3 — a <summary> is a control, not a
   heading, so an h4 here would skip a level under the section's h2. The former
   h4 appearance is kept: level is semantic, size is presentational. */
.tech-h {
  font-size: 1rem;
  margin: 1.5rem 0 0.4rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.tech-body > h3:first-child {
  margin-top: 1.1rem;
}

/* --- Cards and grids ---------------------------------------------------- */

.grid {
  display: grid;
  gap: 1rem;
  margin: 1.6rem 0;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
}

.card {
  background: var(--surface);
  border: var(--rule-width) solid var(--rule);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.card h3,
.card h4 {
  margin-top: 0;
}

.card p:last-child {
  margin-bottom: 0;
}

.stat {
  font-family: var(--font-ui);
  font-variant-numeric: tabular-nums;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--accent);
  display: block;
  letter-spacing: -0.02em;
}

.stat-label {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--muted);
  display: block;
  margin-top: 0.4rem;
  line-height: 1.4;
  max-width: none;
}

/* --- Source list -------------------------------------------------------- */

.source-list {
  display: grid;
  gap: 0.1rem;
  margin: 1.5rem 0;
  border: var(--rule-width) solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--rule);
}

.source-entry {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 0.25rem 1rem;
  padding: 0.85rem 1.1rem;
  background: var(--surface);
  font-family: var(--font-ui);
  font-size: 0.87rem;
  line-height: 1.5;
  scroll-margin-top: 6rem;
}

.source-entry:target {
  background: var(--accent-soft);
}

.source-entry .sid {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--accent);
}

.source-entry .meta {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.8rem;
}

.source-entry .title {
  grid-column: 2;
  color: var(--ink);
}

.verify {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
  border: 1px solid currentColor;
}

.verify-full {
  color: var(--affirm);
  background: var(--affirm-soft);
}

.verify-meta {
  color: var(--caution);
  background: var(--caution-soft);
}

.verify-un {
  color: var(--danger);
  background: var(--danger-soft);
}

/* --- Legend ------------------------------------------------------------- */

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  padding: 0.9rem 1.1rem;
  background: var(--surface-sunken);
  border: var(--rule-width) solid var(--rule);
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 0.84rem;
  color: var(--muted);
  margin: 1.5rem 0;
}

.legend > span {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
}

/* --- Footer ------------------------------------------------------------- */

.site-footer {
  border-top: var(--rule-width) solid var(--rule);
  background: var(--bg-alt);
  padding: 2.5rem 1.25rem 3rem;
  font-family: var(--font-ui);
  font-size: 0.87rem;
  color: var(--muted);
}

.site-footer .footer-inner {
  max-width: 78rem;
  margin: 0 auto;
}

.site-footer p {
  max-width: 52rem;
}

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 1080px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .toc {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0.75rem 0 1rem;
    border-bottom: var(--rule-width) solid var(--rule);
  }

  .toc[hidden] {
    display: none;
  }

  .toc ol {
    border-left: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.1rem;
  }

  .toc a {
    border-left: 0;
    border-bottom: 2px solid transparent;
    padding: 0.55rem 0.6rem;
  }

  .toc a[aria-current="true"] {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
  }
}

@media (max-width: 780px) {
  body {
    font-size: 16px;
  }

  .header-inner,
  .layout {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .hero {
    padding-top: 1.75rem;
  }

  .hero-verdict {
    padding-left: 0.9rem;
  }

  .section {
    padding-top: 2.25rem;
    margin-top: 1.75rem;
  }

  /* Data text must not shrink on the device with the least room to read it:
     0.86rem here was smaller than the 0.9rem desktop size. The min-width is
     what makes the surrounding scroller do its job — without it a table simply
     compresses to the viewport and columns wrap to one word per line. */
  table {
    font-size: 1rem;
    min-width: 30rem;
  }

  caption,
  figcaption,
  .source-entry {
    font-size: 0.95rem;
  }

  th,
  td {
    padding: 0.55rem 0.7rem;
  }

  details.tech > summary {
    flex-wrap: wrap;
    padding: 0.85rem 1rem;
  }

  details.tech > summary .summary-note {
    margin-left: 1.2rem;
    flex-basis: 100%;
    text-align: left;
  }

  .tech-body {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (max-width: 640px) {
  /* The wordmark plus three controls cannot fit one row on a phone; wrapping
     them keeps the document from exceeding the viewport width. */
  html {
    scroll-padding-top: 7.5rem;
  }

  .wordmark {
    flex: 1 1 100%;
  }

  .header-actions {
    margin-left: 0;
    width: 100%;
  }

  .toc {
    top: 7.25rem;
  }
}

@media (max-width: 520px) {
  .wordmark span {
    font-size: 0.78rem;
  }

  /* Last resort on the narrowest phones: the capped flag is a phrase, not a
     token, so it is allowed to wrap rather than push the page sideways. */
  .capped {
    white-space: normal;
  }

  .btn {
    padding: 0.4rem 0.55rem;
    font-size: 0.8rem;
  }

  h1 {
    overflow-wrap: break-word;
  }

  .source-entry {
    grid-template-columns: minmax(0, 1fr);
  }

  .source-entry .meta,
  .source-entry .title {
    grid-column: 1;
  }

  .stat {
    font-size: 1.5rem;
  }

  .headline-figure {
    padding: 1rem 0.9rem 0.85rem;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  .site-header,
  .toc,
  .site-footer .no-print {
    display: none !important;
  }

  body {
    font-size: 11pt;
    background: #fff;
    color: #000;
  }

  .layout {
    display: block;
    padding: 0;
  }

  details.tech {
    break-inside: avoid;
    box-shadow: none;
  }

  details.tech > summary {
    font-size: 12pt;
  }

  .tech-body {
    display: block !important;
  }
}
