/* The Clinical AI Report: website styles.
   Mirrors the newsletter PDF (navy accent, serif headlines, pale blue numbers band,
   red caution box) and reads comfortably on a phone first. Light and dark themes. */

@font-face { font-family: "Source Serif 4"; src: url("/fonts/source-serif-4-latin-wght-normal.woff2") format("woff2"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif 4"; src: url("/fonts/source-serif-4-latin-wght-italic.woff2") format("woff2"); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  color-scheme: light dark;
  --accent: #1D4E6B;
  --accent-ink: #ffffff;
  --ink: #16191c;
  --body: #24282c;
  --mid: #59616a;
  --rule: #dcdfe2;
  --bg: #ffffff;
  --statband: #dde7f0;
  --stat-ink: #34424f;
  --floor: #f2f5f7;
  --toolbox: #f0f0ed;
  --editorbox: #efeff0;
  --caution: #b23b2e;
  --caution-bg: #faf1ef;
  --caution-ink: #4a1a13;
  --track: #e3e5e1;
  --serif: "Source Serif 4", "Liberation Serif", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --gutter-l: max(5vw, 16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(5vw, 16px, env(safe-area-inset-right, 0px));
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #8fc1e3;
    --accent-ink: #0d1419;
    --ink: #eef1f3;
    --body: #d9dee2;
    --mid: #a3adb6;
    --rule: #2d363e;
    --bg: #0f1418;
    --statband: #16242f;
    --stat-ink: #c3d0db;
    --floor: #141c22;
    --toolbox: #181c1f;
    --editorbox: #181b1f;
    --caution: #ff8f80;
    --caution-bg: #2a1815;
    --caution-ink: #f4d8d3;
    --track: #2a3238;
  }
}

*, *::before, *::after { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--sans); overflow-x: clip; }
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--bg); padding: 8px 12px; }

.wrap { max-width: 1120px; margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.col { max-width: 720px; margin: 0 auto; }

/* Site header */
.site-head { border-bottom: 1px solid var(--rule); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 20px; padding-top: calc(12px + env(safe-area-inset-top, 0px)); padding-bottom: 12px; }
.brand { font: 700 19px/1.2 var(--serif); color: var(--ink); text-decoration: none; letter-spacing: -.01em; white-space: nowrap; }
.brand .ai, .masthead .ai { color: var(--accent); }
.site-nav { display: flex; gap: 2px 6px; flex-wrap: wrap; }
.site-nav a { font: 500 15px/1 var(--sans); color: var(--mid); text-decoration: none; padding: 12px 8px; border-radius: 6px; }
.site-nav a:hover { color: var(--accent); background: var(--floor); }
.site-nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }

/* Home masthead, modeled on the PDF header */
.front { text-align: center; padding-top: clamp(28px, 6vw, 64px); }
.eyebrow { text-wrap: balance; font: 600 12px/1.4 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--mid); margin: 0 0 14px; }
.masthead { font: 700 clamp(40px, 8.2vw, 80px)/1 var(--serif); letter-spacing: -.02em; margin: 0 0 14px; color: var(--ink); }
.issue-line { font: 500 14px/1.5 var(--sans); color: var(--mid); margin: 0 0 22px; }
.nw { white-space: nowrap; }
.rule-heavy { border: 0; border-top: 2px solid var(--ink); margin: 0; }

