/* =====================================================================
   Sawora. Solutions — Design-System 2026
   Farben: Sawora-Palette (Blau #15b9fa, Verlauf Blau → Hellblau → Lavendel,
   Gold für Empfehlungen, Violett für Intraware). Hausschrift: Sora, überall (Corporate Design).
   Mobbin-Belege: MOBBIN-PATTERNS.md
   Regel: Komponenten nutzen nur diese Tokens, keine freien Hex-Werte.
   ===================================================================== */
:root {
  /* ---- Flächen ---- */
  --bg-base: #050608;
  --bg-elevated: #0e1015;
  --bg-inset: #0a0c12;
  --bg-app: #0b0d13;
  --bg-deep: #0a1855;
  --bg-panel: rgba(255, 255, 255, 0.035);
  --bg-panel-strong: rgba(255, 255, 255, 0.06);
  --bg-hover: rgba(255, 255, 255, 0.05);
  --bg-rgb: 5, 6, 8;
  --panel-fill: linear-gradient(165deg, rgba(20, 23, 32, 0.9), rgba(10, 12, 18, 0.95));
  --glass-fill: rgba(14, 16, 21, 0.72);
  --menu-fill: rgba(14, 16, 21, 0.97);
  --scrim: rgba(3, 4, 8, 0.62);
  --wash-top: #060912;
  --wash-bottom: #07060c;

  /* ---- Akzente ---- */
  --accent-rgb: 21, 185, 250;
  --accent: #15b9fa;
  --accent-soft: #7cc8ff;
  --accent-deep: #0e7fb5;
  --accent-2-rgb: 167, 139, 250;
  --accent-2: #a78bfa;
  --lavender: #b59cff;
  --indigo-rgb: 82, 72, 220;
  --gold-rgb: 212, 165, 67;
  --gold: #d4a543;
  --ink-on-gold: #1a1304;
  --accent-gradient: linear-gradient(120deg, var(--accent) 0%, var(--accent-soft) 40%, var(--lavender) 100%);
  --accent-06: rgba(var(--accent-rgb), 0.06);
  --accent-10: rgba(var(--accent-rgb), 0.10);
  --accent-18: rgba(var(--accent-rgb), 0.18);
  --accent-30: rgba(var(--accent-rgb), 0.30);
  --accent-45: rgba(var(--accent-rgb), 0.45);
  --accent-2-10: rgba(var(--accent-2-rgb), 0.12);
  --accent-2-22: rgba(var(--accent-2-rgb), 0.28);
  --gold-10: rgba(var(--gold-rgb), 0.12);
  --gold-45: rgba(var(--gold-rgb), 0.45);
  --ink-rgb: 3, 16, 24;
  --ink-on-accent: rgb(var(--ink-rgb));
  --ink-on-accent-muted: rgba(var(--ink-rgb), 0.7);
  --ink-hover: #0a2230;
  --danger: #fca5a5;
  --danger-bg: rgba(239, 68, 68, 0.10);
  --danger-line: rgba(239, 68, 68, 0.45);
  --star: #f5b400;

  /* ---- Text ---- */
  --text-primary: #ffffff;
  --text-secondary: #c4c4c4;
  --text-muted: #8a8a8a;
  --text-faint: #5d6068;

  /* ---- Linien ---- */
  --line-soft: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.14);
  --line: rgba(var(--accent-rgb), 0.24);

  /* ---- Typografie ---- */
  --font-display: 'Sora', system-ui, sans-serif;
  --font-sans: 'Sora', system-ui, sans-serif;
  --fs-display: clamp(2.55rem, 1.35rem + 4.1vw, 4.5rem);
  --fs-h2: clamp(2.05rem, 1.25rem + 2.7vw, 3.5rem);
  --fs-h3: clamp(1.25rem, 1.08rem + 0.6vw, 1.6rem);
  --fs-lead: clamp(1.02rem, 0.96rem + 0.28vw, 1.15rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-micro: 0.6875rem;
  --lh-tight: 1.03;
  --lh-body: 1.6;

  /* ---- Raum ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --section-y: clamp(64px, 5vw + 36px, 108px);
  --shell: 100%;
  --gutter: 20px;
  --nav-h: 64px;

  /* ---- Radien ---- */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;

  /* ---- Schatten / Glow ---- */
  --shadow-panel: 0 60px 120px -48px rgba(0, 0, 0, 0.9);
  --shadow-float: 0 24px 48px -18px rgba(0, 0, 0, 0.78);
  --shadow-accent: 0 14px 34px -14px rgba(var(--accent-rgb), 0.6);
  --glow-accent: 0 0 10px var(--accent);
  --glow-accent-2: 0 0 10px var(--accent-2);

  /* ---- Bewegung ---- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 160ms;
  --dur-base: 260ms;
  --dur-slow: 640ms;

  /* ---- Ebenen ---- */
  --z-raised: 2;
  --z-sticky: 20;
  --z-nav: 50;
  --z-float: 80;
  --z-sheet: 100;

  /* ---- Safe Areas ---- */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

@media (min-width: 1024px) {
  :root { --gutter: clamp(32px, 4vw, 96px); --nav-h: 68px; }
}

/* ================= Basis ================= */
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 20px);
  background: var(--bg-base);
}

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  touch-action: manipulation;
}

