/* ===== CINARIO – Ablauf in 5 Schritten (animiert) ===== */

.ablauf { position: relative; padding: clamp(72px, 12vh, 140px) 16px; }
.ablauf__inner { max-width: 1180px; margin: 0 auto; }
.ablauf__head { text-align: center; margin-bottom: clamp(48px, 8vh, 88px); }
.ablauf__eyebrow { margin: 0 0 14px; font-size: 0.75rem; letter-spacing: 0.32em; text-transform: uppercase; color: var(--muted); font-weight: 400; }
.ablauf__title { margin: 0; font-weight: 400; font-size: clamp(1.8rem, 1.2rem + 2.4vw, 3rem); line-height: 1.15; letter-spacing: 0.01em; }
.ablauf__title span { color: var(--cream-2); font-weight: 300; }

.ablauf__stage { position: relative; }
.ablauf__steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px; position: relative; z-index: 1; }

/* Verbindungslinie (Position per JS) */
.ablauf__track, .ablauf__fill { position: absolute; z-index: 0; pointer-events: none; }
.ablauf__track { background: var(--line); }
.ablauf__fill {
  background: linear-gradient(90deg, rgba(238,229,218,0.25), var(--cream));
  transform: scaleX(0); transform-origin: left center;
  box-shadow: 0 0 12px rgba(255, 236, 214, 0.35);
}
.ablauf.is-vertical .ablauf__fill { background: linear-gradient(180deg, rgba(238,229,218,0.25), var(--cream)); transform: scaleY(0); transform-origin: center top; }
.ablauf.is-playing .ablauf__fill { transform: none; transition: transform var(--line-dur, 10.4s) linear var(--line-delay, 0.4s); }
.ablauf.is-done .ablauf__fill { transform: none; }

/* Schritt */
.step { display: flex; flex-direction: column; align-items: center; text-align: center; }
.step__orb { position: relative; width: clamp(112px, 10vw, 148px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 50% 35%, rgba(46, 41, 37, 0.95), rgba(16, 14, 12, 0.96)); box-shadow: 0 18px 40px rgba(0,0,0,0.45), inset 0 0 0 1px var(--line); transition: box-shadow 0.8s var(--ease); }
.step__ring { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); transform: rotate(-90deg); }
.step__ring circle { fill: none; stroke: var(--cream); stroke-width: 1.4; stroke-dasharray: 302; stroke-dashoffset: 302; stroke-linecap: round; }
.step__scene { position: absolute; inset: 14%; width: 72%; height: 72%; overflow: visible; }
.step__scene * { vector-effect: non-scaling-stroke; }
.step__num { margin: 22px 0 6px; font-size: 0.72rem; letter-spacing: 0.3em; color: var(--muted); font-weight: 400; }
.step__title { margin: 0 0 8px; font-size: clamp(1rem, 0.92rem + 0.3vw, 1.15rem); font-weight: 500; letter-spacing: 0.02em; color: var(--cream); }
.step__text { margin: 0; font-size: 0.88rem; line-height: 1.55; color: var(--cream-2); max-width: 22ch; }

/* Ausgangszustand (vor dem Abspielen) */
.ablauf .step { opacity: 0.32; }
.ablauf .step__num, .ablauf .step__title, .ablauf .step__text { opacity: 0; transform: translateY(10px); }
.ablauf .scene-part { opacity: 0; }

/* Aktiv */
.ablauf .step.is-on { opacity: 1; transition: opacity 0.33s var(--ease); }
.step.is-on .step__orb { box-shadow: 0 18px 50px rgba(0,0,0,0.5), 0 0 40px rgba(255, 228, 196, 0.10), inset 0 0 0 1px var(--line-strong); }
.step.is-on .step__ring circle { animation: ring 0.61s var(--ease) forwards; }
.step.is-on .step__num   { animation: up 0.39s var(--ease) 0.08s forwards; }
.step.is-on .step__title { animation: up 0.39s var(--ease) 0.15s forwards; }
.step.is-on .step__text  { animation: up 0.39s var(--ease) 0.23s forwards; }

