/* Leistungen – „Eine Linie von der Anforderung bis zum Betrieb“
   Seitenspezifische Regeln (Ergänzung zu style.css).

   Geometrie der Linie – alle Konstanten an einer Stelle, JS liest/misst sie nach:
   --sx        horizontale Lage der Linie (Desktop: Mitte des .wrap = Seitenmitte, Mobil: 24 px)
   --gap       Spaltenabstand des 12er-Rasters (muss zu .g12 passen)
   --tie-len   Länge eines Querstrichs von einer 5er-Spalte bis zur Linie: eine Spaltenbreite + 1,5 Abstände
   --tie-y     Höhe des Querstrichs im Block (Mitte der 18 px hohen Mono-Zeile)
   --spine-top / --spine-end  Abstand der Linie zum ersten bzw. letzten Marker (Fallback ohne JS; JS misst exakt)
   --zone-pb   Innenabstand unten der Zone „Wie wir arbeiten“
   --trigger   Anteil der Viewporthöhe, an dem Marker und Fortschrittslinie schalten */

.hero-leistungen { padding-bottom: 56px; }
.stack { display: flex; flex-direction: column; }
.stack-16 { gap: 16px; }
.cta-actions { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }

/* ---------- Die Linie ---------- */
.flow {
  position: relative;
  --gap: 32px;
  --sx: 50%;
  --tie-y: 9px;
  --tie-len: calc((100% - 4 * var(--gap)) / 5 + 1.5 * var(--gap));
  --zone-pb: 96px;
  --spine-top: 9px;
  --spine-end: calc(var(--zone-pb) + 10px);
  --trigger: .62;
}
.flow .mono { line-height: 18px; }
.spine, .spine-on { position: absolute; left: var(--sx); top: var(--spine-top); width: 1px; height: calc(100% - var(--spine-top) - var(--spine-end)); pointer-events: none; }
.spine { background: var(--ink); }
.spine-on { display: none; background: var(--orange); transform-origin: top; transform: scaleY(0); }
html.js .spine-on { display: block; }

