/* =========================
   stats.css
   Petrol blue section + SVG ring animation
   ========================= */

/* =========================
   STATS SECTION
   ========================= */
#stats.stats {
  position: relative;
  overflow: hidden;
  padding: 50px 0;
  border: none;
  color: rgba(255, 255, 255, 0.92);
  background: linear-gradient(135deg, #14687b, #123f4a, #041c22);
  background-size: 200% 200%;
  animation: statsGradient 18s ease infinite;
}

@keyframes statsGradient {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* hide unused bg layer */
#stats .stats-bg {
  display: none;
}

#stats .stats-inner {
  position: relative;
  z-index: 2;
}

#stats .stats-head {
  margin-bottom: 34px;
}

#stats .stats-title {
  margin: 0;
  color: #fff;
}

#stats .stats-subtitle {
  max-width: 70ch;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  line-height: 1.8;
  font-weight: 200;
}

/* =========================
   GRID
   ========================= */
#stats .stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 34px;
}

@media (max-width: 980px) {
  #stats.stats {
    padding: 92px 0;
  }

  #stats .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  #stats.stats {
    padding: 82px 0;
  }

  #stats .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* =========================
   STAT CARD
   ========================= */
#stats .stat {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 235px;
  padding: 18px;
  background: transparent;
  border: none;
  box-shadow: none;
  text-align: center;

  opacity: 0;
  transform: translate3d(0, 12px, 0);
  will-change: transform, opacity;
  transition:
    opacity 0.65s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 0.85s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#stats .stat.is-in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@media (max-width: 640px) {
  #stats .stat {
    min-height: 220px;
  }
}

/* =========================
   SVG RING
   ========================= */
#stats .ring {
  position: relative;
  z-index: 1;
  display: block;
  width: 230px;
  height: 230px;
  margin: 0 auto;
  transform: rotate(-90deg);
}

@media (max-width: 980px) {
  #stats .ring {
    width: 230px;
    height: 230px;
  }
}

@media (max-width: 640px) {
  #stats .ring {
    width: 220px;
    height: 220px;
  }
}

#stats .ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 2.25;
}

#stats .ring-stroke {
  fill: none;
  stroke: #7ded10;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transform-origin: 50% 50%;
  filter: drop-shadow(0 0 4px rgba(50, 255, 0, 0.35));
  will-change: stroke-dashoffset, transform;
  transition:
    stroke-dashoffset 1.15s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 1.15s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#stats .stat.is-in .ring-stroke {
  stroke-dashoffset: 0;
  transform: rotate(12deg);
}

/* =========================
   CONTENT INSIDE RING
   ========================= */
#stats .stat-content {
  position: absolute;
  inset: 0;
  z-index: 2;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;

  opacity: 0;
  transform: translate3d(0, 8px, 0);
  will-change: opacity, transform;
  transition:
    opacity 0.55s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 0.75s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#stats .stat.is-in .stat-content {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

#stats .stat-number {
  margin: 0;
  color: #fff;
  font-size: clamp(34px, 3.8vw, 50px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 800;
}

#stats .stat-label {
  display: block;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}

/* =========================
   STAGGER
   ========================= */
#stats .stat:nth-child(1) .ring-stroke {
  transition-delay: 0.1s;
}
#stats .stat:nth-child(2) .ring-stroke {
  transition-delay: 0.22s;
}
#stats .stat:nth-child(3) .ring-stroke {
  transition-delay: 0.34s;
}
#stats .stat:nth-child(4) .ring-stroke {
  transition-delay: 0.46s;
}

#stats .stat:nth-child(1) .stat-content {
  transition-delay: 0.24s;
}
#stats .stat:nth-child(2) .stat-content {
  transition-delay: 0.36s;
}
#stats .stat:nth-child(3) .stat-content {
  transition-delay: 0.48s;
}
#stats .stat:nth-child(4) .stat-content {
  transition-delay: 0.6s;
}

/* =========================
   REDUCED MOTION
   ========================= */
@media (prefers-reduced-motion: reduce) {
  #stats .stat {
    opacity: 1;
    transform: none;
    transition: none;
  }

  #stats .ring-stroke {
    stroke-dashoffset: 0;
    transform: none;
    transition: none;
  }

  #stats .stat-content {
    opacity: 1;
    transform: none;
    transition: none;
  }
}