/* ==========================================================================
   Vision: Hub-Konzept als Scrollytelling (Präfix hs-)
   Eine Bühne bleibt sticky im Viewport, die Kapitel laufen darüber hinweg.
   Ohne JavaScript oder WebGL (Klasse is-static fehlt/steht) zeigen die Karten
   ihr Bild; mit laufender Szene (is-live) verschwinden die Bilder.
   Farben mit fester Bedeutung: --hs-cool ist nur der Brutstrom,
   --hs-warm ist nur die Plattenlieferung.
   ========================================================================== */

:root {
  --hs-cool: #5fb8ff;
  --hs-warm: #f2b544;
  --hs-card-bg: rgba(11, 16, 21, 0.78);
}

.hs { position: relative; background: var(--eco-surface); }
.hs *, .hs *::before, .hs *::after { box-sizing: border-box; }

/* ------------------------------------------------------------ Bühne */
.hs-stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; z-index: 1; background: var(--eco-surface); }
.hs-stage__sky {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 62% 78%, rgba(127,226,143,0.10), transparent 70%),
    radial-gradient(ellipse 60% 40% at 20% 10%, rgba(95,184,255,0.08), transparent 70%),
    linear-gradient(180deg, #0d1620 0%, #0b1015 55%, #090d11 100%);
}
.hs-stage__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; opacity: 1; transition: opacity .8s ease; }
.hs-stage__canvas { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; }
.hs-stage__canvas canvas { display: block; width: 100%; height: 100%; }
.hs.is-live .hs-stage__canvas { opacity: 1; }
.hs.is-live .hs-stage__poster { opacity: 0; }
.hs.is-static .hs-stage__poster { opacity: 1; }
.hs.is-static .hs-stage__canvas, .hs.is-static .hs-stage__labels { display: none; }

/* Blende für Kapitelwechsel (Reduced Motion) und den Übergang zur Wand */
.hs-stage__veil { position: absolute; inset: 0; background: var(--eco-surface); opacity: 0; pointer-events: none; }

/* Ringschluss: die Hauptbotschaft am Ende noch einmal, klein */
.hs-stage__ring {
  position: absolute; left: var(--eco-gutter); bottom: clamp(24px, 5vh, 48px); margin: 0; max-width: 46ch;
  font-family: var(--eco-font-quote); font-style: italic; font-size: clamp(18px, 1.6vw, 24px); color: var(--eco-ink-strong);
  opacity: 0; transform: translateY(8px); transition: opacity .6s ease, transform .6s ease; pointer-events: none;
}
.hs.is-live .hs-stage__ring.is-on { opacity: 1; transform: none; }