/* Ruhige Farbwaschung, fest am Viewport */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(70% 55% at 80% 15%, rgba(var(--accent-rgb), 0.10), transparent 65%),
    radial-gradient(65% 50% at 15% 85%, rgba(var(--indigo-rgb), 0.09), transparent 70%),
    radial-gradient(55% 45% at 50% 50%, rgba(var(--accent-rgb), 0.04), transparent 75%),
    linear-gradient(180deg, var(--wash-top) 0%, var(--bg-base) 50%, var(--wash-bottom) 100%);
}

* { -webkit-tap-highlight-color: transparent; }

::selection { background: var(--accent-30); color: var(--text-primary); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Programmatisch fokussierte Sprungziele (Sektionen, Überschriften) ohne Rahmen */
[tabindex="-1"]:focus { outline: none; }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: var(--z-sheet);
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--ink-on-accent);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform var(--dur-base) var(--ease-out);
}

.skip-link:focus { transform: translateY(0); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ================= Layout ================= */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: var(--section-y);
}

.hr-t { border-top: 1px solid var(--line-soft); }
.hr-b { border-bottom: 1px solid var(--line-soft); }
.hr-accent-t { border-top: 1px solid var(--line); }

/* ================= Typografie ================= */
/* Hausschrift: Sora für alles – Überschriften, Fließtext, Zahlen und Labels */
h1, h2, h3, .font-display { font-family: var(--font-display); }

.h-display {
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: var(--lh-tight);
}

.h-section {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.04;
  text-wrap: balance;
}

.h-card {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.62;
  color: var(--text-secondary);
  text-wrap: pretty;
}

.body-muted { color: var(--text-muted); }

/* Signatur 1: Akzentwort in jeder Headline — leichter Schnitt im Sawora-Verlauf */
.accent-word {
  font-weight: 300;
  letter-spacing: -0.02em;
  padding-right: 0.04em;
  color: var(--accent-soft);
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.on-accent .accent-word { background: none; -webkit-text-fill-color: currentColor; color: var(--ink-on-accent); }

/* Signatur 2: Eyebrow, uppercase */
.eyebrow {
  font-family: var(--font-sans);
  font-size: var(--fs-micro);
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Kleine Labels und Zeitangaben (Name historisch: früher Monospace-Schrift).
   Ziffern gleich breit, damit Zahlen wie bei Monospace nicht springen. */
.mono {
  font-family: var(--font-sans);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.tabular { font-variant-numeric: tabular-nums; }

/* Index pro Sektion (01 … 09) */
.index-num {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: var(--fs-micro);
  letter-spacing: 0.16em;
  color: var(--accent);
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--accent-06);
  white-space: nowrap;
}

.index-num small {
  font-size: inherit;
  color: var(--text-faint);
}

/* Signatur 3: Status-/Badge-Pills mit Dot */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  white-space: nowrap;
}

.pill--accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink-on-accent);
  font-weight: 500;
}

/* Gold markiert Empfehlungen („Meistgewählt“, „Empfohlen“) */
.pill--gold {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink-on-gold);
  font-weight: 500;
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: var(--glow-accent-2);
  flex-shrink: 0;
}

.pill-dot--accent { background: var(--accent); box-shadow: var(--glow-accent); }
.pill-dot--muted { background: var(--text-faint); box-shadow: none; }

@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.pill-dot--live { animation: dotPulse 2.4s ease-in-out infinite; }

/* ================= Buttons ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out),
    color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-sm { min-height: 38px; padding: 7px 15px; font-size: 13.5px; }
.btn-lg { min-height: 52px; padding: 14px 26px; font-size: 16px; }
.btn-block { width: 100%; }

.btn-primary {
  background: var(--accent);
  color: var(--ink-on-accent);
  box-shadow: var(--shadow-accent), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn-primary:hover { background: var(--accent-soft); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  border-color: var(--line-strong);
}

.btn-ghost:hover { background: var(--bg-hover); border-color: rgba(255, 255, 255, 0.32); }

.btn-dark {
  background: var(--ink-on-accent);
  color: var(--accent);
}

.btn-dark:hover { background: var(--ink-hover); }

.link-accent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 600;
  transition: gap var(--dur-base) var(--ease-out);
}

.link-accent:hover { gap: 10px; }

/* Glanz-Sweep auf Primärbuttons */
.btn-shine { position: relative; overflow: hidden; isolation: isolate; }

.btn-shine::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 800ms ease;
  pointer-events: none;
  z-index: -1;
}

.btn-shine:hover::before { transform: translateX(120%); }

/* ================= Panels (Produkt-UI) ================= */
/* Kein backdrop-filter: Panels sind fast deckend und liegen oft über animierten Streaks */
.panel {
  position: relative;
  border-radius: var(--r-lg);
  background: var(--panel-fill);
  border: 1px solid var(--line-strong);
}

.panel--float { box-shadow: var(--shadow-panel); }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-body { padding: 18px; }

.window-dots { display: inline-flex; gap: 6px; }

