/* =========================================================================
   Hero #start – inszenierter Einstieg (KONZEPT.md §5, §6.1, §7)
   Ablauf: h1-Zeilen steigen aus der Maske → Linie mit vier Knoten zeichnet
   sich → Impuls läuft durch (js/hero.js) → Buttons und Faktzeile blenden ein.
   Die Eintritte sind CSS-Keyframes mit "both": Sie enden immer sichtbar,
   auch wenn js/hero.js fehlt oder spät lädt.
   ========================================================================= */

.hero {
  display: flex;
  min-height: calc(100svh - var(--header-h));
  padding-block: clamp(2rem, 1.4rem + 1.6vw, 3rem);
}
.hero__wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(1.5rem, 1.1rem + 0.9vw, 2rem);
}

.hero__title { max-width: 11ch; text-wrap: initial; }
/* Jede Zeile ist eine eigene Maske */
.hero__line { display: block; overflow: clip; padding-bottom: 0.06em; margin-bottom: -0.06em; }
.hero__line-in { display: inline-block; }

/* ---- Impuls-Linie ------------------------------------------------------- */
.hero__rail { position: relative; }
.hero__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.hero__nodes {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--grid-gap);
}
.hero__node {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
}
.hero__label {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: var(--ls-mono);
  line-height: 1.3;
  color: var(--c-muted);
  transition: color var(--dur-ui) var(--ease-hover);
}
.hero__node:has(.pulse-node[data-state]) .hero__label { color: var(--c-ink); }

/* ---- Fußzeile: Lead links, Buttons + Faktzeile rechts ------------------- */
.hero__foot {
  display: grid;
  gap: var(--space-6);
}
.hero__lead { max-width: 40ch; }
.hero__actions { display: grid; gap: var(--space-4); align-content: start; }
.hero__fact {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  color: var(--c-muted);
  max-width: none;
}
.hero__fact .dot { transform: translateY(-1px); }

@media (min-width: 1024px) {
  .hero__foot {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--grid-gap);
    align-items: end;
  }
  .hero__lead { grid-column: 1 / span 6; }
  .hero__actions { grid-column: 8 / span 5; justify-items: start; }
}

/* ---- Tablet hochkant: größere h1, Inhalt über die ganze Höhe verteilt --- */
@media (min-width: 768px) and (max-width: 1023px) {
  .hero__wrap { justify-content: space-between; }
  .hero__title { font-size: clamp(5rem, 12.5vw, 8rem); }
}

/* ---- Mobil: Linie senkrecht links, Labels rechts daneben --------------- */
@media (max-width: 767px) {
  .hero__title { max-width: none; }
  .hero__nodes {
    grid-template-columns: 1fr;
    row-gap: 0;
  }
  .hero__node {
    flex-direction: row;
    align-items: center;
    gap: var(--space-4);
    min-height: 28px;
  }
  .hero__fact { align-items: flex-start; }
  .hero__fact .dot { transform: translateY(4px); }
}

/* ---- Eintritt (nur mit JS-Klasse am <html>, nur ohne reduzierte Bewegung) */
@media (prefers-reduced-motion: no-preference) {
  html.js .hero__line-in {
    animation: hero-rise var(--dur-scene) var(--ease-out) both;
    animation-delay: calc(80ms + var(--i) * 90ms);
  }
  /* Linie samt Knoten zeichnet sich von links (mobil: von oben) */
  html.js .hero__rail {
    animation: hero-draw-x 700ms var(--ease-in-out) both;
    animation-delay: 560ms;
  }
  html.js .hero__node {
    animation: hero-fade 500ms var(--ease-out) both;
    animation-delay: calc(640ms + var(--i) * 110ms);
  }
  html.js .hero__lead {
    animation: hero-fade-up var(--dur-reveal) var(--ease-out) both;
    animation-delay: 900ms;
  }
  html.js .hero__buttons {
    animation: hero-fade-up 600ms var(--ease-out) both;
    animation-delay: 2000ms;
  }
  html.js .hero__fact {
    animation: hero-fade 600ms var(--ease-out) both;
    animation-delay: 2150ms;
  }
  @media (max-width: 767px) {
    html.js .hero__rail { animation-name: hero-draw-y; }
  }
}

@keyframes hero-rise {
  from { transform: translateY(105%); }
  to   { transform: none; }
}
@keyframes hero-draw-x {
  from { clip-path: inset(-12px 100% -12px -12px); }
  to   { clip-path: inset(-12px -12px -12px -12px); }
}
@keyframes hero-draw-y {
  from { clip-path: inset(-12px -12px 100% -12px); }
  to   { clip-path: inset(-12px -12px -12px -12px); }
}
@keyframes hero-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes hero-fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__line-in, .hero__rail, .hero__node, .hero__lead, .hero__buttons, .hero__fact { animation: none !important; }
}
