/*
 * comp-field — 1,000 deliveries, one dot each (chapter 4). Mother = ink,
 * newborn = var(--cat-emph) (the chapter's newborn ink), both = newborn dot
 * with an ink ring. Unlit dots are a faint ink wash. Dots move with a CSS
 * transform; --d (per dot, by rank) staggers moves and colour changes.
 */
.cf { display: flex; flex-direction: column; height: 100%; color: var(--ink); }
.cf-field { position: relative; flex: 1; min-height: 0; }
.cf:not(.in-scrolly) .cf-field { flex: none; aspect-ratio: 8 / 5; margin-top: 18px; }
.cf-field svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

.cf-dot {
  fill: rgba(var(--ink-rgb), .13);
  stroke: transparent;
  stroke-width: var(--cf-ring, 1.4px);
  transition:
    transform .95s var(--rv-ease) var(--d, 0s),
    fill .45s ease calc(var(--d, 0s) * .55),
    stroke .45s ease calc(var(--d, 0s) * .55),
    opacity .45s ease calc(var(--d, 0s) * .55);
}
.cf-dot.m { fill: var(--ink); }
.cf-dot.b { fill: var(--cat-emph); }
.cf-dot.mb { fill: var(--cat-emph); stroke: var(--ink); }
.cf-dot.dim { opacity: .3; }
.cf.snap .cf-dot { transition: none; }

/* the readout: one number, what it counts, per how many */
.cf-hud { flex: none; padding-bottom: 18px; }
.cf-num {
  display: flex; align-items: center; gap: 14px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(40px, 4.6vw, 60px);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
}
.cf-key {
  flex: none; width: 14px; height: 14px; border-radius: 50%;
  background: rgba(var(--ink-rgb), .13);
  transition: background .3s, box-shadow .3s;
}
.cf-key.k-m { background: var(--ink); }
.cf-key.k-b { background: var(--cat-emph); }
.cf-key.k-mb { background: var(--cat-emph); box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--ink); }
.cf-key.k-u { background: linear-gradient(90deg, var(--ink) 50%, var(--cat-emph) 50%); }
.cf-label {
  margin: 12px 0 3px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink);
}
.cf-sub { margin: 0; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

@container (width <= 600px) {
  .cf-hud { padding-bottom: 12px; }
  .cf-label { margin-top: 8px; font-size: 11.5px; }
}
@media (width < 900px) {
  .cf.in-scrolly .cf-num { font-size: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .cf-dot, .cf-key { transition: none; }
}
.cf.in-scrolly { translate: 0 var(--cf-shift, 0px); }   /* number + grid centred as one block (comp-field.js) */
.cf-hud { padding-bottom: 22px; }
