/* ==========================================================================
   Блок «Сейчас ты на одном из этих уровней»
   Десктоп: блок закрепляется на экране, скролл двигает ряд карточек вбок,
   карточки опускаются и наклоняются по мере удаления от центра (js/levels.js).
   Мобильный: карточки обычным списком друг под другом.
   Размеры — в px макета, весь блок масштабируется через --zoom, как остальные.
   ========================================================================== */

.levels {
  --w: 1200px;
  --gold: #ddd3b2;
  --card-w: 340px;
  --card-h: 450px;
  --gap: 60px;
  position: relative;
  height: calc(100vh + var(--levels-scroll, 0px)); /* длина прокрутки, считает js */
  background-color: #0c0d0e;
}

.levels__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.levels__canvas {
  position: relative;
  width: var(--w);
  height: calc(100vh / var(--zoom));
  margin: 0 auto;
  zoom: var(--zoom);
}

/* ---------------------------------------------------------------- заголовок */
.levels__head {
  position: absolute;
  top: 90px;
  left: 100px;
  width: 490px;
}
.levels__title {
  width: 380px;
  margin: 0;
  color: #fff;
  font-size: 40px;
  line-height: 40px;
  font-weight: 600;
  letter-spacing: -1.8px;
}
.levels__subtitle {
  margin: 30px 0 0;
  color: #f5f5f5;
  font-size: 12px;
  line-height: 14px;
  letter-spacing: -0.6px;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------- лента */
.levels__track {
  position: absolute;
  top: calc(50% + 30px);
  left: 0;
  z-index: 2;
  display: flex;
  gap: var(--gap);
  padding: 0 100px 0 600px;
  translate: var(--levels-x, 0) -50%;
  will-change: translate;
}

.level-card {
  flex: none;
  width: var(--card-w);
  height: var(--card-h);
}

.level-card__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 30px;
  border: 1px solid #303132;
  border-radius: 15px;
  background-color: #212326;
  transform-origin: center;
  will-change: transform;
}

.level-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.level-card__icon { display: block; width: 30px; height: 30px; }
.level-card__num {
  color: rgba(245, 245, 245, .4);
  font-size: 12px;
  line-height: 14px;
  letter-spacing: -0.3px;
}

.level-card__title {
  margin: 26px 0 0;
  color: var(--gold);
  font-size: 28px;
  line-height: 28px;
  font-weight: 600;
  letter-spacing: -1.2px;
}
.level-card__desc {
  margin: 14px 0 0;
  color: #fff;
  font-size: 13px;
  line-height: 16px;
  letter-spacing: -0.4px;
}

.level-card__quote {
  margin: auto 0 0;
  padding: 16px 18px;
  border-radius: 10px;
  background-color: #2b2f33;
  color: #fff;
  font-size: 12px;
  line-height: 14px;
  letter-spacing: -0.4px;
}

.level-card__author {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #303132;
  border-radius: 10px;
  text-decoration: none;
}
.level-card__avatar {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #404447 center / cover no-repeat;
}
.level-card__name {
  flex: 1;
  color: var(--gold);
  font-size: 14px;
  line-height: 17px;
  font-weight: 600;
  letter-spacing: -0.4px;
}
.level-card__read {
  flex: none;
  padding: 8px 14px;
  border-radius: 100px;
  background-color: var(--gold);
  color: #2b2923;
  font-size: 12px;
  line-height: 14px;
  font-weight: 500;
  letter-spacing: -0.3px;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------- кнопка и прогресс */
/* кнопка записи — только на мобильном */
.levels__cta {
  display: none;
  align-items: center;
  justify-content: center;
  width: 300px;
  height: 70px;
  border-radius: 100px;
  background-color: var(--gold);
  color: #2b2923;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -0.4px;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color .2s ease-in-out;
}
.levels__cta:hover { background-color: #c4bda5; }

.levels__bar {
  position: absolute;
  left: 50%;
  bottom: calc(40px / var(--zoom)); /* 40px от низа экрана при любом масштабе */
  z-index: 3;
  width: 290px;
  height: 1px;
  translate: -50% 0;
  background-color: rgba(255, 255, 255, .15);
}
.levels__bar-fill {
  display: block;
  height: 100%;
  background-color: var(--gold);
  transform-origin: left center;
  transform: scaleX(var(--levels-progress, 0));
}

/* ---------------------------------------------------------------- мобильный */
@media (max-width: 959px) {
  .levels {
    --w: 320px;
    --card-w: auto;
    --card-h: auto;
    height: auto;
  }
  .levels__stage { position: static; height: auto; overflow: visible; }
  .levels__canvas { height: auto; padding: 70px 10px 60px; }

  .levels__head { position: static; width: 240px; }
  .levels__title { width: 240px; font-size: 26px; line-height: 26px; }
  .levels__subtitle { width: 230px; margin-top: 16px; font-size: 9px; line-height: 11px; letter-spacing: -0.3px; }

  .levels__track {
    position: static;
    flex-direction: column;
    gap: 20px;
    margin-top: 40px;
    padding: 0;
    translate: none;
  }
  /* мобильный: обычный список, без залипания */
  .level-card { position: static; }
  .level-card__inner { min-height: 320px; padding: 20px; border-radius: 10px; }

  .level-card__title { margin-top: 18px; font-size: 20px; line-height: 20px; letter-spacing: -0.8px; }
  .level-card__desc { margin: 10px 0 16px; font-size: 11px; line-height: 13px; }
  .level-card__quote { padding: 12px 14px; border-radius: 6px; font-size: 11px; line-height: 13px; }
  .level-card__author { gap: 10px; padding: 8px; border-radius: 6px; }
  .level-card__avatar { width: 30px; height: 30px; }
  .level-card__name { font-size: 12px; line-height: 14px; }
  .level-card__read { padding: 7px 12px; font-size: 10px; line-height: 12px; }
  .level-card__num { font-size: 10px; }

  .levels__cta { display: flex; width: 300px; height: 60px; margin-top: 30px; font-size: 10px; }
  .levels__bar { display: none; }
}
