/* ==========================================================================
   Блок «Почему не возможно не сделать результат?» (по образцу chroniclehq.com)
   Десктоп: слева видео (новое въезжает снизу, старое уходит вверх), справа
   список-переключатель, под ним описание и полоса прогресса; по окончании
   полосы — следующий пункт. Мобильный: слайдер со стрелками и счётчиком 01 / 04.
   Логика — js/features.js. Размеры — в px макета, масштаб через --zoom.
   ========================================================================== */

.features {
  --w: 1200px;
  --gold: #ddd3b2;
  --duration: 10s; /* сколько показывается один пункт */
  background-color: #0c0d0e;
}

.features__canvas {
  width: var(--w);
  margin: 0 auto;
  padding: 100px 100px;
  zoom: var(--zoom);
}

.features__title {
  margin: 0;
  color: #fff;
  font-size: 40px;
  line-height: 40px;
  font-weight: 600;
  letter-spacing: -1.8px;
  text-align: center;
}
.features__subtitle {
  margin: 30px 0 0;
  color: #f5f5f5;
  font-size: 12px;
  line-height: 14px;
  letter-spacing: -0.6px;
  text-transform: uppercase;
  text-align: center;
}

/* ---------------------------------------------------------------- карточка */
.features__card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
  margin-top: 60px;
  padding: 32px;
  border-radius: 15px;
  background: linear-gradient(#212326, #17191b);
}

/* видео */
.features__media {
  position: relative;
  aspect-ratio: 458 / 360;
  overflow: hidden;
  border: 1px solid #303132;
  border-radius: 10px;
  background-color: #000;
}
.features__slide {
  position: absolute;
  inset: 0;
  z-index: 1;
  transform: translateY(100%);
}
.features__slide.is-active {
  z-index: 2;
  transform: translateY(0);
}
.features__slide.is-prev:not(.is-active) {
  z-index: 0;
  transform: translateY(-100%);
}
/* анимируются только въезжающий и уезжающий слайды */
.features__slide.is-active,
.features__slide.is-prev {
  transition: transform .4s cubic-bezier(.41, .66, .36, .86);
}
.features__player { width: 100%; height: 100%; }
.features__slide iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
/* пока смотрят видео — полоса прогресса стоит */
.features__card.is-watching .features__progress-bar { animation-play-state: paused; }

/* переключатели */
.features__content {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.features__nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.features__tab {
  padding: 0;
  border: 0;
  background: none;
  color: rgba(245, 245, 245, .35);
  font-family: inherit;
  font-size: 30px;
  line-height: 33px;
  font-weight: 600;
  letter-spacing: -1.5px;
  text-align: left;
  white-space: nowrap; /* названия — в одну строку */
  cursor: pointer;
  transition: color .4s;
}
.features__tab.is-active { color: var(--gold); }

.features__controls { display: none; }

/* описание: все пункты в одной ячейке, виден активный */
.features__copy {
  position: absolute;
  bottom: 24px; /* отступ от полосы прогресса */
  left: 0;
  display: grid;
  width: 100%;
}
.features__item {
  grid-area: 1 / 1;
  align-self: end;
  opacity: 0;
  transition: opacity .6s;
}
.features__item.is-active { opacity: 1; }
.features__item-title { display: none; }
.features__item-text {
  margin: 0;
  color: #fff;
  font-size: 13px;
  line-height: 16px;
  letter-spacing: -0.4px;
}

/* прогресс */
.features__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  overflow: hidden;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, .15);
}
.features__progress-bar {
  display: block;
  width: 0;
  height: 100%;
  background-color: var(--gold);
  animation: features-progress var(--duration) linear forwards;
}
.features__card.is-paused .features__progress-bar { animation-play-state: paused; }

@keyframes features-progress {
  from { width: 0; }
  to   { width: 100%; }
}

/* ---------------------------------------------------------------- мобильный */
@media (max-width: 959px) {
  .features { --w: 320px; }
  .features__canvas { padding: 70px 10px 60px; }
  .features__title { font-size: 26px; line-height: 26px; letter-spacing: -1.5px; text-align: left; }
  .features__subtitle { width: 230px; margin-top: 16px; font-size: 9px; line-height: 11px; letter-spacing: -0.3px; text-align: left; }

  .features__card {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 30px;
    padding: 14px;
    border-radius: 10px;
  }

  /* слайды листаются вбок; при движении назад — с другой стороны */
  .features__slide { transform: translateX(100%); }
  .features__slide.is-active { transform: translateX(0); }
  .features__slide.is-prev:not(.is-active) { transform: translateX(-100%); }
  .features__card.is-back .features__slide:not(.is-active) { transform: translateX(-100%); }
  .features__card.is-back .features__slide.is-prev:not(.is-active) { transform: translateX(100%); }

  .features__content { gap: 16px; }
  .features__nav { display: none; }

  .features__controls {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .features__counter {
    margin-right: auto;
    color: rgba(245, 245, 245, .35);
    font-size: 16px;
    line-height: 16px;
    font-weight: 600;
    letter-spacing: -0.8px;
    font-variant-numeric: tabular-nums;
  }
  .features__counter span { color: var(--gold); }
  .features__arrow {
    position: relative;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background-color: #2b2f33;
    cursor: pointer;
  }
  .features__arrow::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 7px;
    height: 7px;
    border-top: 1.5px solid #f5f5f5;
    border-right: 1.5px solid #f5f5f5;
    transform: translate(-65%, -50%) rotate(45deg);
  }
  .features__arrow--prev::before { transform: translate(-35%, -50%) rotate(-135deg); }

  .features__copy { position: static; }
  .features__item { align-self: start; }
  .features__item-title {
    display: block;
    margin: 0 0 10px;
    color: var(--gold);
    font-size: 20px;
    line-height: 20px;
    font-weight: 600;
    letter-spacing: -0.8px;
  }
  .features__item-text { font-size: 11px; line-height: 13px; }

  .features__progress { position: static; margin-top: 8px; }
}