.window-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.glass {
  background: var(--glass-fill);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* Tabelle (Run-Log) */
.monotable-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

.monotable-row:last-child { border-bottom: 0; }

/* Punktraster (Canvas / Hero) */
.dotgrid {
  background-image: radial-gradient(rgba(255, 255, 255, 0.10) 1px, transparent 1.2px);
  background-size: 22px 22px;
}

.gridlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.06;
  background-image:
    linear-gradient(to right, #fff 1px, transparent 1px),
    linear-gradient(to bottom, #fff 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 70%);
  mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 70%);
}

/* ================= Signatur 4: Light-Streaks (SVG) ================= */
.streaks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.streaks svg {
  position: absolute;
  inset: -6% -4%;
  width: 108%;
  height: 112%;
  animation: streakSway 18s var(--ease-in-out) infinite alternate;
  transform-origin: 40% 70%;
  will-change: transform;
}

.streaks--hero {
  -webkit-mask-image: linear-gradient(90deg, transparent 4%, #000 34%, #000 100%), linear-gradient(180deg, #000 70%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 4%, #000 34%, #000 100%), linear-gradient(180deg, #000 70%, transparent 100%);
  mask-composite: intersect;
}

.streaks--band {
  opacity: 0.85;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
}

.streak-pulse {
  animation-name: streakFlow;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.streak-spark { animation: dotPulse 3.2s ease-in-out infinite; }

@keyframes streakFlow {
  from { stroke-dashoffset: 1100; }
  to { stroke-dashoffset: 0; }
}

@keyframes streakSway {
  from { transform: translate3d(-1.2%, 0.8%, 0) rotate(-0.8deg); }
  to { transform: translate3d(1.2%, -0.8%, 0) rotate(0.6deg); }
}

/* ================= Navigation ================= */
.nav-bar {
  transition: background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
  border-bottom: 1px solid transparent;
}

.nav-bar.is-scrolled {
  background: rgba(var(--bg-rgb), 0.82);
  border-bottom-color: var(--line-soft);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.nav-link {
  position: relative;
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--text-muted);
  border-radius: var(--r-pill);
  transition: color var(--dur-fast) ease;
}

.nav-link:hover, .nav-link.is-active { color: var(--text-primary); }

.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: var(--glow-accent);
}

/* Mobile: Bottom-Sheet */
.sheet-scrim {
  position: fixed;
  inset: 0;
  z-index: var(--z-sheet);
  background: var(--scrim);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
}

.sheet-scrim.is-open { opacity: 1; }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: calc(var(--z-sheet) + 1);
  max-height: min(88dvh, 720px);
  display: flex;
  flex-direction: column;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  padding-bottom: var(--safe-bottom);
  transform: translateY(104%);
  transition: transform 380ms var(--ease-out);
  box-shadow: 0 -30px 80px -20px rgba(0, 0, 0, 0.8);
}

.sheet.is-open { transform: translateY(0); }

.sheet-grabber {
  width: 40px;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--line-strong);
  margin: 10px auto 4px;
}

.sheet-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line-soft);
}

.sheet-row:active { background: var(--bg-hover); }

/* ================= Hero ================= */
.hero {
  position: relative;
  overflow: hidden;
  padding-top: calc(var(--nav-h) + clamp(40px, 6vw, 88px));
}

.hero-dots {
  position: absolute;
  inset: 0;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(60% 50% at 18% 30%, #000 0%, transparent 75%);
  mask-image: radial-gradient(60% 50% at 18% 30%, #000 0%, transparent 75%);
  opacity: 0.6;
}

/* Ruhezustand (ohne Scroll-Bühne): leichte Schräge. Mit .fx-on übernimmt die Scroll-Bühne. */
@media (min-width: 1280px) {
  .hero-stage {
    margin-right: -64px;
    transform: perspective(2200px) rotateY(-6deg) rotateX(2deg);
    transform-origin: 0% 50%;
  }
}

/* Unter 1280 px wird das 620 px breite Canvas beschnitten */
.flow-clip { overflow: hidden; }

.flow-canvas {
  position: relative;
  width: 620px;
  height: 286px;
}

.flow-node {
  position: absolute;
  height: 56px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.9);
}

.flow-node--accent { border-color: var(--accent-30); box-shadow: 0 0 0 1px var(--accent-10) inset, 0 10px 24px -14px rgba(0, 0, 0, 0.9); }

.flow-tag {
  position: absolute;
  padding: 2px 7px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 10.5px;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--line-strong);
}

.flow-edge { fill: none; stroke: rgba(255, 255, 255, 0.18); stroke-width: 1.4; }

.flow-edge--live {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-dasharray: 18 400;
  animation: edgeFlow 2.6s linear infinite;
  filter: drop-shadow(0 0 4px var(--accent));
}

@keyframes edgeFlow {
  from { stroke-dashoffset: 418; }
  to { stroke-dashoffset: 0; }
}

.tool-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-soft);
}

.status-rail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line-soft);
}

.status-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 4px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
  color: var(--text-secondary);
}

@media (min-width: 900px) {
  .status-rail { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .status-cell { border-bottom: 0; padding: 22px 16px; border-left: 1px solid var(--line-soft); }
  .status-cell:first-child { border-left: 0; padding-left: 0; }
}

/* ================= Bento (Leistungen) ================= */
.bento {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 768px) {
  .bento { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
  .tile--a { grid-column: span 12; }
  .tile--b, .tile--c { grid-column: span 6; }
  .tile--d { grid-column: span 12; }
}

@media (min-width: 1024px) {
  .tile--a { grid-column: span 7; grid-row: span 2; }
  .tile--b, .tile--c { grid-column: span 5; }
}

.tile {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--panel-fill);
  border: 1px solid var(--line-soft);
  padding: 26px;
  transition: border-color var(--dur-base) var(--ease-out);
  isolation: isolate;
}

@media (min-width: 1024px) { .tile { padding: 32px; } }

.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), var(--accent-10), transparent 45%);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
}

