/* ==========================================================================
   TechAbbot – company statistics banner
   Markup: partials/stats.html (generated by tools/build-stats.js)
   Behaviour: js/stats.js (count-up only)

   A compact, full-width green-to-blue banner with a dotted texture and ring
   motifs in the corners. Each statistic is an icon chip with the number and
   label beside it; columns are divided by vertical separators.

     below 600px   2 columns x 5 rows, icon above the text, centred
     600px and up  2 columns x 5 rows, icon beside the text
     1100px and up 5 columns x 2 rows
   ========================================================================== */

.stats {
  /* The green end is a step deeper than the logo green so the small white
     labels keep a 4.5:1 contrast across the whole banner. */
  --stats-from: #1F8549;
  --stats-to: #0871A7;
  --stats-line: rgba(255, 255, 255, 0.3);
  --stats-dot: rgba(255, 255, 255, 0.2);
  --stats-ring: rgba(255, 255, 255, 0.11);

  position: relative;
  padding-block: clamp(24px, 2.6vw, 32px) clamp(26px, 2.8vw, 36px);
  background: var(--stats-to) linear-gradient(90deg, var(--stats-from), var(--stats-to));
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}

/* Decoration 1: a dot grid that fades in from the left and right edges. */
.stats::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(circle, var(--stats-dot) 1.3px, transparent 1.8px);
  background-size: 20px 20px;
  -webkit-mask-image: linear-gradient(90deg, #000, transparent 30%, transparent 70%, #000);
  mask-image: linear-gradient(90deg, #000, transparent 30%, transparent 70%, #000);
  pointer-events: none;
}

/* Decoration 2: concentric rings off the top-right and bottom-left corners. */
.stats::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    repeating-radial-gradient(circle at 100% 0, transparent 0 46px, var(--stats-ring) 46px 48px) 100% 0 / 420px 420px no-repeat,
    repeating-radial-gradient(circle at 0 100%, transparent 0 46px, var(--stats-ring) 46px 48px) 0 100% / 340px 340px no-repeat;
  -webkit-mask-image: radial-gradient(circle at 100% 0, #000, transparent 400px), radial-gradient(circle at 0 100%, #000, transparent 320px);
  mask-image: radial-gradient(circle at 100% 0, #000, transparent 400px), radial-gradient(circle at 0 100%, #000, transparent 320px);
  pointer-events: none;
}

.stats__title {
  margin: 0 0 clamp(18px, 2vw, 24px);
  font-size: clamp(1.1875rem, 1rem + 0.8vw, 1.5rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-align: center;
  text-wrap: balance;
}

.stats__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  row-gap: clamp(20px, 2.2vw, 24px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.stats__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding-inline: clamp(8px, 1.4vw, 18px);
  text-align: center;
}

/* Vertical separator on every column except the first of its row. */
.stats__item:nth-child(even) { border-left: 1px solid var(--stats-line); }

/* Icon in a translucent chip. */
.stats__icon {
  flex: none;
  box-sizing: content-box;
  width: 24px;
  height: 24px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--ease), background-color var(--ease);
}

@media (hover: hover) {
  .stats__item:hover .stats__icon {
    background: rgba(255, 255, 255, 0.24);
    transform: scale(1.08);
  }
}

.stats__text {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  min-width: 0;
}

.stats__value {
  font-size: clamp(1.625rem, 1.3rem + 1.1vw, 2.125rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  /* Equal-width digits so the number does not jitter while it counts. */
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stats__label {
  margin-top: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3;
  text-wrap: balance;
}

/* Icon beside the text */
@media (min-width: 600px) {
  .stats__item {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding-inline: clamp(16px, 4vw, 48px);
    text-align: left;
  }

  .stats__text { align-self: auto; flex: 1; }
}

@media (min-width: 1100px) {
  .stats__list { grid-template-columns: repeat(5, minmax(0, 1fr)); }

  .stats__item {
    gap: 10px;
    padding-inline: clamp(10px, 1vw, 14px);
    border-left: 1px solid var(--stats-line);
  }

  .stats__item:nth-child(5n + 1) {
    padding-left: 0;
    border-left: 0;
  }

  .stats__item:nth-child(5n) { padding-right: 0; }
}