/* ---------- Raster und Anbindung an die Linie ---------- */
.g12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: start; }
.st-body { position: relative; display: flex; flex-direction: column; gap: 20px; }
.tie { position: absolute; top: var(--tie-y); height: 1px; background: var(--ink); pointer-events: none; }
.tie-r { left: 100%; width: var(--tie-len); }   /* Text links, Strich nach rechts zur Linie */
.tie-l { right: 100%; width: var(--tie-len); }  /* Text rechts, Strich nach links zur Linie */
.mark { position: absolute; top: 0; width: 11px; height: 11px; transform: translate(-50%, -50%); background: #fff; border: 1px solid var(--ink); transition: background-color .35s, border-color .35s; }
.tie-r .mark { left: 100%; }
.tie-l .mark { left: 0; }
.mark-sm { width: 7px; height: 7px; }
.mark-end { width: 15px; height: 15px; }
.mark.is-on, .mark-end { background: var(--orange); border-color: var(--orange); }

/* ---------- Ursprung „Anforderung“ ---------- */
.st-origin { padding: 0 0 16px; }
.st-origin .st-body { grid-column: 1 / span 5; }
.origin-links { display: flex; flex-wrap: wrap; gap: 8px 32px; font-size: 16px; font-weight: 500; }
.origin-links a { display: inline-flex; align-items: baseline; gap: 10px; min-height: 32px; }
.origin-links .mono { color: var(--orange-text); }

/* ---------- Vier Stationen ---------- */
.stations-text { grid-column: 1 / span 5; display: flex; flex-direction: column; }
.st { padding: 72px 0; }
.st:first-child { padding-top: 72px; }
.st-title { font-size: clamp(32px, 3.4vw, 52px); line-height: 1.02; letter-spacing: -.025em; font-weight: 600; text-wrap: balance; }
.st-codes { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.st-fig { margin: 24px 0 0; display: flex; flex-direction: column; gap: 16px; max-width: 460px; }
.st-fig figcaption { display: flex; justify-content: space-between; gap: 16px; }
.draw { display: block; width: 100%; height: auto; }
.reveal { transition: opacity .7s ease, transform .7s ease; }
.reveal.pending { opacity: 0; transform: translateY(14px); }

/* Bühne: eine Figurenspalte für alle vier Stationen (nur Desktop mit JS) */
.stage { display: none; }
.stage-frame { display: grid; max-width: 460px; }
.stage-frame .draw { grid-area: 1 / 1; opacity: 0; transition: opacity .5s ease; }
.stage[data-state="1"] .draw[data-for="1"],
.stage[data-state="2"] .draw[data-for="2"],
.stage[data-state="3"] .draw[data-for="3"],
.stage[data-state="4"] .draw[data-for="4"] { opacity: 1; }
.stage-meta { display: flex; justify-content: space-between; gap: 24px; max-width: 460px; border-top: 1px solid var(--line); padding-top: 14px; }
.stage-meta [data-for] { display: none; }
.stage[data-state="1"] .stage-meta [data-for="1"],
.stage[data-state="2"] .stage-meta [data-for="2"],
.stage[data-state="3"] .stage-meta [data-for="3"],
.stage[data-state="4"] .stage-meta [data-for="4"] { display: inline; }
.stage-n { color: var(--ink); }

/* ---------- Zone „Wie wir arbeiten“ ---------- */
.zone { margin-top: 112px; padding-bottom: var(--zone-pb); background: var(--soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* Drei Formen: ein Streifen, zwei Haarlinien */
.st-coop { padding-top: 96px; }
.st-coop .st-body { grid-column: 1 / span 5; }
.strip { grid-column: 8 / span 5; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.strip li { display: flex; flex-direction: column; gap: 8px; padding: 24px 0; }
.strip li:first-child { padding-top: 2px; }
.strip li + li { border-top: 1px solid var(--ink); }
.strip .h3 { font-size: clamp(24px, 2.2vw, 32px); line-height: 1.15; }
.strip p { font-size: 16px; color: var(--mute); }

/* Vier Phasen: dichte Haltepunkte an der Linie */
.st-steps { padding-top: 112px; }
.st-steps .st-body { grid-column: 1 / span 5; }
.phases { grid-column: 8 / span 5; list-style: none; margin: 0; padding: 2px 0 0; display: flex; flex-direction: column; gap: 36px; }
.ph { position: relative; display: flex; flex-direction: column; gap: 8px; }
.ph .h3 { font-size: clamp(22px, 2vw, 26px); }
.ph p { font-size: 16px; color: var(--mute); }

/* Endpunkt „Betrieb“ */
.st-end { padding-top: 96px; }
.st-end .st-body { grid-column: 1 / span 5; }

/* Abschnitte nach der Linie */
.section-faq { padding-top: 112px; }

/* ---------- Desktop mit JS: Bühne statt Figur je Station ---------- */
@media (min-width: 901px) {
  html.js .stage { display: flex; flex-direction: column; gap: 14px; grid-column: 8 / span 5; position: sticky; top: 112px; align-self: start; padding-top: 72px; }
  /* Figuren bleiben für Screenreader erhalten (Zeichnung + Caption), werden nur visuell verborgen */
  html.js .st-fig { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- Mobil ---------- */
@media (max-width: 900px) {
  .hero-leistungen { padding-bottom: 56px; }
  .flow { --sx: 24px; --zone-pb: 64px; }
  .flow .wrap { padding-left: 56px; padding-right: 20px; }
  .g12 { display: flex; flex-direction: column; gap: 32px; }
  .tie, .tie-r, .tie-l { left: -32px; right: auto; width: 24px; }
  .tie .mark { left: 0; }
  .st-origin { padding-bottom: 8px; }
  .st { padding: 64px 0; }
  .st:first-child { padding-top: 48px; }
  .st-fig { margin-top: 32px; max-width: none; }
  .zone { margin-top: 80px; }
  .st-coop { padding-top: 64px; }
  .strip .h3 { font-size: 24px; }
  .st-steps { padding-top: 80px; }
  .phases { gap: 28px; }
  .st-end { padding-top: 64px; }
  .section-faq { padding-top: 80px; }
}

@media (prefers-reduced-motion: reduce) {
  .mark, .reveal, .stage-frame .draw { transition: none; }
  .reveal.pending { opacity: 1; transform: none; }
}