.tile:hover { border-color: var(--line); }
.tile:hover::before { opacity: 1; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border: 1px solid var(--line-strong);
}

.hub-line { stroke: rgba(255, 255, 255, 0.16); stroke-width: 1; stroke-dasharray: 3 4; fill: none; }

.hub-spark {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 9 200;
  animation: edgeFlow 3.2s linear infinite;
}

/* Projekt-Screenshot scrollt beim Hover einmal durch die ganze Seite */
.browser-shot img { transition: transform 7s var(--ease-in-out); }
.tile:hover .browser-shot img { transform: translateY(calc(-100% + var(--shot-h, 180px))); }

/* ================= Ablauf (Timeline) ================= */
.timeline {
  display: grid;
  gap: 0;
  grid-template-columns: minmax(0, 1fr);
}

.tl-step {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 16px;
  padding-bottom: 22px;
}

/* Mobil: Schiene links über beide Zeilen, Label + Karte rechts */
.tl-rail { position: relative; display: flex; justify-content: center; grid-column: 1; grid-row: 1 / span 2; }
.tl-when { grid-column: 2; grid-row: 1; padding: 2px 0 10px; }
.tl-card { grid-column: 2; grid-row: 2; }

/* Linie: ::before grau, ::after füllt sich in Akzentfarbe (--seg) */
.tl-rail::before,
.tl-rail::after {
  content: "";
  position: absolute;
  top: 22px;
  bottom: -22px;
  width: 1px;
  background: var(--line-strong);
}

.tl-rail::after {
  background: var(--accent);
  transform-origin: 50% 0;
  transform: scaleY(var(--seg));
}

.tl-step:last-child .tl-rail::before,
.tl-step:last-child .tl-rail::after { display: none; }

/* --lit (0 … 1): Etappe leuchtet, --seg (0 … 1): Linie zur nächsten Etappe gefüllt.
   Ohne Scroll-Bühne nur die erste Etappe; mit .fx-on aus dem Fortschritt --p der Timeline. */
.tl-step { --lit: 0; --seg: 0; }
.tl-step.is-active { --lit: 1; --seg: 1; }

.fx-on .tl-step {
  --lit: clamp(0, calc((var(--p, 1) - var(--t, 0)) * 8), 1);
  --seg: clamp(0, calc((var(--p, 1) - var(--t, 0)) * 4), 1);
}

.tl-dot {
  position: relative;
  z-index: 1;
  margin-top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-base);
  border: 2px solid var(--line-strong);
}

.tl-dot::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-18);
  opacity: var(--lit);
  transform: scale(calc(0.4 + var(--lit) * 0.6));
}

.tl-card {
  position: relative;
  isolation: isolate;
  border-radius: var(--r-md);
  padding: 22px;
  background: var(--bg-panel);
  border: 1px solid var(--line-soft);
  height: 100%;
}

.tl-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(170deg, var(--accent-10), rgba(var(--accent-rgb), 0.02));
  border: 1px solid var(--accent-30);
  opacity: var(--lit);
  pointer-events: none;
}

/* Karten klappen nach vorn, sobald die Linie sie erreicht */
.fx-on .tl-card {
  transform: perspective(900px) translate3d(0, calc((1 - var(--seg)) * 18px), 0) rotateX(calc((1 - var(--seg)) * 16deg));
  transform-origin: 50% 0;
}

@media (min-width: 1024px) {
  .timeline { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .tl-step { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; padding-bottom: 0; row-gap: 14px; }
  .tl-when, .tl-rail, .tl-card { grid-column: 1; grid-row: auto; }
  .tl-when { padding: 0; }
  .tl-rail { justify-content: flex-start; height: 18px; align-items: center; }
  .tl-dot { margin-top: 0; }
  .tl-rail::before,
  .tl-rail::after {
    top: 50%;
    bottom: auto;
    left: 14px;
    width: calc(100% + 16px - 14px);
    height: 1px;
  }
  .tl-rail::after { transform-origin: 0 50%; transform: scaleX(var(--seg)); }
}

/* ================= Projekte (Index + Vorschau) ================= */
.proj-row {
  width: 100%;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 14px;
  padding: 22px 4px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-faint);
  transition: color var(--dur-base) var(--ease-out), padding-left var(--dur-base) var(--ease-out);
}

.proj-row:hover, .proj-row.is-active { color: var(--text-primary); }
.proj-row.is-active { padding-left: 12px; }

.proj-name {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.1rem + 1.3vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.proj-arrow {
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
  color: var(--accent);
}

.proj-row.is-active .proj-arrow { opacity: 1; transform: none; }

.preview-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  opacity: 0;
  transform: scale(1.025);
  transition: opacity 520ms var(--ease-out), transform 900ms var(--ease-out);
}

.preview-img.is-active { opacity: 1; transform: none; }

/* ================= Preise (Finder) ================= */
.range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  background: transparent;
  cursor: pointer;
}

