.problem {
  margin-inline: calc(var(--space-page-x) * -1);
  background: var(--color-page);
  view-timeline-name: --problem;
  view-timeline-axis: block;
}

.problem__pin {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 32px;
  height: 100svh;
  padding: 88px 0 clamp(40px, 6svh, 72px);
  overflow: hidden;
}

.problem__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 48px;
  padding-inline: var(--space-page-x);
}

.problem__title {
  flex: 0 0 609px;
  max-width: 609px;
  color: #212121;
  font-size: 48px;
  line-height: 56px;
  letter-spacing: -0.03em;
}

.problem__title .problem__title-line {
  color: #212121;
  white-space: nowrap;
}

.problem__title span {
  color: #6d6d6d;
}

.problem__lead {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 732px;
  margin-top: 28px;
  color: #6d6d6d;
  font-size: 18px;
  font-weight: 400;
  line-height: 28px;
  letter-spacing: -0.02em;
}

.problem__viewport {
  flex: 1 1 375px;
  min-height: 0;
  max-height: 375px;
  margin-top: auto;
  container-type: inline-size;
  overflow: hidden;
}

.problem__track {
  display: flex;
  gap: 8px;
  width: max-content;
  height: 100%;
  max-height: 375px;
  padding-inline: var(--space-page-x);
}

@supports (animation-timeline: view()) {
  .problem {
    height: calc(100svh + 120vw);
  }

  .problem__track {
    animation: problem-slide linear both;
    animation-timeline: --problem;
    animation-range: contain 0% contain 100%;
  }
}

@keyframes problem-slide {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-100% + 100cqw)); }
}

.problem-card {
  display: flex;
  flex: 0 0 732px;
  flex-direction: column;
  justify-content: space-between;
  width: 732px;
  height: 100%;
  min-height: 0;
  padding: 32px;
  border-radius: 32px;
  background: #101010;
  position: relative;
  overflow: hidden;
}

.problem-card__copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: min(330px, 100%);
  height: 100%;
}

.problem-card h3 {
  color: #ffffff;
  font-family: var(--font-text);
  font-size: 24px;
  font-weight: 600;
  line-height: 32px;
  letter-spacing: 0;
}

.problem-card p {
  color: #6d6d6d;
  font-size: 18px;
  font-weight: 400;
  line-height: 28px;
  letter-spacing: -0.02em;
}

.problem__dots {
  display: none;
}

.problem-card__icon {
  position: absolute;
  top: 50%;
  right: 72px;
  width: 207px;
  height: auto;
  max-height: calc(100% - 24px);
  aspect-ratio: 1;
  transform: translateY(-50%);
  object-fit: contain;
  pointer-events: none;
}

@media (max-width: 900px) {
  .problem {
    height: auto;
  }

  .problem__pin {
    position: relative;
    height: auto;
    padding: 48px 0 32px;
    overflow: visible;
    gap: 32px;
  }

  .problem__head {
    flex-direction: column;
    gap: 16px;
    padding-inline: 24px;
  }

  .problem__title,
  .problem__lead {
    flex: 0 1 auto;
    min-width: 0;
    max-width: none;
  }

  .problem__title {
    font-size: 32px;
    line-height: 38px;
  }

  .problem__title .problem__title-line {
    white-space: normal;
  }

  .problem__lead {
    margin-top: 0;
    font-size: 16px;
    line-height: 24px;
  }

  .problem__viewport {
    flex: none;
    max-height: none;
    margin-top: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 24px;
    scrollbar-width: none;
  }

  .problem__viewport::-webkit-scrollbar {
    display: none;
  }

  .problem__track {
    animation: none;
    height: auto;
    max-height: none;
    padding-inline: 24px;
  }

  .problem-card {
    flex-basis: min(732px, calc(100vw - 72px));
    width: min(732px, calc(100vw - 72px));
    height: 320px;
    scroll-snap-align: start;
  }

  .problem-card__copy {
    width: 100%;
  }

  .problem-card h3 {
    max-width: calc(100% - 108px);
  }

  .problem-card__icon {
    top: 28px;
    right: 20px;
    width: 96px;
    height: 96px;
    transform: none;
  }

  .problem__dots {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-top: 16px;
  }

  .problem__dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: #d0d0d0;
    cursor: pointer;
  }

  .problem__dot.is-on {
    width: 48px;
    background: #212121;
  }
}

@media (max-height: 680px) and (min-width: 901px) {
  .problem__pin {
    gap: 12px;
    padding: 72px 0 12px;
  }

  .problem__lead {
    margin-top: 4px;
    font-size: 16px;
    line-height: 24px;
  }

  .problem-card {
    padding: 20px 24px;
  }
}

@media (max-height: 600px) and (min-width: 901px) {
  .problem__title {
    flex-basis: 480px;
    max-width: 480px;
    font-size: 36px;
    line-height: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .problem {
    height: auto;
  }

  .problem__pin {
    position: relative;
    height: auto;
  }

  .problem__track {
    animation: none;
    height: auto;
    max-height: none;
  }

  .problem__viewport {
    flex: none;
    max-height: none;
    margin-top: 0;
  }

  .problem-card {
    height: 375px;
  }

  .problem__viewport {
    overflow-x: auto;
  }
}
