/* ============================================================
   3D.CSS — Startseite: Abschnitt "Leistungen" als Modell
   ------------------------------------------------------------
   Aufbau: Kopf (h2, Lead, ein Satz zur Abbildung), die Abbildung,
   darunter die Textblöcke (.beat). Jeder Block ist ein Zustand der
   Szene (js/3d.js) und trägt sein Standbild (.beat-figure).

   Zwei Fassungen:
   - flach: jeder Block mit seinem Standbild. Ohne JavaScript, bei
     prefers-reduced-motion und wenn die Szene nicht startet
     (.modell--flat, setzt js/3d.js).
   - laufend (.modell--live): die Abbildung haftet, die Blöcke bekommen
     die Scrollstrecke, an die die Zustände gekoppelt sind. Die Standbilder
     sind dann ausgeblendet, jeder Block hat stattdessen eine Beschreibung
     für Screenreader (.beat-sr).

   Bausteine der Seite: .section, .container, .section-header,
   .heading-lg, .section-lead, .link-text, .nav-toggle-btn, .num,
   .sr-only, .sheet.
   ============================================================ */

.modell {
  --m-top: calc(var(--nav-height) + env(safe-area-inset-top));
  /* Material der Szene: Transparentpapier. Der obere Bogen ist der
     hellste, der untere zwei Tonstufen dunkler, damit sich die drei
     Ebenen auch im Hellen voneinander trennen. */
  --m-sheet-hi: light-dark(#f8f6f2, #2d2b28);
  --m-sheet-lo: light-dark(#e6e1d8, #211f1d);
  --m-side:     light-dark(#bcb6ab, #4a463f);
}

/* Probe-Elemente: js/3d.js liest ihre berechnete Farbe, so folgen die
   Farben der Zeichnung den Tokens und dem Farbschema. */
.m-probe {
  position: absolute;
  width: 0;
  height: 0;
  visibility: hidden;
  pointer-events: none;
}

.m-probe--hi     { color: var(--m-sheet-hi); }
.m-probe--lo     { color: var(--m-sheet-lo); }
.m-probe--side   { color: var(--m-side); }
.m-probe--ink    { color: var(--ink); }
.m-probe--soft   { color: var(--ink-soft); }
.m-probe--accent { color: var(--accent); }
.m-probe--ground { color: var(--ground); }

/* ---- Kopf und Textblöcke ---- */

.modell-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.modell-intro {
  margin-top: var(--space-6);
  max-width: 44ch;
}

.beat-text {
  max-width: 34rem;
}

/* Symbol der Leistung über der Überschrift: Linienzeichen in einem
   Rahmen, damit der Blick beim Durchscrollen am Block hängen bleibt */
.beat-icon {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  margin-bottom: var(--space-4);
  border: 1px solid var(--rule-strong);
  color: var(--accent);
}

.beat-title {
  font-size: min(var(--step-section), 2.25rem);
  line-height: var(--leading-section);
  letter-spacing: var(--tracking-section);
}

.beat-title + p {
  margin-top: var(--space-4);
}

/* Kopf eines Blocks: Symbol links neben der Überschrift (spart die Zeile,
   die es über ihr kostete) */
.beat-head {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.beat-head .beat-icon {
  flex: none;
  width: 3.25rem;
  height: 3.25rem;
  margin-bottom: 0;
}

.beat-head .beat-kicker {
  margin-bottom: 0;
}

.beat-head + p {
  margin-top: var(--space-4);
}

.beat-text p + p {
  margin-top: var(--space-3);
}

.beat-text p {
  max-width: 46ch;
  /* Schmale Spalte: mit text-wrap: pretty (Vorgabe der Seite für p) trennt
     WebKit hier Wörter, obwohl die Zeile noch Platz hat */
  text-wrap: wrap;
  hyphenate-limit-chars: 10 4 4;
  -webkit-hyphenate-limit-before: 4;
  -webkit-hyphenate-limit-after: 4;
}

/* Breit ist die Zeile lang genug für Flattersatz ohne Trennung; getrennte
   Wörter wie "Sicherheitsmaßnah-men" stören dort mehr als sie nützen */
@media (min-width: 960px) {
  .beat-text p {
    hyphens: manual;
  }
}

.beat-text strong {
  font-weight: var(--weight-medium);
}

.beat-text .link-text {
  margin-top: var(--space-3);
}

/* Eigener Titel eines Themas (KI): darüber, zu welchem Angebot es gehört */
.beat-kicker {
  margin-bottom: var(--space-2);
  font-size: var(--step-small);
  color: var(--ink-soft);
}

/* Stichpunkte der Leistung (dieselben wie auf den Karten der Startseite) */
.beat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--step-small);
  line-height: 1.4;
  color: var(--ink-soft);
}

.beat-tags li {
  position: relative;
  padding-left: 12px;
}

.beat-tags li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 5px;
  height: 5px;
  background-color: var(--accent);
}

.beat-tags + p {
  margin-top: var(--space-4);
}

/* Schritte des Angriffspfads: Ziffer im Kreis wie in der Abbildung */
.beat-steps,
.findings {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-3) 0 0;
  padding: 0;
  max-width: 46ch;
  list-style: none;
}