.range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--accent) var(--fill, 50%), rgba(255, 255, 255, 0.09) var(--fill, 50%));
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -9px;
  border-radius: 50%;
  background: var(--accent);
  border: 4px solid var(--bg-base);
  box-shadow: 0 0 0 1px var(--accent), 0 0 18px var(--accent-45);
}

.range::-moz-range-track { height: 6px; border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.09); }
.range::-moz-range-progress { height: 6px; border-radius: var(--r-pill); background: var(--accent); }

.range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 4px solid var(--bg-base);
  box-shadow: 0 0 0 1px var(--accent), 0 0 18px var(--accent-45);
}

.range:focus-visible { outline: none; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent-45); }
.range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--accent-45); }

.switch {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 28px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid var(--line-strong);
  transition: background-color var(--dur-base) var(--ease-out);
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-primary);
  transition: transform var(--dur-base) var(--ease-out);
}

.switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(20px); background: var(--ink-on-accent); }

.price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  padding: 26px;
  background: var(--panel-fill);
  border: 1px solid var(--line-soft);
  transition: border-color 400ms var(--ease-out), box-shadow 400ms var(--ease-out), transform 400ms var(--ease-out);
}

.price-card.is-match {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset, 0 40px 90px -40px var(--accent-45);
}

@media (min-width: 1024px) { .price-card.is-match { transform: translateY(-8px); } }

/* ================= Intraware (App-Fenster) ================= */
.app-window {
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-app);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-panel);
}

.app-side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.app-side-item.is-active { background: var(--accent-2-10); color: var(--text-primary); box-shadow: inset 0 0 0 1px var(--accent-2-22); }

.app-card {
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-soft);
}

.wf-cell {
  position: relative;
  padding: 16px;
  border-top: 2px solid var(--line-strong);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-soft);
  color: var(--text-secondary);
}

/* ================= Stimmen ================= */
.quote-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border-radius: var(--r-lg);
  padding: 28px;
  background: var(--panel-fill);
  border: 1px solid var(--line-soft);
  isolation: isolate;
}

.quote-text {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  font-size: clamp(1.15rem, 1.02rem + 0.4vw, 1.34rem);
  line-height: 1.42;
  color: rgba(255, 255, 255, 0.9);
  text-wrap: pretty;
}

/* ================= FAQ (Master-Detail) ================= */
.faq-tab {
  width: 100%;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  padding: 18px 16px;
  text-align: left;
  border-radius: var(--r-md);
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}

.faq-tab:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.025); }

.faq-tab[aria-selected="true"] {
  color: var(--text-primary);
  background: var(--bg-panel);
  border-color: var(--line-strong);
}

.accordion-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 420ms var(--ease-out);
}

.accordion-body.is-open { grid-template-rows: 1fr; }
.accordion-body > div { overflow: hidden; }

/* ================= Erstgespräch (Konsole) ================= */
.step-item {
  width: 100%;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 10px;
  border-radius: var(--r-sm);
  text-align: left;
  color: var(--text-faint);
  transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}

.step-item.is-done { color: var(--text-secondary); }
.step-item.is-done:hover { background: rgba(255, 255, 255, 0.03); }
.step-item.is-active { color: var(--text-primary); background: var(--bg-panel-strong); }

.step-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 11px;
  border: 1px solid var(--line-strong);
}

.step-item.is-done .step-badge { background: var(--accent-10); border-color: var(--accent-30); color: var(--accent); }
.step-item.is-active .step-badge { background: var(--accent); border-color: var(--accent); color: var(--ink-on-accent); }

.choice {
  text-align: left;
  border-radius: var(--r-md);
  padding: 16px 18px;
  min-height: 56px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line-strong);
  transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.choice:hover { border-color: rgba(255, 255, 255, 0.28); }

.choice[aria-pressed="true"] {
  background: var(--accent-10);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-10);
}

.field-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  font-size: 16px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-strong);
  outline: none;
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease;
  font-family: inherit;
}

.field-input::placeholder { color: var(--text-faint); }
.field-input:focus { border-color: var(--accent); background: rgba(255, 255, 255, 0.06); }
.field-input[aria-invalid="true"] { border-color: var(--danger-line); }

/* ================= Signatur 5: CTA-Karte im Sawora-Verlauf ================= */
.cta-accent {
  background: var(--accent-gradient);
  color: var(--ink-on-accent);
  border-radius: var(--r-xl);
}

.on-accent .eyebrow, .on-accent-muted { color: var(--ink-on-accent-muted); }

.input-on-accent {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  font-size: 16px;
  color: var(--ink-on-accent);
  background: rgba(var(--ink-rgb), 0.08);
  border: 1px solid rgba(var(--ink-rgb), 0.24);
  outline: none;
  font-family: inherit;
}

.input-on-accent::placeholder { color: var(--ink-on-accent-muted); }
.input-on-accent:focus { border-color: var(--ink-on-accent); background: rgba(var(--ink-rgb), 0.12); }
.on-accent :focus-visible { outline-color: var(--ink-on-accent); }

/* ================= Footer ================= */
/* Übergroße Wortmarke, unten vom Seitenende angeschnitten */
.wordmark-crop {
  font-size: clamp(5.5rem, 2rem + 17vw, 17rem);
  height: 0.64em;
  overflow: hidden;
}

