@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../../../fonts/source-sans-3-v19-latin-700.woff2') format('woff2');
}

* {
  padding: 0;
  margin: 0;
}

html {
  background: #0e0e0c;
}

.hero {
  position: relative;
  height: 200vh;
  overflow: hidden;
  scroll-behavior: smooth;
}

.hero__doorway,
.hero__scene {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.hero__title {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-weight: 700;
  position: fixed;
  font-size: clamp(1.6rem, 10vw, 8rem);
  white-space: nowrap;
  color: #fff;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  animation: contract linear forwards;
  animation-timeline: scroll(root);
  animation-range: 0vh 100dvh;
  mix-blend-mode: overlay;
  text-align: center;
  line-height: 1.05;
}

.hero__doorway {
  animation: doorway-zoom linear forwards;
  animation-timeline: scroll(root);
  animation-range: 0vh 60vh;
  z-index: 3;
  pointer-events: none;
}

.hero__scene {
  animation: unblur linear forwards;
  animation-timeline: scroll(root);
  animation-range: 0vh 100dvh;
  z-index: 1;
  pointer-events: none;
}

@keyframes contract {
  0% {
    letter-spacing: -1.5rem;
    opacity: 0;
  }
  100% {
    letter-spacing: 0;
    opacity: 1;
  }
}

@keyframes unblur {
  0% {
    filter: blur(10px);
    transform: translate(-50%, -50%) scale(1.1);
  }
  100% {
    transform: translate(-50%, -50%) scale(1.4);
    filter: blur(0);
  }
}

@keyframes doorway-zoom {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  85% {
    transform: translate(-50%, -50%) scale(5);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(5);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__title,
  .hero__doorway,
  .hero__scene {
    animation: none;
  }

  .hero {
    height: 100vh;
  }

  .hero__doorway {
    opacity: 0;
  }
}
