/* Research-note styling: warm paper, near-black ink, one accent for the model and key numbers. */
:root {
  --paper: #faf8f4;
  --ink: #1a1917;
  --ink-2: #4d4a45;
  --muted: #8a867e;
  --rule: #e6e1d7;
  --grid: #ece8df;
  --accent: #1f47a8;
  --accent-soft: #e7ecf7;
  --gray: #a19c92;
  --gray-2: #c9c4b9;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --col: 760px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-underline-offset: 3px; }
strong { font-weight: 600; }

/* ---- Top nav ---- */
.topnav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(250, 248, 244, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}
.topnav-inner {
  max-width: 1040px; margin: 0 auto; padding: 0 24px;
  height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { font: 600 17px/1 var(--serif); color: var(--ink); text-decoration: none; white-space: nowrap; }
.navlinks { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; }
.navlinks::-webkit-scrollbar { display: none; }
.navlinks a { font-size: 14px; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.navlinks a:hover, .navlinks a.active { color: var(--accent); }

/* ---- Layout ---- */
main { max-width: var(--col); margin: 0 auto; padding: 0 24px; }
.section { padding: 88px 0 24px; border-bottom: 1px solid var(--rule); }
.section:last-of-type { border-bottom: 0; }
.eyebrow {
  font: 600 12px/1.4 var(--sans); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 14px;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; color: var(--ink); }
h1 { font-size: clamp(40px, 6.4vw, 64px); line-height: 1.05; letter-spacing: -0.015em; margin: 0 0 22px; }
h2.finding { font-size: clamp(26px, 3.6vw, 34px); line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 28px; }
h3 { font-size: 20px; margin: 0 0 8px; }
.dek { font-size: 19px; color: var(--ink-2); margin: 0 0 44px; max-width: 680px; }

/* ---- Hero numbers (no cards: big figures separated by thin rules) ---- */
.headline-numbers {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule);
  margin-bottom: 52px;
}
.hn { padding: 20px 20px 22px 0; }
.hn + .hn { padding-left: 20px; border-left: 1px solid var(--rule); }
.hn-value {
  font: 500 clamp(40px, 5.4vw, 54px)/1 var(--serif);
  font-variant-numeric: lining-nums tabular-nums; letter-spacing: -0.02em; margin-bottom: 10px;
}
.hn-label { font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.accent { color: var(--accent); }

.findings-title { font-size: 24px; margin: 0 0 16px; }
.findings { margin: 0; padding: 0; list-style: none; counter-reset: f; }
.findings li {
  counter-increment: f; position: relative; padding: 14px 0 14px 44px;
  border-top: 1px solid var(--rule); color: var(--ink-2);
}
.findings li::before {
  content: counter(f); position: absolute; left: 0; top: 12px;
  font: 500 22px/1.2 var(--serif); color: var(--accent);
}
.findings li strong { color: var(--ink); }
.num { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---- Controls ---- */
.controls { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 32px; margin: 0 0 28px; }
.control label, .picker label { display: block; font-size: 15px; color: var(--ink-2); margin-bottom: 8px; }
.control output, .picker output { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.assume { font-size: 12px; color: var(--muted); margin-left: 6px; white-space: nowrap; }
.segmented { grid-column: 1 / -1; }
.seg-label { display: block; font-size: 15px; color: var(--ink-2); margin-bottom: 8px; }
.seg-row { margin-bottom: 24px; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.seg button {
  font: 500 14px/1 var(--sans); color: var(--ink-2); background: transparent;
  border: 0; padding: 10px 14px; cursor: pointer;
}
.seg button + button { border-left: 1px solid var(--rule); }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--paper); }
.seg button:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

input[type="range"] { width: 100%; accent-color: var(--accent); height: 28px; margin: 0; cursor: pointer; }

/* ---- Readout: inline figures, not cards ---- */
.readout {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); margin-bottom: 36px;
}
.ro { padding: 14px 12px 16px 0; }
.ro + .ro { padding-left: 14px; border-left: 1px solid var(--rule); }
.ro-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.ro-value { font: 500 30px/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.ro-delta { font-size: 13px; color: var(--ink-2); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ---- Charts ---- */
figure.chart { margin: 0 0 32px; }
figcaption { font-size: 14px; color: var(--ink-2); margin-bottom: 12px; }
.chart-box { position: relative; width: 100%; }
/* Phones only: the three profit lines sit too close for on-chart labels, so a key replaces them. */
.line-key { display: none; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); margin-bottom: 10px; }
.line-key span { display: inline-flex; align-items: center; gap: 6px; }
.line-key .model { color: var(--accent); font-weight: 600; }
.chart-box.tall { height: 380px; }
.chart-box.short { height: 260px; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; margin: 0 0 10px; }
table.policy { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
table.policy th {
  text-align: right; font: 500 12px/1.3 var(--sans); color: var(--muted);
  letter-spacing: 0.04em; text-transform: uppercase; padding: 8px 8px; border-bottom: 1px solid var(--ink);
}
table.policy th:first-child, table.policy td:first-child { text-align: left; padding-left: 0; }
table.policy td { text-align: right; padding: 11px 8px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
table.policy td:first-child { white-space: normal; color: var(--ink-2); }
table.policy tr.chosen td { color: var(--accent); font-weight: 600; }
table.policy tr.chosen td:first-child::after {
  content: "chosen policy"; margin-left: 8px; font: 600 11px/1 var(--sans); letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--accent); background: var(--accent-soft);
  padding: 3px 6px; border-radius: 4px; white-space: nowrap;
}
table.policy tr.yours td { color: var(--ink); }
table.policy tr.hindsight td { color: var(--muted); }
.table-note { font-size: 13px; color: var(--muted); margin: 8px 0 36px; }

/* ---- What this means ---- */
.meaning { border-left: 2px solid var(--accent); padding: 2px 0 2px 18px; margin: 8px 0 40px; }
.meaning h3 { font: 600 12px/1.4 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin: 0 0 6px; }
.meaning p { margin: 0 0 10px; color: var(--ink-2); }
.limitation { font-size: 15px; }
.side-facts { font-size: 15px; color: var(--ink-2); margin: -8px 0 28px; }
.monitor-eyebrow { margin-top: 56px; }

/* ---- Applicant explorer ---- */
.picker { margin-bottom: 28px; }
.picker-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.picker-buttons button {
  font: 500 14px/1 var(--sans); color: var(--ink); background: transparent;
  border: 1px solid var(--ink); border-radius: 8px; padding: 10px 14px; cursor: pointer;
}
.picker-buttons button:hover { background: var(--ink); color: var(--paper); }

.applicant { border-top: 1px solid var(--ink); padding-top: 22px; }
.verdict-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 22px; }
.verdict { font: 500 clamp(48px, 8vw, 72px)/1 var(--serif); letter-spacing: -0.02em; }
.verdict.approved { color: var(--accent); }
.verdict.declined { color: var(--ink); }
.verdict-sub { font-size: 16px; color: var(--ink-2); }

.pd-scale { margin: 0 0 30px; }
.pd-track { position: relative; height: 12px; background: var(--grid); border-radius: 6px; margin-top: 30px; }
.pd-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 6px 0 0 6px; opacity: 0.85; }
.pd-marker {
  position: absolute; top: -7px; width: 4px; height: 26px; margin-left: -2px;
  background: var(--ink); border-radius: 2px;
}
.pd-cutoff { position: absolute; top: -8px; bottom: -8px; width: 0; border-left: 2px dashed var(--ink-2); }
.pd-cutoff span {
  position: absolute; bottom: 100%; left: 0; transform: translateX(-50%);
  font-size: 12px; color: var(--ink-2); white-space: nowrap; padding-bottom: 4px;
}
.pd-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 8px; font-variant-numeric: tabular-nums; }

.applicant-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px 40px; }
.reasons { margin: 0; padding-left: 22px; }
.reasons li { margin-bottom: 6px; font-size: 17px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 15px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.outcome { margin: 26px 0 0; padding: 14px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); color: var(--ink-2); }
.outcome strong { color: var(--ink); }

/* ---- Method ---- */
.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 36px; margin-bottom: 20px; }
.method-grid p, .limits { font-size: 15px; color: var(--ink-2); }
.limits { padding-left: 20px; margin: 0 0 24px; }
.limits li { margin-bottom: 6px; }
.links { display: flex; gap: 24px; font-weight: 500; }

