/* UHC Affordability EDA — site stylesheet
   Minimal, clean, professional. Palette: deep navy + warm accent.
*/
:root {
  --navy: #14315c;
  --navy-2: #1d4584;
  --accent: #c45e30;
  --bg: #ffffff;
  --bg-soft: #f7f9fc;
  --bg-card: #f1f5f9;
  --border: #d6dde6;
  --text: #21303e;
  --muted: #5a6f85;
  --good: #2e7d57;
  --warn: #b86c44;
  --bad: #b92034;
  --shadow: 0 2px 8px rgba(20,49,92,0.08);
  --mono: ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg-soft);
  line-height: 1.55;
  font-size: 16px;
}

/* Top nav */
.topnav {
  background: var(--navy);
  color: #fff;
  padding: 14px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topnav .brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 16px; }
.topnav .nav-links a {
  color: #d9e3f1; text-decoration: none; margin-left: 22px;
  font-size: 14px; padding-bottom: 3px; border-bottom: 2px solid transparent;
  transition: .15s;
}
.topnav .nav-links a:hover, .topnav .nav-links a.active { color: #fff; border-bottom-color: var(--accent); }

/* Layout */
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 32px 60px;
}
main.narrative { max-width: 1100px; }
section {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px 32px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}
section h1 { margin: 0 0 8px; color: var(--navy); font-size: 28px; line-height: 1.2; }
section h2 { margin: 28px 0 12px; color: var(--navy-2); font-size: 20px; }
section h3 { margin: 22px 0 8px; color: var(--navy-2); font-size: 16px; text-transform: uppercase; letter-spacing: 0.04em; }
section p { margin: 12px 0; }
section .lead { font-size: 18px; color: var(--muted); margin-top: 4px; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 20px 0; }
.card {
  background: var(--bg-card);
  border-radius: 6px;
  padding: 18px 20px;
  border-left: 3px solid var(--navy-2);
}
.card .stat { font-size: 28px; font-weight: 700; color: var(--navy); }
.card .label { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; }
.card.text-card { border-left-color: var(--accent); padding: 20px 22px; }
.card.text-card h3 { margin-top: 0; }
.card.text-card ul { padding-left: 18px; margin: 8px 0; }
.card.text-card li { margin: 4px 0; font-size: 14px; }

/* Tables */
table { border-collapse: collapse; width: 100%; margin: 14px 0; font-size: 14px; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--bg-card); color: var(--navy); font-weight: 600; }
tr:hover { background: var(--bg-card); }
td.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); }

/* Inline code + blocks */
code, .mono { font-family: var(--mono); background: var(--bg-card); padding: 2px 5px; border-radius: 3px; font-size: 0.92em; }
pre {
  background: #14213d; color: #e8edf2; padding: 18px 22px; border-radius: 6px;
  overflow-x: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.5;
  margin: 16px 0;
}
pre code { background: none; color: inherit; padding: 0; font-size: inherit; }

/* highlight.js (atom-one-dark via CDN) handles syntax coloring; our <pre> block
   only its background+padding. No tok-* classes needed. */

