/*
 * comp-age — maternal complications by age (chapter 4): bars (how often)
 * beside slopes (what kind). Highlights are ink; context is a faint ink, so
 * the one family that tells the story at each step stands alone.
 */
.ca { position: relative; width: 100%; height: 100%; color: var(--ink); }
.ca:not(.in-scrolly) { height: auto; }
.ca svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ca:not(.in-scrolly) svg { height: auto; }

.ca-title { font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; fill: var(--ink); }
.ca-sub { font-family: var(--font-mono); font-size: 11.5px; fill: var(--muted); }
.ca-grid { stroke: rgba(var(--ink-rgb), .08); }
.ca-base { stroke: var(--axis-ink); }
.ca-tick, .ca-n { font-family: var(--font-mono); font-size: 11px; fill: var(--label-ink); }
.ca-x { font-family: var(--font-mono); font-size: 13px; font-weight: 500; fill: rgba(var(--ink-rgb), .7); }

.ca-panel { transition: opacity .5s var(--rv-ease); }
.ca-bar { fill: var(--ink); opacity: .8; transition: opacity .4s; }
.ca-val { font-family: var(--font-mono); font-size: 15px; font-weight: 500; fill: var(--ink); font-variant-numeric: tabular-nums; transition: opacity .4s; }
.ca-u { fill: none; stroke: rgba(var(--ink-rgb), .35); stroke-width: 1.2px; stroke-dasharray: 3 4; transition: opacity .4s; }

.ca-rail { stroke: rgba(var(--ink-rgb), .1); }
.ca-line { fill: none; stroke: rgba(var(--ink-rgb), .2); stroke-width: 1.4px; transition: stroke .4s, stroke-width .4s; }
.ca-dot { fill: rgba(var(--ink-rgb), .25); transition: fill .4s, r .4s; }
.ca-pt { font-family: var(--font-mono); font-size: 12px; font-weight: 500; fill: var(--ink); opacity: 0; transition: opacity .4s; font-variant-numeric: tabular-nums; }
.ca-name { font-family: var(--font-mono); font-size: 12px; fill: var(--label-ink); transition: fill .4s; }
.ca-name.small { font-size: 9.5px; letter-spacing: -.02em; }

/* step "rate": the bars speak, the mix waits */
.ca[data-state="rate"] .ca-slopes { opacity: .35; }
/* steps "older" / "younger": one band, one family */
.ca:not([data-state="rate"]) .ca-band:not(.hl) .ca-bar { opacity: .16; }
.ca:not([data-state="rate"]) .ca-band:not(.hl) .ca-val { opacity: .35; }
.ca:not([data-state="rate"]) .ca-u { opacity: .3; }
.ca-x.hl { fill: var(--ink); }
.ca-rail.hl { stroke: rgba(var(--ink-rgb), .35); }
.ca-fam.hl .ca-line { stroke: var(--ink); stroke-width: 2.6px; }
.ca-fam.hl .ca-dot { fill: var(--ink); r: 4.5px; }
.ca-fam.hl .ca-pt { opacity: 1; }
.ca-fam.hl .ca-dot.hl { r: 6.5px; }
.ca-fam.hl .ca-pt.hl { font-size: 15px; }
.ca-fam.hl .ca-name { fill: var(--ink); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .ca-panel, .ca-bar, .ca-val, .ca-u, .ca-line, .ca-dot, .ca-pt, .ca-name { transition: none; }
}
