/* Premium Facts Grid - asymmetrical mosaic cards */

.about .facts-cloud {
  position: relative;
  margin-top: 24px;
  margin-bottom: 8px;
  padding: clamp(8px, 2.5vw, 24px) 0;
  --fact-card-font-scale: 1;
  box-sizing: border-box;
}

/* Пропорциональный коэффициент для уменьшения текста при сужении экрана */
@media (max-width: 1800px) and (min-width: 1025px) {
  .about .facts-cloud { --fact-card-font-scale: 0.96; }
}

@media (max-width: 1680px) and (min-width: 1025px) {
  .about .facts-cloud { --fact-card-font-scale: 0.9; }
}

@media (max-width: 1560px) and (min-width: 1025px) {
  .about .facts-cloud { --fact-card-font-scale: 0.84; }
}

@media (max-width: 1440px) and (min-width: 1025px) {
  .about .facts-cloud { --fact-card-font-scale: 0.78; }
}

@media (max-width: 1320px) and (min-width: 1025px) {
  .about .facts-cloud { --fact-card-font-scale: 0.72; }
}

@media (max-width: 1200px) and (min-width: 1025px) {
  .about .facts-cloud { --fact-card-font-scale: 0.66; }
}

@media (max-width: 1100px) and (min-width: 1025px) {
  .about .facts-cloud { --fact-card-font-scale: 0.6; }
}

.about .facts-cloud::before {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
}

.about .facts-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  --facts-grid-row-size: clamp(64px, 8.333vw, 120px);
  --facts-grid-gap-size: clamp(12px, 1.25vw, 18px);
  grid-auto-rows: var(--facts-grid-row-size);
  gap: var(--facts-grid-gap-size);
  /* grid-template-areas удалено - теперь используется динамическое размещение через grid-row и grid-column */
}

.about .fact-card {
  --card-fg: #0f172a; /* default text color */
  --card-shadow: 0 14px 32px rgba(2, 6, 23, 0.16), 0 4px 14px rgba(2, 6, 23, 0.10);
  --fact-card-padding-top: clamp(14px, 1.2vw, 22px);
  --fact-card-padding-right: clamp(12px, 1.2vw, 24px);
  --fact-card-padding-bottom: clamp(14px, 1.2vw, 24px);
  --fact-card-padding-left: clamp(12px, 1.2vw, 24px);
  --fact-card-content-width: calc(100% - (var(--fact-card-padding-left) + var(--fact-card-padding-right)));
  --fact-card-edge-gap: clamp(10px, 0.9vw, 18px);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: 18px;
  padding: var(--fact-card-padding-top) var(--fact-card-padding-right) var(--fact-card-padding-bottom) var(--fact-card-padding-left);
  overflow: hidden;
  color: var(--card-fg);
  background: var(--card-bg, linear-gradient(180deg, #ffffff, #f8fafc));
  box-shadow: var(--card-shadow);
  border: none;
  opacity: 0;
  transform: translate(var(--enter-x, 0), var(--enter-y, 20px)) scale(0.92) rotateX(var(--enter-rotate-x, 0deg));
  transition: transform 1000ms cubic-bezier(0.16, 1, 0.3, 1), 
              opacity 900ms cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 600ms cubic-bezier(0.34, 1.56, 0.64, 1), 
              border-color 300ms ease;
  transition-delay: var(--delay, 0ms);
  will-change: transform, opacity;
  perspective: 1000px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

.about .fact-card__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.about .fact-card__media picture,
.about .fact-card__media img {
  width: 100%;
  height: 100%;
  display: block;
}

.about .fact-card__image {
  object-fit: cover;
  transform: scale(1);
  transition: transform 600ms cubic-bezier(0.23, 1, 0.32, 1);
}

.about .fact-card:hover .fact-card__image {
  transform: scale(1.05);
}

.about .fact-card:focus {
  outline: 2px solid rgba(59, 130, 246, 0.6);
  outline-offset: 2px;
}

.about .fact-card:focus:not(:focus-visible) {
  outline: none;
}

.about .fact-card:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.8);
  outline-offset: 2px;
}

.about .fact-card:active {
  transform: translate(0, -4px) scale(1.01);
  transition: transform 150ms ease;
}

.about .fact-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(255,255,255,0.22), transparent 60%),
    radial-gradient(140% 100% at 100% 100%, rgba(255,255,255,0.12), transparent 60%);
  pointer-events: none;
  transition: background 400ms ease, opacity 400ms ease;
}

