html.chapter-scroll-enabled {
  --chapter-height: calc(100dvh - var(--chapter-header, 80px));
  scroll-behavior: auto;
  scroll-padding-top: var(--chapter-header, 80px);
  overflow-anchor: none;
}
.chapter-scroll-enabled .site-header {
  position: sticky;
  top: 0;
  background: #08090cf5;
}
.chapter-scroll-enabled main > [data-chapter] {
  min-height: var(--chapter-height);
  scroll-margin-top: var(--chapter-header, 80px);
}
.chapter-scroll-enabled .hero {
  align-content: center;
  padding-top: 24px;
}
.chapter-scroll-enabled .hero-copy {
  padding-bottom: 0;
}
.chapter-scroll-enabled .hero h1 {
  font-size: clamp(62px, min(7.9vw, 13svh), 122px);
  margin-top: 16px;
}
.chapter-scroll-enabled .hero-description {
  font-size: clamp(14px, min(1.6vw, 2.5svh), 23px);
  margin: clamp(14px, 2vh, 24px) 0 clamp(16px, 2vh, 27px);
}
.chapter-scroll-enabled .hero-object {
  width: min(
    100%,
    calc((100svh - var(--chapter-header, 80px) - 108px) * 1.19838)
  );
  justify-self: end;
  margin: 0;
}
.chapter-scroll-enabled .hero-chapters {
  margin: 12px 0 0;
}
.chapter-scroll-enabled
  :is(
    .workspace,
    .inspiration,
    .acquisition,
    .analysis,
    .creation,
    .processing,
    .operations,
    .advertising,
    .system,
    .download
  ) {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.chapter-scroll-enabled .archive {
  --archive-padding: clamp(18px, 4dvh, 75px);
  padding-block: var(--archive-padding);
}
.chapter-scroll-enabled .archive-wall {
  width: min(
    100%,
    calc(
      (var(--chapter-height) - 2 * var(--archive-padding)) *
        (var(--archive-ratio))
    )
  );
  justify-self: center;
}
.chapter-scroll-enabled .ads-stage {
  height: clamp(440px, var(--chapter-height), 950px);
  max-width: min(1440px, calc(max(440px, var(--chapter-height)) * 1.55));
}
.chapter-scroll-enabled .ads-intro .section-kicker {
  font-size: clamp(30px, min(5.1vw, 8dvh), 77px);
}
.chapter-scroll-enabled .ads-stage h2 {
  font-size: clamp(48px, min(9.5vw, 15dvh), 145px);
}
.chapter-scroll-enabled .creation-space {
  width: 100%;
  flex-shrink: 0;
}

@supports (container-type: size) {
  /* Reserve space for the copy and controls, then fit the artwork into the remaining row. */
  .chapter-scroll-enabled main > :is(.inspiration, .analysis, .creation) {
    display: grid;
    justify-content: stretch;
    grid-template-columns: minmax(0, 1fr);
    height: var(--chapter-height);
    min-height: min-content;
  }
  .chapter-scroll-enabled :is(.inspiration, .analysis) .chapter-tail {
    padding-block: clamp(10px, 2dvh, 24px);
  }

  .chapter-scroll-enabled .inspiration {
    grid-template-rows: auto auto minmax(250px, 1fr) auto;
    padding-top: clamp(18px, 5dvh, 48px);
  }
  .chapter-scroll-enabled .inspiration .semantic-title {
    font-size: clamp(54px, min(8.2vw, 13dvh), 124px);
    margin-top: clamp(10px, 2.8dvh, 26px);
  }
  .chapter-scroll-enabled .agent-stage {
    container-type: size;
    min-height: 0;
  }
  .chapter-scroll-enabled .coffee-brew {
    width: min(39%, calc(100cqh * (var(--art-ratio))));
  }
  .chapter-scroll-enabled .coffee-pack {
    width: min(31%, calc(100cqh * (var(--art-ratio))));
  }

  .chapter-scroll-enabled .analysis {
    grid-template-rows: auto minmax(250px, 1fr) auto auto;
    padding-bottom: clamp(12px, 3dvh, 30px);
  }
  .chapter-scroll-enabled .analysis-stage {
    display: grid;
    grid-template-columns: 63% 37%;
    grid-template-rows: minmax(0, 1fr);
    container-type: size;
    min-height: 0;
  }
  .chapter-scroll-enabled .motion-study {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    align-self: center;
    width: 100%;
    height: 100%;
    max-height: 560px;
    padding-top: clamp(12px, 11cqh, 72px);
  }
  .chapter-scroll-enabled .motion-study .waveform {
    height: clamp(24px, 8cqh, 46px);
  }
  .chapter-scroll-enabled .motion-frames {
    container-type: size;
    align-items: start;
  }
  .chapter-scroll-enabled .motion-frames .art {
    width: min(100%, calc((100cqh - 24px) * (var(--art-ratio))));
  }
  .chapter-scroll-enabled .motion-frames > button > span:not(.art) {
    line-height: 1.4;
  }
  .chapter-scroll-enabled .analysis-player {
    position: relative;
    inset: auto;
    place-self: start center;
    width: min(92%, calc(100cqh * (var(--art-ratio))));
  }
  .chapter-scroll-enabled .analysis-title {
    font-size: clamp(32px, min(5.2vw, 9dvh), 80px);
  }

  .chapter-scroll-enabled .creation {
    grid-template-rows: auto minmax(210px, 1fr) auto;
    padding-top: clamp(18px, 5dvh, 50px);
  }
  .chapter-scroll-enabled .creation-header h2 {
    font-size: clamp(54px, min(8vw, 13dvh), 120px);
  }
  .chapter-scroll-enabled .creation-space {
    display: grid;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
    place-items: center;
    container-type: size;
    height: auto;
  }
  .chapter-scroll-enabled .creation-collage {
    --collage-ratio: 1600 / 740;
    position: relative;
    container-type: inline-size;
    width: min(100%, calc(100cqh * (var(--collage-ratio))));
    height: min(100%, calc(100cqw / (var(--collage-ratio))));
  }
  .chapter-scroll-enabled .creation-ghost {
    font-size: min(24cqw, 370px);
  }
  .chapter-scroll-enabled .creation-dancer {
    bottom: 0;
  }
  .chapter-scroll-enabled .creation-modes button {
    font-size: clamp(15px, min(2vw, 3.1dvh), 28px);
    padding-block: clamp(8px, 1.3dvh, 12px);
  }
  .chapter-scroll-enabled .creation-bottom {
    padding-bottom: clamp(12px, 2.75dvh, 25px);
  }
}
.chapter-scroll-enabled .reveal-ready {
  opacity: 1;
  transform: none;
  transition: none;
}
.chapter-scroll-enabled [data-chapter-visual] {
  backface-visibility: hidden;
}
.chapter-veil {
  position: fixed;
  inset: -10vh -15vw;
  z-index: 9;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    120deg,
    transparent 32%,
    #1646ff25 48%,
    #adc2ff18 50%,
    transparent 66%
  );
}
.chapter-position {
  position: fixed;
  right: max(20px, 2vw);
  bottom: 17px;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 15px;
  pointer-events: none;
  font-size: 10px;
  line-height: 1.8;
  color: #c8ccd6;
  padding: 5px 9px;
  background: #08090cb8;
}
.chapter-position::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--blue);
}
.chapter-position-count {
  color: #a7abb4;
  font-family: var(--va-font-family-mono);
  font-variant-numeric: tabular-nums;
}
.is-chapter-transitioning .chapter-position::before {
  background: #b3c5ff;
}
@media (prefers-reduced-motion: reduce) {
  .chapter-veil,
  .chapter-position {
    display: none;
  }
}
