/* ==========================================================================
   By the Numbers — editorial stat grid, integrated into the homepage's
   immersive scroll rather than a bolted-on widget. Large numbers read fine
   with CSS alone; JS only adds an optional lightweight count-up.
   ========================================================================== */

.stats {
  position: relative;
  background: var(--color-navy-950);
  border-top: 1px solid var(--border-subtle);
  overflow: hidden;
}

.stats__grid-bg {
  position: absolute;
  inset: 0;
  background-image: url('../images/blueprint-grid.svg');
  background-size: 96px 96px;
  opacity: 0.08;
  pointer-events: none;
}

.stats__inner {
  position: relative;
  z-index: 1;
}

.stats__head {
  max-width: 56ch;
  margin-bottom: var(--space-2xl);
}

.stats__title {
  font-size: var(--text-h2);
}

.stat-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--border-subtle);
  border-left: 1px solid var(--border-subtle);
}

.stat-item {
  position: relative;
  padding: var(--space-lg) var(--space-lg) var(--space-md);
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--dur-med) var(--ease-out);
}

.stat-item:hover {
  background: var(--color-navy-900);
}

.stat-item__number {
  display: flex;
  align-items: baseline;
  gap: 0.15em;
  font-family: var(--font-mono);
  font-size: clamp(2.5rem, 2rem + 3vw, 4.25rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  transition: color var(--dur-fast) var(--ease-out);
}

.stat-item:hover .stat-item__number {
  color: var(--accent);
}

.stat-item__suffix {
  font-size: 0.5em;
  color: var(--accent);
}

.stat-item__label {
  margin-top: var(--space-sm);
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  max-width: 22ch;
}

.stat-item__index {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  color: rgba(var(--ghost-rgb), 0.18);
}

@media (max-width: 900px) {
  .stat-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .stat-list {
    grid-template-columns: 1fr;
  }
}