/* ------------------------------------------------------------ Labels in der Szene */
.hs-stage__labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.hs-label {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -100%);
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  font-family: var(--eco-font-mono); font-size: 12px; letter-spacing: 0.05em; color: var(--eco-ink);
  background: rgba(11,16,21,0.82); border: 1px solid var(--eco-line-strong); border-radius: var(--eco-radius-pill);
  padding: 5px 11px; opacity: 0; transition: opacity .25s ease, border-color .25s ease, box-shadow .25s ease;
  will-change: transform;
}
.hs-label::after { content: ""; position: absolute; left: 50%; bottom: -9px; width: 1px; height: 9px; background: var(--eco-line-strong); }
.hs-label i { width: 8px; height: 8px; border-radius: 50%; background: var(--eco-green); flex: none; }
.hs-label--zentrale i, .hs-label--eco i { background: var(--eco-green); }
.hs-label--eco { border-color: rgba(127,226,143,0.5); }
.hs-label--dim { opacity: 0.85; font-size: 11px; padding: 4px 9px; }
.hs-label--hub i { background: #f3f6f1; }
.hs-label--region i { background: #b78a3c; }
.hs-label--cool { border-color: rgba(95,184,255,0.55); }
.hs-label--cool i { background: var(--hs-cool); }
.hs-label--warm { border-color: rgba(242,181,68,0.6); }
.hs-label--warm i { background: var(--hs-warm); }
.hs-label--num { padding-left: 0; overflow: hidden; }
.hs-label--num b { font-weight: var(--eco-weight-bold); color: var(--eco-surface); background: var(--eco-ink); min-width: 26px; padding: 5px 8px; text-align: center; margin-right: -2px; }
.hs-label--big { font-size: 13px; padding: 7px 14px; }
.hs-label.is-hot { border-color: var(--eco-green); box-shadow: 0 0 22px rgba(127,226,143,0.45); }
.hs-label.is-hot::after { background: var(--eco-green); }

/* ------------------------------------------------------------ Kapitel */
.hs-chapters { position: relative; z-index: 2; margin-top: -100vh; margin-top: -100svh; pointer-events: none; }
.hs-chapter { min-height: var(--len, 150vh); position: relative; }
.hs-pin { position: sticky; top: 0; height: 100vh; height: 100svh; display: flex; align-items: center; }
.hs-pin > * { pointer-events: auto; }

.hs-card {
  width: min(38vw, 560px); margin-left: auto; margin-right: var(--eco-gutter);
  background: var(--hs-card-bg); backdrop-filter: blur(14px) saturate(130%); -webkit-backdrop-filter: blur(14px) saturate(130%);
  border: 1px solid var(--eco-line); border-radius: var(--eco-radius-card);
  padding: clamp(22px, 2.4vw, 36px) clamp(22px, 2.4vw, 36px) clamp(20px, 2.2vw, 30px);
  box-shadow: var(--eco-shadow-media);
  max-height: calc(100vh - 40px); overflow: auto;
}
.hs-card__eyebrow { margin-bottom: 14px; font-size: 12px; }
.hs-card__title { font-family: var(--eco-font-display); font-weight: var(--eco-weight-medium); font-size: clamp(22px, 1.9vw, 30px); line-height: 1.2; letter-spacing: var(--eco-track-display); color: var(--eco-ink); margin: 0 0 16px; }
.hs-card p { font-size: clamp(15px, 1.05vw, 17px); line-height: 1.65; color: var(--eco-ink-strong); margin: 0 0 14px; }
.hs-card p:last-child { margin-bottom: 0; }
.hs-card__img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--eco-line); margin: 16px 0 4px; }
.hs.is-live .hs-card__img { display: none; }
.hs-modules { margin: 4px 0 14px; padding: 0 0 0 4px; list-style: none; counter-reset: hs-mod; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; }
.hs-modules li { counter-increment: hs-mod; font-family: var(--eco-font-mono); font-size: 12px; letter-spacing: 0.03em; color: var(--eco-ink-muted); display: flex; gap: 8px; align-items: baseline; }
.hs-modules li::before { content: counter(hs-mod); color: var(--eco-ink); border: 1px solid var(--eco-line-strong); border-radius: var(--eco-radius-pill); min-width: 22px; text-align: center; font-size: 11px; padding: 1px 0; flex: none; }
.hs-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.hs-cta .eco-btn { padding: 13px 22px; }
.hs-cta__note { font-size: 13px !important; color: var(--eco-ink-muted) !important; margin-top: 12px !important; }

/* ------------------------------------------------------------ Seite 1: Overlay auf der Szene */
.hs-cover { position: relative; width: 100%; height: 100%; padding: calc(var(--eco-header-h) + 28px) var(--eco-gutter) clamp(24px, 4vh, 44px); display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.hs-cover::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(11,16,21,0.9) 0%, rgba(11,16,21,0.7) 22%, rgba(11,16,21,0.25) 38%, rgba(11,16,21,0) 50%),
    linear-gradient(180deg, rgba(11,16,21,0.55) 0%, rgba(11,16,21,0) 30%, rgba(11,16,21,0) 60%, rgba(11,16,21,0.7) 100%);
}
.hs-cover > * { position: relative; pointer-events: auto; }
.hs-cover__top { max-width: min(40vw, 640px); }
.hs-cover__eyebrow { margin-bottom: 18px; }
.hs-cover__title { font-family: var(--eco-font-display); font-weight: var(--eco-weight-medium); font-size: clamp(30px, 3.3vw, 54px); line-height: 1.06; letter-spacing: var(--eco-track-display); color: var(--eco-ink); margin: 0; text-wrap: balance; }
.hs-cover__break { display: block; color: var(--eco-green); }
.hs-cover__lead { font-size: clamp(16px, 1.25vw, 20px); line-height: 1.55; color: var(--eco-ink-strong); max-width: 52ch; margin: 22px 0 0; }

.hs-args { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-width: min(40vw, 600px); }
.hs-arg { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--eco-ink-strong); padding: 9px 12px 9px 8px; margin-left: -8px; border-radius: 12px; transition: background .25s ease, color .25s ease, transform .3s var(--eco-ease); }
.hs-arg:hover, .hs-arg:focus-visible { background: rgba(243,246,241,0.06); color: var(--eco-ink); transform: translateX(4px); outline: none; }
.hs-arg__n { font-family: var(--eco-font-mono); font-size: 12px; color: var(--eco-ink); border: 1px solid var(--eco-line-strong); border-radius: var(--eco-radius-pill); min-width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; flex: none; transition: all .25s ease; }
.hs-arg:hover .hs-arg__n, .hs-arg:focus-visible .hs-arg__n { color: var(--eco-surface); background: var(--eco-green); border-color: transparent; box-shadow: 0 0 16px rgba(127,226,143,0.45); }
.hs-arg__t { font-size: clamp(15px, 1.15vw, 18px); line-height: 1.4; }
.hs-arg__t b { font-weight: var(--eco-weight-bold); color: var(--eco-ink); }

