/* Kapitel: hoher Abschnitt mit klebender Bühne, die Scroll-Distanz treibt die 3D-Szene */
.chapter {
  position: relative;
  height: calc(100svh * (1 + var(--extra, 1)));
}

.chapter__pin {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  min-height: 100svh;
  height: 100svh;
  padding: calc(var(--nav-height) + var(--sp-sm)) var(--gutter) var(--sp-md);
}

.chapter__inner {
  display: flex;
  flex-direction: column;
  width: min(100%, 1280px);
  margin: 0 auto;
}

.chapter__inner > * {
  width: min(100%, 680px);
}

.chapter[data-side='right'] .chapter__inner > * {
  margin-left: auto;
}

.chapter[data-side='center'] .chapter__inner > * {
  margin-inline: auto;
}

.sec-head {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-bottom: var(--sp-md);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.sec-head__k b {
  color: var(--honey-300);
  font-weight: 600;
}

.sec-head__rule {
  flex: 1;
  height: 1px;
  background: var(--line);
}

.chapter__grid {
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
}

.chapter__title {
  text-wrap: balance;
}

.chapter__copy {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  color: var(--text-soft);
}

.chapter__copy .lead {
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.6;
  color: var(--text);
}

.chapter__copy p:not(.lead):not(.note) {
  font-size: 15px;
}

.note {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-xs);
  font-size: 14px;
}

.note b {
  color: var(--text);
}

.chapter__inner--center {
  align-items: center;
  text-align: center;
}

/* Finale */
.finale__title {
  margin-bottom: var(--sp-md);
}

.finale__sub {
  max-width: 560px;
  margin-bottom: var(--sp-lg);
}

.finale__note {
  margin-top: var(--sp-lg);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* Ohne JS, bei reduzierter Bewegung oder auf kleinen Bildschirmen: normaler Fluss statt klebender Bühne */
html:not(.is-enhanced) .chapter,
html.is-flow .chapter {
  height: auto;
}

html:not(.is-enhanced) .chapter__pin,
html.is-flow .chapter__pin {
  position: static;
  height: auto;
  padding-block: var(--sp-xl);
}

@media (max-width: 820px), (max-height: 680px) {
  .chapter {
    height: auto;
  }

  .chapter__pin {
    position: static;
    height: auto;
    padding-block: calc(var(--nav-height) + var(--sp-lg)) var(--sp-xl);
  }

  .chapter__inner > *,
  .chapter[data-side='right'] .chapter__inner > * {
    width: 100%;
  }

  .chapter__inner > .stats,
  .chapter[data-side='right'] .chapter__inner > .stats {
    width: 100%;
  }
}

/* Kapitel 07 trägt am meisten Inhalt: Abstände enger, damit alles in eine Bildschirmhöhe passt */
#stock .chapter__grid {
  gap: var(--sp-sm);
}

#stock .sec-head {
  margin-bottom: var(--sp-sm);
}

#stock .chapter__inner > * {
  width: min(100%, 600px);
}

/* Niedrige Fenster: Abstände enger, damit jedes Kapitel in eine Bildschirmhöhe passt */
@media (min-width: 821px) and (max-height: 920px) {
  .sec-head {
    margin-bottom: var(--sp-sm);
  }

  .chapter__grid {
    gap: var(--sp-sm);
  }

  .chapter__copy {
    gap: var(--sp-xs);
  }

  .beats {
    margin-top: var(--sp-md);
  }

  .beat {
    padding: var(--sp-xs) 0;
  }
}

@media (min-width: 821px) and (max-height: 760px) {
  .sf-h2 {
    font-size: clamp(36px, 4.2vw, 52px);
  }

  .chapter__copy p:not(.lead):not(.note) {
    font-size: 14px;
  }

  .chapter__copy .lead {
    font-size: 15px;
    line-height: 1.5;
  }

  .beat h3 {
    font-size: 18px;
  }

  .beat p {
    font-size: 13px;
    line-height: 1.45;
  }
}