/* Latest issue lead */
.lead { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 28px 56px; padding-block: clamp(28px, 4vw, 48px); align-items: start; }
.kicker { font: 700 13px/1.4 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
.lead h2 { font: 700 clamp(30px, 4.4vw, 48px)/1.08 var(--serif); letter-spacing: -.02em; margin: 0 0 16px; text-wrap: balance; }
.lead h2 a { color: var(--ink); text-decoration: none; }
.lead h2 a:hover { color: var(--accent); }
.dek { font: 400 19px/1.6 var(--serif); color: var(--body); margin: 0 0 22px; max-width: 62ch; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 8px; border: 1.5px solid var(--accent); font: 600 15px/1 var(--sans); text-decoration: none; color: var(--accent); background: transparent; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn svg { width: 18px; height: 18px; flex: none; }
.toc { border-top: 1px solid var(--ink); }
.toc h3 { font: 700 13px/1.4 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--mid); margin: 12px 0 4px; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { border-bottom: 1px solid var(--rule); }
.toc a { display: block; padding: 12px 0; text-decoration: none; color: var(--ink); }
.toc a:hover .t { color: var(--accent); }
.toc .s { display: block; font: 600 12px/1.4 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.toc .t { display: block; font: 600 17px/1.35 var(--serif); }

/* By the numbers band */
.band { padding-block: clamp(32px, 5vw, 56px); }
.numbers { background: var(--statband); }
.band-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 24px; margin-bottom: 22px; }
.band-head h2 { font: 700 clamp(24px, 3vw, 32px)/1.15 var(--serif); margin: 0; letter-spacing: -.01em; }
.band-head .kicker { margin: 0 0 8px; color: var(--accent); }
.band-head > p { margin: 0; color: var(--stat-ink); font: 400 16px/1.5 var(--sans); max-width: 52ch; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.stat { padding: 6px 24px 4px; border-left: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.stat:first-child { border-left: 0; padding-left: 0; }
.snum { font: 700 clamp(44px, 6vw, 68px)/1 var(--serif); color: var(--accent); letter-spacing: -.02em; margin-bottom: 12px; font-variant-numeric: lining-nums; }
.slabel { font: 500 16px/1.45 var(--sans); color: var(--ink); margin: 0 0 8px; }
.ssrc { display: block; font: 400 13px/1.45 var(--sans); color: var(--stat-ink); }

/* Archive list */
.sec-title { font: 700 clamp(26px, 3.2vw, 34px)/1.15 var(--serif); margin: 0 0 6px; letter-spacing: -.01em; }
.sec-note { color: var(--mid); margin: 0 0 22px; }
.issues { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.issues li { display: grid; grid-template-columns: 9.5em minmax(0, 1fr) auto; gap: 4px 24px; align-items: baseline; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.issues .when { font: 600 14px/1.4 var(--sans); color: var(--mid); white-space: nowrap; }
.issues .when b { color: var(--ink); font-weight: 700; }
.issues .hl { font: 650 19px/1.3 var(--serif); color: var(--ink); text-decoration: none; text-wrap: pretty; }
.issues .hl:hover { color: var(--accent); }
.issues .pdf { font: 600 14px/1 var(--sans); white-space: nowrap; padding: 10px 0 10px 8px; }
.vol { font: 700 13px/1.4 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin: 26px 0 8px; }

/* Two-up cards */
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.card { border: 1px solid var(--rule); border-radius: 10px; padding: 24px; background: var(--bg); display: flex; flex-direction: column; gap: 10px; }
.card.tint { background: var(--floor); border-color: transparent; border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; }
.card h3 { font: 700 23px/1.2 var(--serif); margin: 0; }
.card p { margin: 0; color: var(--body); }
.card .more { margin-top: auto; padding-top: 6px; font-weight: 600; }
.card .note { color: var(--mid); font-size: 15.5px; }
.pill { align-self: flex-start; font: 600 12.5px/1 var(--sans); padding: 6px 10px; border-radius: 99px; background: var(--statband); color: var(--stat-ink); }

/* Issue page */
.issue-head { padding-top: clamp(28px, 5vw, 56px); }
.meta { font: 600 14px/1.5 var(--sans); color: var(--mid); margin: 0 0 12px; }
.meta a { color: var(--mid); }
.issue-head h1 { font: 700 clamp(32px, 5.4vw, 52px)/1.08 var(--serif); letter-spacing: -.02em; margin: 0 0 18px; text-wrap: balance; }
.byline { font: 500 15px/1.5 var(--sans); color: var(--mid); margin: 0 0 22px; }
.byline strong { color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 0; padding: 16px 0 0; border-top: 1px solid var(--rule); list-style: none; }
.chips a { display: inline-block; font: 600 14px/1 var(--sans); padding: 10px 13px; border-radius: 99px; border: 1px solid var(--rule); text-decoration: none; color: var(--ink); }
.chips a:hover { border-color: var(--accent); color: var(--accent); }

.article { padding-top: 30px; padding-bottom: 24px; }
.article p { font: 400 19px/1.68 var(--serif); color: var(--body); margin: 0 0 1.05em; }
.article strong { color: var(--ink); }
.article h2.sec { font: 700 13px/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin: 52px 0 14px; padding-top: 14px; border-top: 1px solid var(--rule); scroll-margin-top: 16px; }
.article h3.subhead { font: 700 clamp(24px, 3.4vw, 30px)/1.2 var(--serif); letter-spacing: -.01em; margin: 0 0 14px; color: var(--ink); text-wrap: balance; }
.article p.lede { font: 400 18px/1.55 var(--sans); color: var(--mid); }
.article p.small { font-size: 17px; }
.article a { word-break: break-word; }

.article .caution { border-left: 4px solid var(--caution); background: var(--caution-bg); color: var(--caution-ink); padding: 18px 20px; margin: 26px 0; font: 400 17px/1.6 var(--serif); border-radius: 0 8px 8px 0; }
.article .caution b { display: block; font: 700 12.5px/1.4 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--caution); margin-bottom: 8px; }
.article .caution strong { color: inherit; }

.article .statwrap { background: var(--statband); margin: 18px calc(-1 * min(20px, 4vw)) 24px; padding: 22px 20px; border-radius: 10px; }
.article .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.article .stat { text-align: left; }
.article .snum { font-size: clamp(38px, 6vw, 50px); margin-bottom: 8px; }
.article .slabel { font-size: 15.5px; }

.article .floor { background: var(--floor); border-left: 4px solid var(--accent); padding: 22px 22px 6px; margin: 8px 0 18px; border-radius: 0 8px 8px 0; }
.article .floor p { font-size: 18px; }
.article .floor .caveat { border-top: 1px solid var(--rule); margin: 6px 0 16px; padding-top: 14px; font: 400 15.5px/1.6 var(--sans); color: var(--mid); }
.article .floor .caveat strong { color: var(--ink); }

.article .tool { background: var(--toolbox); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; margin: 8px 0 18px; }
.article .tool .strip { background: var(--accent); color: var(--accent-ink); font: 700 12.5px/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; padding: 11px 20px; }
.article .tool .tbody { padding: 18px 20px 20px; }
.article .tool .tsub { font: italic 400 14.5px/1.5 var(--sans); color: var(--mid); margin-bottom: 14px; }
.article .tool p { font-size: 18px; }
.article .tool .caveat { border-top: 1px solid var(--rule); padding-top: 14px; font: 400 15.5px/1.6 var(--sans); color: var(--mid); }
.article .tool .caveat strong { color: var(--ink); }

.article .read { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.article .read:last-of-type { border-bottom: 0; }
.article .rt { font: 650 19px/1.35 var(--serif); color: var(--ink); }
.article .rt a { color: var(--accent); }
.article .rt .ext { font: 500 13px/1 var(--sans); white-space: nowrap; }
.article .rs { font: 500 13.5px/1.5 var(--sans); color: var(--mid); margin-top: 4px; }
.article .rd { font: 400 16.5px/1.55 var(--serif); color: var(--body); margin-top: 6px; }

.article .editor { background: var(--editorbox); padding: 22px 22px 18px; border-radius: 10px; margin: 8px 0 18px; }
.article .elabel { font: 700 12.5px/1.4 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.article .editor p { font-style: italic; font-size: 18.5px; }
.article .sig { font: 500 14.5px/1.5 var(--sans); color: var(--mid); margin-top: 6px; }
.article .sig strong { color: var(--ink); }

.article .poll { border: 1px solid var(--rule); border-radius: 10px; padding: 18px 20px; margin: 14px 0 22px; }
.article .poll-q { font: 700 18px/1.35 var(--serif); margin: 0 0 12px; }
.article .poll-q.second { margin-top: 22px; }
.article .prow { display: grid; grid-template-columns: minmax(0, 13em) minmax(0, 1fr) 3.2em; gap: 10px; align-items: center; margin-bottom: 8px; }
.article .plabel { font: 400 15px/1.35 var(--sans); color: var(--mid); }
.article .ptrack { height: 12px; background: var(--track); border-radius: 99px; overflow: hidden; }
.article .pfill { height: 100%; background: var(--accent); border-radius: 99px; }
.article .ppct { font: 700 15px/1 var(--sans); text-align: right; font-variant-numeric: tabular-nums; }
.article .pnote { font: italic 400 15px/1.5 var(--sans); color: var(--mid); margin-top: 10px; }

.disclosure { border: 1px dashed var(--rule); border-radius: 8px; padding: 14px 16px; font: 400 15px/1.55 var(--sans); color: var(--mid); margin: 30px 0 0; }
.disclosure strong { color: var(--ink); }

.pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 36px 0 0; }
.pager a { display: block; border: 1px solid var(--rule); border-radius: 10px; padding: 16px 18px; text-decoration: none; color: var(--ink); }
.pager a:hover { border-color: var(--accent); }
.pager .dir { display: block; font: 600 13px/1.4 var(--sans); color: var(--mid); margin-bottom: 4px; }
.pager .t { font: 650 17px/1.35 var(--serif); }
.pager .next { text-align: right; grid-column: 2; }

/* Plain pages (About, Lab) */
.page-head { padding-block: clamp(28px, 5vw, 56px) 8px; }
.page-head h1 { font: 700 clamp(34px, 5.6vw, 54px)/1.06 var(--serif); letter-spacing: -.02em; margin: 0 0 14px; }
.page-head .dek { margin-bottom: 0; }
.prose h2 { font: 700 clamp(23px, 3vw, 28px)/1.2 var(--serif); margin: 44px 0 12px; letter-spacing: -.01em; }
.prose p, .prose li { font: 400 18.5px/1.65 var(--serif); color: var(--body); }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin-bottom: .4em; }
.prose li strong, .prose p strong { color: var(--ink); }
.guard { list-style: none; padding: 0; margin: 8px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15em, 1fr)); gap: 12px; }
.guard li { border: 1px solid var(--rule); border-radius: 10px; padding: 16px 18px; margin: 0; font: 400 16px/1.55 var(--sans); }
.guard b { display: block; font: 700 17px/1.3 var(--serif); color: var(--accent); margin-bottom: 4px; }
.project { border: 1px solid var(--rule); border-radius: 12px; overflow: hidden; margin: 10px 0 0; }
.project .strip { background: var(--accent); color: var(--accent-ink); font: 700 12.5px/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; padding: 11px 20px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.project .pbody { padding: 20px; }
.project h3 { font: 700 26px/1.2 var(--serif); margin: 0 0 10px; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 2.1em minmax(0, 1fr); gap: 12px; align-items: start; font: 400 16.5px/1.5 var(--sans); color: var(--body); }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 2.1em; height: 2.1em; border-radius: 50%; background: var(--statband); color: var(--accent); font: 700 15px/1 var(--sans); }
.steps b { color: var(--ink); }

/* Footer */
.site-foot { border-top: 2px solid var(--ink); margin-top: clamp(40px, 6vw, 72px); padding-bottom: env(safe-area-inset-bottom, 0px); }
.site-foot .wrap { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px 48px; padding-top: 28px; padding-bottom: 36px; }
.site-foot p { margin: 0 0 8px; font: 400 14.5px/1.55 var(--sans); color: var(--mid); }
.site-foot .brand { font-size: 21px; display: inline-block; margin-bottom: 8px; }
.site-foot strong { color: var(--ink); }
.foot-nav { display: flex; flex-wrap: wrap; gap: 0 18px; }
.foot-nav a { font: 600 14.5px/1 var(--sans); padding: 10px 0; text-decoration: none; }

@media (max-width: 860px) {
  .lead { grid-template-columns: minmax(0, 1fr); }
  .duo { grid-template-columns: minmax(0, 1fr); }
  .site-foot .wrap { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
  .stat, .stat:first-child { border-left: 0; padding: 16px 0; border-top: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
  .stat:first-child { border-top: 0; padding-top: 0; }
  .article .stats { grid-template-columns: minmax(0, 1fr); }
  .issues li { grid-template-columns: minmax(0, 1fr) auto; }
  .issues .when { grid-column: 1 / -1; }
  .article .prow { grid-template-columns: minmax(0, 1fr) 3.2em; }
  .article .plabel { grid-column: 1 / -1; }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager .next { grid-column: 1; }
}
@media (max-width: 420px) {
  body { font-size: 16.5px; }
  .brand { font-size: 17.5px; }
  .site-nav a { padding: 12px 7px; font-size: 14.5px; }
  .article p { font-size: 18px; }
  .dek { font-size: 18px; }
}
@media print {
  .site-head, .site-foot, .chips, .pager, .btns { display: none; }
}