.wordmark {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.82;
  font-size: 1em;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.11) 0%, rgba(255, 255, 255, 0) 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  user-select: none;
  white-space: nowrap;
}

.wordmark b {
  background: linear-gradient(180deg, var(--accent) 0%, rgba(var(--accent-rgb), 0) 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ================= Mega-Menü (Leistungen) ================= */
.mega {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  padding-top: 8px;
}

.mega:not([hidden]) { animation: megaIn 240ms var(--ease-out) both; }

@keyframes megaIn {
  from { opacity: 0; transform: translate3d(0, -8px, 0); }
  to { opacity: 1; transform: none; }
}

.mega-panel {
  padding: 26px;
  border-radius: var(--r-lg);
  /* fast deckend: unter dem backdrop-filter der Navigation wirkt ein eigener Blur nicht */
  background: var(--menu-fill);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-panel);
}

.mega-big {
  display: block;
  padding: 4px 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-secondary);
  transition: color var(--dur-fast) ease;
}

.mega-big:hover { color: var(--text-primary); }

.mega-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: var(--r-sm);
  transition: background-color var(--dur-fast) ease;
}

.mega-item:hover { background: var(--bg-hover); }

.mega-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: var(--accent-10);
  border: 1px solid var(--line);
}

/* Promo-Karte im Sawora-Verlauf (Referenz Hers) */
.mega-promo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px;
  border-radius: var(--r-md);
  background: var(--accent-gradient);
  color: var(--ink-on-accent);
  transition: transform var(--dur-base) var(--ease-out);
}

.mega-promo:hover { transform: translateY(-2px); }
.mega-promo :focus-visible, .mega-promo:focus-visible { outline-color: var(--ink-on-accent); }

.mega-chevron { transition: transform var(--dur-base) var(--ease-out); }
[aria-expanded="true"] > .mega-chevron { transform: rotate(180deg); }

.sheet-row.is-current { color: var(--accent); }

/* ================= Unterseiten-Kopf ================= */
.page-hero {
  position: relative;
  overflow: hidden;
  padding-top: calc(var(--nav-h) + clamp(28px, 4vw, 56px));
  padding-bottom: clamp(40px, 5vw, 72px);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: var(--fs-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.crumbs li { display: inline-flex; align-items: center; gap: 10px; }
.crumbs li + li::before { content: "→"; color: var(--text-faint); letter-spacing: 0; }
.crumbs a { transition: color var(--dur-fast) ease; }
.crumbs a:hover { color: var(--text-primary); }
.crumbs [aria-current="page"] { color: var(--accent); }

.status-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  transition: color var(--dur-fast) ease;
}

.status-link:hover { color: var(--text-primary); }
.status-arrow { margin-left: auto; color: var(--text-faint); transition: transform var(--dur-base) var(--ease-out), color var(--dur-base) ease; }
.status-link:hover .status-arrow { transform: translateX(3px); color: var(--accent); }

/* ================= Leistungen im Detail (Koto / Büro) ================= */
.svc-row {
  position: relative;
  display: grid;
  gap: 28px;
  padding-block: clamp(48px, 6vw, 96px);
  border-top: 1px solid var(--line-soft);
}

.svc-row:first-child { border-top: 0; }

@media (min-width: 1024px) {
  .svc-row {
    grid-template-columns: minmax(0, 0.42fr) minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
  }
  .svc-num { position: sticky; top: calc(var(--nav-h) + 32px); }
}

.svc-num {
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 2rem + 8vw, 9.5rem);
  font-weight: 300;
  line-height: 0.82;
  letter-spacing: -0.06em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent);
}

.svc-title { font-size: clamp(1.9rem, 1.35rem + 1.7vw, 2.85rem); max-width: 15ch; }

.svc-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 15px;
  color: var(--text-secondary);
}

.svc-list li:last-child { border-bottom: 1px solid var(--line-soft); }
.svc-list svg { margin-top: 3px; flex-shrink: 0; }

/* ================= Projekt-Karten (Start) ================= */
.proj-card {
  display: block;
  overflow: hidden;
  transition: border-color var(--dur-base) var(--ease-out);
}

.proj-card:hover { border-color: var(--line); }
.proj-card-img { transition: transform 900ms var(--ease-out); }
.proj-card:hover .proj-card-img { transform: scale(1.04); }

/* ================= Arbeitsweise (basement.studio) ================= */
.principle {
  padding: 26px 0 30px;
  border-top: 1px solid var(--line-strong);
}

/* ================= Kontakt: direkte Wege ================= */
.contact-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
  min-height: 84px;
  padding: 18px 20px;
  border-radius: var(--r-md);
  background: var(--panel-fill);
  border: 1px solid var(--line-soft);
  transition: border-color var(--dur-base) var(--ease-out);
}

a.contact-tile:hover { border-color: var(--line); }

/* ================= Nächstes Kapitel (Analogue) ================= */
.next-chapter {
  position: relative;
  border-top: 1px solid var(--line-soft);
  padding-block: clamp(72px, 9vw, 150px);
  overflow: hidden;
}

.next-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  perspective: 1200px;
}

