/* ===========================================================================
   Platform section — единая цифровая сеть фулфилмента
   Темный фон, большой заголовок, MacBook мокап, glow эффект.
   Размер: 1920x1212px (desktop), без вертикальных отступов на корне.
   =========================================================================== */

.platform {
  position: relative;
  width: 100%;
  max-width: 1920px;
  height: 1212px;
  margin-inline: auto;
  background: var(--bg-dark-primary);
  padding-inline: var(--container-pad);
  padding-block: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: center;
  justify-content: flex-start;
  color: var(--text-constant-light);
}

/* --- Background layer ---------------------------------------------------- */

.platform__bg {
  /* Экспорт узла platform-bg уже обрезан Figma по секции, поэтому слой
     кладём ровно на неё. Прозрачность (0.7 узла x 0.6 заливки = 0.42)
     запечена в альфу PNG — в CSS opacity: 1. */
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.platform__bg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  max-width: none;
}

/* --- Glow effect layer --------------------------------------------------- */

.platform__glow {
  position: absolute;
  top: calc(50% + 365.5px);
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(1587px, 90vw);
  height: auto;
  aspect-ratio: 1587 / 1145;
  pointer-events: none;
  z-index: 1;
}

.platform__glow-svg {
  width: 100%;
  height: 100%;
  filter: blur(60px);
  opacity: 0.7;
}

/* --- Main content wrapper ------------------------------------------------ */

.platform__content {
  position: relative;
  z-index: 2;
  width: 1652px;
  margin-top: 44px;
  display: flex;
  flex-direction: column;
  gap: 48px;
  align-items: center;
  justify-content: flex-start;
}

/* --- Text block ---------------------------------------------------------- */

.platform__text {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  justify-content: center;
  width: 1136px;
}

/* Badge styling override for platform (matches Figma exactly) */
.platform__text .badge {
  padding: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 24px;
  font-weight: var(--weight-500);
}

.platform__title {
  font-weight: var(--weight-500);
  font-size: 64px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-align: center;
  color: var(--text-constant-light);
  margin: 0;
  width: 1136px;
}

.platform__title-line {
  display: block;
}

.platform__lead {
  width: 895px;
  font-size: 24px;
  line-height: 1.5;
  font-weight: var(--weight-400);
  text-align: center;
  color: var(--text-constant-light);
}

/* Button styling for platform (matches Figma exactly) */
.platform .btn--xl {
  width: 423px;
  height: 61px;
  padding: 16px 24px;
  font-size: 24px;
}

/* --- MacBook device ----------------------------------------------------- */

.platform__device {
  /* В макете артборд мокапа 1328x862 стоит на 296,354 внутри секции 1920x1212
     и снизу срезается её краем (354+862=1216 > 1212). Поэтому позиционируем
     абсолютно и в процентах, чтобы пропорция сохранялась на любой ширине. */
  /* В макете мокап — последний слой, он перекрывает свечение.
     Без z-index свечение (z-index:1) ложилось поверх ноутбука. */
  z-index: 3;
  position: absolute;
  left: 15.4167%;   /* 296 / 1920  */
  top: 29.2079%;    /* 354 / 1212  */
  width: 69.1667%;  /* 1328 / 1920 */
  height: auto;
  display: block;
  pointer-events: none;
}

/* ===========================================================================
   Адаптив: брейкпоинты 1440 / 1024 / 768 / 480
   =========================================================================== */

