/* Stat scrub · Scroll Story Kit
   Static (no JS, reduced motion): the final figures, each with a full ring or bar.
   Motion: the figures are tied to scroll position, not to a timer. As the grid scrolls through its range
   (data-sk="cover" with data-sk-range on the list) each number runs up from 0 to its value and back down when
   you scroll up, through a registered integer property and a CSS counter, and its ring or bar fills with it.
   The real figure stays in the text for screen readers; the running number is an aria-hidden copy. */
@property --sk-stat-n { syntax: "<integer>"; inherits: false; initial-value: 0; }
.sk-stat {
  --sk-stat-stagger: .07;  /* progress between one figure starting and the next */
  --sk-stat-span: .79;     /* progress each figure takes to run up; keep stagger * (figures - 1) + span at 1 or less */
}
.sk-stat-head { max-width: 780px; }
.sk-stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sk-gap); margin: clamp(36px, 5vw, 56px) 0 0; padding: 0; list-style: none; }
.sk-stat-card { --lp: 1; position: relative; display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: clamp(22px, 3vw, 34px); border-radius: var(--sk-radius); background: var(--sk-surface); box-shadow: var(--sk-shadow-sm); }
.sk-stat-card--ring { grid-row: span 3; align-items: center; justify-content: center; gap: 22px; text-align: center; }
.sk-stat-fig { display: flex; align-items: baseline; gap: 8px; margin: 0; font: var(--sk-weight-display) clamp(2.6rem, 1.7rem + 2.6vw, 4rem)/1 var(--sk-font-display); letter-spacing: var(--sk-track-display); font-variant-numeric: tabular-nums; }
.sk-stat-unit { font-size: max(.36em, 1rem); font-weight: 700; letter-spacing: 0; color: var(--sk-ink-2); }
.sk-stat-tick { position: absolute; width: 0; height: 0; overflow: clip; } /* empty until motion is on; kept in layout so it never leaves a gap */
.sk-stat-label { margin: 0; max-width: 32ch; color: var(--sk-ink-2); text-wrap: pretty; }
.sk-stat-bar { display: block; margin-top: auto; height: 10px; border-radius: 5px; background: var(--sk-sunk); overflow: clip; }
.sk-stat-bar i { display: block; height: 100%; border-radius: inherit; background: var(--sk-bar, var(--sk-accent-2)); transform-origin: 0 50%; transform: scaleX(calc(var(--to) / var(--max) * var(--lp))); }
.sk-stat-card:nth-child(3) { --sk-bar: var(--sk-accent-3); }
.sk-stat-card:nth-child(4) { --sk-bar: var(--sk-accent-4); }
.sk-stat-card:not(.sk-stat-card--ring) .sk-stat-label { margin-bottom: 8px; }

/* the ring card: number in the middle of a dial */
.sk-stat-dial { position: relative; display: grid; place-items: center; width: min(100%, 300px); aspect-ratio: 1; }
.sk-stat-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.sk-stat-track { fill: none; stroke: var(--sk-sunk); stroke-width: 9; }
.sk-stat-arc { fill: none; stroke: var(--sk-accent); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 100 200; stroke-dashoffset: calc(100 - 100 * var(--to) / var(--max) * var(--lp)); opacity: clamp(0, var(--lp) * 40, 1); }
.sk-stat-card--ring .sk-stat-fig { justify-content: center; gap: 4px; font-size: clamp(3.6rem, 2.2rem + 4.6vw, 6.2rem); }
.sk-stat-card--ring .sk-stat-unit { font-size: .42em; font-weight: var(--sk-weight-display); color: var(--sk-accent-text); }
.sk-stat-card--ring .sk-stat-label { max-width: 24ch; font-size: var(--sk-size-lead); color: var(--sk-ink); }
.sk-stat-note { margin: 18px 0 0; font-size: var(--sk-size-small); color: var(--sk-ink-2); }

:root.sk-on .sk-stat-card { --lp: clamp(0, (var(--sk-p) - var(--i) * var(--sk-stat-stagger)) / var(--sk-stat-span), 1); }
:root.sk-on .sk-stat-val { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: clip; clip: rect(0 0 0 0); white-space: nowrap; }
:root.sk-on .sk-stat-tick { --sk-stat-n: calc(var(--to) * var(--lp)); position: static; display: inline-block; width: auto; height: auto; overflow: visible; min-width: calc(var(--w) * 1ch); text-align: left; counter-reset: sk-stat var(--sk-stat-n); }
:root.sk-on .sk-stat-tick::before { content: counter(sk-stat); }

@media (max-width: 760px) {
  .sk-stat-grid { grid-template-columns: 1fr; }
  .sk-stat-card--ring { grid-row: auto; }
  .sk-stat-dial { width: min(100%, 240px); }
}