/* Callout boxes */
.callout {
  border-left: 4px solid var(--accent);
  background: #fbf1ec;
  padding: 14px 18px;
  border-radius: 0 6px 6px 0;
  margin: 18px 0;
}
.callout.attribution { border-color: var(--navy-2); background: #eaf1fa; }
.callout.finding { border-color: var(--good); background: #e9f5ee; }
.callout.warning { border-color: var(--warn); background: #fdf3eb; }

.callout-heading { font-weight: 700; color: var(--navy); margin-bottom: 6px; }

/* Capability chart containers */
.chart { min-height: 420px; margin: 18px 0; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); }
.chart.tall { min-height: 560px; }
.chart.sm { min-height: 340px; }
.chart-empty { padding: 40px; text-align: center; color: var(--muted); background: var(--bg-card); border-radius: 6px; }

/* Code browser layout */
.code-page { display: grid; grid-template-columns: 260px 1fr; gap: 20px; max-width: 1400px; margin: 30px auto; padding: 0 32px; }
.sidebar {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 18px 14px; box-shadow: var(--shadow); position: sticky; top: 80px; align-self: start;
}
.sidebar h2 { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 4px 0 12px; }
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar a {
  display: block; padding: 6px 10px; color: var(--text); text-decoration: none; border-radius: 4px;
  font-family: var(--mono); font-size: 13px; margin-bottom: 2px; border-left: 3px solid transparent;
}
.sidebar a:hover { background: var(--bg-card); }
.sidebar a.active { background: var(--bg-card); border-left-color: var(--accent); color: var(--navy); font-weight: 600; }
.sidebar-foot { margin: 14px 0 0; font-size: 13px; }
.sidebar-foot a { color: var(--muted); text-decoration: none; }
.sidebar-foot a:hover { color: var(--accent); }

.code-article { min-width: 0; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 22px 28px; box-shadow: var(--shadow); }
.code-header h1 { margin: 0 0 4px; font-family: var(--mono); color: var(--navy); font-size: 24px; }
.code-meta { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.code-meta a { color: var(--navy-2); text-decoration: none; }
.code-meta a:hover { color: var(--accent); }
.code-block { background: #14213d; padding: 18px 22px; border-radius: 6px; }
.code-block code { font-family: var(--mono); font-size: 13px; line-height: 1.55; color: #e8edf2; }

.code-index, .code-index main { max-width: 900px; margin: 40px auto; padding: 0 32px; }
.code-index h1 { color: var(--navy); margin-top: 0; }
.code-index .lead { color: var(--muted); margin-bottom: 24px; max-width: 700px; }
.file-list { list-style: none; padding: 0; margin: 12px 0; }
.file-list li {
  padding: 14px 18px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; margin-bottom: 8px; transition: .15s;
}
.file-list li:hover { border-color: var(--navy-2); box-shadow: var(--shadow); }
.file-list strong { font-family: var(--mono); color: var(--navy); font-size: 16px; }
.file-list a { text-decoration: none; }
.file-list .size { color: var(--muted); margin-left: 12px; font-size: 13px; font-family: var(--mono); }
.code-index .foot { margin-top: 24px; }
.code-index .foot a { color: var(--navy-2); text-decoration: none; }

/* Footnotes / attribution small */
.attr-source { font-size: 12px; color: var(--muted); font-style: italic; margin-top: 14px; }
.attr-source a { color: var(--navy-2); }

/* Two-column compare */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 18px 0; }

/* Service pickers — stacked full-width so long descriptions never bleed */
.select-stack > div { margin-bottom: 18px; }
.select-stack select,
.narrative select {
  width: 100%;
  max-width: 720px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
}
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .code-page { grid-template-columns: 1fr; max-width: 100%; padding: 0 16px; }
  .sidebar { position: static; }
}

/* Comparison-table */
.compare th, .compare td { padding: 10px 14px; }
.compare th { background: #e8eef5; }
.compare tr.prior td { background: #fafcfe; }
.compare tr.us td { background: #fbf1ec; }
.compare td.metric { font-weight: 600; color: var(--navy); }

/* Footer ish */
.page-foot { color: var(--muted); font-size: 13px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.page-foot a { color: var(--navy-2); text-decoration: none; }

/* Plotly modebar — less in-your-face */
.modebar { opacity: 0.3; transition: .2s; }
.plotly:hover .modebar { opacity: 1; }

/* Rank tables — ensure cells have enough padding for read */
.data-table td { padding: 8px 14px; }
.data-table th { padding: 9px 14px; }

/* ============================================================
   Hero page — front-page scroll-reveal (D3)
   ============================================================ */
.hero-page { background: #0a162a; color: #e6eef7; }

#hero-bg {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  z-index: 0; pointer-events: none;
}

.hero-page main, .hero-page section, .hero-page header {
  position: relative; z-index: 1;
}
.hero-page .topnav { z-index: 10; }

/* Hero header */
.hero {
  min-height: 92vh;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 80px 32px 60px;
  text-align: center;
  background: linear-gradient(180deg,
    rgba(10,22,42,0) 0%,
    rgba(10,22,42,0.6) 65%,
    rgba(10,22,42,0.95) 100%);
}
.hero .kicker {
  font-family: var(--mono); font-size: 12px; color: #4d80c4;
  letter-spacing: 0.22em; text-transform: uppercase; margin: 0 0 22px;
}
.hero h1 {
  font-size: clamp(40px, 7vw, 88px); line-height: 1.05; color: #fff;
  margin: 0 0 20px; font-weight: 800; letter-spacing: -0.02em;
}
.hero h1 em { font-style: italic; color: #5dc7ff; font-weight: 400; }
.hero .lead { font-size: clamp(18px, 2.4vw, 26px); color: #d3e0f3; margin: 0 0 60px; }
.scroll-cue {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.3em;
  color: #5dc7ff; text-transform: uppercase;
}
.scroll-cue .arrow { font-size: 22px; animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(6px);} }

/* Scenes */
.scenes { display: flex; flex-direction: column; }

/* Prologue — headline section before the five scenes */
.prologue {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 60px 64px 70px;
  background: var(--bg);
}
.prologue-inner { max-width: 900px; margin: 0 auto; width: 100%; }
.prologue .kicker {
  font-family: var(--mono); font-size: 12px; color: var(--accent);
  letter-spacing: 0.25em; text-transform: uppercase; margin: 0 0 18px;
}
.prologue h2 {
  color: var(--navy); font-size: clamp(30px, 4vw, 52px);
  line-height: 1.15; font-weight: 700; margin: 0 0 18px; letter-spacing: -0.01em;
}
.prologue h2 em { font-style: italic; color: var(--accent); font-weight: 400; }
.prologue .body { color: var(--text); font-size: 18px; line-height: 1.65; margin: 0 0 26px; }
.prologue-list { list-style: none; margin: 0 0 10px; padding: 0; }
.prologue-list li {
  position: relative; padding: 0 0 0 34px; margin: 0 0 14px;
  font-size: 17px; line-height: 1.55; color: var(--text);
}
.prologue-list li::before { content: "\2192"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.prologue-list .scene-ref { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-left: 8px; white-space: nowrap; }
.prologue .callout ul { margin: 8px 0 0; padding-left: 18px; }
.prologue .callout { background: var(--good); border-left-color: var(--navy); color: #ffffff; }
.prologue .callout-heading { color: #ffffff; font-size: 17px; letter-spacing: 0.02em; }
.prologue .callout li { font-size: 16px; line-height: 1.55; margin-bottom: 8px; color: #ffffff; }
.prologue .callout li strong { color: #d8f3e3; }
.scene-text .callout { background: var(--good); border-left-color: var(--navy); color: #ffffff; }
.scene-text .callout-heading { color: #ffffff; }
.scene-text .callout p { color: #ffffff; font-size: 15px; line-height: 1.6; margin: 0; }
.scene-text .callout a, .scene-text .callout strong { color: #d8f3e3; }
.prologue .attr-source { font-size: 12px; color: var(--muted); font-style: italic; margin-top: 16px; }
.scene {
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 60px 64px 70px;
  position: relative;
}
.scene-num {
  position: absolute; top: 28px; left: 36px;
  font-family: var(--mono); font-size: 13px; color: var(--accent);
  letter-spacing: 0.25em; opacity: 0.9;
}
.scene-num::before { content: "// "; opacity: 0.5; }
.scene-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; max-width: 1280px; margin: 0 auto; width: 100%; }
.scene-text h2 {
  color: var(--navy); font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.15; font-weight: 700; margin: 0 0 22px; letter-spacing: -0.01em;
}
.scene-text h2 em { font-style: italic; color: var(--accent); font-weight: 400; }
.scene-text .body { color: var(--text); font-size: 18px; line-height: 1.65; margin: 0 0 18px; font-weight: 400; }
.scene-text .body strong { color: #0d1d3a; font-weight: 600; }
.scene-text .attr-source { color: var(--muted); font-size: 12px; font-family: var(--mono); margin: 0; }
.scene-text .scene-takeaway {
  margin: 0 0 14px; padding: 10px 14px;
  background: var(--bg-card); border-left: 3px solid var(--accent);
  color: var(--navy); font-size: 16px; line-height: 1.5;
}
.scene-text .scene-takeaway::before { content: "Bottom line: "; font-weight: 700; color: var(--accent); }
.scene-text code { color: var(--navy-2); background: var(--bg-card); padding: 1px 6px; border-radius: 3px; }

.scene-viz { display: flex; flex-direction: column; align-items: center; }
.scene-viz svg { width: 100%; max-width: 360px; height: auto; }
.viz-caption { margin-top: 14px; font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.05em; text-align: center; }

/* Footer */
.hero-footer { padding: 60px 32px; text-align: center; }
.footer-inner { max-width: 720px; margin: 0 auto; }
.hero-footer h2 { color: var(--navy-2); font-size: 22px; font-weight: 600; margin: 0 0 14px; }
.hero-footer p { color: var(--text); font-size: 15px; line-height: 1.6; margin: 8px 0; font-weight: 400; }
.hero-footer code { color: var(--navy-2); background: var(--bg-card); padding: 1px 6px; border-radius: 3px; }
.footer-nav { list-style: none; padding: 18px 0; margin: 18px 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 22px;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.footer-nav a { color: var(--navy-2); text-decoration: none; font-size: 14px; font-weight: 500; transition: .15s; }
.footer-nav a:hover { color: var(--accent); }
.hero-footer .attr-source { margin-top: 22px; }

/* Hero SVG defaults */
.scene-viz svg text { font-family: var(--mono); font-size: 11px; fill: var(--muted); }
.scene-viz svg .axis line, .scene-viz svg .axis path { stroke: var(--border); }
.scene-viz svg .grid line { stroke: rgba(20,49,92,0.06); shape-rendering: crispEdges; }

@media (max-width: 820px) {
  .scene { padding: 60px 24px 70px 48px; }
  .scene-grid { grid-template-columns: 1fr; gap: 30px; }
  .scene-num { left: 18px; top: 20px; }
  .hero h1 { font-size: 38px; }
}

/* Page-level headline stat band — carries the landing-page confidence inward */
.stat-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1px;
  background: rgba(90, 111, 133, 0.35);
  border-radius: 8px;
  overflow: hidden;
  margin: 20px 0 10px;
}
.stat-band .sb { background: var(--navy); padding: 16px 20px; }
.stat-band .sb-value {
  font-size: 25px; font-weight: 700; color: #ffffff;
  font-variant-numeric: tabular-nums; line-height: 1.15;
}
.stat-band .sb-value em { font-style: normal; font-weight: 400; font-size: 17px; color: #5dc7ff; }
.stat-band .sb-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.07em;
  text-transform: uppercase; color: #9db8dc; margin-top: 5px; line-height: 1.45;
}

/* On-this-page TOC */
.page-toc {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted); margin: 4px 0 2px;
}
.page-toc .toc-label { color: var(--accent); font-weight: 700; margin-right: 8px; }
.page-toc a { color: var(--navy-2); text-decoration: none; border-bottom: 1px solid transparent; }
.page-toc a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.page-toc a + a::before { content: "·  "; color: var(--border); }

/* Prose measure — keep long-form lines readable on wide sections */
main.narrative section p,
main.narrative section li { max-width: 74ch; }

/* Agent review */
.review-page .lead { max-width: 860px; }
.review-disposition { border-left-color: var(--bad); background: #fff3f1; }
.review-disposition .callout-heading { color: var(--bad); }
.review-summary-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 20px 0 0; }
.review-summary-cards .card { min-height: 106px; }
.review-summary-cards .stat { font-size: 22px; }
.review-lenses { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 20px; }
.review-lens { padding: 16px 18px; background: var(--bg-card); border-top: 3px solid var(--navy-2); border-radius: 5px; }
.review-lens strong, .review-lens span { display: block; }
.review-lens strong { color: var(--navy); margin-bottom: 6px; }
.review-lens span { color: var(--muted); font-size: 14px; line-height: 1.45; }
.section-intro { color: var(--muted); }
.review-findings { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.review-finding { background: #fbfcfe; border: 1px solid var(--border); border-left: 5px solid var(--navy-2); border-radius: 5px; padding: 18px 20px; }
.review-finding.critical { border-left-color: var(--bad); }
.review-finding.high { border-left-color: var(--accent); }
.review-finding.medium { border-left-color: var(--warn); }
.review-finding h3 { text-transform: none; letter-spacing: 0; margin: 7px 0 10px; color: var(--navy); font-size: 17px; line-height: 1.3; }
.review-finding p { font-size: 14px; line-height: 1.55; }
.review-severity { font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.critical .review-severity { color: var(--bad); }
.high .review-severity { color: var(--accent); }
.review-evidence, .review-action { margin-bottom: 0; color: var(--muted); }
.review-action { color: var(--text); }
.review-table-wrap { overflow-x: auto; }
.review-table { margin-top: 16px; font-size: 14px; }
.review-table th:first-child { width: 13%; }
.review-table th:nth-child(2) { width: 42%; }
.review-table td { vertical-align: top; line-height: 1.45; }
.review-strengths { columns: 2; column-gap: 42px; }
.review-strengths li { break-inside: avoid; margin: 0 0 12px; line-height: 1.5; }
.review-rounds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 20px 0; }
.review-round { display: flex; gap: 14px; align-items: center; padding: 16px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-card); }
.review-round.completed { border-color: var(--good); background: #eef8f2; }
.round-number { font-family: var(--mono); font-size: 24px; font-weight: 700; color: var(--navy); }
.review-round strong, .review-round span { display: block; }
.review-round strong { color: var(--navy); }
.review-round span { color: var(--muted); font-size: 12px; margin-top: 3px; }
.review-next { color: var(--muted); font-size: 14px; max-width: 900px; }