/* Эффект при наведении - overlay для затемнения/осветления */
.about .fact-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.05) 0%, 
    transparent 50%, 
    rgba(0, 0, 0, 0.03) 100%);
  opacity: 0;
  transition: opacity 600ms ease;
  pointer-events: none;
  z-index: 1;
}

.about .fact-card:hover {
  transform: scale(1.01);
  box-shadow: 
    0 24px 48px rgba(2, 6, 23, 0.2), 
    0 8px 20px rgba(2, 6, 23, 0.14);
  border-color: transparent;
  transition: transform 500ms cubic-bezier(0.23, 1, 0.32, 1), 
              box-shadow 500ms cubic-bezier(0.23, 1, 0.32, 1);
}

.about .fact-card:hover::before {
  opacity: 1;
}

.about .fact-card:hover::after {
  background:
    radial-gradient(140% 90% at 0% 0%, rgba(255,255,255,0.35), transparent 70%),
    radial-gradient(160% 110% at 100% 100%, rgba(255,255,255,0.25), transparent 70%);
  transition: background 600ms ease;
}

.about .fact-card:hover .fact-card__title {
  transform: translateY(-2px);
  transition: transform 500ms cubic-bezier(0.23, 1, 0.32, 1);
}

.about .fact-card:hover .fact-card__badge {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 20px rgba(2, 6, 23, 0.25), inset 0 0 0 1px rgba(15, 23, 42, 0.08);
  animation: none;
  transition: transform 500ms cubic-bezier(0.23, 1, 0.32, 1),
              box-shadow 400ms ease;
}

.about .fact-card.is-visible {
  opacity: 1;
  transform: translate(0, 0) scale(1) rotateX(0deg);
  animation: cardGlow 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardGlow {
  0% {
    box-shadow: 0 14px 32px rgba(2, 6, 23, 0.16), 0 4px 14px rgba(2, 6, 23, 0.10);
  }
  50% {
    box-shadow: 0 18px 36px rgba(59, 130, 246, 0.12), 
                0 14px 32px rgba(2, 6, 23, 0.16), 
                0 4px 14px rgba(2, 6, 23, 0.10);
  }
  100% {
    box-shadow: 0 14px 32px rgba(2, 6, 23, 0.16), 0 4px 14px rgba(2, 6, 23, 0.10);
  }
}

/* Анимация внутренних элементов при появлении */
.about .fact-card .fact-card__body {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--delay, 0ms) + 200ms);
}

.about .fact-card.is-visible .fact-card__body {
  opacity: 1;
  transform: translateY(0);
}

.about .fact-card .fact-card__title {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--delay, 0ms) + 300ms);
}

.about .fact-card.is-visible .fact-card__title {
  opacity: 1;
  transform: translateY(0);
}

.about .fact-card .fact-card__badge {
  opacity: 0;
  transform: translateY(-4px) scale(0.9);
  transition: opacity 500ms cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
  transition-delay: calc(var(--delay, 0ms) + 150ms);
}

.about .fact-card.is-visible .fact-card__badge {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: badgePulse 3s ease-in-out infinite;
  animation-delay: calc(var(--delay, 0ms) + 500ms);
}

.about .fact-card[data-enter="left"] { 
  --enter-x: -32px; 
  --enter-y: 0; 
  --enter-rotate-x: 8deg;
}
.about .fact-card[data-enter="right"] { 
  --enter-x: 32px; 
  --enter-y: 0; 
  --enter-rotate-x: -8deg;
}
.about .fact-card[data-enter="top"] { 
  --enter-x: 0; 
  --enter-y: -32px; 
  --enter-rotate-x: 0deg;
}
.about .fact-card[data-enter="bottom"] { 
  --enter-x: 0; 
  --enter-y: 32px; 
  --enter-rotate-x: 0deg;
}

.about .fact-card .fact-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.about .fact-card.no-icon .fact-card__header { display: none; }

.about .fact-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.22);
}

.about .fact-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.25px;
  font-weight: 700;
  color: #0b1020;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.2), inset 0 0 0 1px rgba(15, 23, 42, 0.06);
  transition: opacity 500ms cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 500ms cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 300ms ease,
              background 300ms ease;
  z-index: 2;
  /* Анимация badgePulse запускается только после появления карточки */
  animation: none;
}

