:root {
  --story-progress: 0;
  --story-rail: rgba(139, 126, 255, .82);
}

.story-progress {
  position: fixed;
  z-index: 22;
  top: 50%;
  right: max(18px, calc((100vw - 1440px) / 2));
  display: grid;
  grid-template-columns: 2px auto;
  grid-template-rows: auto 1fr;
  gap: 12px 15px;
  width: 126px;
  padding: 14px 13px;
  border: 1px solid rgba(137, 153, 175, .15);
  border-radius: 18px;
  background: rgba(8, 16, 24, .68);
  box-shadow: 0 18px 55px rgba(0, 0, 0, .25);
  opacity: 0;
  pointer-events: none;
  transform: translate(16px, -50%);
  backdrop-filter: blur(18px) saturate(135%);
  transition: opacity var(--motion-duration-base) ease, transform var(--motion-duration-base) var(--motion-ease-enter);
}

.story-progress.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(0, -50%);
}

.story-progress-track {
  position: relative;
  grid-row: 1 / 3;
  width: 2px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(136, 151, 172, .18);
}

.story-progress-track i {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, #8874ff, #40d9a0);
  transform: scaleY(var(--story-progress));
  transform-origin: top;
  transition: transform 90ms linear;
}

.story-progress-copy small,
.story-progress-copy b {
  display: block;
}

.story-progress-copy small {
  color: #718397;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.story-progress-copy b {
  margin-top: 2px;
  color: #e8ecf6;
  font-size: 11px;
  transition: opacity var(--motion-duration-fast) ease;
}

.story-progress nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.story-progress-link {
  display: grid;
  min-width: 22px;
  min-height: 30px;
  place-items: center;
  color: #6f7f91;
  font-size: 8px;
  font-weight: 900;
  transition: color var(--motion-duration-fast) ease, transform var(--motion-duration-fast) var(--motion-ease-enter);
}

.story-progress-link i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 rgba(128, 109, 255, 0);
  transition: width var(--motion-duration-fast) ease, box-shadow var(--motion-duration-fast) ease;
}

.story-progress-link span {
  margin-top: 3px;
}

.story-progress-link:hover,
.story-progress-link.is-active {
  color: #b9afff;
  transform: translateY(-1px);
}

.story-progress-link.is-active i {
  width: 13px;
  border-radius: 99px;
  box-shadow: 0 0 14px rgba(128, 109, 255, .7);
}

.story-chapter {
  --chapter-progress: 0;
  position: relative;
  isolation: isolate;
  scroll-margin-top: 88px;
}

.story-chapter-marker {
  display: flex;
  align-items: center;
  gap: 13px;
  max-width: 1200px;
  margin: 0 auto 28px;
  color: #7a8b9e;
}

.story-chapter-marker > span {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(128, 109, 255, .3);
  border-radius: 50%;
  background: rgba(128, 109, 255, .065);
  color: #9b8fff;
  font-size: 10px;
  font-weight: 900;
  box-shadow: 0 0 0 7px rgba(128, 109, 255, .025);
  transition: color var(--motion-duration-base) ease, border-color var(--motion-duration-base) ease, box-shadow var(--motion-duration-base) ease, transform var(--motion-duration-base) var(--motion-ease-enter);
}

.story-chapter.is-story-active .story-chapter-marker > span {
  color: #d7d1ff;
  border-color: rgba(128, 109, 255, .74);
  box-shadow: 0 0 0 7px rgba(128, 109, 255, .065), 0 0 28px rgba(128, 109, 255, .24);
  transform: scale(1.07);
}

.story-chapter-marker small,
.story-chapter-marker b {
  display: block;
}

.story-chapter-marker small {
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.story-chapter-marker b {
  color: #cdd6e2;
  font-size: 13px;
}

.story-chapter-ambient {
  position: absolute;
  z-index: -1;
  inset: 5% 0 0;
  overflow: hidden;
  pointer-events: none;
  opacity: calc(.18 + var(--chapter-progress) * .48);
}

.story-chapter-ambient::before {
  position: absolute;
  width: 1px;
  height: min(82%, 640px);
  left: max(25px, calc((100% - 1152px) / 2));
  top: 76px;
  content: "";
  background: linear-gradient(180deg, rgba(128, 109, 255, .55), rgba(64, 217, 160, .08), transparent);
  transform: scaleY(var(--chapter-progress));
  transform-origin: top;
}

.story-chapter-ambient i {
  position: absolute;
  width: 390px;
  height: 390px;
  border: 1px solid rgba(128, 109, 255, .1);
  border-radius: 50%;
  right: -190px;
  top: 9%;
  transform: translateY(calc((.5 - var(--chapter-progress)) * 110px)) rotate(calc(var(--chapter-progress) * 40deg));
}

.story-chapter-ambient i:nth-child(2) {
  width: 270px;
  height: 270px;
  right: -105px;
  top: 21%;
  border-color: rgba(64, 217, 160, .09);
  transform: translateY(calc((.5 - var(--chapter-progress)) * -80px)) rotate(calc(var(--chapter-progress) * -35deg));
}

.story-chapter-ambient strong {
  position: absolute;
  right: 2%;
  top: 6%;
  color: rgba(255, 255, 255, .025);
  font-size: clamp(140px, 22vw, 330px);
  line-height: 1;
  letter-spacing: -.08em;
  transform: translateY(calc((.5 - var(--chapter-progress)) * 80px));
}

.video-feature.story-chapter {
  padding-top: 54px;
}

.video-feature .story-chapter-marker {
  position: absolute;
  top: 34px;
  left: 80px;
  margin: 0;
}

.video-feature .story-chapter-ambient {
  border-radius: inherit;
}

.video-feature > div:not(.story-chapter-marker, .story-chapter-ambient) {
  margin-top: 58px;
}

.story-chapter + .story-chapter::before {
  position: absolute;
  z-index: -1;
  width: min(64vw, 740px);
  height: 1px;
  top: -35px;
  left: 50%;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(128, 109, 255, .18), transparent);
  transform: translateX(-50%) scaleX(var(--chapter-progress));
}

@media (max-width: 1280px) {
  .story-progress {
    right: 12px;
    width: 42px;
    grid-template-columns: 2px 1fr;
    padding: 12px 9px;
  }

  .story-progress-copy,
  .story-progress-link span {
    display: none;
  }

  .story-progress nav {
    flex-direction: column;
  }
}

@media (max-width: 850px) {
  .story-progress {
    display: none;
  }

  .story-chapter-marker {
    margin-bottom: 22px;
  }

  .video-feature.story-chapter {
    padding-top: 45px;
  }

  .video-feature .story-chapter-marker {
    position: relative;
    top: auto;
    left: auto;
    grid-column: 1 / -1;
    margin: 0 0 -25px;
  }

  .video-feature > div:not(.story-chapter-marker, .story-chapter-ambient) {
    margin-top: 0;
  }

  .story-chapter-ambient::before {
    left: 18px;
  }
}

@media (max-width: 520px) {
  .story-chapter-marker > span {
    width: 36px;
    height: 36px;
  }

  .story-chapter-ambient strong {
    font-size: 130px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-progress-track i,
  .story-chapter-ambient,
  .story-chapter-ambient * {
    transition: none !important;
    transform: none !important;
  }
}