/* Die Überschrift füllt sich mit dem Verlauf, während man auf sie zuscrollt (--p) */
.next-title {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 1rem + 11vw, 11rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.05em;
  padding-bottom: 0.06em;
  background-image: linear-gradient(90deg, var(--accent) 0%, var(--accent-soft) 25%, var(--lavender) 50%, rgba(255, 255, 255, 0.12) 50%, rgba(255, 255, 255, 0.12) 100%);
  background-size: 200% 100%;
  background-position: calc((1 - var(--p, 1)) * 100%) 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--text-primary);
}

.next-sub {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(1rem, 0.9rem + 0.5vw, 1.25rem);
  color: var(--text-secondary);
  transition: gap var(--dur-base) var(--ease-out), color var(--dur-base) ease;
}

.next-link:hover .next-sub { gap: 16px; color: var(--accent); }

/* ================= Scroll-Bühne: 3D + Scroll =================
   --p (0 … 1) schreibt ScrollStage (components.jsx) pro [data-fx]-Element, --tilt-x/-y folgen der Maus.
   Alles nur mit .fx-on: ohne JS oder bei reduzierter Bewegung gilt der Endzustand.
   --fx-depth dämpft die Wege auf kleinen Bildschirmen. */
:root { --fx-depth: 1; }
@media (max-width: 767px) { :root { --fx-depth: 0.55; } }

/* Fortschritt der Seite unter der Navigation */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: calc(var(--z-nav) + 1);
  background: var(--accent-gradient);
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
  pointer-events: none;
}

html:not(.fx-on) .scroll-progress { display: none; }

/* Headlines: Wörter klappen in 3D auf (beim Einblenden der Sektion bzw. beim Laden) */
.words .word {
  display: inline-block;
  perspective: 700px;
}

.words .word-in {
  display: inline-block;
  transform-origin: 50% 100%;
}

.js .reveal .words .word-in {
  opacity: 0;
  transform: translate3d(0, 0.45em, 0) rotateX(-82deg);
  transition: opacity 600ms var(--ease-out), transform 1000ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 55ms + 120ms);
}

.js .reveal.in .words .word-in { opacity: 1; transform: none; }

.js .words--load .word-in {
  animation: wordIn 1100ms var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 70ms + 140ms);
}

@keyframes wordIn {
  from { opacity: 0; transform: translate3d(0, 0.5em, 0) rotateX(-85deg); }
  to { opacity: 1; transform: none; }
}

/* Aufbauen: Element steigt aus der Tiefe und klappt nach vorn */
.fx-on .fx-rise {
  transform: perspective(1400px)
    translate3d(0, calc((1 - var(--p, 1)) * 110px * var(--fx-depth)), calc((1 - var(--p, 1)) * -220px * var(--fx-depth)))
    rotateX(calc((1 - var(--p, 1)) * 24deg * var(--fx-depth) + var(--tilt-x, 0deg)))
    rotateY(var(--tilt-y, 0deg));
  transform-origin: 50% 100%;
  opacity: calc(0.12 + var(--p, 1) * 0.88);
}

/* Bildschirm: liegt schräg nach hinten und richtet sich beim Scrollen auf */
.fx-on .fx-screen {
  transform: perspective(2000px)
    translate3d(0, calc((1 - var(--p, 1)) * 70px * var(--fx-depth)), 0)
    rotateX(calc((1 - var(--p, 1)) * var(--fx-angle, 32deg) * var(--fx-depth) + var(--tilt-x, 0deg)))
    rotateY(var(--tilt-y, 0deg))
    scale(calc(1 - (1 - var(--p, 1)) * 0.12));
  transform-origin: 50% 100%;
  opacity: calc(0.25 + var(--p, 1) * 0.75);
}

/* Schwenk: dreht sich von der Seite in die Bildebene (Projekt-Vorschau) */
.fx-on .fx-swing {
  transform: perspective(1600px)
    translate3d(calc((1 - var(--p, 1)) * 90px), 0, calc((1 - var(--p, 1)) * -140px))
    rotateY(calc((1 - var(--p, 1)) * -34deg + var(--tilt-y, 0deg)))
    rotateX(var(--tilt-x, 0deg));
  transform-origin: 100% 50%;
  opacity: calc(0.2 + var(--p, 1) * 0.8);
}

/* Gleiten: Zeilen kommen von links (Projekt-Index) */
.fx-on .fx-slide {
  transform: translate3d(calc((1 - var(--p, 1)) * -90px * var(--fx-depth)), 0, 0);
  opacity: calc(0.1 + var(--p, 1) * 0.9);
}

/* Fächer: Karten kommen aus der Mitte und der Tiefe (--fan: -1 links, 0 Mitte, 1 rechts) */
.fan-stage { perspective: 1700px; }

.fx-on .fx-fan {
  transform: translate3d(0, calc((1 - var(--p, 1)) * 100px * var(--fx-depth)), calc((1 - var(--p, 1)) * -200px * var(--fx-depth)))
    rotateX(calc((1 - var(--p, 1)) * 14deg + var(--tilt-x, 0deg)))
    rotateY(var(--tilt-y, 0deg));
  opacity: calc(0.15 + var(--p, 1) * 0.85);
}