@keyframes badgePulse {
  0%, 100% {
    box-shadow: 0 6px 18px rgba(2, 6, 23, 0.2), inset 0 0 0 1px rgba(15, 23, 42, 0.06);
    transform: translateY(0) scale(1);
  }
  50% {
    box-shadow: 0 7px 20px rgba(2, 6, 23, 0.24), inset 0 0 0 1px rgba(15, 23, 42, 0.07);
    transform: translateY(-1px) scale(1.01);
  }
}

.about .fact-card__body {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  /* Анимация появления уже определена выше */
}

/* Позиционирование текста относительно всей карточки */
.about .fact-card[class*="text-position-"] .fact-card__body {
  position: absolute !important;
  width: var(--fact-card-content-width);
  max-width: var(--fact-card-content-width);
  height: auto !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  top: var(--fact-card-text-top, var(--fact-card-padding-top)) !important;
  bottom: var(--fact-card-text-bottom, auto) !important;
  left: var(--fact-card-text-left, var(--fact-card-padding-left)) !important;
  right: var(--fact-card-text-right, auto) !important;
  transform: translate(
    var(--fact-card-text-translate-x, 0),
    var(--fact-card-text-translate-y, 0)
  ) !important;
  text-align: var(--fact-card-text-align, left) !important;
}

/* Карточки с текстом сверху убирают верхний внутренний отступ */
.about .fact-card.text-position-left-top,
.about .fact-card.text-position-center-top,
.about .fact-card.text-position-right-top {
  padding-top: 0 !important;
}

/* Карточки с текстом снизу убирают нижний внутренний отступ */
.about .fact-card.text-position-left-bottom,
.about .fact-card.text-position-center-bottom,
.about .fact-card.text-position-right-bottom {
  padding-bottom: 0 !important;
}

.about .fact-card__title {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.2px;
  line-height: 1.1;
  transition: transform 450ms cubic-bezier(0.34, 1.56, 0.64, 1),
              color 300ms ease;
  box-sizing: border-box;
}

/* RichText может генерировать <p> внутри заголовка, убираем их внешние отступы */
.about .fact-card .fact-card__title p {
  margin: 0;
  display: inline;
}

/* Использование CSS переменной для размера шрифта из админки */
/* Размер адаптируется пропорционально как размеру экрана, так и размеру карточки */
/* Если переменная --fact-card-font-size задана, она переопределяет базовые размеры */
/* Важно: применяем к span и другим элементам внутри заголовка, чтобы переопределить inline стили */

/* Базовые стили для карточек с кастомным размером */
/* Текст масштабируется пропорционально размеру карточки (которая уменьшается пропорционально viewport) */
.about .fact-card[style*="--fact-card-font-size"] .fact-card__title,
.about .fact-card[style*="--fact-card-font-size"] .fact-card__title {
  font-size: calc(var(--fact-card-font-size) * var(--fact-card-font-scale, 1));
  line-height: 1.1;
  max-width: 100%;
  overflow-wrap: break-word;
}

/* Базовые размеры для карточек без кастомного размера из админки */
.about .fact-card.size-l .fact-card__title { font-size: 28px; }
.about .fact-card.size-m .fact-card__title { font-size: 22px; }
.about .fact-card.size-s .fact-card__title { font-size: clamp(16px, 2vw, 22px); }

/* Индивидуальные настройки для каждой карточки */

/* Карточка "Более 4000 клиентов" */
.about .fact-card.fact-card--clients .fact-card__title { 
  font-size: 53px; 
  color: #ffffff; 
}

/* Стилизация текста в карточке клиентов (обводка и тень) */
.about .fact-card.fact-card--clients .fact-card__text { 
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.3);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

/* Стилизация цифры "4000" в карточке клиентов */
.about .fact-card.fact-card--clients .fact-card__number { 
  color: #2563eb;
  font-weight: 900;
  -webkit-text-stroke: none;
  filter: none;
  display: inline-block;
  transition: transform 500ms cubic-bezier(0.23, 1, 0.32, 1),
              color 400ms ease,
              text-shadow 400ms ease;
}

/* Анимация числа при hover на карточку */
.about .fact-card.fact-card--clients:hover .fact-card__number {
  transform: scale(1.1) translateY(-2px);
  color: #3b82f6;
  text-shadow: 0 2px 12px rgba(37, 99, 235, 0.3),
               0 0 20px rgba(59, 130, 246, 0.2);
}

