/* Ширина наклейки со счётчиком: по макету, но не больше 300 px — дальше она наезжает на ручку */
.launch {
  --counter-w: min(calc(239 * var(--u)), 300px);
  padding-top: clamp(80px, calc(125 * var(--u)), 130px);
}

.launch__card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(40px, calc(59 * var(--u)), 80px) clamp(20px, calc(44 * var(--u)), 44px) clamp(40px, calc(55 * var(--u)), 60px);
  border-radius: clamp(64px, calc(105 * var(--u)), 105px);
  background: var(--color-black);
  box-shadow: inset 0 -14px 110px -11px var(--color-white);
  color: var(--color-bg);
}

/* Счётчик «21 325» — SVG по геометрии макета: внешняя обводка со скруглёнными углами,
   CSS-обводка текста давала острые шипы на «2» и «5». Верх наклейки выше карточки на 69 из 117 */
.launch__counter {
  position: absolute;
  top: calc(var(--counter-w) * -69 / 239);
  left: 50%;
  width: var(--counter-w);
  translate: -50% 0;
}

.launch__sticker {
  display: block;
  width: 100%;
  overflow: visible;
}

.launch__sticker-neck {
  fill: var(--color-bg);
  stroke: var(--color-black);
  stroke-width: 1px;
}

/* Обводка и заливка — два слоя <use>: Safari красит обводку и заливку SVG-текста по буквам,
   и обводка следующей буквы закрывает предыдущую. Шрифт задаём самим <use> — копии наследуют его */
.launch__sticker use {
  text-anchor: middle;
}

.launch__sticker-stroke {
  fill: var(--color-black);
  stroke: var(--color-black);
  stroke-linejoin: round;
}

.launch__sticker-fill {
  fill: var(--color-bg);
}

.launch__sticker-count {
  font-family: var(--font-display);
  font-size: 60px;
  font-weight: 500;
  letter-spacing: 0.6px;
}

.launch__sticker-label {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.32px;
}

.launch__sticker-stroke .launch__sticker-count {
  stroke-width: 26px;
}

.launch__sticker-stroke .launch__sticker-label {
  stroke-width: 16px;
}

.launch__switch {
  --drag: 0px;
  --progress: 0;
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 352 / 141;
  padding: 2.4%;
  border-radius: 999px;
  background: rgb(217 217 217 / 0.2);
  overflow: hidden;
  isolation: isolate;
}

/* Розовый след за ручкой при перетаскивании */
.launch__switch::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(90deg, rgb(255 36 134 / 0.1), rgb(255 36 134 / 0.85));
  opacity: var(--progress);
  clip-path: inset(0 calc(100% - var(--drag) - 36%) 0 0 round 999px);
}

.launch__knob {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  height: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #1c1c1c;
  box-shadow:
    inset 4.9px 4.9px 32.3px -4.9px var(--color-white),
    inset -8.8px -6.4px 22.5px -4.9px rgb(0 0 0 / 0.2),
    inset 2.4px 2.4px 19.6px -4.9px var(--color-white),
    inset -7.8px -6.4px 19.6px -4.9px rgb(0 0 0 / 0.2),
    0 13.7px 19.6px -11.7px rgb(0 0 0 / 0.5);
  cursor: grab;
  touch-action: none;
  transform: translateX(var(--drag));
  transition:
    transform 0.6s var(--ease-back),
    background-color 0.35s ease;
  animation: launch-nudge 3.2s var(--ease-in-out) 1.5s infinite;
}

.launch__switch_dragging .launch__knob {
  cursor: grabbing;
  transition: none;
  animation: none;
}

.launch__switch_done .launch__knob {
  background: var(--color-pink);
  animation: none;
}

.launch__knob-text {
  font-family: var(--font-display);
  font-size: clamp(24px, calc(33 * var(--u)), 40px);
  font-weight: 800;
  line-height: 1;
  color: rgb(255 255 255 / 0.3);
  transition: color 0.35s ease;
}

.launch__switch_done .launch__knob-text {
  color: var(--color-white);
}

.launch__track-arrow {
  position: absolute;
  top: 50%;
  left: 50.3%;
  width: 4.2%;
  translate: -50% -50%;
  animation: launch-arrow 1.8s var(--ease-in-out) infinite;
}

.launch__track-arrow img {
  width: 100%;
  transform: rotate(90deg);
}

.launch__track-text {
  position: absolute;
  padding-bottom: 0.25em;
  top: 50%;
  left: 65%;
  font-family: var(--font-display);
  font-size: clamp(18px, calc(25 * var(--u)), 30px);
  line-height: 0.96;
  letter-spacing: 0.01em;
  background: linear-gradient(90deg, rgb(255 255 255 / 0.12) 30%, rgb(255 255 255 / 0.55) 50%, rgb(255 255 255 / 0.12) 70%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  translate: 0 -50%;
  animation: launch-shine 2.6s linear infinite;
}

.launch__text {
  margin-top: clamp(22px, calc(32 * var(--u)), 36px);
  font-size: var(--fs-body);
  line-height: 1.25;
  letter-spacing: 0.02em;
  text-align: center;
}

@keyframes launch-nudge {
  0%,
  70%,
  100% {
    transform: translateX(var(--drag));
  }

  78% {
    transform: translateX(calc(var(--drag) + 14%));
  }

  86% {
    transform: translateX(var(--drag));
  }

  92% {
    transform: translateX(calc(var(--drag) + 6%));
  }
}

@keyframes launch-arrow {
  0%,
  100% {
    translate: -80% -50%;
    opacity: 0.6;
  }

  50% {
    translate: -20% -50%;
    opacity: 1;
  }
}

@keyframes launch-shine {
  from {
    background-position: 100% 0;
  }

  to {
    background-position: -150% 0;
  }
}

@media (min-width: 768px) {
  .launch {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0;
    background: none;
    box-shadow: none;
  }

  .launch__card {
    flex: 1;
    justify-content: center;
    padding-top: calc(32px + var(--counter-w) * 117 / 239 + 24px);
    border-radius: var(--radius-section);
  }

  .launch__counter {
    top: 32px;
  }
}
