/* ==========================================================================
   heroscene.css — Erklär-Szene im Hero der Startseite
   Ersetzt das 23-MB-MP4 durch eine gebaute Szene: sieben Stationen des
   Acessio-Systems, je ein Beweisbild. Reines HTML/CSS/SVG, ~20 KB statt 23 MB,
   gestochen scharf auf jedem Display, respektiert prefers-reduced-motion.
   Tokens kommen aus main.css (premium-v7).
   ========================================================================== */

.hscene {
  --hs-ink: var(--ink);
  --hs-muted: var(--muted);
  --hs-line: var(--line);
  --hs-accent: var(--accent);
  --hs-paper: #fff;
  --hs-dur: 320ms;

  position: relative;
  margin-top: clamp(48px, 6vw, 88px);
  /* Der Hero ist zentriert — die Szene erbt das sonst und stellt alle Karten mittig. */
  text-align: left;
  border: 1px solid var(--line);
  border-radius: clamp(20px, 2.4vw, 30px);
  background: linear-gradient(180deg, #EAE4DD 0%, #E4DCD3 100%);
  overflow: hidden;
  container-type: inline-size;
}
.hscene__stage {
  position: relative;
  aspect-ratio: 16 / 9;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(10px, 1.4cqw, 22px);
  padding: clamp(16px, 2.6cqw, 40px);
}

/* ---------- Kopfzeile der Szene ---------- */
.hscene__head { display: flex; align-items: baseline; gap: clamp(10px, 1.4cqw, 18px); min-height: 1.6em; }
.hscene__step {
  font-family: var(--sans);
  font-size: clamp(9px, 1.05cqw, 13px);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--hs-muted);
  font-variant-numeric: tabular-nums;
}
.hscene__label {
  font-family: var(--serif);
  font-style: normal;
  font-size: clamp(17px, 2.5cqw, 34px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--hs-ink);
}
.hscene__label .dot { color: var(--hs-accent); font-style: normal; }
.hscene__note {
  margin-left: auto;
  font-size: clamp(9px, 1.05cqw, 13px);
  color: var(--hs-muted);
  text-align: right;
  max-width: 32ch;
}

/* ---------- Bühne ---------- */
.hscene__frames { position: relative; }
.hscene__frame {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  transition: opacity var(--hs-dur) var(--ease), transform var(--hs-dur) var(--ease);
  pointer-events: none;
}
.hscene__frame[data-active="true"] { opacity: 1; transform: none; }

/* ---------- Fortschritt ---------- */
.hscene__rail { display: flex; align-items: center; gap: clamp(5px, 0.7cqw, 9px); }
.hscene__tick {
  height: 2px;
  flex: 1;
  border-radius: 2px;
  background: rgba(25, 25, 28, 0.12);
  overflow: hidden;
}
.hscene__tick i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--hs-accent);
  border-radius: 2px;
}
.hscene__tick[data-state="done"] i { width: 100%; }
.hscene__tick[data-state="run"] i { width: 100%; transition: width var(--hs-hold, 3400ms) linear; }

/* ---------- Karte (gemeinsamer Rahmen aller Stationen) ---------- */
.hs-card {
  width: min(76cqw, 700px);
  background: var(--hs-paper);
  border: 1px solid rgba(25, 25, 28, 0.08);
  border-radius: clamp(10px, 1.2cqw, 16px);
  box-shadow: 0 clamp(10px, 1.6cqw, 26px) clamp(24px, 3.4cqw, 56px) -18px rgba(25, 25, 28, 0.32);
  padding: clamp(12px, 1.7cqw, 24px);
  font-size: clamp(9px, 1.15cqw, 14px);
  line-height: 1.45;
  color: var(--hs-ink);
}
.hs-card--narrow { width: min(62cqw, 540px); }
.hs-row { display: flex; align-items: center; gap: clamp(7px, 0.9cqw, 12px); }
.hs-muted { color: var(--hs-muted); }
.hs-bar { height: clamp(5px, 0.62cqw, 8px); border-radius: 99px; background: rgba(25, 25, 28, 0.10); }
.hs-bar--accent { background: rgba(34, 199, 214, 0.5); }

