/* ==========================================================================
   Hero — full viewport, cinematic intro.

   Timeline (all triggered by .is-loaded):
     0ms     image fades in, eases out of a 1.10 zoom
     500ms   eyebrow
     620ms   headline line 1 · 750ms line 2
     1000ms  subtitle
     1180ms  CTA
     1360ms  scroll indicator
   ========================================================================== */

.hero {
  --hero-exit: 0;

  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100vh;
  min-height: 100svh;
  /*
     10vh rather than 12: on a 1080 px-tall screen the headline is now large
     enough that the old headroom pushed the foot bar against the edge. The
     6rem floor keeps short laptop viewports exactly as they were.
  */
  padding-block: clamp(6rem, 10vh, 9rem) clamp(1.5rem, 4vh, 2.75rem);
  overflow: hidden;
  background: var(--c-ink);
  isolation: isolate;
}

/* ---------------------------------------------------------------- Media -- */

.hero__media {
  position: absolute;
  inset: -6% 0;
  z-index: -1;
  transform: translate3d(0, var(--parallax-y, 0%), 0);
}

.hero__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  opacity: 0;
  transform: scale(1.1);
  transition: opacity var(--dur-slower) var(--ease-out),
    transform var(--dur-cinematic) var(--ease-out);
}

.hero.is-loaded .hero__image {
  opacity: 1;
  transform: scale(1);
}

/*
   Three stacked layers, deliberately restrained: a flat wash that lifts
   overall contrast without dulling the photo, plus gradients that carry the
   header and the copy at the bottom.
*/
.hero__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to bottom,
      rgba(26, 18, 20, 0.45) 0%,
      rgba(26, 18, 20, 0.08) 22%,
      transparent 40%
    ),
    linear-gradient(
      to top,
      rgba(26, 18, 20, 0.72) 0%,
      rgba(26, 18, 20, 0.46) 24%,
      rgba(26, 18, 20, 0.14) 52%,
      transparent 74%
    ),
    linear-gradient(rgba(26, 18, 20, 0.16), rgba(26, 18, 20, 0.16));
}

/* -------------------------------------------------------------- Content -- */

.hero__body,
.hero__foot {
  position: relative;
  color: #fff;
  /* Content lifts and dissolves as the hero scrolls away. */
  opacity: calc(1 - var(--hero-exit) * 1.15);
  transform: translate3d(0, calc(var(--hero-exit) * -42px), 0);
}

/* Keeps type legible wherever the photo turns bright. */
.hero__eyebrow,
.hero__title,
.hero__subtitle {
  text-shadow: 0 1px 2px rgba(22, 16, 18, 0.28),
    0 2px 28px rgba(22, 16, 18, 0.34);
}

.hero__body {
  display: flex;
  align-items: flex-end;
}

.hero__content {
  max-width: 62rem;
}

.hero__eyebrow {
  color: rgba(255, 255, 255, 0.94);
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition: opacity var(--dur-slow) var(--ease-out) 500ms,
    transform var(--dur-slow) var(--ease-out) 500ms;
}

.hero.is-loaded .hero__eyebrow {
  opacity: 1;
  transform: none;
}

.hero__title {
  margin-block: clamp(1rem, 2.4vw, 1.9rem) 0;
  color: #fff;
  font-size: var(--fs-hero);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: var(--ls-hero);
}

.hero__title .reveal-line:last-child > span {
  font-style: italic;
  font-weight: 500;
  padding-inline-start: 0.06em;
  margin-inline-start: -0.06em;
}

/* Line masks open once the image is in. */
.hero.is-loaded .hero__title .reveal-line > span {
  transform: translate3d(0, 0, 0);
}

.hero__title .reveal-line > span {
  transition-delay: calc(620ms + var(--reveal-delay, 0ms));
}

.hero__subtitle {
  max-width: 36rem;
  /* Two even lines rather than a long one and an orphan. */
  text-wrap: balance;
  margin-block-start: clamp(1.4rem, 2.6vw, 2.1rem);
  color: rgba(255, 255, 255, 0.95);
  font-size: var(--fs-lead);
  font-weight: 300;
  line-height: 1.58;
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition: opacity var(--dur-slower) var(--ease-out) 1000ms,
    transform var(--dur-slower) var(--ease-out) 1000ms;
}

.hero.is-loaded .hero__subtitle {
  opacity: 1;
  transform: none;
}

.hero__actions {
  margin-block-start: clamp(1.9rem, 3.4vw, 2.9rem);
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition: opacity var(--dur-slower) var(--ease-out) 1180ms,
    transform var(--dur-slower) var(--ease-out) 1180ms;
}

.hero.is-loaded .hero__actions {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------------- Foot bar -- */

/*
   Only the scroll hint lives here now. `flex-end` keeps it against the same
   right edge that `space-between` gave it while the facts sat opposite.
*/
.hero__foot {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: var(--sp-6);
  margin-block-start: clamp(2.5rem, 6vh, 4.5rem);
}

.scroll-hint {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition: opacity var(--dur-slower) var(--ease-out) 1360ms,
    transform var(--dur-slower) var(--ease-out) 1360ms;
}

.hero.is-loaded .scroll-hint {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------- Scroll hint ----- */

.scroll-hint {
  display: grid;
  justify-items: center;
  gap: 0.85rem;
  padding-block-end: 0.25rem;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 12px rgba(22, 16, 18, 0.4);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: opacity var(--dur-slower) var(--ease-out) 1360ms,
    transform var(--dur-slower) var(--ease-out) 1360ms,
    color var(--dur-hover) var(--ease-out-soft);
}

.scroll-hint:hover {
  color: #fff;
}

.scroll-hint__track {
  position: relative;
  display: block;
  width: 1px;
  height: 3.6rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.22);
}

.scroll-hint__track i {
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 45%;
  background: #fff;
  animation: scroll-hint-run 2.6s var(--ease-in-out) infinite;
}

@keyframes scroll-hint-run {
  0% {
    transform: translateY(-105%);
  }
  55%,
  100% {
    transform: translateY(240%);
  }
}

/* ------------------------------------------------------------ Responsive -- */

@media (max-width: 720px) {
  .hero {
    padding-block-start: clamp(7rem, 18vh, 10rem);
  }

  .hero__foot {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-5);
  }

  .scroll-hint {
    justify-items: start;
  }

  .scroll-hint__track {
    height: 2.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-hint__track i {
    animation: none;
    height: 100%;
    opacity: 0.5;
  }
}

/* ==========================================================================
   Kopf einer Unterseite.

   Kein zweiter Entwurf, nur eine kürzere Fassung desselben Hero: gleiche
   Bildbehandlung, gleicher Schleier, gleiche maskierte Headline, gleiche
   Parallaxe. Was hier fehlt, fehlt mit Absicht — Faktenleiste, Scroll-
   Hinweis und die Verabschiedung beim Scrollen gehören dem Aufschlag der
   Startseite. Eine Unterseite beginnt mit ihrem Thema.
   ========================================================================== */

.hero--page {
  min-height: clamp(30rem, 62vh, 44rem);
  /* Ohne Faktenleiste braucht die Unterkante nur noch Luft, keinen Platz. */
  padding-block: clamp(7rem, 14vh, 10rem) clamp(3rem, 7vh, 5rem);
}

.hero--page .hero__title {
  /* Eine Stufe unter dem Aufschlag der Startseite. */
  font-size: var(--fs-display);
}

.hero--page .hero__subtitle {
  max-width: 46ch;
}

@media (max-width: 900px) {
  .hero--page {
    min-height: clamp(26rem, 56vh, 34rem);
  }
}
