/* ============================================
   HERO PREMIUM — "100k€ website" layer
   #1 Editorial Overline
   #2 Kinetic Reveal
   #3 Chat Spotlight + Ghost-Typing
   #4 Gradient Mesh + Orbs + Vignette
   ============================================ */

/* ---------- #1 EDITORIAL OVERLINE ---------- */
.hero__overline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 0 auto 1.75rem;
  font-family: "Clash Display", "Outfit", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: rgba(212, 151, 111, 0.8);
  opacity: 0;
  transform: translateY(6px);
  /* animated in via JS timeline */
}
.hero__overline-rule {
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(212, 151, 111, 0), rgba(212, 151, 111, 0.6));
  display: inline-block;
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.hero__overline-rule--left {
  background: linear-gradient(90deg, rgba(212, 151, 111, 0), rgba(212, 151, 111, 0.6));
}
.hero__overline-rule--right {
  background: linear-gradient(90deg, rgba(212, 151, 111, 0.6), rgba(212, 151, 111, 0));
}
.hero__overline.is-revealed {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.hero__overline.is-revealed .hero__overline-rule {
  width: clamp(30px, 5vw, 55px);
}

/* ---------- #2 KINETIC REVEAL — char splits ---------- */
.hero__title--editorial .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.55em);
  /* clip-path reveal from bottom */
  clip-path: inset(100% 0 0 0);
  transition:
    opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    clip-path 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.hero__title--editorial.is-revealed .char {
  opacity: 1;
  transform: translateY(0);
  /* Clip-Bereich nach unten/oben über die enge (line-height:1.05) Box hinaus
     erweitern, damit Unterlängen (g, ß) und Umlaut-Punkte nicht abgeschnitten
     werden. Negative Insets zeigen nur mehr, clippen nie zusätzlich. */
  clip-path: inset(-0.08em 0 -0.28em 0);
}
/* "Messbare Ergebnisse." and "Unsere KI." (accent line) are always visible — no split/animation */
.hero__title-line--accent .char {
  opacity: 1 !important;
  transform: none !important;
  clip-path: none !important;
  transition: none !important;
}
.hero__title-italic .char {
  display: inline !important; /* inline statt inline-block: verhindert Box-Clipping bei kursiven Glyphen */
  opacity: 1 !important;
  transform: none !important;
  clip-path: none !important;
  transition: none !important;
  background: linear-gradient(135deg, #E5B896 0%, #D4976F 45%, #B87E5F 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero__title--editorial .char-space {
  display: inline-block;
  width: 0.25em;
}
/* Hält ein Wort zusammen → Zeilenumbruch nur ZWISCHEN Wörtern (Mobile),
   nie mitten im Wort. Auf Desktop ist die Zeile nowrap → ohne Effekt. */
.hero__title--editorial .char-word {
  display: inline-block;
  white-space: nowrap;
}

/* Underline stroke beneath the italic */
.hero__title-italic {
  position: relative;
}
.hero__title-underline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.08em;
  height: 0.08em;
  pointer-events: none;
  overflow: visible;
}
.hero__title-underline svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}
.hero__title-underline path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  transition: stroke-dashoffset 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.hero__title--editorial.is-underlined .hero__title-underline path {
  stroke-dashoffset: 0;
}

/* ---------- #3 CHAT SPOTLIGHT ---------- */
.hero__spotlight {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 900px;
  height: 900px;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(212, 151, 111, 0.18) 0%,
    rgba(212, 151, 111, 0.08) 30%,
    rgba(212, 151, 111, 0) 60%
  );
  filter: blur(40px);
  pointer-events: none;
  transform: translate3d(-50%, -50%, 0);
  mix-blend-mode: screen;
  z-index: 1;
  will-change: transform;
  opacity: 0;
  transition: opacity 1.2s ease 0.5s;
}
.hero.is-loaded .hero__spotlight {
  opacity: 1;
}

/* ---------- #3 GHOST-TYPING ---------- */
.hero-chat__input::placeholder {
  transition: color 0.3s ease;
}
.hero-chat__input--ghost::placeholder {
  color: rgba(255, 255, 255, 0.55);
}
.hero-chat__ghost-caret {
  display: none;
}

/* ---------- #4 GRADIENT MESH + ORBS + VIGNETTE ---------- */
.hero {
  position: relative;
  isolation: isolate;
}

