/* Intro- und In-View-Bewegungen, getrennt von der Szene. */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(0);
  will-change: transform;
  transition: transform 1.05s cubic-bezier(0.76, 0, 0.24, 1);
}
.preloader.is-leaving {
  transform: translateY(-100%);
}
.preloader.is-gone {
  display: none;
}
.preloader-logo {
  width: 64px;
  height: 64px;
}
.preloader-status {
  position: absolute;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.preloader-status span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 16px;
}
.preloader-status strong {
  color: #fff;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
}
.preloader-status b {
  font: inherit;
}
html.is-loading {
  overflow: hidden;
}

/* Intro-Startzustand (nur mit JS; ohne JS bleibt alles sichtbar) */
.js .site-header,
.js .hero-title .kicker,
.js .facts-card,
.js .hero-copy > p,
.js .hero-copy .actions .pill,
.js .scroll-hint {
  opacity: 0;
}
.js .site-header {
  transform: translateY(22px);
  filter: blur(5px);
}
.js .hero-title .kicker,
.js .facts-card,
.js .hero-copy > p,
.js .hero-copy .actions .pill {
  transform: translateY(20px);
  filter: blur(7px);
}
.title-word {
  display: inline-block;
  white-space: nowrap;
}
.title-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(15px);
  filter: blur(12px);
  will-change: opacity, transform, filter;
}

.intro-ready .site-header {
  animation: layer-rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.12s forwards;
}
.intro-ready .hero-title .kicker {
  animation: layer-rise 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.72s forwards;
}
.intro-ready .hero-title .title-char {
  animation: letter-reveal 0.72s cubic-bezier(0.22, 1, 0.36, 1)
    calc(0.68s + var(--char-index) * 0.032s) forwards;
}
.intro-ready .facts-card {
  animation: layer-rise 0.75s cubic-bezier(0.22, 1, 0.36, 1) 1.55s forwards;
}
.intro-ready .hero-copy > p {
  animation: layer-rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) 1.84s forwards;
}
.intro-ready .hero-copy .actions .pill:first-child {
  animation: layer-rise 0.72s cubic-bezier(0.22, 1, 0.36, 1) 2.08s forwards;
}
.intro-ready .hero-copy .actions .pill:last-child {
  animation: layer-rise 0.72s cubic-bezier(0.22, 1, 0.36, 1) 2.2s forwards;
}
.intro-ready .scroll-hint {
  animation: layer-rise 0.8s ease 2.6s forwards;
}

.second-ui h2 .title-char,
.second-ui .second-intro,
.second-ui .feature-grid article {
  opacity: 0;
}
.second-ui .second-intro,
.second-ui .feature-grid article {
  transform: translateY(30px);
}
.second-ui .second-intro {
  filter: blur(7px);
}
.second-ui.is-inview h2 .title-char {
  animation: letter-reveal 0.72s cubic-bezier(0.22, 1, 0.36, 1) calc(var(--char-index) * 0.032s)
    forwards;
}
.second-ui.is-inview .second-intro {
  animation: layer-rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.72s forwards;
}
.second-ui.is-inview .feature-grid article {
  animation: card-rise 0.82s cubic-bezier(0.22, 1, 0.36, 1)
    calc(0.98s + var(--card-index, 0) * 0.13s) forwards;
}
.second-ui .feature-grid article:nth-child(2) {
  --card-index: 1;
}
.second-ui .feature-grid article:nth-child(3) {
  --card-index: 2;
}
.second-ui .feature-grid article:nth-child(4) {
  --card-index: 3;
}

/* Inhaltsabschnitte beim Hineinscrollen */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

@keyframes layer-rise {
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}
@keyframes letter-reveal {
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}
@keyframes card-rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header,
  .hero-title .kicker,
  .facts-card,
  .hero-copy > p,
  .hero-copy .actions .pill,
  .title-char,
  .second-ui .second-intro,
  .second-ui .feature-grid article,
  .scroll-hint {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
  }
  .js .reveal {
    transition: none;
  }
  .preloader {
    transition: none;
  }
}