/* Карточка "Работаем с 2001 года" */
.about .fact-card.fact-card--worksince .fact-card__title { 
  font-size: 65px; 
  color: #ffffff; 
}

/* Выравнивание текста в верхней части карточки "Работаем с 2001 года" */
.about .fact-card.fact-card--worksince {
  justify-content: flex-start;
  align-items: flex-start;
  padding-top: 20px;
}

/* Карточка "Сотрудничаем с Касперским" */
.about .fact-card.fact-card--kaspersky .fact-card__title { 
  font-size: 66px; 
  color: #ffffff; 
}

/* Карточка "Качество обслуживания" */
.about .fact-card.fact-card--quality .fact-card__title { 
  font-size: 28px; 
  color: #000000a1;
}

/* Карточка "Самые низкие цены" */
.about .fact-card.fact-card--lowprices .fact-card__title { 
  font-size: 22px; 
  color: #ffffff; 
}

/* Карточка "Телефония" */
.about .fact-card.fact-card--telephony .fact-card__title { 
  font-size: 28px; 
  color: #ffffff; 
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.3);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

/* Карточка "Хостинг" */
.about .fact-card.fact-card--hosting .fact-card__title { 
  font-size: 52px; 
  color: #ffffff; 
}

/* Дополнительные правила для карточек без специальных классов */

/* Карточка с МТС (позиция d в grid) */
.about .fact-card[style*="grid-area: d"] .fact-card__title { 
  font-size: 51px; 
  color: #ffffff; 
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.3);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

/* Карточка "IP-телевидение" (позиция f в grid) */
.about .fact-card[style*="grid-area: f"] .fact-card__title { 
  font-size: 22px; 
  color: #ffffff; 
}

/* Карточка "Оперативная телеграм поддержка" (позиция g в grid) */
.about .fact-card[style*="grid-area: g"] .fact-card__title { 
  font-size: 20px; 
  color: #ffffff; 
}

/* Restrained palette: brand blue, ink, neutral slate */
.about .fact-card.gradient-blue { --card-fg: #ffffff; --card-bg: radial-gradient(160% 120% at 0% 0%, var(--primary-600, #1d4ed8) 0%, var(--primary, #2563eb) 50%, #3b82f6 100%); }
.about .fact-card.gradient-ink { --card-fg: #ffffff; --card-bg: radial-gradient(140% 110% at 0% 0%, #0b1020 0%, #111827 50%, #1f2937 100%); }
.about .fact-card.gradient-slate { --card-fg: #0b1020; --card-bg: linear-gradient(180deg, #ffffff 0%, #f8fafc 60%, #eef2f7 100%); }
.about .fact-card.fact-card--kaspersky,
.about .fact-card.fact-card--clients,
.about .fact-card.fact-card--worksince,
.about .fact-card.fact-card--telephony,
.about .fact-card.fact-card--mtspartnership,
.about .fact-card.fact-card--iptv,
.about .fact-card.fact-card--fastsupport,
.about .fact-card.fact-card--lowprices,
.about .fact-card.fact-card--quality,
.about .fact-card.fact-card--hosting {
  --card-fg: #ffffff;
}

/* Стилизация бейджа МТС - красный цвет */
.about .fact-card.fact-card--mtspartnership .fact-card__badge {
  color: #ffffff;
  background: #dc2626; /* красный цвет */
  font-weight: 700;
}

/* Стилизация слова "МТС" в тексте - красный цвет */
.about .fact-card.fact-card--mtspartnership .fact-card__highlight {
  color: #dc2626; /* красный цвет */
  font-weight: 900;
  display: inline-block;
  transition: transform 500ms cubic-bezier(0.23, 1, 0.32, 1),
              color 400ms ease,
              text-shadow 400ms ease;
}

/* Анимация МТС при hover */
.about .fact-card.fact-card--mtspartnership:hover .fact-card__highlight {
  transform: scale(1.06) translateY(-1px);
  color: #ef4444;
  text-shadow: 0 2px 12px rgba(220, 38, 38, 0.3),
               0 0 20px rgba(239, 68, 68, 0.2);
}

/* Desktop placements are defined via grid-template-areas above. */

/* Large screens adjustments */
@media (min-width: 1440px) {
  .about .facts-grid { grid-auto-rows: 130px; gap: 20px; }
  .about .fact-card.size-l .fact-card__title { font-size: 30px; }
  
  /* Индивидуальные размеры для больших экранов */
  .about .fact-card.fact-card--clients .fact-card__title { font-size: 53px; }
  .about .fact-card.fact-card--worksince .fact-card__title { font-size: 65px; }
  .about .fact-card.fact-card--kaspersky .fact-card__title { font-size: 66px; }
  .about .fact-card.fact-card--quality .fact-card__title { font-size: 30px; }
  .about .fact-card.fact-card--lowprices .fact-card__title { font-size: 44px;
    -webkit-text-stroke: 1.2px rgba(255, 255, 255, 0.3);
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));}
  .about .fact-card.fact-card--telephony .fact-card__title { 
    font-size: 30px; 
    -webkit-text-stroke: 1.2px rgba(255, 255, 255, 0.3);
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));
  }
  .about .fact-card.fact-card--hosting .fact-card__title { font-size: 52px; }
  .about .fact-card[style*="grid-area: d"] .fact-card__title { font-size: 51px; }
  .about .fact-card[style*="grid-area: f"] .fact-card__title { font-size: 52px; }
  .about .fact-card[style*="grid-area: g"] .fact-card__title { font-size: 40px;
    -webkit-text-stroke: 1.2px rgba(255, 255, 255, 0.3);
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));}
  
  /* Стилизация текста для больших экранов */
  .about .fact-card.fact-card--clients .fact-card__text { 
    -webkit-text-stroke: 1.2px rgba(255, 255, 255, 0.3);
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.5));
  }
  
  /* Стилизация цифры "4000" для больших экранов */
  .about .fact-card.fact-card--clients .fact-card__number { 
    color: #2563eb; 
    font-weight: 900;
    -webkit-text-stroke: none;
    filter: none;
  }
  
  /* Выравнивание текста в верхней части для больших экранов */
  .about .fact-card.fact-card--worksince {
    justify-content: flex-start;
    align-items: flex-start;
    padding-top: 22px;
  }
}