/* Mesh layer */
.hero__mesh {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60vw 55vh at 15% 25%, rgba(122, 48, 32, 0.28), transparent 60%),
    radial-gradient(45vw 45vh at 82% 35%, rgba(212, 151, 111, 0.14), transparent 65%),
    radial-gradient(80vw 80vh at 50% 110%, rgba(8, 12, 24, 0.6), transparent 70%);
  animation: hero-mesh-drift 42s ease-in-out infinite alternate;
  mix-blend-mode: screen;
  opacity: 0.9;
}
@keyframes hero-mesh-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-2%, 1%, 0) scale(1.04); }
  100% { transform: translate3d(2%, -1%, 0) scale(1.02); }
}

/* Orbs */
.hero__orbs {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  mix-blend-mode: screen;
  will-change: transform;
}
.hero__orb--1 {
  width: 440px; height: 440px;
  top: -8%; left: -6%;
  background: radial-gradient(circle, #D4976F 0%, rgba(212, 151, 111, 0) 70%);
  animation: orb-drift-1 48s ease-in-out infinite alternate;
}
.hero__orb--2 {
  width: 340px; height: 340px;
  top: 55%; right: -5%;
  background: radial-gradient(circle, #E5B896 0%, rgba(229, 184, 150, 0) 70%);
  animation: orb-drift-2 62s ease-in-out infinite alternate;
  opacity: 0.28;
}
.hero__orb--3 {
  width: 560px; height: 560px;
  bottom: -15%; left: 30%;
  background: radial-gradient(circle, #7A3020 0%, rgba(122, 48, 32, 0) 70%);
  animation: orb-drift-3 92s ease-in-out infinite alternate;
  opacity: 0.4;
}
@keyframes orb-drift-1 {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(14vw, 8vh, 0) scale(1.15); }
  100% { transform: translate3d(8vw, 18vh, 0) scale(1.05); }
}
@keyframes orb-drift-2 {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-10vw, -12vh, 0) scale(1.2); }
  100% { transform: translate3d(-6vw, 4vh, 0) scale(1.1); }
}
@keyframes orb-drift-3 {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-8vw, -10vh, 0) scale(1.1); }
  100% { transform: translate3d(6vw, -18vh, 0) scale(1.25); }
}

/* Vignette */
.hero__vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background:
    radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.35) 100%);
}

/* Hero content sits above all background layers */
.hero__content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: calc(100dvh - var(--nav-height));
  width: 100%;
  padding-bottom: 2rem;
}
/* Push title+chat into the vertical middle of the viewport */
.hero__title--editorial {
  margin-top: auto !important;
}
.hero-chat {
  margin-bottom: auto;
}
.hero__hint {
  z-index: 3;
}

/* ---------- Overline pinned to bottom of hero ---------- */
.hero__overline--bottom {
  margin: 0 auto;
}

/* ---------- MOBILE / PERFORMANCE FALLBACK ---------- */
@media (max-width: 767px) {
  .hero__orb {
    filter: blur(70px);
  }
  .hero__orb--2 { display: none; }
  .hero__spotlight { display: none; }

  /* Mobile-Hero: ruhige, kontrollierte Abstände statt großer auto-Lücken.
     Padding-top schützt die Überschrift vor dem fixen Header. */
  .hero__content {
    min-height: calc(100dvh - var(--nav-height));
    justify-content: space-between;
    padding-top: calc(var(--nav-height) + 0.5rem);
    padding-bottom: 1.25rem;
    gap: clamp(0.75rem, 2vh, 1.5rem);
  }
  .hero__title--editorial { margin-top: 0 !important; }
  .hero-chat { margin-bottom: 0; }
  /* Mobile: Trust-Zeile bleibt einzeilig wie auf dem Desktop (mit Trennpunkten
     und feinen Linien), nur fluide kleiner skaliert, damit sie in eine Zeile
     passt. */
  .hero__overline--bottom {
    margin: 0 auto;
    gap: clamp(0.25rem, 1.1vw, 1rem);
    font-size: clamp(0.4rem, 1.8vw, 0.72rem);
    letter-spacing: clamp(0.04em, 0.28vw, 0.36em);
    white-space: nowrap;
    max-width: 100%;
  }
  .hero__overline--bottom .hero__overline-inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: clamp(0.25rem, 1.1vw, 0.75rem);
    white-space: nowrap;
  }
  /* Seitenlinien mobil kürzer, damit mehr Platz für den Text bleibt */
  .hero__overline--bottom.is-revealed .hero__overline-rule {
    width: clamp(8px, 3vw, 30px);
  }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero__mesh,
  .hero__orb {
    animation: none !important;
  }
  .hero__title--editorial .char {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }
  .hero__title-underline path {
    stroke-dashoffset: 0 !important;
  }
  .hero__overline {
    opacity: 1 !important;
    transform: none !important;
  }
  .hero__overline .hero__overline-rule {
    width: clamp(30px, 5vw, 55px) !important;
  }
}
