/* ==========================================================================
   Let's Do. – Hero der Startseite
   Erste Einstellung nach dem Intro: eine Titelkarte über dem Erdhorizont.
   Markup: templates/home-hero.php · Verhalten: assets/js/modules/hero.js

   Der Hero ist durchsichtig. Dahinter steht die 3D-Bühne (.stage) als fester
   Hintergrund. Gibt es keine Bühne (html.no-stage) oder kein JavaScript,
   zeichnet .hero__ground einen ruhenden Horizont rein mit CSS.
   ========================================================================== */

.hero {
  --hero-nav: 64px;
  --hero-pad-x: clamp(1.25rem, 6vw, 9.5rem);
  --hero-pad-bottom: clamp(1rem, 3.2vh, 2.25rem);
  --hero-ink: #F0F0F5;
  --hero-ink-soft: rgba(240, 240, 245, 0.86);
  --hero-ink-quiet: rgba(240, 240, 245, 0.74);
  --hero-dawn: #F4DAC6;            /* Morgenlicht: Ton des Sonnenaufgangs am Erdrand */
  --hero-ease: cubic-bezier(0.16, 1, 0.3, 1);

  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(var(--hero-nav) + clamp(0.75rem, 2.2vh, 2rem)) var(--hero-pad-x) var(--hero-pad-bottom);
  overflow: hidden;
  overflow: clip;
  color: var(--hero-ink);
  background: transparent;
}

/* ── Abdunklung: hält die Schrift auf Sternen, Netzbögen und Stadtlichtern lesbar ── */
.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(5, 5, 8, 0.66) 0%, rgba(5, 5, 8, 0) 24%),
    radial-gradient(ellipse 78% 82% at 14% 40%, rgba(5, 5, 8, 0.84) 0%, rgba(5, 5, 8, 0.66) 42%, rgba(5, 5, 8, 0) 100%),
    linear-gradient(to top, rgba(5, 5, 8, 0.88) 0%, rgba(5, 5, 8, 0.7) 8%, rgba(5, 5, 8, 0) 22%);
}

/* ── Textblock ── */
.hero__content {
  align-self: start;                             /* oben links: der Horizont im unteren Drittel bleibt frei */
  max-width: 62rem;
  margin-top: clamp(0.25rem, 3.6vh, 5rem);
  padding-bottom: 1.5rem;
  transform: translate3d(
    calc(var(--hero-mx, 0) * -10px),
    calc(var(--hero-my, 0) * -6px - var(--hero-out, 0) * 56px),
    0);
  opacity: calc(1 - var(--hero-out, 0) * 1.3);
}

.hero__kicker {
  margin-bottom: clamp(0.9rem, 2.4vh, 1.75rem);
  font-size: clamp(0.9rem, 0.8rem + 0.3vw, 1.25rem);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: var(--hero-ink-soft);
}

.hero__kicker-part {
  white-space: nowrap;
}

.hero__kicker-dot {
  margin-inline: 0.35em;
  font-weight: 800;
  color: var(--ld-red-glow);
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.35rem, min(6.2vw, 10vh), 8.25rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.04em;
  color: var(--hero-ink);
  text-shadow: 0 0 60px rgba(5, 5, 8, 0.55);
}

/* Jede Zeile ist eine Maske, aus der die Schrift beim Einstieg aufsteigt */
.hero__line {
  display: block;
  overflow: hidden;
  padding-block: 0.1em 0.17em;
  margin-block: -0.1em -0.17em;
}

.hero__line-in {
  display: block;
}

/* Zweite Stimme der Überschrift: der Satz zur Haltung, leicht und im Ton des Sonnenaufgangs */
.hero__voice {
  display: block;
  margin-top: 0.3em;
  font-family: var(--font-display);
  font-size: 0.5em;
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.005em;
  color: var(--hero-dawn);
}

