/* WebsiteUpgrade: Projekt-Cover-Flow.
   Ein Projekt steht groß in der Mitte, die anderen sind schräg dahinter. Wechsel per Wischen, Ziehen, Pfeiltasten,
   Knöpfen, Punkten oder Klick auf eine Seitenkarte. Die Drehung kommt aus CSS Scroll-Driven Animations (view(inline));
   ohne diese Unterstützung (oder mit "Bewegung reduzieren") stehen die Karten flach nebeneinander, alles bleibt benutzbar. */

.flow { --w: min(52vw, 660px); --ov: 0px; margin-top: 12px; position: relative; isolation: isolate; }
.flow::before { content: ""; position: absolute; z-index: -1; left: 12%; right: 12%; top: 6%; height: 62%; background: radial-gradient(closest-side, rgba(229, 189, 100, .10), transparent); pointer-events: none; }

.flow-track {
  list-style: none; margin: 0; padding: 24px calc(50% - var(--w) / 2 + var(--ov)) 8px;
  display: flex; gap: 0; position: relative;
  overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none;
  perspective: 1500px; perspective-origin: 50% 35%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 11%, #000 89%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 11%, #000 89%, transparent 100%);
  cursor: grab; -webkit-tap-highlight-color: transparent;
}
.flow-track::-webkit-scrollbar { display: none; }
.flow-track:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; border-radius: 8px; }
.flow-track.is-dragging { scroll-snap-type: none; scroll-behavior: auto; cursor: grabbing; }
.flow-track.is-dragging * { pointer-events: none; }

.flow-item { flex: 0 0 var(--w); margin-inline: calc(var(--ov) * -1); scroll-snap-align: center; scroll-snap-stop: always; transform-style: preserve-3d; min-width: 0; }

.flow-card {
  position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: #0f110f;
  box-shadow: 0 46px 80px -44px rgba(0, 0, 0, .95), 0 0 0 1px rgba(255, 255, 255, .07); user-select: none; -webkit-user-drag: none;
}
.flow-card img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; -webkit-user-drag: none; user-select: none; }
.flow-card:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
.flow-card::after { content: ""; position: absolute; inset: 0; background: #151715; opacity: 0; pointer-events: none; }

.flow-cap { padding: 18px 8px 0; text-align: center; min-height: 0; display: flex; flex-direction: column; align-items: center; }
.flow-tag { display: block; font-size: 14px; line-height: 1.4; color: var(--muted); margin-bottom: 8px; }
.flow-tag--real { color: var(--gold); }
.flow-tag:not(.flow-tag--real) > span { display: none; }
.flow-tag--real > span { display: inline-block; vertical-align: middle; width: 7px; height: 7px; margin: -2px 9px 0 0; border-radius: 50%; background: var(--gold); }
.flow-cap h3 { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.12; margin: 0 0 6px; }
.flow-text { max-width: 52ch; color: var(--muted); font-size: 17px; line-height: 1.5; margin: 0 0 8px; }
.flow-cap .text-link { margin-top: 6px; }

.flow-controls { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 6px; }
.flow-btn {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--ink, #f2f1e9); cursor: pointer;
  transition: border-color .25s var(--ease), background-color .25s var(--ease), transform .25s var(--ease), opacity .25s var(--ease);
}
.flow-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.flow-btn:hover { border-color: var(--gold); background: rgba(229, 189, 100, .08); }
.flow-btn:active { transform: scale(.94); }
.flow-btn:focus-visible, .flow-dot:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.flow-btn[disabled] { opacity: .35; cursor: default; pointer-events: none; }

.flow-dots { display: flex; gap: 2px; }
.flow-dot { position: relative; width: 28px; height: 44px; border: 0; background: transparent; cursor: pointer; padding: 0; }
.flow-dot::before { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--line); transition: background-color .3s var(--ease), width .3s var(--ease), margin .3s var(--ease); }
.flow-dot[aria-current="true"]::before { background: var(--gold); width: 22px; margin-left: -11px; border-radius: 4px; }

.projects .flow-note { text-align: center; color: var(--muted); font-size: 15px; margin: 0 auto; max-width: 62ch; }
.projects .section-heading { margin-bottom: 28px; }
/* Straffung: etwas weniger Luft zwischen den Abschnitten (Desktop) */
@media (min-width: 1101px) { .section { padding-block: 92px; } }

/* Cover-Flow: nur mit Scroll-Timelines und ohne "Bewegung reduzieren" */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view(inline)) {
    .flow { --ov: calc(var(--w) * .2); }
    .flow-card { view-timeline: --flow-card inline; animation: flow-card linear both; animation-timeline: --flow-card; animation-range: cover var(--rs, 18%) cover var(--re, 82%); will-change: transform; }
    .flow-card::after { animation: flow-shade linear both; animation-timeline: --flow-card; animation-range: cover var(--rs, 18%) cover var(--re, 82%); }
    .flow-cap { animation: flow-cap linear both; animation-timeline: view(inline); animation-range: cover var(--rs, 18%) cover var(--re, 82%); }
    /* 0% = Karte steht links der Mitte, 50% = mittig, 100% = rechts der Mitte (Bereich wird per Skript auf die Kartenbreite abgestimmt) */
    @keyframes flow-card {
      0% { transform: translateZ(-100px) rotateY(40deg) scale(.9); }
      50% { transform: translateZ(30px) rotateY(0deg) scale(1); }
      100% { transform: translateZ(-100px) rotateY(-40deg) scale(.9); }
    }
    @keyframes flow-shade { 0%, 100% { opacity: .55; } 50% { opacity: 0; } }
    @keyframes flow-cap {
      0%, 30% { opacity: 0; transform: translateY(10px); }
      50% { opacity: 1; transform: none; }
      70%, 100% { opacity: 0; transform: translateY(10px); }
    }
  }
}

/* Ersatz ohne Scroll-Timelines: Überlappung und Abdunklung kommen aus dem Skript */
@media (prefers-reduced-motion: no-preference) {
  .flow.flow-js { --ov: calc(var(--w) * .2); }
  .flow-js .flow-card { will-change: transform; }
  .flow-js .flow-card::after { opacity: var(--shade, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .flow-track { scroll-behavior: auto; }
}

@media (max-width: 799px) {
  .flow { --w: 74vw; }
  .flow-cap { padding-top: 16px; }
  .flow-btn { width: 44px; height: 44px; }
  .flow-note { padding-inline: 8px; }
}
@media (min-width: 800px) and (max-width: 1100px) { .flow { --w: min(64vw, 620px); } }