/* Station 1 · Suche */
.hs-search {
  display: flex;
  align-items: center;
  gap: clamp(7px, 0.9cqw, 12px);
  border: 1px solid rgba(25, 25, 28, 0.14);
  border-radius: 99px;
  padding: clamp(7px, 0.9cqw, 12px) clamp(11px, 1.4cqw, 18px);
}
.hs-search svg { width: 1.15em; height: 1.15em; stroke: var(--hs-muted); fill: none; stroke-width: 1.6; flex-shrink: 0; }
.hs-caret { display: inline-block; width: 1px; height: 1.1em; background: var(--hs-ink); vertical-align: -0.18em; margin-left: 2px; animation: hs-blink 1s steps(1) infinite; }
@keyframes hs-blink { 50% { opacity: 0; } }
.hs-results { margin-top: clamp(10px, 1.3cqw, 18px); display: grid; gap: clamp(7px, 0.9cqw, 12px); }
.hs-result { display: grid; gap: 5px; justify-items: start; text-align: left; padding: clamp(7px, 0.9cqw, 12px); border-radius: clamp(7px, 0.8cqw, 11px); transition: background var(--hs-dur) var(--ease), box-shadow var(--hs-dur) var(--ease); }
.hs-result[data-you="true"] { background: rgba(34, 199, 214, 0.09); box-shadow: inset 0 0 0 1px rgba(34, 199, 214, 0.32); }
.hs-result__name { font-weight: 500; }
.hs-result[data-you="true"] .hs-result__name { color: var(--accent-ink); }

/* Station 2 · KI-Antwort */
.hs-chat { display: grid; gap: clamp(9px, 1.1cqw, 15px); }
.hs-chat__q { justify-self: end; background: rgba(25, 25, 28, 0.055); border-radius: 14px 14px 4px 14px; padding: clamp(7px, 0.9cqw, 12px) clamp(10px, 1.2cqw, 16px); max-width: 74%; }
.hs-chat__a { justify-self: start; border: 1px solid rgba(25, 25, 28, 0.10); border-radius: 14px 14px 14px 4px; padding: clamp(9px, 1.1cqw, 15px) clamp(11px, 1.3cqw, 17px); max-width: 88%; }
.hs-chat__a b { color: var(--accent-ink); font-weight: 500; }
.hs-chat__meta { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; font-size: 0.82em; color: var(--hs-muted); letter-spacing: 0.09em; text-transform: uppercase; }
.hs-chat__meta span { width: 5px; height: 5px; border-radius: 50%; background: var(--hs-accent); }

/* Station 3 · Website */
.hs-site { border: 1px solid rgba(25, 25, 28, 0.10); border-radius: clamp(8px, 0.9cqw, 12px); overflow: hidden; }
.hs-site__bar { display: flex; align-items: center; gap: 5px; padding: clamp(6px, 0.7cqw, 10px) clamp(9px, 1cqw, 14px); border-bottom: 1px solid rgba(25, 25, 28, 0.08); background: rgba(25, 25, 28, 0.03); }
.hs-site__dot { width: clamp(4px, 0.48cqw, 7px); height: clamp(4px, 0.48cqw, 7px); border-radius: 50%; background: rgba(25, 25, 28, 0.16); }
.hs-site__body { padding: clamp(12px, 1.5cqw, 22px); display: grid; gap: clamp(8px, 1cqw, 14px); }
.hs-site__h { font-family: var(--serif); font-style: normal; font-size: clamp(15px, 2cqw, 27px); line-height: 1; letter-spacing: -0.02em; }
.hs-site__cta { justify-self: start; background: var(--hs-ink); color: #fff; border-radius: 99px; padding: clamp(5px, 0.62cqw, 9px) clamp(11px, 1.3cqw, 18px); font-size: 0.92em; }

/* Station 4 · Anfrage */
.hs-form { display: grid; gap: clamp(8px, 1cqw, 13px); }
.hs-field { display: grid; gap: 5px; }
.hs-field__label { font-size: 0.85em; color: var(--hs-muted); }
.hs-field__box { border: 1px solid rgba(25, 25, 28, 0.14); border-radius: clamp(6px, 0.7cqw, 9px); padding: clamp(6px, 0.75cqw, 10px) clamp(8px, 1cqw, 13px); }
.hs-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(34, 199, 214, 0.4); background: rgba(34, 199, 214, 0.09); color: var(--accent-ink); border-radius: 99px; padding: 4px 11px; font-size: 0.85em; }

