/* =====================================================================
   Hero "Kontrollraum" (Optik-Version). Alles in einem Bildschirm, Texte unverändert.
   - Perspektivischer Rasterboden, der auf den Betrachter zuläuft
   - App-Fenster mit rotierendem Lichtkranz, Umlaufbahn und laufender Leuchtkante
   - Fenster neigt sich leicht zur Maus (steht ohne Maus gerade), Badges mit Tiefe
   - Überschrift baut sich Buchstabe für Buchstabe auf, grüne Welle läuft durch
   - Plattform-Laufband über die volle Bildschirmbreite
   Farben wie live: Grund #0f1117 · Grün #2ecc71 · Phosphor #b8ffd6
   ===================================================================== */
@font-face { font-family: "Geist"; src: url("../fonts/geist-vf.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JB Mono"; src: url("../fonts/jetbrains-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@property --hx-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

.hx-zone {
  --hx-night: #0f1117; --hx-ink: #eef3ef; --hx-green: #2ecc71; --hx-phos: #b8ffd6; --hx-steel: #2a3040; --hx-mute: #8a93a3;
  --hs: 0; /* Scroll-Fortschritt 0..1 (JS) */
  position: relative; overflow: clip; background: var(--hx-night);
  height: 100svh; min-height: 640px; padding: 0 !important; display: block !important;
}
.hx { position: relative; isolation: isolate; height: 100%; }

/* ---------- Hintergrund ---------- */
.hx-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
/* Rasterboden in Perspektive, läuft auf den Betrachter zu */
.hx-dots {
  position: absolute; left: -60%; right: -60%; bottom: -6%; height: 62%;
  background-image: linear-gradient(rgba(46,204,113,.22) 1px, transparent 1px), linear-gradient(90deg, rgba(46,204,113,.22) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(520px) rotateX(64deg); transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 55%, #000 100%); mask-image: linear-gradient(180deg, transparent 0%, #000 55%, #000 100%);
  animation: hx-floor 3.2s linear infinite; opacity: .55;
}
@keyframes hx-floor { to { background-position: 0 64px, 0 0; } }
/* Horizont-Glühen */
.hx-horizon {
  position: absolute; left: 0; right: 0; top: 38%; height: 46%;
  background: radial-gradient(ellipse 55% 50% at 68% 55%, rgba(46,204,113,.20), transparent 70%), radial-gradient(ellipse 40% 45% at 12% 80%, rgba(56,189,248,.10), transparent 70%);
  animation: hx-breathe 8s ease-in-out infinite;
}
@keyframes hx-breathe { 50% { opacity: .65; } }
/* Abdunklung oben, damit der Header ruhig bleibt + Maus-Spotlight */
.hx-scan { position: absolute; inset: 0; background: linear-gradient(180deg, var(--hx-night) 0%, transparent 30%, transparent 78%, var(--hx-night) 100%); }
.hx-bg::after {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .5s ease;
  background: radial-gradient(520px circle at var(--sx, 50%) var(--sy, 40%), rgba(46,204,113,.10), transparent 60%);
}
.hx-zone.hx-hover .hx-bg::after { opacity: 1; }

/* ---------- Raster: Text | Fenster ---------- */
.hx-inner {
  position: relative; z-index: 2; height: 100%; max-width: 1320px; margin: 0 auto;
  padding: calc(64px + clamp(14px, 3.5vh, 40px)) clamp(16px, 5vw, 80px) 84px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); grid-template-rows: minmax(0, 1fr);
  column-gap: clamp(28px, 4vw, 72px);
}
.hx-screen { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; justify-content: center; min-height: 0; text-align: left; }
.hx-stage, .hx-copy { display: flex; flex-direction: column; gap: clamp(14px, 2.4vh, 22px); }
.hx-stage { margin-top: clamp(14px, 2.4vh, 22px); }

.hx .hx-eyebrow {
  align-self: flex-start; margin: 0 0 clamp(14px, 2.6vh, 24px); white-space: nowrap; max-width: 100%;
  font-family: "JB Mono", ui-monospace, monospace; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--hx-phos); background: rgba(46,204,113,.07); border: 1px solid rgba(46,204,113,.28); padding: 7px 13px; border-radius: 999px;
}
.hx .hx-eyebrow::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 10px; border-radius: 50%; background: var(--hx-green); box-shadow: 0 0 10px var(--hx-green); vertical-align: 1px; animation: hx-blink 2.4s steps(1) infinite; }
@keyframes hx-blink { 50% { opacity: .25; } }

.hx-h1 { margin: 0; color: var(--hx-ink); }
.hx-line {
  display: block; white-space: nowrap; font-family: "Geist", "Roboto", sans-serif; font-weight: 700;
  font-size: clamp(2.6rem, min(5.8vw, 9.8vh), 5.8rem); line-height: .96; letter-spacing: -0.03em;
}
.hx-em { display: inline; font-style: normal; color: var(--hx-green); text-shadow: 0 0 46px rgba(46,204,113,.45); }
.hx-ch { display: inline-block; }
/* grüne Welle läuft regelmäßig durch "Unternehmens-KI." */
.hx-em .hx-ch { animation: hx-wave 6s ease-in-out infinite; animation-delay: calc(var(--i) * 70ms + 2.2s); }
@keyframes hx-wave { 0%, 12%, 100% { color: var(--hx-green); translate: 0 0; } 6% { color: #eafff3; translate: 0 -0.06em; } }
.hx-sub { display: block; margin-top: clamp(10px, 1.8vh, 16px); font-family: "Geist", "Roboto", sans-serif; font-weight: 400; font-size: clamp(1.1rem, min(1.9vw, 3.2vh), 1.6rem); line-height: 1.25; color: #c4ccd6; }
.hx .hdesc { margin: 0; max-width: 54ch; font-size: clamp(.92rem, 1.9vh, 1.02rem); line-height: 1.65; color: #9aa4b1; }
.hx .hero-cta { display: flex; flex-direction: column; gap: clamp(14px, 2.2vh, 20px); width: auto; }
/* Tags: eine ruhige Zeile mit Häkchen */
.hx .hero-meta { margin: 0; flex-wrap: wrap; gap: 6px 20px; }
.hx .hero-meta span { font-family: "JB Mono", ui-monospace, monospace; font-size: .74rem; border: 0; background: none; padding: 0; border-radius: 0; color: #b9c2cd; gap: 7px; backdrop-filter: none; }
.hx .hero-meta span::before { content: "✓"; color: var(--hx-green); font-size: .78rem; }
.hx .hero-btns { gap: 12px; width: auto; }
.hx .hero-btns .bp, .hx .hero-btns .bo { position: relative; overflow: hidden; flex: 0 0 auto; white-space: nowrap; padding: 15px 26px; border-radius: 12px; translate: var(--mg-x, 0) var(--mg-y, 0); transition: translate .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s, background .25s, border-color .25s; }
.hx .hero-btns .bp { box-shadow: 0 0 0 1px rgba(46,204,113,.5), 0 18px 50px -12px rgba(46,204,113,.65); }
.hx .hero-btns .bp::after { content: ""; position: absolute; inset: 0; translate: -130% 0; pointer-events: none; background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.5) 50%, transparent 65%); transition: translate .7s ease; }
.hx .hero-btns .bp:hover::after { translate: 130% 0; }

/* ---------- App-Fenster ---------- */
.hx .hx-vis { display: contents; }
.hx .hero-chat-wrap { grid-column: 2; grid-row: 1; align-self: center; position: relative; width: 100%; max-width: none; height: min(100%, 560px); min-height: 0; isolation: isolate; }
/* Lichtkranz hinter dem Fenster: dreht sich langsam (nur transform, GPU-billig) */
.hx .hero-chat-wrap::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 118%; aspect-ratio: 1; margin: -59% 0 0 -59%; z-index: -2; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, transparent 0deg, rgba(46,204,113,.55) 60deg, transparent 130deg, rgba(56,189,248,.32) 210deg, transparent 280deg, rgba(184,255,214,.35) 330deg, transparent 360deg);
  filter: blur(70px); opacity: .75; animation: hx-spin 16s linear infinite;
}
/* Umlaufbahn mit Satellit */
.hx .hero-chat-wrap::after {
  content: ""; position: absolute; inset: -9% -13%; z-index: -1; border-radius: 50%; pointer-events: none;
  border: 1px solid rgba(46,204,113,.2);
  background: radial-gradient(circle 5px at 50% 5px, var(--hx-phos) 60%, transparent 100%);
  animation: hx-spin 22s linear infinite reverse;
}
@keyframes hx-spin { to { rotate: 360deg; } }
/* Neigung zur Maus (ohne Maus gerade) + Scroll-Kopplung */
.hx .hero-tilt {
  height: 100%; max-width: none; width: 100%;
  transform: perspective(1400px) rotateY(var(--tx, 0deg)) rotateX(var(--ty, 0deg)) !important; transition: transform .3s ease-out;
  scale: calc(1 - var(--hs) * .14); translate: 0 calc(var(--hs) * 50px);
}
.hx .hmk {
  position: relative; height: 100%; max-width: none; width: 100%; display: flex; flex-direction: column; text-align: left; border-radius: 18px; overflow: hidden;
  background: linear-gradient(180deg, #1e2130, #171a26); border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 60px 120px -30px rgba(0,0,0,.85), 0 0 0 1px rgba(46,204,113,.12), 0 0 90px -20px rgba(46,204,113,.35);
}
/* Leuchtkante läuft einmal rund um das Fenster */
.hx .hmk::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; z-index: 5; pointer-events: none;
  background: conic-gradient(from var(--hx-a), transparent 0deg, var(--hx-phos) 28deg, var(--hx-green) 55deg, transparent 95deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: hx-edge 5s linear infinite;
}
@keyframes hx-edge { to { --hx-a: 360deg; } }
.hx .hmb { padding: 13px 18px; border-bottom: 1px solid rgba(255,255,255,.06); flex: 0 0 auto; }
.hx .hmb-label { font-family: "JB Mono", ui-monospace, monospace; letter-spacing: .08em; }
.hx-app { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 190px 1fr; }
.hx-side { border-right: 1px solid rgba(255,255,255,.06); padding: 16px 14px; display: flex; flex-direction: column; gap: 11px; background: rgba(255,255,255,.015); }
.hx-side i { display: block; height: 8px; border-radius: 5px; background: rgba(255,255,255,.07); }
.hx-side i.kurz { width: 62%; }
.hx-side i.hx-new { height: 30px; border-radius: 10px; margin-bottom: 8px; background: rgba(46,204,113,.12); border: 1px solid rgba(46,204,113,.25); }
.hx-main { min-height: 0; display: flex; flex-direction: column; padding: 18px 22px; gap: 12px; }
.hx .hmby { flex: 1 1 auto; min-height: 0; height: auto; max-width: none; overflow: hidden; }
.hx .hmi { margin: 0; flex: 0 0 auto; }
/* Badges schweben mit Tiefe (bewegen sich gegenläufig zur Maus) */
.hx .hfl { z-index: 6; transition: translate .35s ease-out; box-shadow: 0 18px 40px -14px rgba(0,0,0,.7), 0 0 0 1px rgba(46,204,113,.18); }
.hx .hfl.f1 { top: -16px; right: 8%; left: auto; translate: calc(var(--px, 0) * -18px) calc(var(--py, 0) * -12px); }
.hx .hfl.f2 { bottom: 16%; left: -18px; right: auto; translate: calc(var(--px, 0) * 26px) calc(var(--py, 0) * 16px); }
/* Text gleitet beim Scrollen weg (läuft rückwärts genauso) */
.hx-screen { translate: 0 calc(var(--hs) * -70px); opacity: calc(1 - var(--hs) * 1.7); }

/* ---------- Plattform-Laufband: volle Bildschirmbreite ---------- */
.hx .hero-logos {
  position: absolute; left: 0; bottom: 0; width: 100vw; margin: 0 0 0 calc(50% - 50vw); height: 64px; padding: 0;
  display: flex; flex-direction: row; align-items: center; gap: 0;
  border-top: 1px solid rgba(255,255,255,.08); background: rgba(15,17,23,.72);
}
/* Beschriftung sitzt mittig auf der Linie, wie eine Legende */
.hx .hero-logos-label {
  position: absolute; left: 50%; top: 0; translate: -50% -50%; z-index: 2; white-space: nowrap; padding: 2px 14px;
  font-family: "JB Mono", ui-monospace, monospace; font-size: .62rem; letter-spacing: .1em; color: var(--hx-mute);
  background: var(--hx-night); border: 1px solid rgba(255,255,255,.08); border-radius: 999px;
}
.hx .hx-marquee { flex: 1 1 auto; min-width: 0; height: 100%; overflow: hidden; display: flex; align-items: center;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.hx .hero-logos-row { flex-wrap: nowrap; align-items: center; gap: 0; width: max-content; animation: hx-marquee 60s linear infinite; }
.hx .hero-logos:hover .hero-logos-row { animation-play-state: paused; }
.hx .hero-logo-item { flex: 0 0 auto; margin: 0 34px; padding: 0; border: 0; background: none; border-radius: 0; opacity: .6; transition: opacity .25s ease; font-size: .95rem; }
.hx .hero-logo-item:hover { opacity: 1; }
@keyframes hx-marquee { from { translate: 0 0; } to { translate: -50% 0; } }

/* ---------- Eintritt (nur mit JS) ---------- */
html.hx-js .hx-fade { opacity: 0; translate: 0 22px; filter: blur(8px); }
html.hx-js .hx-zone.hx-run .hx-fade { opacity: 1; translate: 0 0; filter: blur(0); transition: opacity .9s ease, translate .9s cubic-bezier(.16,1,.3,1), filter .9s ease; transition-delay: var(--hx-d, 0s); }
/* Fenster: fährt aus der Tiefe herein */
html.hx-js .hero-chat-wrap.hx-fade { translate: 0 40px; scale: .86; }
html.hx-js .hx-zone.hx-run .hero-chat-wrap.hx-fade { translate: 0 0; scale: 1; transition: opacity 1s ease, translate 1.2s cubic-bezier(.16,1,.3,1), scale 1.2s cubic-bezier(.16,1,.3,1), filter 1s ease; transition-delay: var(--hx-d, 0s); }
/* Überschrift: Buchstaben fallen gestaffelt ein */
html.hx-js .hx-line .hx-ch { opacity: 0; translate: 0 .55em; filter: blur(10px); }
html.hx-js .hx-zone.hx-run .hx-line .hx-ch { opacity: 1; translate: 0 0; filter: blur(0); transition: opacity .5s ease, translate .8s cubic-bezier(.16,1,.3,1), filter .6s ease; transition-delay: calc(var(--i) * 32ms + .1s); }
.hx-zone.hx-fern *, .hx-zone.hx-fern *::before, .hx-zone.hx-fern *::after { animation-play-state: paused !important; }

/* Niedrige Bildschirme: kompakter, nichts wird gekürzt */
@media (max-height: 780px) and (min-width: 1024px) {
  .hx .hdesc { font-size: .9rem; line-height: 1.55; }
  .hx-line { font-size: clamp(2.4rem, min(5vw, 8.6vh), 4.6rem); }
  .hx .hero-btns .bp, .hx .hero-btns .bo { padding: 12px 20px; }
  .hx-inner { padding-bottom: 76px; }
}

/* ---------- Tablet / Handy ---------- */
@media (max-width: 1023px) {
  .hx-zone { height: auto; min-height: 0; }
  .hx-inner { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; padding-bottom: 104px; row-gap: 8px; }
  .hx-screen { min-height: calc(100svh - 64px - clamp(14px, 3.5vh, 40px)); padding-bottom: 24px; translate: none; opacity: 1; }
  .hx .hero-chat-wrap { grid-column: 1; grid-row: auto; height: 460px; }
  .hx .hero-tilt { scale: 1; translate: none; }
  .hx-app { grid-template-columns: 1fr; }
  .hx-side { display: none; }
  .hx .hfl.f2 { left: 6px; } .hx .hfl.f1 { right: 6px; }
  .hx .hero-chat-wrap::after { display: none; }
  .hx .hero-logos-label { font-size: .54rem; letter-spacing: .06em; }
}
@media (max-width: 480px) {
  .hx-line { font-size: clamp(2.5rem, 12.5vw, 3.4rem); }
  .hx .hero-btns { width: 100%; }
  .hx .hero-btns .bp, .hx .hero-btns .bo { flex: 1 1 100%; justify-content: center; }
  .hx .hero-meta { gap: 6px 14px; }
}

/* ---------- Weniger Bewegung (bleibt am Dateiende) ---------- */
@media (prefers-reduced-motion: reduce) {
  .hx-dots, .hx-horizon, .hx .hx-eyebrow::before, .hx .hero-logos-row, .hx .hero-chat-wrap::before, .hx .hero-chat-wrap::after, .hx .hmk::before, .hx-em .hx-ch { animation: none !important; }
  html.hx-js .hx-fade, html.hx-js .hx-line .hx-ch { opacity: 1 !important; translate: none !important; scale: none !important; filter: none !important; transition: none !important; }
  .hx .hero-tilt { transform: none !important; scale: 1; translate: none; transition: none; }
  .hx-screen { translate: none; opacity: 1; }
  .hx .hfl { translate: none !important; }
}

/* ---------- Korrekturen ---------- */
/* Eingabezeile bleibt im Fenster */
.hx-main { min-width: 0; }
.hx .hmi { width: auto; max-width: 100%; min-width: 0; box-sizing: border-box; }
.hx .hmi .chat-field { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: clip; }
/* Rasterboden sichtbar: nur oben abdunkeln, Boden kräftiger */
.hx-scan { background: linear-gradient(180deg, var(--hx-night) 0%, transparent 26%); }
.hx-dots { opacity: .8; height: 58%; bottom: 0; }
@media (prefers-reduced-motion: reduce) { .hx-dots { animation: none !important; } }
/* Rasterboden deutlich: höher, heller, weicher Auslauf zum Horizont */
.hx-dots {
  height: 110%; opacity: 1; transform: perspective(760px) rotateX(62deg);
  background-image: linear-gradient(rgba(46,204,113,.42) 1.5px, transparent 1.5px), linear-gradient(90deg, rgba(46,204,113,.42) 1.5px, transparent 1.5px);
  background-size: 72px 72px;
  -webkit-mask-image: linear-gradient(180deg, transparent 8%, rgba(0,0,0,.5) 55%, #000 100%); mask-image: linear-gradient(180deg, transparent 8%, rgba(0,0,0,.5) 55%, #000 100%);
}
@keyframes hx-floor { to { background-position: 0 72px, 0 0; } }
/* Horizontlinie, an der der Boden endet */
.hx-horizon::after { content: ""; position: absolute; left: 0; right: 0; top: 52%; height: 1px; background: linear-gradient(90deg, transparent, rgba(46,204,113,.55) 30%, rgba(184,255,214,.8) 60%, rgba(46,204,113,.4) 85%, transparent); box-shadow: 0 0 30px 2px rgba(46,204,113,.35); }
.hx-horizon::after { display: none; }

/* ---------- Firefox-Fix: Leuchtkante ohne Maske ----------
   Firefox ignoriert mask-composite, sobald ein Elternelement in 3D gedreht ist (Neigung beim Hover)
   und zeigte dann den ganzen grünen Lichtkegel. Jetzt liegt der drehende Verlauf als Fläche HINTER
   dem deckenden Fenster und schaut nur 1,5 px am Rand heraus, ganz ohne Maske. */
.hx .hmk::before { content: none !important; animation: none !important; }
.hx .hero-tilt { position: relative; isolation: isolate; }
.hx .hero-tilt::before {
  content: ""; position: absolute; inset: -1.5px; z-index: -1; border-radius: 19.5px; pointer-events: none;
  background: conic-gradient(from var(--hx-a), rgba(255,255,255,.10) 0deg, var(--hx-phos) 28deg, var(--hx-green) 55deg, rgba(255,255,255,.10) 95deg, rgba(255,255,255,.10) 360deg);
  animation: hx-edge 5s linear infinite;
}
.hx .hmk { background: linear-gradient(180deg, #1e2130, #171a26) !important; border-color: transparent !important; }
@media (prefers-reduced-motion: reduce) { .hx .hero-tilt::before { animation: none; } }
