/* === Numbers section ===
   Стили вынесены в отдельный файл, чтобы избежать конфликта
   парсинга в конце основного styles.css. */

.numbers-section {
  position: relative;
  /* Сокращаем оба отступа — секция между лентой логотипов и блоком
     «Как делаем»; дефолтные padding-block по 140px слишком большие. */
  padding-top: clamp(16px, 2.5vw, 36px);
  padding-bottom: clamp(20px, 3vw, 44px);
}

/* Подтягиваем секцию «Как делаем» (#system) ближе к Numbers — у неё свой
   pillar-section, у которого сверху тоже стоит дефолтный .section padding */
.pillar-section {
  padding-top: clamp(24px, 3.5vw, 56px);
}

.numbers-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 24px);
  margin-top: clamp(20px, 3vw, 32px);
}

.numbers-card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(24px, 3vw, 36px) clamp(20px, 3vw, 32px);
  gap: clamp(8px, 1.4vw, 14px);
  overflow: hidden;
  transition:
    transform 0.5s cubic-bezier(0.33, 1, 0.68, 1),
    border-color 0.5s,
    box-shadow 0.5s;
}

/* Анимированная красная полоса по верхнему краю — как у .pillar-card::before
   в секции «3 опоры системы». */
.numbers-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 6%;
  right: 6%;
  height: 3px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 74, 78, 0.35) 24%,
    rgba(233, 4, 8, 0.85) 50%,
    rgba(255, 74, 78, 0.35) 76%,
    transparent 100%
  );
  box-shadow:
    0 0 18px rgba(233, 4, 8, 0.35),
    0 0 36px rgba(233, 4, 8, 0.08);
  opacity: 0.95;
  animation: numbers-card-top 14s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 1;
}

/* Сдвигаем фазу анимации у соседних карточек, чтобы пульсация не была синхронной */
.numbers-grid > :nth-child(2) .numbers-card::before { animation-delay: -4.6s; }
.numbers-grid > :nth-child(3) .numbers-card::before { animation-delay: -9.3s; }

/* Hover-лифт + красный glow по контуру — как у .pillar-card:hover */
.numbers-card:hover {
  transform: translate3d(0, -4px, 0);
  border-color: rgba(255, 72, 76, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 20px 64px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(233, 4, 8, 0.12),
    0 0 56px rgba(233, 4, 8, 0.1);
}

@keyframes numbers-card-top {
  0%   { opacity: 0.75; filter: saturate(1); }
  100% { opacity: 1;    filter: saturate(1.15); }
}

@media (prefers-reduced-motion: reduce) {
  .numbers-card::before { animation: none; }
  .numbers-card:hover { transform: none; }
}

.numbers-card__visual {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-bottom: clamp(6px, 1.2vw, 12px);
}

.numbers-donut {
  width: clamp(140px, 16vw, 180px);
  height: auto;
  filter: drop-shadow(0 0 28px rgba(233, 4, 8, 0.22));
}

/* Вращающееся кольцо: сегменты крутятся вокруг центра.
   transform-box: view-box + transform-origin в координатах SVG. */
.numbers-donut__ring {
  transform-box: view-box;
  transform-origin: 90px 90px;
  animation: numbers-donut-spin 9s linear infinite;
}

.numbers-donut__ring--reverse {
  animation-duration: 11s;
  animation-direction: reverse;
}

@keyframes numbers-donut-spin {
  from { transform: rotate(-90deg); }
  to   { transform: rotate(270deg); }
}

.numbers-card__caption {
  margin: 0;
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: clamp(13px, 1.3vw, 14.5px);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9b9d9f;
}

.numbers-card__value {
  margin: 0;
  max-width: 100%;
  font-family: 'Manrope', system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(22px, 1.8vw + 12px, 40px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  color: #f5f7fa;
  text-shadow: 0 0 32px rgba(233, 4, 8, 0.22);
  white-space: nowrap;
  overflow: visible;
}

.numbers-card__period {
  margin: 0;
  font-size: clamp(12px, 1.05vw, 13.5px);
  color: #9b9d9f;
}

/* Подсветка в строке-подписи: маленькая красная пилюля, как в фирменных
   pill-эйчбраузерах сайта. Используется для акцента (ROMI > 200% и пр.). */
.numbers-card__highlight {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: linear-gradient(
    132deg,
    rgba(255, 26, 31, 0.22) 0%,
    rgba(233, 4, 8, 0.16) 48%,
    rgba(151, 2, 3, 0.18) 100%
  );
  border: 1px solid rgba(233, 4, 8, 0.42);
  color: rgba(255, 232, 234, 0.98);
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow:
    0 0 14px rgba(233, 4, 8, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.numbers-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border-radius: 18px;
  border: 1px solid rgba(233, 4, 8, 0.32);
  background:
    radial-gradient(circle at 32% 18%, rgba(255, 108, 112, 0.28), rgba(8, 9, 11, 0.94)),
    linear-gradient(148deg, rgba(233, 4, 8, 0.22), rgba(10, 11, 15, 0.92));
  color: #ff4a4e;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 32px rgba(233, 4, 8, 0.22),
    0 10px 28px rgba(0, 0, 0, 0.4);
}

.numbers-card--records {
  justify-content: flex-start;
  gap: clamp(12px, 1.6vw, 18px);
}

.numbers-card__title {
  margin: 0;
  font-family: 'Manrope', system-ui, sans-serif;
  font-size: clamp(20px, 0.4vw + 18px, 26px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f5f7fa;
}

.numbers-card__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.1vw, 12px);
  width: 100%;
}

.numbers-card__list li {
  position: relative;
  padding: 12px 16px 12px 38px;
  border-radius: 14px;
  border: 1px solid rgba(233, 4, 8, 0.14);
  background:
    radial-gradient(ellipse 120% 100% at 0% 0%, rgba(233, 4, 8, 0.1), transparent 55%),
    rgba(11, 12, 14, 0.55);
  font-size: clamp(13px, 0.28vw + 11px, 14.5px);
  line-height: 1.5;
  color: rgba(245, 247, 250, 0.88);
  text-align: left;
}

.numbers-card__list li::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  translate: 0 -50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff1a1f;
  box-shadow: 0 0 12px rgba(233, 4, 8, 0.6);
}

.numbers-card__list strong {
  color: #f5f7fa;
  font-weight: 700;
}

@media (max-width: 900px) {
  .numbers-grid {
    grid-template-columns: 1fr;
  }
  .numbers-card {
    padding: 28px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .numbers-donut circle[fill='#e90408'],
  .numbers-donut circle[fill='#ff1a1f'] {
    animation: none !important;
  }
  .numbers-donut__ring {
    animation: none !important;
    transform: rotate(-90deg);
  }
}