.hero__lead {
  max-width: 35em;
  margin-top: clamp(1.1rem, 3vh, 2.25rem);
  font-size: clamp(1.05rem, 0.9rem + 0.5vw, 1.65rem);
  font-weight: 300;
  line-height: 1.55;
  color: var(--hero-ink-soft);
  text-shadow: 0 0 28px rgba(5, 5, 8, 0.7);
}

/* Der Schlusssatz des Fließtexts steht für sich */
.hero__reach {
  display: block;
  margin-top: 0.35em;
  font-weight: 500;
  color: var(--hero-ink);
}

/* ── Die beiden Wege aus dem Hero ── */
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem clamp(1.25rem, 2.4vw, 2.25rem);
  margin-top: clamp(1.3rem, 3.6vh, 2.5rem);
}

.hero__btn {
  display: inline-flex;
  align-items: center;
  min-height: 3.05em;
  padding: 0 1.65em;
  font-family: var(--font-display);
  font-size: clamp(1.0625rem, 0.94rem + 0.2vw, 1.2rem);
  font-weight: 600;
  letter-spacing: 0.005em;
  color: #fff;
  background-color: var(--ld-red);
  border-radius: 2px;
  transition:
    background-color 0.25s var(--hero-ease),
    box-shadow 0.35s var(--hero-ease),
    transform 0.2s var(--hero-ease);
}

.hero__btn:hover {
  background-color: #C9151B;
  box-shadow: 0 14px 44px -14px rgba(228, 28, 34, 0.85);
  transform: translateY(-1px);
}

.hero__btn:active {
  transform: translateY(0);
}

.hero__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 3.05em;
  font-family: var(--font-display);
  font-size: clamp(1.0625rem, 0.94rem + 0.2vw, 1.2rem);
  font-weight: 500;
  color: var(--hero-ink);
  text-shadow: 0 0 2px rgba(5, 5, 8, 0.8), 0 0 14px rgba(5, 5, 8, 0.9);
}

.hero__link::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: 0.72em;
  height: 1px;
  background: currentColor;
  opacity: 0.45;
  transition: opacity 0.25s var(--hero-ease), height 0.25s var(--hero-ease);
}

.hero__link:hover::after {
  height: 2px;
  opacity: 1;
}

.hero__btn:focus-visible,
.hero__link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

/* ── Fußzeile der Einstellung: Arbeitsfelder links, Leitsatz rechts ── */
.hero__base {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.6rem 3rem;
  padding-right: 1.5rem;                 /* Platz für die Lotlinie */
  text-shadow: 0 0 2px rgba(5, 5, 8, 0.8), 0 0 14px rgba(5, 5, 8, 0.9);
  opacity: calc(1 - var(--hero-out, 0) * 2.6);
}

.hero__fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0;
  font-size: clamp(0.84rem, 0.78rem + 0.2vw, 1.06rem);
  line-height: 1.4;
  color: var(--hero-ink-soft);
}

.hero__fields li + li::before {
  content: '';
  display: inline-block;
  width: 1px;
  height: 0.9em;
  margin-inline: 1.05em;
  vertical-align: -0.1em;
  background: rgba(240, 240, 245, 0.38);
}

.hero__claim {
  font-family: var(--font-display);
  font-size: clamp(1.02rem, 0.86rem + 0.5vw, 1.55rem);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--hero-dawn);
}

/* Lotlinie: führt am rechten Rand aus dem Bild nach unten (Scroll-Hinweis) */
.hero__scroll {
  position: absolute;
  right: 0;
  bottom: calc(var(--hero-pad-bottom) * -1);
  width: 1px;
  height: clamp(3rem, 9vh, 5rem);
  overflow: hidden;
  background: linear-gradient(to bottom, rgba(240, 240, 245, 0), rgba(240, 240, 245, 0.6));
}

.hero__scroll::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 55%, rgba(255, 255, 255, 0));
  transform: translateY(-100%);
}