/* Grafik-Grundstil */
.ink { fill: none; stroke: var(--cream); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ink-soft { fill: none; stroke: rgba(238,229,218,0.45); stroke-width: 1.6; stroke-linecap: round; }
.fill-soft { fill: rgba(238, 229, 218, 0.14); stroke: var(--cream); stroke-width: 1.6; }
.fill-cream { fill: var(--cream); }
.draw { stroke-dasharray: 100; stroke-dashoffset: 100; }

/* --- Szene 1: Gespräch --- */
.step.is-on .s1-a   { animation: pop 0.3s cubic-bezier(.3,1.5,.5,1) 0.14s forwards; transform-origin: 22% 62%; transform-box: fill-box; }
.step.is-on .s1-al  { animation: show 0.01s 0.33s forwards, dash 0.28s var(--ease) 0.33s forwards; }
.step.is-on .s1-b   { animation: pop 0.3s cubic-bezier(.3,1.5,.5,1) 0.55s forwards; transform-origin: 80% 70%; transform-box: fill-box; }
.step.is-on .s1-dot { animation: show 0.11s 0.74s forwards, typing 0.5s ease-in-out 0.74s 3; transform-box: fill-box; transform-origin: center; }
.step.is-on .s1-dot:nth-of-type(2) { animation-delay: 0.74s, 0.83s; }
.step.is-on .s1-dot:nth-of-type(3) { animation-delay: 0.74s, 0.91s; }

/* --- Szene 2: Konzept / Storyboard --- */
.step.is-on .s2-f { animation: slide-up 0.33s var(--ease) forwards; }
.step.is-on .s2-f1 { animation-delay: 0.11s; }
.step.is-on .s2-f2 { animation-delay: 0.25s; }
.step.is-on .s2-f3 { animation-delay: 0.39s; }
.step.is-on .s2-sk { animation: show 0.01s forwards, dash 0.33s var(--ease) forwards; }
.step.is-on .s2-sk1 { animation-delay: 0.5s, 0.5s; }
.step.is-on .s2-sk2 { animation-delay: 0.63s, 0.63s; }
.step.is-on .s2-sk3 { animation-delay: 0.77s, 0.77s; }
.step.is-on .s2-ln  { animation: show 0.01s 0.94s forwards, dash 0.33s var(--ease) 0.94s forwards; }

/* --- Szene 3: Dreh --- */
.step.is-on .s3-vf   { animation: zoom-in 0.5s var(--ease) 0.11s forwards; transform-box: view-box; transform-origin: 50% 50%; }
.step.is-on .s3-subj { animation: focus 0.61s var(--ease) 0.33s forwards; }
.step.is-on .s3-rec  { animation: show 0.01s 0.61s forwards, blink 0.66s steps(1) 0.61s infinite; }
.step.is-on .s3-txt  { animation: show 0.17s 0.61s forwards; }

/* --- Szene 4: Schnitt / Timeline --- */
.step.is-on .s4-trk  { animation: show 0.22s 0.06s forwards; }
.step.is-on .s4-c    { animation: clip-in 0.33s var(--ease) forwards; }
.step.is-on .s4-c1   { animation-delay: 0.17s; }
.step.is-on .s4-c2   { animation-delay: 0.3s; }
.step.is-on .s4-c3   { animation-delay: 0.44s; }
.step.is-on .s4-wave { animation: show 0.01s 0.55s forwards, dash 0.5s linear 0.55s forwards; }
.step.is-on .s4-ph   { animation: show 0.01s 0.66s forwards, playhead 0.77s cubic-bezier(.45,0,.55,1) 0.66s forwards; }

/* --- Szene 5: Freigabe & Lieferung --- */
.step.is-on .s5-cir  { animation: show 0.01s 0.11s forwards, dash 0.39s var(--ease) 0.11s forwards; }
.step.is-on .s5-chk  { animation: show 0.01s 0.41s forwards, dash 0.25s var(--ease) 0.41s forwards; }
.step.is-on .s5-tray { animation: show 0.22s 0.61s forwards; }
.step.is-on .s5-arr  { animation: drop 0.44s cubic-bezier(.5,0,.3,1.4) 0.69s forwards; }

/* Replay */
.ablauf__replay-wrap { display: flex; justify-content: center; margin-top: clamp(40px, 7vh, 72px); min-height: 60px; }
.ablauf__replay {
  width: 58px; height: 58px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong); background: rgba(20, 18, 16, 0.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: var(--cream); cursor: pointer;
  opacity: 0; transform: scale(0.8); pointer-events: none;
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease), background-color 0.3s, border-color 0.3s;
}
.ablauf__replay svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.6s var(--ease); }
.ablauf__replay:hover { background: rgba(238, 229, 218, 0.1); border-color: rgba(238,229,218,0.6); }
.ablauf__replay:hover svg { transform: rotate(-200deg); }
.ablauf.is-done .ablauf__replay { opacity: 1; transform: none; pointer-events: auto; }

/* Keyframes */
@keyframes ring    { to { stroke-dashoffset: 0; } }
@keyframes up      { to { opacity: 1; transform: none; } }
@keyframes show    { to { opacity: 1; } }
@keyframes dash    { to { stroke-dashoffset: 0; } }
@keyframes pop     { 0% { opacity: 0; transform: scale(0.4); } 100% { opacity: 1; transform: scale(1); } }
@keyframes typing  { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-3px); } }
@keyframes slide-up{ from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes zoom-in { from { opacity: 0; transform: scale(1.35); } to { opacity: 1; transform: scale(1); } }
@keyframes focus   { from { opacity: 0; filter: blur(3px); } to { opacity: 1; filter: blur(0); } }
@keyframes blink   { 0% { opacity: 1; } 50% { opacity: 0.15; } }
@keyframes clip-in { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
@keyframes playhead{ from { transform: translateX(0); } to { transform: translateX(62px); } }
@keyframes drop    { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }

/* Mobil: senkrechte Zeitleiste */
@media (max-width: 760px) {
  .ablauf__steps { grid-template-columns: 1fr; gap: 34px; }
  .step { display: grid; grid-template-columns: 92px 1fr; column-gap: 20px; align-items: center; text-align: left; }
  .step__orb { width: 92px; grid-row: 1 / span 3; }
  .step__num { margin: 0 0 2px; }
  .step__text { max-width: none; }
}

/* Bewegung reduzieren: Endzustand ohne Animation */
@media (prefers-reduced-motion: reduce) {
  .ablauf .step, .ablauf .step__num, .ablauf .step__title, .ablauf .step__text, .ablauf .scene-part { opacity: 1 !important; transform: none !important; animation: none !important; filter: none !important; }
  .ablauf .draw, .step__ring circle { stroke-dashoffset: 0 !important; animation: none !important; }
  .ablauf .ablauf__fill { transform: none !important; transition: none !important; }
  .ablauf__replay-wrap { display: none; }
}
