/* Diagnostics page */

.dx-wrap {
  width: min(1200px, 100%);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 48px);
}

.dx-fig {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.dx-head {
  display: grid;
  gap: 16px;
  margin-bottom: clamp(40px, 5vw, 64px);
}

.dx-head h2 { max-width: 24ch; }
.dx-head .lede { max-width: 60ch; }

main > .section { padding-bottom: clamp(72px, 8vw, 128px); }

/* ── Hero ── */

.hero.dx-hero {
  padding-top: calc(var(--nav-gap) + var(--nav-h) + clamp(48px, 7vw, 104px));
  padding-bottom: clamp(56px, 6vw, 96px);
  overflow: hidden;
}

.dx-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
}

.dx-hero-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.dx-kicker { color: #8f83ff; margin-bottom: 24px; }

.dx-hero h1 {
  font-size: clamp(32px, 3.6vw, 54px);
  line-height: 1.06;
  max-width: 15em;
}

.dx-hero .lede {
  max-width: 50ch;
  margin-top: clamp(20px, 2.2vw, 28px);
  font-size: clamp(16px, 1.3vw, 18px);
  line-height: 1.55;
}

.dx-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 28px;
  margin-top: clamp(28px, 3vw, 40px);
}

.dx-link-quiet {
  font-size: 15px;
  color: var(--fog);
  text-decoration: none;
  transition: color var(--duration-micro) var(--ease-out);
}

.dx-link-quiet span { display: inline-block; margin-left: 4px; transition: transform var(--duration-micro) var(--ease-out); }
.dx-link-quiet:hover { color: var(--paper); }
.dx-link-quiet:hover span { transform: translateY(2px); }
.dx-link-quiet:focus-visible { outline: 2px solid #8f83ff; outline-offset: 4px; border-radius: 3px; }

.dx-map-fig { margin: 0; min-width: 0; }

.dx-map {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin-inline: auto;
  aspect-ratio: 1120 / 1180;
}

.dx-map canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.dx-map-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity var(--duration-reveal) var(--ease-out);
}

.dx-map:has(canvas.is-live) .dx-map-fallback { opacity: 0; }

.dx-map-cap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  margin-top: 16px;
  font-size: 13px;
  color: #8b909d;
}

.dx-map-cap span { display: inline-flex; align-items: center; gap: 8px; }