/* Station 5 · Termin */
.hs-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: clamp(4px, 0.52cqw, 7px); }
.hs-cal__d { aspect-ratio: 1; display: grid; place-items: center; border-radius: clamp(5px, 0.6cqw, 8px); background: rgba(25, 25, 28, 0.045); font-size: 0.88em; color: var(--hs-muted); }
.hs-cal__d[data-pick="true"] { background: var(--hs-ink); color: #fff; }
.hs-slots { display: flex; gap: clamp(5px, 0.65cqw, 9px); margin-top: clamp(10px, 1.2cqw, 16px); }
.hs-slot { border: 1px solid rgba(25, 25, 28, 0.14); border-radius: 99px; padding: 4px 11px; font-size: 0.85em; color: var(--hs-muted); }
.hs-slot[data-pick="true"] { border-color: var(--hs-accent); background: rgba(34, 199, 214, 0.1); color: var(--accent-ink); }

/* Station 6 · Rechnung */
.hs-inv { display: grid; gap: clamp(8px, 1cqw, 13px); }
.hs-inv__line { display: flex; justify-content: space-between; gap: 12px; }
.hs-inv__total { border-top: 1px solid rgba(25, 25, 28, 0.10); padding-top: clamp(7px, 0.9cqw, 12px); font-weight: 500; }
.hs-stamp {
  justify-self: end;
  border: 1px solid rgba(34, 199, 214, 0.55);
  color: var(--accent-ink);
  border-radius: 99px;
  padding: 4px 13px;
  font-family: var(--serif);
  font-style: normal;
  font-size: 1.05em;
  transform: rotate(-4deg);
}

/* Station 7 · Bewertung + Kreis */
.hs-stars { font-size: clamp(15px, 2.1cqw, 30px); letter-spacing: 0.12em; color: var(--hs-accent); }
.hs-quote { font-family: var(--serif); font-style: italic; font-size: clamp(12px, 1.55cqw, 20px); line-height: 1.3; margin-top: clamp(7px, 0.9cqw, 12px); }
.hs-loop { display: flex; align-items: center; gap: 9px; margin-top: clamp(10px, 1.3cqw, 18px); color: var(--hs-muted); font-size: 0.9em; }
.hs-loop svg { width: 1.25em; height: 1.25em; stroke: var(--hs-accent); fill: none; stroke-width: 1.5; }

/* ---------- Bedienung ---------- */
.hscene__controls { position: absolute; right: clamp(10px, 1.3cqw, 18px); bottom: clamp(10px, 1.3cqw, 18px); }
.hscene__toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(25, 25, 28, 0.16);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(6px);
  border-radius: 99px;
  padding: 6px 13px;
  font-size: clamp(9px, 1cqw, 12px);
  color: var(--hs-ink);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.hscene__toggle:hover { background: #fff; border-color: rgba(25, 25, 28, 0.3); }
.hscene__toggle svg { width: 1em; height: 1em; fill: currentColor; }

/* ---------- Ohne JavaScript / reduzierte Bewegung ---------- */
html.no-js .hscene__frame { position: relative; opacity: 1; transform: none; }
html.no-js .hscene__stage { aspect-ratio: auto; }
html.no-js .hscene__frames { display: grid; gap: 20px; }
html.no-js .hscene__rail, html.no-js .hscene__controls, html.no-js .hscene__step { display: none; }

@media (prefers-reduced-motion: reduce) {
  .hscene__frame { transition: none; }
  .hs-caret { animation: none; }
  .hscene__tick[data-state="run"] i { transition: none; }
}

@container (max-width: 560px) {
  .hscene__note { display: none; }
  .hs-card { width: 88cqw; }
  .hs-card--narrow { width: 88cqw; }
}

/* ---------- Station 8 · Verbunden: das Ökosystem um den Betrieb ---------- */
.hs-orbit {
  width: min(92cqw, 860px);
  display: grid;
  justify-items: center;
  gap: clamp(6px, 0.9cqw, 14px);
}
.hs-orbit svg { width: 100%; height: auto; display: block; overflow: visible; }

/* Verbindungen */
.hs-orbit__lines use {
  fill: none;
  stroke: rgba(25, 25, 28, 0.16);
  stroke-width: 1;
  stroke-dasharray: 3 5;
  animation: hs-dash 3.2s linear infinite;
}
@keyframes hs-dash { to { stroke-dashoffset: -32; } }

/* Datenpunkte, die zwischen Betrieb und System laufen */
.hs-flow { fill: var(--hs-accent); opacity: 0.85; }
.hs-flow--in { fill: rgba(25, 25, 28, 0.45); }
.hs-flow--pay { fill: #2E7D50; r: 4.2; }

/* Satelliten */
.hs-node rect {
  fill: var(--hs-paper);
  stroke: rgba(25, 25, 28, 0.10);
  stroke-width: 1;
}
.hs-node text {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  fill: var(--hs-ink);
}
.hs-node .hs-node__sub {
  font-size: 10.5px;
  font-weight: 400;
  fill: var(--hs-muted);
}
.hs-node__ic {
  fill: none;
  stroke: var(--accent-ink);
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Mitte */
.hs-hub rect {
  fill: #19191C;
  stroke: none;
}
.hs-hub text {
  font-family: var(--serif);
  font-style: normal;
  font-size: 19px;
  fill: #F3F1F0;
  text-anchor: middle;
}
.hs-hub .hs-hub__sub {
  font-family: var(--sans);
  font-style: normal;
  font-size: 10.5px;
  fill: rgba(243, 241, 240, 0.62);
}

/* Bezahl-Leiste: Betrag, Fortschritt, Stempel */
.hs-pay {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.2cqw, 18px);
  background: var(--hs-paper);
  border: 1px solid rgba(25, 25, 28, 0.08);
  border-radius: 99px;
  padding: clamp(6px, 0.8cqw, 11px) clamp(12px, 1.6cqw, 22px);
  box-shadow: 0 clamp(8px, 1.2cqw, 18px) clamp(18px, 2.6cqw, 40px) -16px rgba(25, 25, 28, 0.3);
  font-size: clamp(8px, 1.02cqw, 12.5px);
}
.hs-pay__label { color: var(--hs-muted); }
.hs-pay__amount { font-weight: 500; font-variant-numeric: tabular-nums; }
.hs-pay__track {
  position: relative;
  width: clamp(46px, 8cqw, 110px);
  height: clamp(3px, 0.42cqw, 5px);
  border-radius: 99px;
  background: rgba(25, 25, 28, 0.10);
  overflow: hidden;
}
.hs-pay__track i {
  position: absolute;
  inset: 0 100% 0 0;
  background: #2E7D50;
  border-radius: 99px;
  animation: hs-pay-fill 3.4s var(--ease, ease) infinite;
}
@keyframes hs-pay-fill {
  0%, 8%   { inset: 0 100% 0 0; }
  52%, 100% { inset: 0 0 0 0; }
}
.hs-pay__stamp {
  color: #2E7D50;
  font-weight: 500;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: scale(1.35) rotate(-6deg);
  animation: hs-pay-stamp 3.4s var(--ease, ease) infinite;
}
@keyframes hs-pay-stamp {
  0%, 50%  { opacity: 0; transform: scale(1.35) rotate(-6deg); }
  58%      { opacity: 1; transform: scale(0.96) rotate(-6deg); }
  64%, 100% { opacity: 1; transform: scale(1) rotate(-6deg); }
}

/* Nur die aktive Station animiert — spart Rechenzeit und beruhigt das Bild. */
.hscene__frame[data-active="false"] .hs-orbit__lines use,
.hscene__frame[data-active="false"] .hs-pay__track i,
.hscene__frame[data-active="false"] .hs-pay__stamp { animation-play-state: paused; }

@media (prefers-reduced-motion: reduce) {
  .hs-orbit__lines use,
  .hs-pay__track i,
  .hs-pay__stamp { animation: none; }
  .hs-pay__track i { inset: 0 0 0 0; }
  .hs-pay__stamp { opacity: 1; transform: none; }
  .hs-flow { display: none; }
}