.hs-scrollhint { position: absolute; right: var(--eco-gutter); bottom: clamp(24px, 4vh, 44px); display: flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--eco-font-mono); font-size: 11px; letter-spacing: var(--eco-track-label); text-transform: uppercase; color: var(--eco-ink-muted); }
.hs-scrollhint i { display: block; width: 1px; height: 38px; background: linear-gradient(180deg, var(--eco-ink-ghost), var(--eco-green)); position: relative; overflow: hidden; }
.hs-scrollhint i::after { content: ""; position: absolute; left: 0; top: -12px; width: 1px; height: 12px; background: var(--eco-ink); animation: hs-hint 1.8s ease-in-out infinite; }
@keyframes hs-hint { 0% { top: -12px; } 100% { top: 40px; } }

/* Das Overlay blendet mit dem ersten Scrollen aus (JS setzt --hs-cover) */
.hs.is-live .hs-cover { opacity: var(--hs-cover, 1); transform: translateY(calc((1 - var(--hs-cover, 1)) * -24px)); }
.hs.is-live .hs-cover[data-gone] { pointer-events: none; }
.hs.is-live .hs-cover[data-gone] > * { pointer-events: none; }

/* Fokus-Hervorhebung aus den drei Argumenten heraus */
.hs-arg[data-hs-focus] { cursor: pointer; }

/* ------------------------------------------------------------ Mobile */
@media (max-width: 900px) {
  .hs-card { width: min(100% - 32px, 560px); margin: 0 auto; }
  .hs-pin { align-items: flex-end; padding-bottom: 14px; }
  .hs-card { max-height: 44vh; padding: 18px 18px 16px; }
  .hs-card__title { font-size: 20px; }
  .hs-card p { font-size: 14px; line-height: 1.55; }
  .hs-modules { grid-template-columns: 1fr; gap: 4px; }
  .hs-cover { padding: calc(var(--eco-header-h) + 8px) 20px 20px; }
  .hs-cover__top, .hs-args { max-width: 100%; }
  .hs-cover::before { background: linear-gradient(180deg, rgba(11,16,21,0.9) 0%, rgba(11,16,21,0.55) 32%, rgba(11,16,21,0.1) 50%, rgba(11,16,21,0.75) 82%, rgba(11,16,21,0.92) 100%); }
  .hs-cover__title { font-size: clamp(26px, 7.4vw, 34px); }
  .hs-cover__lead { font-size: 15px; margin-top: 14px; max-width: 100%; }
  .hs-arg { padding: 6px 8px 6px 6px; gap: 10px; }
  .hs-arg__t { font-size: 14px; }
  .hs-scrollhint { display: none; }
  .hs-stage__ring { left: 20px; right: 20px; bottom: auto; top: calc(52vh - 40px); font-size: 16px; max-width: none; text-shadow: 0 1px 12px rgba(11,16,21,0.8); }
  .hs-label { font-size: 11px; padding: 4px 9px; }
  .hs-label--num span { display: none; } /* auf dem Telefon nur die Ziffer, die Namen stehen in der Karte */
  .hs-label--num b { margin-right: 0; padding: 4px 8px; }
}
@media (max-width: 900px) and (max-height: 640px) {
  .hs-cover__lead { display: none; }
}

/* Unter 400 px oder ohne WebGL: statische Bilder je Kapitel statt Canvas. JS setzt is-static, CSS sichert die Breite ab. */
@media (max-width: 399px) {
  .hs-stage { display: none; }
  .hs-chapters { margin-top: 0; }
  .hs-chapter { min-height: 0; }
  .hs-pin { position: static; height: auto; display: block; padding: 0; }
  .hs-chapter--cover .hs-pin { background: url("../img/vision/seite-1.jpg") center / cover no-repeat; }
  .hs-cover { height: auto; min-height: 100vh; }
  .hs-card { max-height: none; margin: 24px auto; }
  .hs.is-live .hs-card__img { display: block; }
}
.hs.is-static .hs-stage { display: none; }
.hs.is-static .hs-chapters { margin-top: 0; }
.hs.is-static .hs-chapter { min-height: 0; }
.hs.is-static .hs-pin { position: static; height: auto; display: block; padding: 0; }
.hs.is-static .hs-chapter--cover .hs-pin { background: url("../img/vision/seite-1.jpg") center / cover no-repeat; }
.hs.is-static .hs-cover { height: auto; min-height: 100vh; }
.hs.is-static .hs-card { max-height: none; margin: 24px auto; }
.hs.is-static .hs-card__img { display: block; }

/* ------------------------------------------------------------ Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .hs-scrollhint i::after { animation: none; }
  .hs-stage__poster, .hs-stage__canvas, .hs-label, .hs-arg { transition: none; }
}
