/* ==========================================================================
   Making Strides or Standstill? 35 Years of HIV in Kenya
   Rate versus reality, the dot field

   One pinned frame. The canvas fills it, the field sits right, the copy
   sits left on glass, the readout top right. Below 900px the field takes
   the top and the copy the bottom.

   Copyright Willow Health Media 2026
   ========================================================================== */

.df {
  position: relative;
  background: var(--bg);
}

.wh-js .df { height: 560vh; }

.wh-js .df__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.df__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---- readout ------------------------------------------------------------- */

.df__hud {
  position: absolute;
  top: 4vh;
  right: 3vw;
  text-align: right;
  font-family: var(--sans);
  pointer-events: none;
}

.df__year {
  font: 300 clamp(2.6rem, 5vw, 4.4rem)/1 var(--sans);
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  margin: 0 0 .9rem;
  color: var(--ink);
}

.df__stats { margin: 0; }
.df__stats div { margin: 0 0 .55rem; }

.df__stats dt {
  font: 600 11px/1.3 var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.df__stats dd {
  margin: .15rem 0 0;
  font: 400 1.25rem/1.2 var(--sans);
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}

.df__stats-red dt, .df__stats-red dd { color: var(--red); }

.df__rate {
  display: inline-block;
  margin-left: .6rem;
  padding: .1rem .45rem;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-size: .85em;
}

.df__key {
  margin: .6rem 0 0;
  font: 12px/1.3 var(--sans);
  color: var(--ink-3);
}

.df__swatch {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(12, 14, 17, .35);
  margin-right: .5rem;
  vertical-align: 1px;
}

/* ---- steps --------------------------------------------------------------- */

.wh-js .df__steps {
  position: absolute;
  left: 3vw;
  top: 0;
  bottom: 0;
  width: min(30rem, 36vw);
}

.df-step {
  max-width: 30rem;
  font-size: 18px;
}

.wh-js .df-step {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  padding: 1.4rem 1.5rem;
  /* background, edge and corners: the shared liquid glass in timeline.css */
  opacity: 0;
  transform: translateY(-50%);
  will-change: opacity, transform;
}

.df-step p { margin: 0 0 .85rem; }
.df-step p:last-child { margin-bottom: 0; }

.df-step__kicker {
  font: 600 12px/1 var(--sans);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--red);
}

.df-step__h {
  font: 400 2rem/1.15 var(--serif);
  margin: 0 0 .8rem;
}

.df-step__src {
  font: 12px/1.5 var(--sans);
  color: var(--ink-3);
}

/* no JavaScript: the steps are the scene */
.wh-no-js .df__canvas, .wh-no-js .df__hud { display: none; }
.wh-no-js .df__stage { max-width: 46rem; margin: 0 auto; padding: 4rem 1.25rem; }
.wh-no-js .df-step { padding: 1rem 0; }

/* ---- narrow screens ------------------------------------------------------ */

@media (max-width: 899px) {
  .df__hud { top: 2vh; right: 16px; text-shadow: 0 0 8px var(--bg), 0 0 3px var(--bg); }
  .df__year { font-size: 2.2rem; margin-bottom: .4rem; }
  .df__stats dd { font-size: 1rem; }
  .df__stats div { margin-bottom: .3rem; }

  .wh-js .df__steps {
    left: 16px;
    right: 16px;
    top: auto;
    bottom: 3vh;
    width: auto;
    height: 40%;
  }

  .wh-js .df-step { top: auto; bottom: 0; transform: none; }
  .df-step { font-size: 15px; }
  .df-step__h { font-size: 1.5rem; }
}

/* white on blue (Stanley's call, 16 Nov 2026): the red figures beside the
   dots are yellow. The red dots themselves stay red. */
.df__stats-red dt, .df__stats-red dd { color: #fbe056; }
