/* Stats: a dark band after the hero. Each number counts up as an unlit
   outline, then flickers on in amber like the bulb (js/stats.js). Without JS
   (or with reduced motion) the numbers simply show lit. */
.stats-section {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(56px, 8vw, 104px) max(6vw, 36px, (100% - 1280px) / 2);
  background:
    radial-gradient(60% 120% at 50% 0%, #2c312f, transparent 70%),
    var(--stage);
  color: var(--paper);
}

/* The hero's dot grid, fading out towards the edges. */
.stats-section::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image: radial-gradient(circle, rgb(255 255 255 / 9%) 1.2px, transparent 1.7px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(closest-side, #000, transparent);
  mask-image: radial-gradient(closest-side, #000, transparent);
}

.stats-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px clamp(12px, 3vw, 40px);
  text-align: center;
}

.stat + .stat {
  border-left: 1px solid rgb(255 255 255 / 12%);
}

.stat-number {
  --stat-on: var(--amber);
  --stat-glow: 0 0 .2em rgb(253 178 1 / 45%), 0 0 .7em rgb(253 178 1 / 25%);
  margin: 0;
  color: var(--stat-on);
  font-family: var(--font-display);
  font-size: clamp(4rem, 9vw, 8.5rem);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: .9;
  -webkit-text-stroke: max(1px, .012em) transparent;
  text-shadow: var(--stat-glow);
}

/* A short amber filament between the number and its label. */
.stat-number::after {
  content: "";
  display: block;
  width: 34px;
  height: 2px;
  margin: clamp(14px, 1.6vw, 20px) auto 0;
  background: var(--amber);
  box-shadow: 0 0 8px rgb(253 178 1 / 60%);
}

.stat-label {
  max-width: 18ch;
  margin: clamp(12px, 1.4vw, 18px) 0 0;
  color: rgb(255 255 255 / 78%);
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  font-weight: 600;
  letter-spacing: .05em;
  line-height: 1.1;
  text-transform: uppercase;
}

/* Counting: numbers wait as unlit outlines until they reach their value. */
.stats-section.is-counting .stat-number {
  color: transparent;
  -webkit-text-stroke-color: rgb(255 255 255 / 35%);
  text-shadow: none;
}

.stats-section.is-counting .stat-number::after {
  opacity: .25;
  box-shadow: none;
}

.stats-section.is-counting .stat.is-lit .stat-number {
  animation: stat-power 700ms step-end both;
}

.stats-section.is-counting .stat.is-lit .stat-number::after {
  opacity: 1;
  box-shadow: 0 0 8px rgb(253 178 1 / 60%);
  transition: opacity 300ms ease 300ms;
}

/* step-end holds each keyframe, so the number snaps on like a bulb catching. */
@keyframes stat-power {
  0%, 14%, 28% {
    color: transparent;
    -webkit-text-stroke-color: rgb(255 255 255 / 35%);
    text-shadow: none;
  }

  8%, 22%, 40%, 100% {
    color: var(--stat-on);
    -webkit-text-stroke-color: transparent;
    text-shadow: var(--stat-glow);
  }
}

@media (max-width: 680px) {
  .stats-section {
    padding: 56px 16px;
  }

  .stat {
    padding-inline: 8px;
  }

  .stat-number {
    font-size: clamp(3rem, 15vw, 4.5rem);
  }

  .stat-label {
    font-size: 1rem;
  }
}