/* ── Einstieg nach dem Intro ───────────────────────────────────────────────
   Nur mit JavaScript und nur, wenn Bewegung erwünscht ist, wird vorab
   versteckt. hero.js setzt .hero--in, sobald die Seite aufgedeckt ist. */
@media (prefers-reduced-motion: no-preference) {
  html.js .hero:not(.hero--in) .hero__kicker,
  html.js .hero:not(.hero--in) .hero__lead,
  html.js .hero:not(.hero--in) .hero__actions,
  html.js .hero:not(.hero--in) .hero__fields,
  html.js .hero:not(.hero--in) .hero__claim {
    opacity: 0;
    transform: translateY(0.9rem);
  }

  html.js .hero:not(.hero--in) .hero__line-in {
    transform: translateY(112%);
  }

  html.js .hero:not(.hero--in) .hero__voice {
    opacity: 0;
    filter: blur(14px);
    transform: translateY(0.12em);
  }

  html.js .hero:not(.hero--in) .hero__scroll {
    opacity: 0;
  }

  html.js .hero--in .hero__kicker {
    transition: opacity 1s ease 0.1s, transform 1.1s var(--hero-ease) 0.1s;
  }

  html.js .hero--in .hero__line-in {
    transition: transform 1.25s var(--hero-ease) 0.22s;
  }

  html.js .hero--in .hero__line + .hero__line .hero__line-in {
    transition-delay: 0.36s;
  }

  /* Schärfe ziehen: die zweite Stimme kommt aus der Unschärfe */
  html.js .hero--in .hero__voice {
    transition: opacity 1.5s ease 0.85s, filter 1.5s ease 0.85s, transform 1.5s var(--hero-ease) 0.85s;
  }

  html.js .hero--in .hero__lead {
    transition: opacity 1.1s ease 1.3s, transform 1.2s var(--hero-ease) 1.3s;
  }

  html.js .hero--in .hero__actions {
    transition: opacity 1.1s ease 1.5s, transform 1.2s var(--hero-ease) 1.5s;
  }

  html.js .hero--in .hero__fields {
    transition: opacity 1.2s ease 1.85s, transform 1.2s var(--hero-ease) 1.85s;
  }

  html.js .hero--in .hero__claim {
    transition: opacity 1.2s ease 2s, transform 1.2s var(--hero-ease) 2s;
  }

  html.js .hero--in .hero__scroll {
    transition: opacity 1.2s ease 2.3s;
  }

  .hero__scroll::after {
    animation: hero-plumb 3.6s cubic-bezier(0.65, 0, 0.35, 1) 3s infinite;
  }

  /* Sicherheitsnetz: Meldet sich hero.js nicht, wird trotzdem alles sichtbar */
  html.js:not(.intro-pending) .hero:not(.hero--in) .hero__kicker,
  html.js:not(.intro-pending) .hero:not(.hero--in) .hero__line-in,
  html.js:not(.intro-pending) .hero:not(.hero--in) .hero__voice,
  html.js:not(.intro-pending) .hero:not(.hero--in) .hero__lead,
  html.js:not(.intro-pending) .hero:not(.hero--in) .hero__actions,
  html.js:not(.intro-pending) .hero:not(.hero--in) .hero__fields,
  html.js:not(.intro-pending) .hero:not(.hero--in) .hero__claim,
  html.js:not(.intro-pending) .hero:not(.hero--in) .hero__scroll {
    animation: hero-failsafe 0.8s ease 5s forwards;
  }
}

@keyframes hero-plumb {
  0%        { transform: translateY(-100%); }
  45%, 100% { transform: translateY(100%); }
}

@keyframes hero-failsafe {
  to { opacity: 1; transform: none; filter: none; }
}

/* ── Ruhender Hintergrund ohne 3D-Bühne ────────────────────────────────────
   Derselbe Bildgedanke wie die Bühne, nur gezeichnet: Weltraum, gekrümmter
   Erdrand bei Nacht, Sonnenaufgang rechts der Mitte, rote Netzbögen. */
