@charset "UTF-8";

/* ═══════════════════════════════════════════════════════════════════════
   BEWEGUNG
   Die Scroll-Szenen der Startseite. Reines CSS: Jede Animation haengt an
   einer Scroll-Timeline und laeuft so weit, wie gescrollt wurde – auch
   rueckwaerts. Greift nur, wenn der Browser Scroll-Timelines kann und
   niemand reduzierte Bewegung wuenscht; sonst gilt die ruhige Fassung
   aus sektionen.css. Wird nur auf der Startseite geladen.

   Szenen
   01  Hero: BUSINESS, BESTFORM, BESTLEISTUNG schieben sich herein, dann
       oeffnet sich das Fenster, die Woerter ziehen sich zusammen und
       steigen weg, das Foto wird farbig, der Text faehrt ein
   02  Fuer wen: Satz fuellt sich Wort fuer Wort, Haken setzen sich
   03  Auftauchen: Punkte, Zeilen, Fragen steigen beim Erreichen auf
   04  Ueber mich: Portraet oeffnet sich von unten, bleibt in Farbe
   05  Ablauf: Zeitleiste laeuft seitlich durch
   ═══════════════════════════════════════════════════════════════════════ */

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {

    /* ── 01  HERO ─────────────────────────────────────────────────────
       3,2 Bildschirmhoehen Szene, 2,2 davon Scrollweg; die Buehne steht.
       Ablauf (Anteil des Scrollwegs):
          0–4 %   BUSINESS allein auf Schwarz
          4–20 %  BESTFORM (orange) schiebt sich von unten herein,
                  BUSINESS auf 55 %
         28–44 %  BESTLEISTUNG schiebt sich herein, BUSINESS auf 25 %
         52–72 %  das Fenster oeffnet sich zum Vollbild, dabei ruecken die
                  Woerter zusammen und ueberlappen
         64–84 %  das Foto wird farbig
         70–84 %  die Woerter steigen nach oben weg – danach steht das
                  Foto in voller Farbe
         84–96 %  der Text links faehrt ein, danach steht alles kurz still
       Die Woerter sind fort, bevor der Text kommt – sonst laege er am
       Rechner ueber BESTLEISTUNG.
       Abgestuft wird ueber die Farbe (Weiss, #8c8c8c, #404040 = 100, 55,
       25 % Helligkeit), nicht ueber Deckkraft: So scheint ein hinteres
       Wort nicht durch ein vorderes hindurch. BESTFORM bleibt in vollem
       Orange (sektionen.css) – zurueckgenommen wuerde es braun.                                                */

    .szene {
      --band: 0px;
      height: 320svh;
      view-timeline: --szene block;
    }

    .szene__foto,
    .szene__foto img,
    .szene__woerter,
    .szene__wort,
    .szene__hinweis,
    .platte {
      animation-timing-function: linear;
      animation-fill-mode: both;
      animation-timeline: --szene;
      animation-range: contain 0% contain 100%;
    }

    /* Bis 52 % ist ausser den Woertern nichts zu sehen; das Fenster
       blendet auf, bevor es sich oeffnet.                               */
    .szene__foto {
      animation-name: fenster;
      animation-range: contain 52% contain 72%;
    }

    @keyframes fenster {
      0%   { clip-path: inset(24% 42% 24% 42%); opacity: 0; }
      12%  { opacity: 1; }
      100% { clip-path: inset(0); opacity: 1; }
    }

    /* 52–84 %: das Bild setzt sich bis 72 % auf seinen Zoom (1.1) und
       wird ab 64 % farbig, fertig, wenn die Woerter fort sind.          */
    .szene__foto img {
      animation-name: setzen;
      animation-range: contain 52% contain 84%;
    }

    @keyframes setzen {
      0%    { transform: scale(1.4); filter: grayscale(1) contrast(1.12) brightness(0.86); }
      37.5% { filter: grayscale(1) contrast(1.12) brightness(0.86); }
      62.5% { transform: scale(1.1); }
      100%  { transform: scale(1.1); filter: grayscale(0) contrast(1) brightness(1); }
    }

    /* Am Handy endet der Zoom bei 1: Der Ausschnitt (Kopf an der
       Oberkante, Haende unten) ist dort schon im Bild eingestellt.     */
    @media (max-width: 47.99rem) {
      .szene__foto img {
        animation-name: setzen-handy;
        transform-origin: 50% 20%;
      }
    }

    @keyframes setzen-handy {
      0%    { transform: scale(1.3); filter: grayscale(1) contrast(1.12) brightness(0.86); }
      37.5% { filter: grayscale(1) contrast(1.12) brightness(0.86); }
      62.5% { transform: none; }
      100%  { transform: none; filter: grayscale(0) contrast(1) brightness(1); }
    }

    /* Die Woerter mitten auf der Buehne. Die Groesse richtet sich nach
       BESTLEISTUNG (5,905 em): hoechstens 86 % der Breite (am Handy die
       ganze Breite innerhalb des Rands), hoechstens so
       gross, dass der Stapel rund 60 % der Buehnenhoehe fuellt.         */
    .szene__woerter {
      left: 50%;
      right: auto;
      top: 46%;
      bottom: auto;
      translate: -50% -50%;
      font-size: min(
        calc(min(86vw, 100vw - 2 * var(--rand)) / 5.905),
        calc((100svh - var(--kopf-hoehe)) / 4)
      );
      text-align: center;
      animation-name: stapel;
    }

    /* Am Handy duerfen die Woerter bis an den Rand gehen */
    @media (max-width: 47.99rem) {
      .szene__woerter {
        font-size: calc((100vw - 2 * var(--rand)) / 5.905);
      }
    }

    /* Der Stapel rueckt nach oben, damit die Woerter, die schon da sind,
       mittig stehen: erst BUSINESS, dann BUSINESS und BESTFORM.         */
    @keyframes stapel {
      0%, 4%    { transform: translateY(0.84em); opacity: 1; }
      20%, 28%  { transform: translateY(0.42em); }
      44%, 70%  { transform: translateY(0); opacity: 1; }
      84%, 100% { transform: translateY(-40svh); opacity: 0; }
    }

    .szene__wort:nth-child(1) { animation-name: wort-1; }
    .szene__wort:nth-child(2) { animation-name: wort-2; }
    .szene__wort:nth-child(3) { animation-name: wort-3; }

    /* Neue Woerter kommen von unterhalb der Buehne (65svh tiefer).
       52–72 %: BUSINESS und BESTLEISTUNG ruecken um 0.36em an BESTFORM
       heran, aus 0.84em Zeilenabstand werden 0.48em – die Buchstaben
       ueberlappen dann um 30 % ihrer Hoehe (Versalhoehe 0.69em).       */
    @keyframes wort-1 {
      0%, 4%    { color: #fff; transform: none; }
      20%, 28%  { color: #8c8c8c; }
      44%, 52%  { color: #404040; transform: none; }
      72%, 100% { color: #404040; transform: translateY(0.36em); }
    }

    @keyframes wort-2 {
      0%, 4%    { transform: translateY(65svh); }
      20%, 100% { transform: none; }
    }

    @keyframes wort-3 {
      0%, 28%   { transform: translateY(65svh); }
      44%, 52%  { transform: none; }
      72%, 100% { transform: translateY(-0.36em); }
    }

    .szene__hinweis {
      display: block;
      animation-name: verblassen;
      animation-range: contain 0% contain 10%;
    }

    @keyframes verblassen {
      to { opacity: 0; }
    }

    .platte {
      animation-name: platte;
      animation-range: contain 84% contain 96%;
    }

    @keyframes platte {
      from { opacity: 0; transform: translateY(2rem); }
      to   { opacity: 1; transform: none; }
    }


    /* ── 02  FUER WEN ─────────────────────────────────────────────────
       Jedes Wort faerbt sich in seinem eigenen kurzen Abschnitt, Wort
       fuer Wort 3.5 % spaeter – so liest der Satz sich mit dem Scrollen. */

    .fuerwen__titel {
      view-timeline: --satz block;
    }

    /* Position des Worts im Satz. Steht hier statt als style-Attribut im
       Markup, weil die CSP Inline-Stile sperrt. Reicht fuer 16 Woerter;
       ein laengerer Satz braucht weitere Zeilen.                        */
    .wort:nth-child(2)  { --i: 1; }
    .wort:nth-child(3)  { --i: 2; }
    .wort:nth-child(4)  { --i: 3; }
    .wort:nth-child(5)  { --i: 4; }
    .wort:nth-child(6)  { --i: 5; }
    .wort:nth-child(7)  { --i: 6; }
    .wort:nth-child(8)  { --i: 7; }
    .wort:nth-child(9)  { --i: 8; }
    .wort:nth-child(10) { --i: 9; }
    .wort:nth-child(11) { --i: 10; }
    .wort:nth-child(12) { --i: 11; }
    .wort:nth-child(13) { --i: 12; }
    .wort:nth-child(14) { --i: 13; }
    .wort:nth-child(15) { --i: 14; }
    .wort:nth-child(16) { --i: 15; }

    .wort {
      --i: 0;
      animation: tinte linear both;
      animation-timeline: --satz;
      animation-range:
        cover calc(12% + var(--i) * 3.5%)
        cover calc(18% + var(--i) * 3.5%);
    }

    /* Aus der Schriftfarbe der Flaeche gemischt – funktioniert auf
       Schwarz wie auf Orange                                            */
    @keyframes tinte {
      from { color: color-mix(in srgb, var(--text) 22%, transparent); }
      to   { color: var(--text); }
    }

    .pruefliste__kasten::after {
      animation: haken var(--kurve) both;
      animation-timeline: view();
      animation-range: entry 100% cover 45%;
    }

    @keyframes haken {
      from { opacity: 0; transform: rotate(45deg) scale(0.4); }
      to   { opacity: 1; transform: rotate(45deg); }
    }



    /* ── 03  AUFTAUCHEN ───────────────────────────────────────────────
       Was beim Erreichen aufsteigt. Jedes Element hat seine eigene
       Timeline, laeuft also genau dann, wenn es selbst ins Bild kommt. */

    .pruefliste__punkt,
    .wahrheit__punkt,
    .weg__punkt,
    .frage,
    .erwartung > div,
    .aufruf > * {
      animation: auftauchen var(--kurve) both;
      animation-timeline: view();
      animation-range: entry 0% cover 30%;
    }

    @keyframes auftauchen {
      from { opacity: 0; transform: translateY(2rem); }
      to   { opacity: 1; transform: none; }
    }


    /* ── 04  UEBER MICH ────────────────────────────────────────────── */

    .ueber__bild img {
      animation: portraet linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 40%;
    }

    @keyframes portraet {
      from { clip-path: inset(100% 0 0 0); }
      to   { clip-path: inset(0); }
    }


    /* ── 05  ABLAUF ───────────────────────────────────────────────────
       Vier Bildschirme Scrollweg. Die Buehne steht, die Spur faehrt
       seitlich um genau so viel, wie sie breiter ist als der
       Bildschirm; unten waechst ein Fortschrittsbalken mit.            */

    .ablauf {
      height: 400svh;
      padding-top: 0;
      view-timeline: --ablauf block;
    }

    .ablauf__buehne {
      position: sticky;
      top: var(--kopf-hoehe);
      display: flex;
      flex-direction: column;
      justify-content: center;
      height: calc(100svh - var(--kopf-hoehe));
      overflow: hidden;
    }

    .ablauf__kopf {
      margin-bottom: clamp(2rem, 5vh, 4rem);
    }

    .ablauf__spur {
      display: flex;
      width: max-content;
      animation: fahren linear both;
      animation-timeline: --ablauf;
      animation-range: contain 0% contain 100%;
    }

    @keyframes fahren {
      from { transform: translateX(0); }
      to   { transform: translateX(calc(-100% + 100vw)); }
    }

    .ablauf__schritt {
      flex: none;
      grid-template-columns: 1fr;
      align-content: start;
      width: min(80vw, 40rem);
      padding: 0 clamp(1.5rem, 3vw, 3rem) 0 0;
      margin-right: clamp(1.5rem, 3vw, 3rem);
      border-top: 0;
      border-right: 1px solid var(--strich);
    }

    .ablauf__schritt:last-child {
      border-right: 0;
    }

    .ablauf__fortschritt {
      display: block;
      position: relative;
      height: 2px;
      margin: clamp(2rem, 5vh, 4rem) var(--rand) 0;
      background-color: var(--strich);
    }

    .ablauf__fortschritt span {
      position: absolute;
      inset: 0;
      background-color: var(--akzent);
      transform-origin: left;
      animation: messen-quer linear both;
      animation-timeline: --ablauf;
      animation-range: contain 0% contain 100%;
    }

    /* Die Buehne endet schon mit Abstand nach unten; der Aufruf danach
       braucht keinen vollen Sektionsabstand mehr.                       */
    .ablauf__danach {
      padding-top: 0;
    }

    @keyframes messen-quer {
      from { transform: scaleX(0); }
      to   { transform: none; }
    }
  }
}