@media (min-width: 768px) {
  .fx-on .fx-fan {
    transform: translate3d(calc((1 - var(--p, 1)) * var(--fan, 0) * -110px), calc((1 - var(--p, 1)) * 70px), calc((1 - var(--p, 1)) * -240px))
      rotateY(calc((1 - var(--p, 1)) * var(--fan, 0) * -30deg + var(--tilt-y, 0deg)))
      rotateX(calc((1 - var(--p, 1)) * 10deg + var(--tilt-x, 0deg)));
  }
}

/* Parallaxe: Karten ziehen unterschiedlich schnell vorbei (--depth) */
@media (min-width: 1024px) {
  .fx-on .fx-parallax {
    transform: perspective(1200px)
      translate3d(0, calc((0.5 - var(--p, 0.5)) * var(--depth, 1) * 130px), 0)
      rotateX(calc((0.5 - var(--p, 0.5)) * var(--depth, 1) * 8deg + var(--tilt-x, 0deg)))
      rotateY(var(--tilt-y, 0deg));
  }
}

/* Bild bewegt sich im Rahmen langsamer als die Seite */
.fx-on .fx-img-parallax img {
  transform: scale(1.14) translate3d(0, calc((0.5 - var(--p, 0.5)) * 9%), 0);
}

/* Große Leistungsnummer kippt aus der Tiefe nach vorn */
.fx-on .svc-num {
  transform: perspective(900px) rotateX(calc((1 - var(--p, 1)) * -70deg)) translate3d(0, calc((1 - var(--p, 1)) * 40px), 0);
  transform-origin: 50% 100%;
  opacity: calc(0.1 + var(--p, 1) * 0.9);
}

/* Nächstes Kapitel: Titel richtet sich auf, während er sich füllt */
.fx-on .next-title {
  transform: rotateX(calc((1 - var(--p, 1)) * 38deg)) scale(calc(0.86 + var(--p, 1) * 0.14));
  transform-origin: 0% 100%;
}

/* ---- Hero: Bühne kippt beim Hinausscrollen, Ebenen schweben auseinander ---- */
.fx-on .hero .streaks,
.fx-on .page-hero .streaks { transform: translate3d(0, calc(var(--p, 0) * 220px), 0); }

.fx-on .hero-copy,
.fx-on .page-hero-copy {
  transform: translate3d(0, calc(var(--p, 0) * -100px), 0);
  opacity: calc(1 - var(--p, 0) * 1.3);
}

@media (min-width: 1024px) {
  .fx-on .hero-stage {
    transform: perspective(2200px)
      translate3d(0, calc(var(--p, 0) * 150px), calc(var(--p, 0) * -260px))
      rotateX(calc(4deg + var(--p, 0) * 30deg + var(--tilt-x, 0deg)))
      rotateY(calc(-9deg + var(--p, 0) * -12deg + var(--tilt-y, 0deg)))
      rotateZ(calc(var(--p, 0) * 2deg));
    transform-origin: 50% 40%;
  }
}

/* Ab 1280 px ist das Canvas unbeschnitten: echte 3D-Ebenen statt flachem Bild */
@media (min-width: 1280px) {
  .fx-on .hero-stage,
  .fx-on .hero-stage .panel,
  .fx-on .hero-stage .panel-body { transform-style: preserve-3d; }
  .fx-on .hero-stage .flow-clip { overflow: visible; }
  .fx-on .hero-stage .flow-layer { transform: translate3d(0, 0, calc(36px + var(--p, 0) * 130px)); }
  .fx-on .hero-stage .log-layer { transform: translate3d(0, 0, calc(14px + var(--p, 0) * 60px)); }
  .fx-on .hero-stage .float-layer { transform: translate3d(0, 0, calc(80px + var(--p, 0) * 260px)); }
}

/* ================= Bewegung ================= */
@keyframes heroUp {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-anim-1 { animation: heroUp 900ms var(--ease-out) both; }
.hero-anim-2 { animation: heroUp 900ms var(--ease-out) 120ms both; }
.hero-anim-3 { animation: heroUp 900ms var(--ease-out) 240ms both; }
.hero-anim-4 { animation: heroUp 900ms var(--ease-out) 360ms both; }
.hero-anim-5 { animation: heroUp 1100ms var(--ease-out) 300ms both; }

@keyframes floatA { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes floatB { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.float-a { animation: floatA 5.5s ease-in-out infinite; }
.float-b { animation: floatB 7s ease-in-out infinite 0.8s; }

/* Reveal: Kinder mit .ri erscheinen gestaffelt, sobald die Sektion sichtbar wird */
.js .reveal .ri {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
}

.js .reveal.in .ri { opacity: 1; transform: none; }
.ri.d1 { transition-delay: 70ms !important; }
.ri.d2 { transition-delay: 150ms !important; }
.ri.d3 { transition-delay: 230ms !important; }
.ri.d4 { transition-delay: 320ms !important; }
.ri.d5 { transition-delay: 420ms !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }

  .streaks svg, .streak-pulse, .flow-edge--live, .hub-spark, .float-a, .float-b, .pill-dot--live { animation: none !important; }
  .streak-pulse, .flow-edge--live, .hub-spark { display: none; }
  .js .reveal .ri { opacity: 1; transform: none; }
  .hero-stage { transform: none !important; }
  .js .reveal .words .word-in, .js .words--load .word-in { opacity: 1; transform: none; animation: none; }
  .mega:not([hidden]) { animation: none; }
  .tile:hover .browser-shot img { transform: none; }
}