.beat-steps li {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  column-gap: var(--space-3);
  align-items: baseline;
}

.step-no,
.finding-no {
  display: inline-grid;
  place-items: center;
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 50%;
  background-color: var(--accent);
  color: var(--ground);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  transform: translateY(-1px);
}

/* Befunde zum Aufklappen (geht ohne Skript, per Tastatur und Touch) */
.findings-intro {
  margin-top: var(--space-4);
}

.findings {
  gap: 0;
  border-top: 1px solid var(--rule);
}

.finding {
  border-bottom: 1px solid var(--rule);
}

.finding summary {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  column-gap: var(--space-3);
  align-items: baseline;
  min-height: 44px;
  padding: var(--space-2) 0;
  cursor: pointer;
  list-style: none;
}

.finding summary::-webkit-details-marker {
  display: none;
}

.finding summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.finding-name {
  font-weight: var(--weight-medium);
}

.beat-text .finding-body .finding-rating {
  margin-top: 0;
  color: var(--ink-soft);
}

.finding[open] summary .finding-name {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.finding-body {
  padding: 0 0 var(--space-3) calc(1.5rem + var(--space-3));
  font-size: var(--step-small);
}

.beat-text .finding-body p {
  margin-top: var(--space-1);
}

/* ---- Ablauf: Schritt 1 im Kopf, Nummer des Schritts vor der Überschrift ---- */

.beat-open {
  margin-top: var(--space-8);
}

/* Nummer des Schritts: Kreis in Petrol wie die Pfadschritte der Abbildung,
   nur größer (er steht an der Stelle des Symbols) */
.beat-step {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background-color: var(--accent);
  color: var(--ground);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1;
}

/* ---- Dokumente: das Ergebnis jedes Schritts als Papierblatt ----
   Zeichensprache der Szene: Papierton des obersten Bogens, Rand in der
   Kantenfarbe, ein zweites Blatt versetzt dahinter (flach, ohne Schatten),
   Petrol nur für Nummern und hervorgehobene Felder. */

.doc {
  margin: var(--space-5) 0 0;
  max-width: 24rem;
  padding: var(--space-3) var(--space-4) var(--space-4);
  border: 1px solid var(--m-side);
  background-color: var(--m-sheet-hi);
  box-shadow: 5px 5px 0 -1px var(--m-sheet-lo), 5px 5px 0 0 var(--m-side);
  font-size: var(--step-small);
  line-height: 1.45;
  hyphens: manual;
}

.doc + .link-text,
.doc + p {
  margin-top: var(--space-5);
}

.doc-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--rule);
}

.doc-title {
  font-weight: 600;
  color: var(--ink);
}