.hero__ground {
  --ground-horizon: 72%;                      /* Höhe des Erdrands am Scheitel */
  --ground-apex: 60%;                         /* waagrechte Lage des Scheitels */
  --ground-earth: max(300vw, 190vh);          /* Durchmesser der Erdscheibe */
  --ground-origin: 36%;                       /* Ausgangspunkt der Netzbögen */
  --ground-sag: 1.5vw;                        /* so viel tiefer liegt der Rand am Ausgangspunkt */
  --ground-origin-y: calc(var(--ground-horizon) + var(--ground-sag));

  position: absolute;
  inset: 0;
  z-index: -2;
  display: none;
  overflow: hidden;
  pointer-events: none;
  background:
    linear-gradient(118deg, rgba(150, 160, 220, 0) 30%, rgba(150, 160, 220, 0.06) 44%, rgba(196, 180, 214, 0.1) 50%, rgba(150, 160, 220, 0.06) 56%, rgba(150, 160, 220, 0) 70%),
    radial-gradient(ellipse 95% 62% at var(--ground-apex) 80%, #10214C 0%, #0A1128 36%, rgba(5, 5, 8, 0) 74%),
    #050508;
}

html.no-stage .hero__ground,
html:not(.js) .hero__ground {
  display: block;
}

.hero__ground > span {
  position: absolute;
  display: block;
}

/* Sterne: zwei Kacheln verschiedener Größe, damit sich kein Raster abzeichnet */
.hero__stars {
  inset: 0;
  background-image:
    radial-gradient(circle at 7% 12%, rgba(255, 255, 255, 0.9) 0, rgba(255, 255, 255, 0.9) 0.8px, transparent 1.4px),
    radial-gradient(circle at 23% 67%, rgba(255, 255, 255, 0.55) 0, rgba(255, 255, 255, 0.55) 0.6px, transparent 1.2px),
    radial-gradient(circle at 38% 29%, rgba(205, 222, 255, 0.85) 0, rgba(205, 222, 255, 0.85) 1.1px, transparent 1.7px),
    radial-gradient(circle at 52% 88%, rgba(255, 255, 255, 0.5) 0, rgba(255, 255, 255, 0.5) 0.5px, transparent 1.1px),
    radial-gradient(circle at 61% 8%, rgba(255, 236, 214, 0.7) 0, rgba(255, 236, 214, 0.7) 0.7px, transparent 1.3px),
    radial-gradient(circle at 74% 49%, rgba(255, 255, 255, 0.6) 0, rgba(255, 255, 255, 0.6) 0.6px, transparent 1.2px),
    radial-gradient(circle at 88% 76%, rgba(255, 255, 255, 0.8) 0, rgba(255, 255, 255, 0.8) 0.9px, transparent 1.5px),
    radial-gradient(circle at 95% 22%, rgba(255, 255, 255, 0.45) 0, rgba(255, 255, 255, 0.45) 0.5px, transparent 1.1px),
    radial-gradient(circle at 31% 95%, rgba(205, 222, 255, 0.5) 0, rgba(205, 222, 255, 0.5) 0.6px, transparent 1.2px),
    radial-gradient(circle at 14% 43%, rgba(255, 255, 255, 0.4) 0, rgba(255, 255, 255, 0.4) 0.5px, transparent 1.1px);
  background-size: 440px 400px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 40%, transparent 68%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 40%, transparent 68%);
}