/* Tablets in landscape orientation (1025px - 1366px) */
@media (min-width: 1025px) and (max-width: 1366px) {
  .about .facts-cloud {
    padding: clamp(12px, 2vw, 20px) 0;
  }
  
  .about .facts-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: minmax(var(--facts-grid-row-size), auto);
    gap: var(--facts-grid-gap-size);
    align-items: stretch;
    /* grid-template-areas удалено - теперь используется динамическое размещение через grid-row и grid-column */
  }
  
  .about .fact-card {
    --fact-card-padding-top: clamp(14px, 2vw, 20px);
    --fact-card-padding-right: clamp(16px, 2.5vw, 22px);
    --fact-card-padding-bottom: clamp(16px, 2.5vw, 22px);
    --fact-card-padding-left: clamp(16px, 2.5vw, 22px);
    border-radius: 16px;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow: hidden;
  }
  
  .about .fact-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    width: 100%;
    min-height: 0;
  }
  
  .about .fact-card__title {
    max-width: 100%;
    white-space: normal;
    word-break: normal; /* Не разрывать слова (стандартное поведение для русского) */
    overflow-wrap: normal; /* Перенос только между словами, не разрывать слова */
  }
  
  .about .fact-card.size-l .fact-card__title { 
    font-size: clamp(20px, 2.5vw, 28px); 
    line-height: 1.15;
  }
  .about .fact-card.size-m .fact-card__title { 
    font-size: clamp(18px, 2.2vw, 24px); 
    line-height: 1.2;
  }
  .about .fact-card.size-s .fact-card__title { 
    font-size: clamp(16px, 2vw, 22px); 
    line-height: 1.25;
  }
  
  /* Индивидуальные адаптивные размеры для планшетов в альбомной ориентации */
  /* Карточка "Более 4000 клиентов" (a) - большая карточка */
  .about .fact-card.fact-card--clients .fact-card__title { 
    font-size: clamp(28px, 3.5vw, 42px); 
    line-height: 1.15;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
  }
  .about .fact-card.fact-card--clients .fact-card__text { 
    font-size: clamp(20px, 2.5vw, 26px); /* Увеличен размер текста для лучшей читаемости */
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.4);
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    line-height: 1.4;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
    font-weight: 600; /* Немного увеличиваем жирность для лучшей читаемости */
  }
  .about .fact-card.fact-card--clients .fact-card__number { 
    color: #2563eb; 
    font-weight: 900;
    font-size: clamp(40px, 5vw, 56px); /* Увеличен для баланса с текстом */
    -webkit-text-stroke: none;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    text-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
    line-height: 1;
    display: inline-block;
    white-space: nowrap; /* Цифра не переносится */
  }
  
  /* Карточка "Работаем с 2001 года" (b) - средняя карточка */
  .about .fact-card.fact-card--worksince {
    justify-content: flex-start;
    align-items: flex-start;
    padding-top: clamp(16px, 2vw, 20px);
  }
  .about .fact-card.fact-card--worksince .fact-card__title { 
    font-size: clamp(24px, 3vw, 36px); 
    line-height: 1.15;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
  }
  
  /* Карточка "Касперский" (c) - маленькая карточка */
  .about .fact-card.fact-card--kaspersky .fact-card__title { 
    font-size: clamp(20px, 2.5vw, 30px); 
    line-height: 1.2;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
  }
  
  /* Карточка "МТС" (d) - средняя карточка */
  .about .fact-card[style*="grid-area: d"] .fact-card__title { 
    font-size: clamp(20px, 2.5vw, 30px); 
    line-height: 1.2;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.35);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
    text-shadow: 
      0 2px 10px rgba(0, 0, 0, 0.7),
      0 1px 5px rgba(0, 0, 0, 0.8),
      0 4px 14px rgba(0, 0, 0, 0.5);
  }
  
  /* Карточка "Качество обслуживания" (e) - большая карточка */
  .about .fact-card.fact-card--quality .fact-card__title { 
    font-size: clamp(22px, 2.8vw, 32px); 
    line-height: 1.2;
    color: #000000a1;
    text-shadow: none;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
  }
  
  /* Карточка "Самые низкие цены" (h) - средняя карточка */
  .about .fact-card.fact-card--lowprices .fact-card__title { 
    font-size: clamp(18px, 2.2vw, 26px); 
    line-height: 1.25;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
  }
  
  /* Карточка "Телефония" (i) - занимает 2 колонки из 12 (16.67% ширины grid) */
  /* Учитываем: ширина карточки = (2/12 * 100%) - gap - padding */
  /* Для узких карточек уменьшаем padding, чтобы дать больше места тексту */
  .about .fact-card.fact-card--telephony {
    padding: clamp(12px, 1.5vw, 18px) clamp(12px, 1.8vw, 18px); /* Уменьшен padding для узкой карточки */
  }
  .about .fact-card.fact-card--telephony .fact-card__title { 
    font-size: clamp(15px, 1.5vw, 19px); /* Еще уменьшен размер для узкой карточки (2 колонки) */
    line-height: 1.35;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.35);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
    text-shadow: 
      0 2px 10px rgba(0, 0, 0, 0.7),
      0 1px 5px rgba(0, 0, 0, 0.8),
      0 4px 14px rgba(0, 0, 0, 0.5);
    max-width: 100%;
    box-sizing: border-box;
  }
  
  /* Карточка "Хостинг" (j) - занимает 2 колонки из 12, но слово короче */
  .about .fact-card.fact-card--hosting .fact-card__title { 
    font-size: clamp(18px, 1.8vw, 24px); /* Немного меньше, так как карточка узкая (2 колонки) */
    line-height: 1.25;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
  }
  
  /* Карточка "IP-телевидение" (f) - средняя карточка */
  .about .fact-card.fact-card--iptv .fact-card__title { 
    font-size: clamp(18px, 2.2vw, 26px); 
    line-height: 1.25;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
  }
  
  /* Карточка "Оперативная поддержка" (g) - средняя карточка */
  .about .fact-card.fact-card--fastsupport .fact-card__title { 
    font-size: clamp(16px, 2vw, 24px); 
    line-height: 1.3;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
  }
  
  /* Улучшение читаемости текста для карточек с фоновыми изображениями */
  .about .fact-card.fact-card--worksince .fact-card__title,
  .about .fact-card.fact-card--kaspersky .fact-card__title,
  .about .fact-card.fact-card--iptv .fact-card__title,
  .about .fact-card.fact-card--fastsupport .fact-card__title,
  .about .fact-card.fact-card--lowprices .fact-card__title,
  .about .fact-card.fact-card--hosting .fact-card__title {
    text-shadow: 
      0 2px 8px rgba(0, 0, 0, 0.6),
      0 1px 4px rgba(0, 0, 0, 0.7),
      0 4px 12px rgba(0, 0, 0, 0.4);
  }

  /* Locale-safe wrapping for translated content on desktop/tablet landscape. */
  .about .facts-grid .fact-card .fact-card__title,
  .about .facts-grid .fact-card .fact-card__text {
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: auto;
  }
  
  /* Убираем затемнение от псевдоэлемента ::after на планшетах */
  .about .fact-card::after {
    display: none;
  }
  
  /* Убираем затемнение от псевдоэлемента ::before на планшетах */
  .about .fact-card::before {
    display: none;
  }
}