.doc-tag {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.beat-text .doc p {
  max-width: none;
  margin-top: 0;
}

.beat-text .doc .doc-note {
  margin-top: var(--space-2);
  color: var(--ink-soft);
}

/* Kurzbriefing: Feld und Eintrag je Zeile, getrennt durch feine Linien */
.doc-dl {
  display: grid;
  margin: 0;
}

.doc-dl > div {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  column-gap: var(--space-3);
  padding: var(--space-1) 0;
  border-top: 1px solid var(--rule);
}

.doc-dl > div:first-child {
  border-top: 0;
  padding-top: 0;
}

.doc-dl dt {
  color: var(--ink-soft);
}

.doc-dl dd {
  margin: 0;
  color: var(--ink);
}

/* Datenfluss-Diagramm: Zeichen wie in der Szene, Linien in Tinte */
.doc-svg {
  display: block;
  width: 100%;
  max-width: 19rem;
  height: auto;
  overflow: visible;
}

.doc-svg .doc-flow,
.doc-node circle,
.doc-node rect,
.doc-node path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.3;
}

.doc-node circle,
.doc-node rect {
  fill: var(--m-sheet-hi);
}

.doc-node path {
  stroke-width: 1.8;
}

.doc-svg .doc-bound {
  stroke: var(--ink-soft);
  stroke-width: 1;
  stroke-dasharray: 4 3;
}

.doc-svg .doc-arrow {
  fill: var(--ink);
}

.doc-node text {
  fill: var(--ink);
  font-size: 11px;
  text-anchor: middle;
}

/* Risikomatrix: kleines Abbild im Kopf, darunter die Befunde */
.doc-thumb {
  flex: none;
}

.doc-thumb rect {
  fill: none;
  stroke: var(--rule-strong);
  stroke-width: 1;
}

.doc-thumb rect.is-hot {
  fill: color-mix(in srgb, var(--accent) 18%, transparent);
}

.doc-thumb circle {
  fill: var(--accent);
}

.beat-text .doc .findings-intro {
  margin: 0 0 var(--space-2);
}

.doc .findings {
  max-width: none;
}

/* Maßnahmenkatalog: je Maßnahme Nummer des Befunds, Name und eine Zeile
   Verantwortung · Zeitrahmen · Aufwand */
.doc-rows {
  display: grid;
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}

.doc-rows li {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  column-gap: var(--space-3);
  padding: 6px 0;
  border-bottom: 1px solid var(--rule);
  line-height: 1.35;
}

.doc-body > .doc-rows:first-child {
  margin-top: 0;
  border-top: 0;
}