.dx-dot { width: 6px; height: 6px; flex: none; }
.dx-dot--lab { background: #8f83ff; }
.dx-dot--case { background: rgba(255, 253, 249, 0.95); width: 4px; height: 4px; }

/* ── Flow ── */

.dx-flow { padding-top: clamp(80px, 9vw, 128px); }

.dx-flow-fig {
  margin: 0;
  padding: clamp(24px, 3.4vw, 48px);
  background: var(--paper-card);
  border: 1px solid rgba(17, 13, 23, 0.06);
  border-radius: var(--radius-lg);
}

.dx-flow-plate {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 480 / 132;
  image-rendering: pixelated;
  background: url("../assets/diagnostics-plate-flow.png?v=1") center / 100% 100% no-repeat;
}

.dx-flow-plate.is-live { background: none; }

.dx-steps {
  list-style: none;
  margin: clamp(24px, 3vw, 36px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.dx-steps li {
  padding-top: 16px;
  border-top: 1px solid rgba(17, 13, 23, 0.1);
  transition: border-color var(--duration-reveal) var(--ease-out);
}

.dx-steps li.is-on { border-top-color: var(--ink); }
.dx-steps .dx-fig { margin-bottom: 10px; }
.dx-steps li.is-on .dx-fig { color: var(--blue); }
.dx-steps h3 { font-family: var(--font-sans); font-size: 17px; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
.dx-steps li > p:last-child { font-size: 15px; line-height: 1.5; color: var(--ink-muted); }

/* ── Biomarker range ── */

.dx-spectrum {
  margin: 0;
  padding: clamp(28px, 3.4vw, 48px);
  background: var(--paper-card);
  border: 1px solid rgba(17, 13, 23, 0.06);
  border-radius: var(--radius-lg);
}

.dx-spec-axis {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 14px;
}

.dx-spec-track {
  position: relative;
  height: 2px;
  background: rgba(17, 13, 23, 0.1);
}

.dx-spec-track i {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--ink), var(--blue));
  transform-origin: left;
  transform: scaleX(var(--fill, 1));
}

.dx-spec-marks {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 76px;
}

.dx-spec-marks li {
  position: absolute;
  top: 0;
  left: var(--at);
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  text-align: center;
  padding-top: 18px;
  white-space: nowrap;
  transition: opacity var(--duration-reveal) var(--ease-out), transform var(--duration-reveal) var(--ease-out);
}

.dx-spec-marks li::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 9px;
  height: 9px;
  margin-left: -4.5px;
  border-radius: 50%;
  background: var(--paper-card);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.dx-spec-marks li:nth-child(n + 4)::before { box-shadow: inset 0 0 0 1.5px var(--blue); }
.dx-spec-marks li:last-child::before { background: var(--blue); }
.dx-spec-marks b { font-size: 15px; font-weight: 500; color: var(--ink); }
.dx-spec-marks span { font-size: 13px; color: var(--ink-muted); margin-top: 2px; }
.dx-spec-marks li:last-child b { color: var(--blue); }

.dx-spectrum.is-armed .dx-spec-marks li { opacity: 0; transform: translate(-50%, 6px); }
.dx-spectrum.is-armed .dx-spec-marks li.is-on { opacity: 1; transform: translate(-50%, 0); }

.dx-spec-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px clamp(24px, 4vw, 64px);
  margin-top: clamp(28px, 3vw, 40px);
  padding-top: 24px;
  border-top: 1px solid rgba(17, 13, 23, 0.1);
}

.dx-spec-notes h3 { font-family: var(--font-sans); font-size: 17px; font-weight: 500; color: var(--ink); margin-bottom: 6px; }
.dx-spec-notes p { font-size: 15px; line-height: 1.5; color: var(--ink-muted); max-width: 48ch; }

.dx-spec-cap { margin-top: 24px; font-size: 12.5px; line-height: 1.5; color: var(--ink-muted); }

/* ── Cards ── */

.dx-trio {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.dx-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 24px 28px 30px;
  background: var(--paper-card);
  border: 1px solid rgba(17, 13, 23, 0.06);
  border-radius: var(--radius-lg);
  transition: border-color var(--duration-move) var(--ease-out), background var(--duration-move) var(--ease-out);
  outline: none;
}

.dx-card:hover,
.dx-card:focus-visible { border-color: rgba(17, 13, 23, 0.16); background: #e7e4dc; }
.dx-card:focus-visible { box-shadow: 0 0 0 2px var(--blue); }

.dx-plate {
  display: block;
  width: 100%;
  max-width: 340px;
  height: auto;
  aspect-ratio: 200 / 140;
  margin: 18px auto 32px;
  image-rendering: pixelated;
  background: center / 100% 100% no-repeat;
}

.dx-plate[data-plate="trial"] { background-image: url("../assets/diagnostics-plate-trial.png?v=1"); }
.dx-plate[data-plate="cdx"] { background-image: url("../assets/diagnostics-plate-cdx.png?v=1"); }
.dx-plate[data-plate="prevalence"] { background-image: url("../assets/diagnostics-plate-prevalence.png?v=1"); }
.dx-plate.is-live { background: none; }

.dx-card h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 8px;
}

.dx-ico {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.dx-card > p:not(.dx-fig) { font-size: 15px; line-height: 1.5; color: var(--ink-muted); max-width: 38ch; }

.dx-card > .dx-card-meta {
  margin-top: auto;
  padding-top: 18px;
  font-size: 13px;
  color: var(--ink);
}

.dx-card-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--blue);
  text-decoration: none;
}

.dx-card-link span { display: inline-block; transition: transform var(--duration-micro) var(--ease-out); }
.dx-card-link:hover span { transform: translateX(3px); }
.dx-card-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 3px; }

/* ── Program view mock ── */

.dx-term {
  --m-text: #e6e7eb;
  --m-muted: #8b909d;
  --m-faint: #5f6472;
  --m-line: rgba(255, 255, 255, 0.07);
  --m-raise: rgba(255, 255, 255, 0.05);

  container: term / inline-size;
  position: relative;
  margin: 0;
  background: #0e0c16;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: 0 50px 100px -40px rgba(10, 8, 24, 0.45), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
  color: var(--m-text);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
  overflow: hidden;
}

.dx-term p,
.dx-term span,
.dx-term b,
.dx-term th,
.dx-term td,
.dx-term dt,
.dx-term dd { font-family: inherit; letter-spacing: inherit; line-height: inherit; }