/* Tablet and mobile grid */
@media (max-width: 1024px) {
  .about .facts-cloud {
    width: 100%;
    margin-left: 0;
    padding: 10px 0 14px;
  }

  .about .facts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
    gap: clamp(12px, 2vw, 20px);
    max-width: min(100%, 980px);
    margin: 0 auto;
    /* grid-template-areas удалено - теперь используется динамическое размещение через grid-row и grid-column */
  }

  .about .fact-card {
    grid-row: auto !important;
    grid-column: auto !important;
    aspect-ratio: var(--fact-card-aspect, 1 / 1);
    min-height: 0;
    --fact-card-padding-top: clamp(0.9rem, 2.2vw, 1.2rem);
    --fact-card-padding-right: clamp(0.9rem, 2.1vw, 1.15rem);
    --fact-card-padding-bottom: clamp(1rem, 2.4vw, 1.3rem);
    --fact-card-padding-left: clamp(0.9rem, 2.1vw, 1.15rem);
    --fact-card-edge-gap: clamp(0.6rem, 1.6vw, 1rem);
    --fact-card-mobile-scale: 1;
    --fact-card-title-min: 1.2rem;
    --fact-card-title-max: 1.7rem;
    --fact-card-title-fluid: 2.4vw;
    --fact-card-title-lh: 1.18;
    --fact-card-text-min: 1rem;
    --fact-card-text-max: 1.3rem;
    --fact-card-text-fluid: 2.1vw;
    --fact-card-number-min: 1.8rem;
    --fact-card-number-max: 2.6rem;
    --fact-card-number-fluid: 3.6vw;
  }

  .about .fact-card.size-l {
    --fact-card-title-max: 1.85rem;
    --fact-card-number-max: 2.8rem;
  }
  .about .fact-card.size-s {
    --fact-card-title-max: 1.5rem;
    --fact-card-number-max: 2.3rem;
  }

  .about .fact-card__body {
    min-width: 0;
    width: 100%;
  }

  .about .fact-card__title {
    font-size: calc(clamp(var(--fact-card-title-min), var(--fact-card-title-fluid), var(--fact-card-title-max)) * var(--fact-card-mobile-scale, 1));
    line-height: var(--fact-card-title-lh);
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: auto;
    text-wrap: balance;
  }

  .about .fact-card[style*="--fact-card-font-size"] .fact-card__title,
  .about .fact-card[style*="--fact-card-font-size"] .fact-card__title {
    font-size: calc(clamp(var(--fact-card-title-min), var(--fact-card-title-fluid), var(--fact-card-title-max)) * var(--fact-card-mobile-scale, 1));
  }

  .about .fact-card__number {
    font-size: calc(clamp(var(--fact-card-number-min), var(--fact-card-number-fluid), var(--fact-card-number-max)) * var(--fact-card-mobile-scale, 1)) !important;
    line-height: 1;
  }

  .about .fact-card__text {
    font-size: calc(clamp(var(--fact-card-text-min), var(--fact-card-text-fluid), var(--fact-card-text-max)) * var(--fact-card-mobile-scale, 1)) !important;
    line-height: 1.2;
  }
  
  /* Индивидуальные размеры для планшетов */
  .about .fact-card.fact-card--telephony .fact-card__title { 
    text-shadow: 
      0 0 8px rgba(0, 0, 0, 0.8),
      0 0 16px rgba(0, 0, 0, 0.6),
      0 0 24px rgba(0, 0, 0, 0.4),
      2px 2px 4px rgba(0, 0, 0, 0.9);
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.3);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
  }
  
  /* Стилизация цифры "4000" для планшетов */
  .about .fact-card.fact-card--clients .fact-card__number { 
    color: #2563eb; 
    font-weight: 900;
  }
  
  /* Выравнивание текста в верхней части для планшетов */
  .about .fact-card.fact-card--worksince {
    justify-content: flex-start;
    align-items: flex-start;
    padding-top: 18px;
  }
}