.doc-no {
  display: inline-grid;
  grid-row: 1 / span 2;
  place-items: center;
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 50%;
  background-color: var(--accent);
  color: var(--ground);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

/* Der KI-Assistent ist kein Befund der Matrix: Ring statt Scheibe */
.doc-no--ki {
  border: 1.5px solid var(--accent);
  background-color: transparent;
  color: var(--accent);
  font-size: 0.625rem;
}

.beat-text .doc .doc-measure {
  font-weight: var(--weight-medium);
  color: var(--ink);
}

.beat-text .doc .doc-meta {
  color: var(--ink-soft);
}

/* Schaltfläche zum Erstgespräch am Ende der Szene */
.beat-cta-text {
  margin-top: var(--space-6);
}

.beat-text .beat-cta {
  margin-top: var(--space-3);
}

/* ---- Flache Fassung: Block und Standbild ---- */

.modell-beats {
  display: grid;
  row-gap: var(--space-16);
  margin-top: var(--space-16);
}

.beat-figure {
  margin: var(--space-6) 0 0;
  max-width: 560px;
  hyphens: manual;
}

.beat-figure img {
  display: block;
  width: 100%;
  height: auto;
}

/* Zwei Standbilder in einem Zustand (Abgesichert: Modell, dann Matrix) */
.beat-figure picture + picture img,
.beat-figure img + img {
  margin-top: var(--space-4);
}

.beat-caption {
  margin-top: var(--space-2);
  max-width: 60ch;
  font-size: var(--step-small);
  line-height: 1.45;
  color: var(--ink-soft);
}

.beat-caption strong {
  font-weight: var(--weight-medium);
  color: var(--ink);
}

@media (min-width: 960px) {
  .modell-beats .beat {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: var(--space-12);
    align-items: center;
  }

  .beat-figure {
    margin-top: 0;
    justify-self: center;
    width: 100%;
  }
}

/* Mit Skript und ohne reduzierte Bewegung startet die Szene: die
   Standbilder bleiben aus, bis feststeht, ob sie läuft. Startet sie
   nicht, setzt js/3d.js .modell--flat. */
@media (prefers-reduced-motion: no-preference) {
  .js .modell:not(.modell--flat) .beat-figure {
    display: none;
  }

}

/* Die Beschreibung für Screenreader gilt nur, solange die Szene läuft;
   in der flachen Fassung beschreiben Alternativtext und Unterschrift. */
.modell:not(.modell--live) .beat-sr {
  display: none;
}

/* ---- Abbildung der laufenden Szene ---- */

.modell-figure {
  display: none;
  margin: 0;
  /* Kein Zeilenumbruch mitten im Wort einer Bildunterschrift */
  hyphens: manual;
}

.modell-stage {
  position: relative;
}

.modell-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.modell-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.modell-caption {
  flex: 1 1 auto;
  max-width: 68ch;
  font-size: var(--step-small);
  line-height: 1.45;
  color: var(--ink-soft);
}

.modell-state {
  font-weight: var(--weight-medium);
  color: var(--ink);
}

/* Fortschrittsmarke: ein kurzer Strich je Zustand, der aktuelle in
   Tinte, die übrigen zurückgenommen. Jeder Strich ist ein Knopf mit 44 px
   Höhe; daneben der Zähler in Tabellenziffern. */
.modell-pager {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--space-3);
}

.modell-marks {
  display: flex;
  align-items: center;
}

.modell-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: none;
  color: color-mix(in srgb, var(--ink) 25%, transparent);
  cursor: pointer;
  transition: color 200ms var(--ease-out);
}

.modell-mark::before {
  content: "";
  width: 14px;
  height: 2px;
  border-radius: 1px;
  background-color: currentColor;
}

.modell-mark[aria-current="step"] {
  color: var(--ink);
}

@media (hover: hover) and (pointer: fine) {
  .modell-mark:hover {
    color: color-mix(in srgb, var(--ink) 60%, transparent);
  }

  .modell-mark[aria-current="step"]:hover {
    color: var(--ink);
  }
}

.modell-mark:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -8px;
}

.modell-count {
  font-size: var(--step-small);
  line-height: 1;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Legende im Ist-Zustand: unten links auf der Bühne, in der Schrift der
   Seite. js/3d.js hält darunter Platz frei. */
.modell-key {
  position: absolute;
  left: 0;
  bottom: 2px;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--ink-soft);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease-out);
}

.modell--live[data-state="0"] .modell-key {
  opacity: 1;
}

/* Knöpfe über den Befunden der Matrix (js/3d.js setzt Lage und Größe).
   Unsichtbar bis auf den Fokusrahmen; die Auswahl zeichnet die Szene. */
