/*
 * dyad-hundred — two grids of 100 newborns (chapter 4). Filled dots are
 * newborn outcomes in the chapter's newborn ink, var(--cat-emph); the side
 * "mother had a complication" is marked in ink.
 */
.dh { display: flex; flex-direction: column; justify-content: center; height: 100%; color: var(--ink); }
.dh-metric {
  margin: 0 0 28px;
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; text-align: center;
}
.dh-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas: "from mult to";
  align-items: center;
  column-gap: clamp(16px, 3vw, 44px);
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
}
.dh-side[data-side="from"] { grid-area: from; }
.dh-side[data-side="to"] { grid-area: to; }
.dh-mult { grid-area: mult; }
.dh-side { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.dh-who {
  margin: 0 0 14px;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); text-align: center;
}
.dh-side[data-side="to"] .dh-who { color: var(--ink); font-weight: 500; }
.dh-grid { width: 100%; max-width: min(320px, 38svh); height: auto; overflow: visible; }
.dh-base { fill: rgba(var(--ink-rgb), .12); }
.dh-fill { fill: var(--cat-emph); opacity: 0; transition: opacity .35s ease var(--d, 0s); }
.dh-fill.on { opacity: 1; }
.dh-side[data-side="to"] .dh-grid { filter: drop-shadow(0 0 0 transparent); }
.dh-val { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 16px 0 0; }
.dh-num {
  font-family: var(--font-mono); font-size: clamp(32px, 3.6vw, 48px); font-weight: 300;
  line-height: 1; letter-spacing: -.035em; font-variant-numeric: tabular-nums;
}
.dh-side[data-side="to"] .dh-num { color: var(--cat-emph); }
.dh-unit { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.dh-mult { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 0; }
.dh-x { font-family: var(--font-mono); font-size: 20px; font-weight: 500; letter-spacing: -.02em; color: var(--cat-emph); font-variant-numeric: tabular-nums; }
.dh-x-label { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.dh-mult::before { content: "›"; font-family: var(--font-mono); font-size: 22px; color: rgba(var(--ink-rgb), .35); }

.dh:not(.in-scrolly) { padding-block: 18px 6px; }
@container (width <= 560px) {
  .dh-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "from to" "mult mult"; row-gap: 18px; }
  .dh-mult { flex-direction: row; justify-content: center; gap: 8px; }
  .dh-mult::before { content: none; }
  .dh-who { min-height: 2.8em; font-size: 11px; }
}
@media (width < 900px) {
  .dh.in-scrolly { justify-content: flex-start; padding-top: 12px; }
  .dh.in-scrolly .dh-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "from to" "mult mult"; row-gap: 14px; column-gap: 18px; }
  .dh.in-scrolly .dh-mult { flex-direction: row; justify-content: center; gap: 8px; }
  .dh.in-scrolly .dh-mult::before { content: none; }
  .dh.in-scrolly .dh-who { min-height: 2.8em; font-size: 11px; }
  .dh.in-scrolly .dh-metric { margin-bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .dh-fill { transition: none; }
}