.hero__stars::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 11% 81%, rgba(255, 255, 255, 0.75) 0, rgba(255, 255, 255, 0.75) 0.7px, transparent 1.3px),
    radial-gradient(circle at 27% 17%, rgba(255, 255, 255, 0.5) 0, rgba(255, 255, 255, 0.5) 0.5px, transparent 1.1px),
    radial-gradient(circle at 44% 58%, rgba(255, 255, 255, 0.9) 0, rgba(255, 255, 255, 0.9) 1.2px, transparent 1.8px),
    radial-gradient(circle at 58% 34%, rgba(255, 236, 214, 0.45) 0, rgba(255, 236, 214, 0.45) 0.5px, transparent 1.1px),
    radial-gradient(circle at 69% 91%, rgba(255, 255, 255, 0.6) 0, rgba(255, 255, 255, 0.6) 0.6px, transparent 1.2px),
    radial-gradient(circle at 83% 13%, rgba(205, 222, 255, 0.7) 0, rgba(205, 222, 255, 0.7) 0.8px, transparent 1.4px),
    radial-gradient(circle at 93% 61%, rgba(255, 255, 255, 0.5) 0, rgba(255, 255, 255, 0.5) 0.5px, transparent 1.1px);
  background-size: 610px 530px;
}

/* Netzbögen: Ellipsen, deren untere Hälfte hinter der Erde verschwindet */
.hero__arc {
  border: 2px solid rgba(255, 92, 96, 0.95);
  border-bottom-color: transparent;
  border-radius: 50%;
  filter: drop-shadow(0 0 5px rgba(255, 60, 64, 0.9)) drop-shadow(0 0 16px rgba(228, 28, 34, 0.7));
}

.hero__arc--far {
  --arc-rise: 10vw;
  left: var(--ground-origin);
  top: calc(var(--ground-origin-y) - var(--arc-rise));
  width: 47%;
  height: calc(var(--arc-rise) * 2);
}

.hero__arc--near {
  --arc-rise: 4.6vw;
  left: var(--ground-origin);
  top: calc(var(--ground-origin-y) - var(--arc-rise));
  width: 21%;
  height: calc(var(--arc-rise) * 2);
  opacity: 0.85;
}

/* Der Bogen nach Westen folgt der Erdkrümmung und neigt sich deshalb */
.hero__arc--west {
  --arc-rise: 6.4vw;
  right: calc(100% - var(--ground-origin));
  top: calc(var(--ground-origin-y) - var(--arc-rise));
  width: 31%;
  height: calc(var(--arc-rise) * 2);
  transform: rotate(-15deg);
  transform-origin: 100% 50%;
  opacity: 0.7;
}

.hero__earth {
  left: var(--ground-apex);
  top: var(--ground-horizon);
  width: var(--ground-earth);
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  box-shadow:
    0 0 0 1px rgba(170, 208, 255, 0.7),
    0 0 26px 3px rgba(104, 166, 255, 0.7),
    0 0 120px 24px rgba(58, 112, 255, 0.42),
    0 0 300px 80px rgba(44, 86, 230, 0.2);
}

/* Sonnenaufgang: liegt hinter der Erdscheibe, nur die obere Hälfte schaut heraus */
.hero__earth::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: min(96vw, 84rem);
  height: clamp(8rem, 30vh, 19rem);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(closest-side,
    rgba(255, 252, 240, 1) 0%,
    rgba(255, 230, 178, 0.94) 9%,
    rgba(255, 180, 100, 0.68) 22%,
    rgba(255, 124, 58, 0.38) 42%,
    rgba(96, 146, 255, 0.16) 68%,
    rgba(96, 146, 255, 0) 100%);
  filter: blur(4px);
}

/* Erdkörper bei Nacht mit erstem Tageslicht am Scheitel */
.hero__earth::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(ellipse 50vw 26vh at 50% 0%, rgba(64, 120, 224, 0.55) 0%, rgba(30, 62, 140, 0.22) 48%, rgba(10, 20, 50, 0) 100%),
    #04060E;
  box-shadow:
    inset 0 2px 2px -1px rgba(255, 238, 212, 0.9),
    inset 0 12px 30px -8px rgba(90, 150, 255, 0.65);
}