.footer { max-width: var(--col); margin: 0 auto; padding: 32px 24px 64px; font-size: 13px; color: var(--muted); }

/* ---- Small screens ---- */
@media (max-width: 720px) {
  body { font-size: 16px; }
  main { padding: 0 18px; }
  .topnav-inner { padding: 0 18px; }
  .brand { display: none; }
  .navlinks { gap: 14px; }
  .navlinks a { font-size: 13px; }
  .section { padding-top: 64px; }
  .dek { font-size: 17px; }
  .headline-numbers { grid-template-columns: 1fr; }
  .hn, .hn + .hn { padding: 16px 0; border-left: 0; }
  .hn + .hn { border-top: 1px solid var(--rule); }
  .controls { grid-template-columns: 1fr; }
  .readout { grid-template-columns: 1fr 1fr; }
  .ro:nth-child(3) { padding-left: 0; border-left: 0; }
  .ro:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .ro-value { font-size: 26px; }
  .chart-box.tall { height: 300px; }
  .chart-box.short { height: 240px; }
  .chart-box.psi { height: 440px; }
  .line-key { display: flex; }
  .seg { display: flex; flex-direction: column; width: 100%; }
  .seg button { text-align: left; }
  .seg button + button { border-left: 0; border-top: 1px solid var(--rule); }
  .hide-sm { display: none; }
  table.policy { font-size: 14px; }
  table.policy td { padding: 10px 5px; }
  table.policy tr.chosen td:first-child::after { display: block; width: fit-content; margin: 4px 0 0; }
  .applicant-grid, .method-grid { grid-template-columns: 1fr; }
}