.modell-hits {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.modell-hit {
  position: absolute;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.modell-hit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0;
}

.modell-key-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.modell-key-icon {
  flex: none;
  color: var(--ink);
}

/* ============================================================
   LIVE: die Abbildung haftet, die Textblöcke scrollen daran vorbei.
   Gilt mit Skript und ohne reduzierte Bewegung schon vor dem Start der
   Szene, damit beim Start nichts springt. Startet sie nicht, setzt
   js/3d.js .modell--flat, und die flache Fassung gilt.
   ============================================================ */

@media (prefers-reduced-motion: no-preference) {
  .js .modell:not(.modell--flat) .modell-head {
    margin-bottom: var(--space-8);
  }

  /* Telefon und Tablet: Abbildung oben unter der Leiste, der Text läuft
     darunter durch. Der Grundton deckt den Text, der hinter ihr verschwindet. */
  .js .modell:not(.modell--flat) .modell-figure {
    display: block;
    position: sticky;
    /* Die Abbildung greift 3px unter die Leiste (z-index 1000). Sonst bleibt
       auf iOS Safari bei Bruchteilen eines Pixels ein Spalt, durch den der
       Text beim Scrollen flackernd läuft. */
    top: calc(var(--m-top) - 3px);
    z-index: 2;
    margin-inline: calc(-1 * var(--page-margin));
    padding-inline: var(--page-margin);
    padding-top: 3px;
    padding-bottom: var(--space-2);
    background-color: var(--ground);
  }

  /* Telefon: 40 % der Höhe, damit darunter genug Text in einen Blick passt */
  .js .modell:not(.modell--flat) .modell-stage {
    height: clamp(280px, 40svh, 460px);
  }

  .js .modell:not(.modell--flat) .modell-foot {
    align-items: center;
    min-height: 44px;
  }

  /* Auf schmalen Bühnen steht unter der Abbildung nur der Name des Zustands;
     was sie zeigt, sagt der Textblock darunter. */
  .js .modell:not(.modell--flat) .modell-legend {
    display: none;
  }

  .js .modell:not(.modell--flat) .modell-beats {
    row-gap: 0;
    margin-top: 0;
  }

  /* Telefon: die Blöcke folgen dicht aufeinander. Die Strecke für den
     Übergang liefert der Text selbst; mehr Abstand hieße eine halbe
     Bildschirmhöhe ohne Text unter der Abbildung. */
  .js .modell:not(.modell--flat) .modell-beats .beat {
    padding-block: 7svh;
  }

  .js .modell:not(.modell--flat) .modell-beats .beat:first-child {
    padding-top: 12svh;
  }

  /* Nach dem letzten Block: Platz für das zweite Bild des Schlusszustands
     (die Matrix nach den Maßnahmen), bevor die Abbildung sich löst */
  .js .modell:not(.modell--flat) .modell-beats .beat:last-child {
    padding-bottom: 4svh;
  }

  .js .modell:not(.modell--flat) {
    padding-bottom: var(--space-8);
  }

  /* Es spricht immer ein Block: der zum Zustand im Bild (.is-current, setzt
     js/3d.js). Die anderen treten zurück, bleiben aber lesbar genug, um zu
     sehen, was kommt. Mit Tastaturfokus steht ein Block immer voll. */
  .modell--live .modell-head,
  .modell--live .modell-beats .beat {
    transition: opacity 200ms var(--ease-out);
  }

  .modell--live .modell-head:not(.is-current):not(:focus-within),
  .modell--live .modell-beats .beat:not(.is-current):not(:focus-within) {
    opacity: 0.35;
  }

  @media (min-width: 600px) and (max-width: 959.98px) {
    .js .modell:not(.modell--flat) .modell-stage {
      height: clamp(320px, 50svh, 600px);
    }
  }

  /* Tablet: unter der Abbildung auch die Unterschrift, mit Platz für drei
     Zeilen, damit die Abbildung beim Wechsel ihre Höhe behält; der Text
     läuft breiter als auf dem Telefon */
  @media (min-width: 720px) and (max-width: 959.98px) {
    .js .modell:not(.modell--flat) .modell-foot {
      align-items: flex-start;
      min-height: calc(3 * 1.45 * var(--step-small) + var(--space-3));
      padding-top: var(--space-3);
    }

    .js .modell:not(.modell--flat) .modell-pager {
      margin-top: -11px;
    }

    .js .modell:not(.modell--flat) .modell-legend {
      display: inline;
    }

    .js .modell:not(.modell--flat) .beat-text {
      max-width: 60ch;
    }

    .js .modell:not(.modell--flat) .beat-text p {
      max-width: 60ch;
    }
  }

  @media (min-width: 960px) {
    .js .modell:not(.modell--flat) .modell-grid {
      grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
      grid-template-rows: auto 1fr;
      column-gap: var(--space-12);
    }

    .js .modell:not(.modell--flat) .modell-head {
      display: block;
      grid-column: 1;
      grid-row: 1;
      margin-bottom: 0;
    }

    .js .modell:not(.modell--flat) .modell-beats {
      grid-column: 1;
      grid-row: 2;
    }

    .js .modell:not(.modell--flat) .modell-figure {
      grid-column: 2;
      grid-row: 1 / span 2;
      align-self: start;
      top: calc(var(--m-top) + var(--space-6));
      display: flex;
      flex-direction: column;
      height: calc(100svh - var(--m-top) - 2 * var(--space-6));
      max-height: 900px;
      margin-inline: 0;
      padding: 0;
      background-color: transparent;
    }

    .js .modell:not(.modell--flat) .modell-stage {
      flex: 1 1 auto;
      height: auto;
      min-height: 0;
    }

    /* Platz für drei Zeilen, damit die Bühne beim Wechsel der Unterschrift
       ihre Höhe behält */
    .js .modell:not(.modell--flat) .modell-foot {
      align-items: flex-start;
      min-height: calc(3 * 1.45 * var(--step-small) + var(--space-3));
      padding-top: var(--space-3);
    }

    /* Die Knöpfe sind 44px hoch, die Unterschrift beginnt bündig mit der Zahl */
    .js .modell:not(.modell--flat) .modell-pager {
      margin-top: -11px;
    }

    .js .modell:not(.modell--flat) .modell-legend {
      display: inline;
    }

    .js .modell:not(.modell--flat) .modell-beats {
      padding-top: 10svh;
      padding-bottom: 0;
    }

    .js .modell:not(.modell--flat) .modell-beats .beat,
    .js .modell:not(.modell--flat) .modell-beats .beat:first-child,
    .js .modell:not(.modell--flat) .modell-beats .beat:last-child {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: flex-start;
      min-height: 48svh;
      padding-block: 4svh;
    }

    .js .modell:not(.modell--flat) .modell-beats .beat:last-child {
      justify-content: flex-start;
      padding-bottom: 15svh;
    }
  }

  /* Dokumente der laufenden Szene: js/3d.js setzt --doc (0 bis 1) nach der
     Scrollposition. Breit kommt das Blatt von rechts, aus der Richtung der
     Abbildung; schmal zieht es sich von oben auf, unter der Abbildung
     heraus. Danach erscheinen seine Zeilen nacheinander. Ohne --doc (flache
     Fassung, ohne Skript) steht alles. Mit Tastaturfokus steht es sofort. */
  .modell--live .doc {
    opacity: clamp(0, var(--doc, 1) * 2.5, 1);
    transform: translateX(calc((1 - var(--doc, 1)) * 3rem));
  }

  .modell--live .doc-dl > div,
  .modell--live .doc-rows li,
  .modell--live .doc .findings li,
  .modell--live .doc-node {
    opacity: clamp(0, (var(--doc, 1) - 0.35 - var(--i, 0) * 0.07) * 4, 1);
  }

  .modell--live .doc-flow,
  .modell--live .doc-arrow {
    opacity: clamp(0, (var(--doc, 1) - 0.7) * 4, 1);
  }

  .doc-dl > div:nth-child(2), .doc-rows li:nth-child(2), .doc .findings li:nth-child(2), .doc-node:nth-of-type(2) { --i: 1; }
  .doc-dl > div:nth-child(3), .doc-rows li:nth-child(3), .doc .findings li:nth-child(3), .doc-node:nth-of-type(3) { --i: 2; }
  .doc-dl > div:nth-child(4), .doc-rows li:nth-child(4), .doc .findings li:nth-child(4), .doc-node:nth-of-type(4) { --i: 3; }
  .doc-rows li:nth-child(5), .doc .findings li:nth-child(5), .doc-node:nth-of-type(5) { --i: 4; }
  .doc-rows li:nth-child(6), .doc-node:nth-of-type(6) { --i: 5; }
  .doc-node:nth-of-type(7) { --i: 6; }

  .modell--live .doc:focus-within,
  .modell--live .doc:focus-within * {
    opacity: 1;
    transform: none;
    clip-path: none;
  }

  @media (max-width: 959.98px) {
    .modell--live .doc {
      opacity: 1;
      transform: none;
      clip-path: inset(0 -8px calc((1 - var(--doc, 1)) * 100%) 0);
    }
  }

  /* Diagnoseschalter ?sticky=0 (galt nur auf der entfernten Testseite /3d,
     js/3d.js): Abbildung im Fluss */
  .js .modell.modell--nosticky:not(.modell--flat) .modell-figure {
    position: static;
  }

  /* Anheft-Varianten zum Vergleich auf dem Telefon (galten nur auf der
     entfernten Testseite /3d, ?pin=…,
     docs/3d-diagnose.md). js/3d.js setzt die Klasse nur schmal und nicht
     in niedrigen Fenstern, dazu Lage und Breite in Pixeln.
     fixed: die Abbildung liegt außerhalb des Flusses, der Platzhalter
     hält ihre Höhe; Lage (absolute/fixed) und top/left setzt das Skript. */
  .js .modell--pin-fixed:not(.modell--flat) .modell-grid {
    position: relative;
  }

  .js .modell--pin-fixed:not(.modell--flat) .modell-figure {
    position: absolute;
    margin-inline: 0;
  }

  .js .modell--pin-fixed:not(.modell--flat) .modell-pin-ph {
    display: block;
  }

  /* transform: im Fluss, translate3d aus der Scrollposition */
  .js .modell--pin-transform:not(.modell--flat) .modell-figure {
    position: relative;
    top: auto;
    will-change: transform;
  }

  /* nolap: sticky ohne die 3px unter der Leiste; top setzt das Skript */
  .js .modell--pin-nolap:not(.modell--flat) .modell-figure {
    padding-top: 0;
  }

  /* Niedrige Fenster (Querformat am Telefon): keine haftende Abbildung */
  @media (max-height: 520px) and (max-width: 959.98px) {
    .js .modell:not(.modell--flat) .modell-figure {
      position: static;
    }
  }
}

/* Platzhalter für ?pin=fixed (js/3d.js), sonst ohne Wirkung */
.modell-pin-ph {
  display: none;
}

/* Platzhalter, bis die Szene zeichnet: das Standbild des ersten Zustands
   unter dem Canvas. Nach dem ersten Bild blendet es in 200 ms aus. */
.modell-placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  transition: opacity 200ms var(--ease-out);
}

.modell-placeholder.is-gone {
  opacity: 0;
}

/* ============================================================
   FOLGEABSCHNITT: die Leistungsseiten
   ============================================================ */

.modell-next {
  padding-top: 0;
}

.next-sheet {
  max-width: var(--sheet-reading);
  margin-inline: auto;
}

.next-text {
  margin-top: var(--space-4);
  max-width: 52ch;
}

.next-list {
  display: grid;
  gap: var(--space-6);
  margin: var(--space-6) 0 0;
  padding: 0;
  list-style: none;
}

/* Kurzbeschreibung unter dem Link: der Text der Leistung, damit er auch
   auf der Startseite ohne Szene im HTML steht */
.next-desc {
  margin: var(--space-2) 0 0;
  font-size: var(--step-small);
  line-height: var(--leading-body);
  color: var(--ink-soft);
}

@media (min-width: 720px) {
  .next-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-10);
  }
}