.dx-term i { font-style: normal; }
.dx-term b { font-weight: 500; }

.dx-id {
  font-family: var(--font-mono) !important;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.dx-term-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 54px;
  padding: 0 20px;
  border-bottom: 1px solid var(--m-line);
  font-size: 12.5px;
}

.dx-brand { flex: none; font-size: 12px; font-weight: 500; letter-spacing: 0.06em !important; }

.dx-crumbs {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--m-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dx-crumbs i { color: var(--m-faint); padding: 0 6px; }
.dx-crumbs b { color: var(--m-text); }

.dx-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  font-size: 12px;
  padding: 1px 9px 1px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--m-muted);
  white-space: nowrap;
}

.dx-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--m-faint); }
.dx-pill--on { color: var(--m-text); }
.dx-pill--on::before { background: #8f83ff; }

.dx-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--m-line);
}

.dx-kpis > div {
  display: grid;
  gap: 4px;
  padding: 16px 20px 18px;
  border-left: 1px solid var(--m-line);
  min-width: 0;
}

.dx-kpis > div:first-child { border-left: 0; }
.dx-kpis span { font-size: 12px; color: var(--m-muted); }
.dx-kpis b { font-size: 22px; font-weight: 400 !important; color: var(--m-text); font-variant-numeric: tabular-nums; }

.dx-term-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(240px, 30%, 300px);
  min-height: 320px;
}

.dx-table-wrap { min-width: 0; overflow-x: auto; }

.dx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.dx-table th {
  height: 40px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 400;
  color: var(--m-muted);
  text-align: left;
  border-bottom: 1px solid var(--m-line);
  white-space: nowrap;
}

.dx-table td {
  height: 48px;
  padding: 0 12px;
  color: var(--m-muted);
  border-bottom: 1px solid var(--m-line);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.dx-table th:first-child,
.dx-table td:first-child { padding-left: 20px; }
.dx-table th:last-child,
.dx-table td:last-child { padding-right: 20px; }
.dx-table td:first-child { color: var(--m-text); }
.dx-table .dx-num { text-align: right; }

.dx-table tbody tr { cursor: pointer; outline: none; transition: background var(--duration-micro) var(--ease-out); }
.dx-table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.dx-table tbody tr[aria-selected="true"] { background: var(--m-raise); }
.dx-table tbody tr:focus-visible { box-shadow: inset 2px 0 0 #8f83ff; }

.dx-col-bar { width: 22%; min-width: 80px; }

.dx-col-bar i {
  display: block;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(143, 131, 255, 0.9) calc(var(--v) * 100%), rgba(255, 255, 255, 0.08) 0);
}

.dx-case {
  min-width: 0;
  padding: 18px 20px 20px;
  border-left: 1px solid var(--m-line);
}

.dx-case-k { font-size: 12px; color: var(--m-muted); margin-bottom: 10px; }

.dx-case-id {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--m-line);
  color: var(--m-muted);
  font-size: 12.5px;
}

.dx-case-id .dx-id { color: var(--m-text); }

.dx-case dl { margin: 0; }

.dx-case dl > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--m-line);
}

.dx-case dl > div:last-child { border-bottom: 0; }
.dx-case dt { font-size: 12.5px; color: var(--m-muted); }
.dx-case dd { margin: 0; font-size: 12.5px; color: var(--m-text); text-align: right; }

.dx-case.is-swap dd,
.dx-case.is-swap .dx-case-id { animation: dx-fade var(--duration-move) var(--ease-out) both; }

@keyframes dx-fade {
  from { opacity: 0.2; }
}

.dx-term-cap { margin-top: 14px; font-size: 12.5px; line-height: 1.5; color: var(--ink-muted); }

@container term (max-width: 819px) {
  .dx-term-body { grid-template-columns: minmax(0, 1fr); }
  .dx-case { border-left: 0; border-top: 1px solid var(--m-line); }
}

@container term (max-width: 559px) {
  .dx-term-bar { gap: 14px; height: 50px; padding: 0 14px; }
  .dx-crumb-path, .dx-brand { display: none; }
  .dx-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dx-kpis > div { padding: 14px 16px; }
  .dx-kpis > div:nth-child(3) { border-left: 0; }
  .dx-kpis > div:nth-child(n + 3) { border-top: 1px solid var(--m-line); }
  .dx-col-status, .dx-col-flag, .dx-col-bar { display: none; }
  .dx-table th:first-child, .dx-table td:first-child { padding-left: 16px; }
  .dx-table th:last-child, .dx-table td:last-child { padding-right: 16px; }
  .dx-case { padding: 16px; }
}