@media (max-width: 1440px) {
  .platform {
    height: auto;
    padding-inline: var(--container-pad);
  }

  .platform__content {
    width: 100%;
  }

  .platform__text {
    width: 100%;
    max-width: 1136px;
  }

  .platform__title {
    font-size: clamp(40px, 2.9167vw, 56px);
    width: 100%;
    max-width: 1136px;
  }

  .platform__lead {
    width: 100%;
    max-width: 895px;
    font-size: clamp(16px, 1.25vw, 24px);
  }

  .platform .btn--xl {
    width: min(423px, 90vw);
    font-size: clamp(24px, 2vw, 24px);
  }

  .platform__device {
    width: min(900px, 85vw);
    height: auto;
    aspect-ratio: 1019 / 660;
  }

  .platform__bg {
  /* Экспорт узла platform-bg уже обрезан Figma по секции, поэтому слой
     кладём ровно на неё. Прозрачность (0.7 узла x 0.6 заливки = 0.42)
     запечена в альфу PNG — в CSS opacity: 1. */
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

  .platform__glow {
    width: min(1200px, 85vw);
  }
}







/* ===========================================================================
   Dark theme support (if needed in future)
   =========================================================================== */

@media (prefers-color-scheme: dark) {
  .platform {
    background: var(--bg-dark-primary);
    color: var(--text-constant-light);
  }
}

/* ============================================================================
   Планшет (≤1024) — узел 526:1679: секция 768x874 на всю ширину, r24,
   контент в потоке: бейдж 18, заголовок 40, лид 18 сплошной белый,
   кнопка 423x54 (18px), макбук 620px по центру.
   ============================================================================ */

@media (max-width: 1199px) {
  /* В ассете текстуры на x13-17 чёрный шов; на планшете он попадал на
     левый край секции — сдвигаем срез за кадр */
  .platform__bg img {
    margin-left: -18px;
    width: calc(1920px + 18px);
  }

  .platform {
    max-width: none;
    height: 874px;
    border-radius: 24px;
    overflow: hidden;
    padding: 44px 32px;
  }

  .platform__content {
    width: 100%;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 48px;
  }

  .platform__text { gap: 16px; }

  .platform__text .badge {
    font-size: 18px;
    letter-spacing: -0.01em;
  }

  .platform__title { font-size: 40px; }

  .platform__lead {
    font-size: 18px;
    line-height: 1.5;
    color: var(--text-constant-light); /* на планшете лид сплошной белый */
  }

  .platform .btn--xl {
    width: 423px;
    max-width: 100%;
    height: 54px;
    padding: 16px 24px;
    border-radius: var(--radius-m);
    font-size: 18px;
    font-weight: var(--weight-500);
  }

  /* Экранная графика мокапа больше рамки инстанса: RECT 809x524 при
     инстансе 620x402. Видимый макбук в макете — 809px с центром секции,
     верх на 311; низ и бока режутся секцией. */
  .platform__device {
    position: absolute;
    top: 311px;
    left: 50%;
    width: 809px;
    max-width: none;
    height: auto;
    margin-left: -404.5px;
    z-index: 3;
  }

  /* Эллипс свечения в макете: 1587x1145 на (-398, 230) — без vw-сжатия */
  .platform__glow {
    top: 230px;
    bottom: auto;
    left: -398px;
    transform: none;
    width: 1587px;
    height: 1145px;
    max-width: none;
  }

  /* Текстура в макете лежит слева (RECT 1920px с x:0), не по центру */
  .platform__bg img {
    width: 1920px;
    height: auto;
    max-width: none;
    object-fit: fill;
    object-position: left top;
  }
}

/* ===========================================================================
   Мобильный (≤767) — узел 529:4002: секция 381x663 на x:-3 (выпуск 3px),
   контент в потоке с padding 44/24, бейдж 248x29, заголовок 32px, лид 14px,
   кнопка 240x44, макбук 296x192.
   =========================================================================== */

@media (max-width: 767px) {
  /* Экранная графика мокапа: RECT 386x251 на x:-3 секции (узел 529:4012) */
  .platform__device {
    position: absolute;
    top: 373px;
    left: 50%;
    width: 386px;
    max-width: none;
    height: auto;
    margin-left: -193px;
    z-index: 3;
  }

  /* Лид переносится как в макете (бокс 333, метрики Chrome шире) */

  .platform {
    width: calc(100% + 6px);
    margin-inline: -3px;
    height: 663px;
    padding: 44px 24px 44px 24px;
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: center;
    justify-content: flex-start;
  }

  .platform__content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 333px;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: 48px;
    align-items: center;
    justify-content: flex-start;
  }

  .platform__text {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 16px;
    align-items: center;
    justify-content: center;
  }

  .platform__text .badge {
    font-size: 12px;
    letter-spacing: -0.01em;
    padding: 8px;
  }

  .platform__title {
    font-size: 32px;
    line-height: 1.1;
    letter-spacing: -0.03em;
    text-align: center;
    width: 100%;
    margin: 0;
  }

  .platform__lead {
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
    width: 100%;
    color: var(--text-constant-light);
  }

  .platform .btn--xl {
    width: 240px;
    height: 44px;
    padding: 8px 24px;
    font-size: 14px;
    border-radius: 12px;
  }

  /* Макбук 296x192 по центру, в потоке */

  /* Глоу-эллипс 1587x1145 на (-594, 125) отн. секции */
  .platform__glow {
    position: absolute;
    top: 125px;
    left: -594px;
    transform: none;
    width: 1587px;
    height: 1145px;
    max-width: none;
    z-index: 1;
  }

  /* Фон: RECT 996x661 на x:-310 */
  .platform__bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
  }

  .platform__bg img {
    display: block;
    width: 996px;
    height: 661px;
    object-fit: cover;
    margin-left: -310px;
    max-width: none;
  }
}

/* На промежуточных ширинах секция теряла высоту (1212 → 335): мокап
   позиционирован абсолютно и не давал высоты, поэтому «ноутбук» пропадал.
   Ставим его в поток — секция растёт по контенту. */
@media (min-width: 1200px) and (max-width: 1919px) {
  .platform {
    height: auto;
    padding-block: 80px;
  }

  .platform__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 48px;
    margin-top: 0;
  }

  .platform__device {
    position: relative;
    top: auto;
    left: auto;
    margin-left: 0;
    width: min(1328px, 100%);
    max-width: 100%;
    height: auto;
  }
}

/* Внутреннее поле полноширинной секции не меньше бокового поля страницы */
@media (min-width: 1200px) and (max-width: 1919px) {
  .platform {
    padding-inline: max(var(--page-gutter), 40px);
  }
}