@media (max-width: 599px) {
  .about .facts-grid {
    grid-template-columns: 1fr;
    max-width: min(100%, 560px);
  }

  .about .fact-card {
    --fact-card-padding-top: clamp(1rem, 3.2vw, 1.4rem);
    --fact-card-padding-right: clamp(0.95rem, 3vw, 1.3rem);
    --fact-card-padding-bottom: clamp(1.05rem, 3.4vw, 1.45rem);
    --fact-card-padding-left: clamp(0.95rem, 3vw, 1.3rem);
    --fact-card-edge-gap: clamp(0.7rem, 2.4vw, 1.1rem);
    --fact-card-mobile-scale: 1;
    --fact-card-title-min: 1.5rem;
    --fact-card-title-max: 2.35rem;
    --fact-card-title-fluid: 5.4vw;
    --fact-card-title-lh: 1.22;
    --fact-card-text-min: 1.15rem;
    --fact-card-text-max: 1.55rem;
    --fact-card-text-fluid: 3.8vw;
    --fact-card-number-min: 2.3rem;
    --fact-card-number-max: 3.7rem;
    --fact-card-number-fluid: 8vw;
  }

  .about .fact-card.size-l {
    --fact-card-title-max: 2.55rem;
    --fact-card-number-max: 4rem;
  }

  .about .fact-card.size-s {
    --fact-card-title-max: 2.05rem;
    --fact-card-number-max: 3.1rem;
  }
}