/* ── What the network handles ── */

.dx-spec { margin: 0; }

.dx-spec > div {
  display: grid;
  grid-template-columns: minmax(160px, 0.36fr) minmax(0, 1fr);
  gap: 8px 24px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.dx-spec > div:last-child { border-bottom: 1px solid var(--line); }
.dx-spec dt { font-size: 15px; font-weight: 500; color: var(--ink); }
.dx-spec dd { margin: 0; font-size: 16px; line-height: 1.5; color: var(--ink-muted); max-width: 58ch; }

/* ── Network band ── */

.dx-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 32px 64px;
  padding: clamp(28px, 3.4vw, 44px) clamp(24px, 3.4vw, 48px);
  background: var(--paper-card);
  border: 1px solid rgba(17, 13, 23, 0.06);
  border-radius: var(--radius-lg);
}

.dx-band .kicker { margin-bottom: 14px; }
.dx-band h2 { font-size: clamp(24px, 2.4vw, 32px); line-height: 1.12; max-width: 26ch; margin-bottom: 12px; }
.dx-band-copy > p:last-child { font-size: 16px; line-height: 1.55; color: var(--ink-muted); max-width: 64ch; }
.dx-band-links { display: grid; gap: 12px; justify-items: start; }
.dx-band-links .dx-card-link { white-space: nowrap; }

/* ── FAQ ── */

.dx-faq-grid { display: grid; grid-template-columns: 0.8fr 1.4fr; gap: 48px; align-items: start; }

.dx-faq-list details { border-top: 1px solid var(--line); }
.dx-faq-list details:last-child { border-bottom: 1px solid var(--line); }

.dx-faq-list summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.dx-faq-list summary::-webkit-details-marker { display: none; }

.dx-faq-list summary::after {
  content: "+";
  flex: none;
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--ink-muted);
  transition: transform var(--duration-micro) var(--ease-out);
}

.dx-faq-list details[open] summary::after { transform: rotate(45deg); }
.dx-faq-list summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.dx-faq-list details p { padding: 0 0 22px; font-size: 16px; line-height: 1.55; color: var(--ink-muted); max-width: 62ch; }

/* ── Responsive ── */

@media (max-width: 1000px) {
  .dx-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .dx-map { max-width: 520px; }
  .dx-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 24px; }
}

@media (max-width: 860px) {
  .dx-trio, .dx-band, .dx-faq-grid { grid-template-columns: 1fr; }
  .dx-faq-grid { gap: 8px; }
  .dx-plate { max-width: 300px; }
}

/* On narrow screens the range reads top to bottom. */
@media (max-width: 900px) {
  .dx-spec-axis { display: none; }
  .dx-spectrum { display: grid; grid-template-columns: 2px minmax(0, 1fr); column-gap: 20px; }
  .dx-spec-track { grid-row: 1; grid-column: 1; height: auto; }
  .dx-spec-track i { background: linear-gradient(180deg, var(--ink), var(--blue)); transform-origin: top; transform: scaleY(var(--fill, 1)); }
  .dx-spec-marks { grid-row: 1; grid-column: 2; height: auto; display: grid; gap: 18px; }
  .dx-spec-marks li { position: relative; left: auto; transform: none; justify-items: start; text-align: left; padding-top: 0; white-space: normal; }
  .dx-spec-marks li::before { top: 5px; left: -25.5px; margin-left: 0; }
  .dx-spectrum.is-armed .dx-spec-marks li { transform: translateY(6px); }
  .dx-spectrum.is-armed .dx-spec-marks li.is-on { transform: none; }
  .dx-spec-notes, .dx-spec-cap { grid-column: 1 / -1; }
  .dx-spec-notes { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .dx-steps { grid-template-columns: minmax(0, 1fr); }
  .dx-spec > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .dx-flow-fig { padding: 20px 16px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .dx-card, .dx-card-link span, .dx-steps li, .dx-spec-marks li, .dx-map-fallback, .dx-table tbody tr { transition: none; }
  .dx-case.is-swap dd, .dx-case.is-swap .dx-case-id { animation: none; }
}