.hero__origin {
  left: var(--ground-origin);
  top: var(--ground-origin-y);
  width: 0.5rem;
  height: 0.5rem;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #FF7A7D;
  box-shadow: 0 0 0 4px rgba(228, 28, 34, 0.3), 0 0 24px 7px rgba(228, 28, 34, 0.8);
}

/* ── Tablet hochkant: die Überschrift darf mehr Breite nehmen ── */
@media (min-width: 768px) and (max-width: 1023px) {
  .hero__title {
    font-size: clamp(3rem, min(8.4vw, 9.5vh), 5.25rem);
  }
}

/* ── Handy ── */
@media (max-width: 767px) {
  .hero {
    --hero-pad-x: 1.25rem;
    --hero-pad-bottom: 1.1rem;
    padding-top: calc(var(--hero-nav) + clamp(0.9rem, 3.5vh, 2rem));
  }

  .hero__scrim {
    background:
      linear-gradient(to bottom,
        rgba(5, 5, 8, 0.8) 0%,
        rgba(5, 5, 8, 0.7) 52%,
        rgba(5, 5, 8, 0.4) 72%,
        rgba(5, 5, 8, 0.62) 88%,
        rgba(5, 5, 8, 0.82) 100%);
  }

  .hero__content {
    margin-top: clamp(0rem, 2.5vh, 2rem);
  }

  .hero__kicker {
    margin-bottom: clamp(0.8rem, 2.4vh, 1.5rem);
  }

  .hero__title {
    font-size: clamp(2rem, 10.6vw, 3.75rem);
  }

  .hero__voice {
    margin-top: 0.36em;
    font-size: 0.7em;
    font-weight: 400;
  }

  .hero__lead {
    font-weight: 400;
    line-height: 1.5;
  }

  .hero__btn {
    padding-inline: 1.3em;
  }

  .hero__base {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
    padding-right: 0;
  }

  .hero__fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, auto));
    justify-content: start;
    gap: 0.2rem 1.15rem;
    font-size: 0.8125rem;
  }

  .hero__claim {
    padding-right: 1rem;                 /* Abstand zur Lotlinie */
    font-size: clamp(1.1rem, 5.3vw, 1.4rem);
  }

  .hero__fields li + li::before {
    content: none;
  }

  .hero__ground {
    --ground-horizon: 76%;
    --ground-apex: 66%;
    --ground-origin: 28%;
    --ground-sag: 3.4vw;
  }

  .hero__arc--far  { --arc-rise: 19vw; width: 60%; }
  .hero__arc--near { --arc-rise: 9vw;  width: 30%; }
  .hero__arc--west { --arc-rise: 11vw; width: 36%; }
}

/* ── Schmale Handys: beide Wege bleiben in einer Zeile ── */
@media (max-width: 374px) {
  .hero__actions {
    column-gap: 1rem;
  }

  .hero__btn,
  .hero__link {
    font-size: 1rem;
  }
}

/* ── Sehr schmale Handys ── */
@media (max-width: 359px) {
  .hero__fields {
    grid-template-columns: 1fr;
  }
}

/* ── Niedrige Fenster (Handy quer, kleine Laptops): Abstände raffen ── */
@media (max-height: 560px) {
  .hero__content {
    margin-top: 0;
    padding-bottom: 1rem;
  }

  .hero__scroll {
    display: none;
  }
}

@media (max-height: 560px) and (min-width: 600px) {
  .hero__title {
    font-size: clamp(2rem, min(6vw, 13vh), 4rem);
  }
}

/* ── Druck und erzwungene Farben: keine Verläufe nötig ── */
@media (forced-colors: active) {
  .hero__scrim,
  .hero__ground {
    display: none !important;
  }

  .hero__btn {
    border: 1px solid ButtonText;
  }
}

/* Claim bleibt auf schmalen Bildschirmen einzeilig */
@media (max-width: 480px) {
  .hero__claim { font-size: 0.95rem; }
}