/* Mobile grid */
@media (max-width: 768px) {
  .about .facts-cloud { padding: 4px 0 8px; }
  .about .fact-card { 
    /* Уменьшенные анимации для мобильных */
    transition: transform 600ms cubic-bezier(.22,.78,.16,.95), opacity 600ms cubic-bezier(.22,.78,.16,.95), box-shadow 200ms ease, border-color 200ms ease;
  }
  
  .about .fact-card:hover {
    transform: scale(1.01);
    transition: transform 250ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
  .about .fact-card.fact-card--telephony .fact-card__title { 
    text-shadow: 
      0 0 6px rgba(0, 0, 0, 0.8),
      0 0 12px rgba(0, 0, 0, 0.6),
      0 0 18px rgba(0, 0, 0, 0.4),
      1px 1px 3px rgba(0, 0, 0, 0.9);
    -webkit-text-stroke: 0.8px rgba(255, 255, 255, 0.3);
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5));
  }
  
  /* Стилизация текста для мобильных устройств */
  .about .fact-card.fact-card--clients .fact-card__text { 
    -webkit-text-stroke: 0.8px rgba(255, 255, 255, 0.3);
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5));
  }
  
  /* Стилизация цифры "4000" для мобильных устройств */
  .about .fact-card.fact-card--clients .fact-card__number { 
    color: #2563eb; 
    font-weight: 900;
    -webkit-text-stroke: none;
    filter: none;
  }
  
  /* Выравнивание текста в верхней части для мобильных устройств */
  .about .fact-card.fact-card--worksince {
    justify-content: flex-start;
    align-items: flex-start;
    padding-top: 16px;
  }
}

@media (max-width: 480px) {
  .about .fact-card { 
    /* Еще более мягкие анимации для маленьких экранов */
    transition: transform 500ms cubic-bezier(.22,.78,.16,.95), opacity 500ms cubic-bezier(.22,.78,.16,.95), box-shadow 150ms ease, border-color 150ms ease;
  }
  
  .about .fact-card:hover {
    transform: scale(1.005);
    transition: transform 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .about .fact-card:hover {
    transform: none;
    box-shadow: var(--card-shadow);
    border-color: transparent;
  }
  
  .about .fact-card:active {
    transform: translate(0, -2px) scale(1.005);
    box-shadow: 0 20px 40px rgba(2, 6, 23, 0.2), 0 6px 18px rgba(2, 6, 23, 0.12);
    transition: transform 150ms ease, box-shadow 150ms ease;
  }
}

/* Accessibility: reduce motion */
@media (prefers-reduced-motion: reduce) {
  .about .fact-card { 
    transition: none; 
    transform: none !important; 
    opacity: 1 !important; 
    animation: none !important;
    filter: none !important;
  }
  .about .fact-card::before,
  .about .fact-card::after,
  .about .fact-card__badge,
  .about .fact-card__title,
  .about .fact-card__body,
  .about .fact-card__number,
  .about .fact-card__highlight {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

