/* Layout rules for page sections and hero area */
.page {
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
}

.site-header {
  position: absolute;
  inset-inline: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 5;
  pointer-events: none;
}

.site-header__scroll-progress {
  position: fixed;
  top: 0.875rem;
  left: 50%;
  transform: translateX(-50%);
  width: min(70vw, 640px);
  height: 3px;
  border-radius: 999px;
  background: rgba(165, 177, 194, 0.38);
  overflow: hidden;
  z-index: 20;
}

.site-header__badge {
  margin-top: 1.5rem;
}

.site-header__scroll-progress-fill {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: rgba(236, 244, 255, 0.96);
  transform: scaleX(var(--scroll-progress, 0));
  transform-origin: center;
  will-change: transform;
}

.site-main {
  position: relative;
  min-height: 100vh;
}

.hero {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
}

.prologue {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 4rem 3rem;
  color: #f5f7fb;
  overflow: hidden;
}

.prologue__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #02040c;
}

.prologue__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.75s ease;
}

.prologue__video.prologue__video--ready {
  opacity: 1;
}

.prologue__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(2, 4, 12, 0.55) 0%,
    rgba(2, 4, 12, 0.72) 45%,
    rgba(2, 4, 12, 0.82) 100%
  );
  pointer-events: none;
}

.prologue__content {
  position: relative;
  z-index: 2;
  max-width: 720px;
  margin-left: 1rem;
}

.prologue__title {
  font-size: clamp(2rem, 3.2vw, 3.2rem);
  line-height: 1.08;
  margin: 0 0 1rem;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.prologue__copy {
  margin: 0;
  padding-left: 1.4rem;
  max-width: 640px;
  font-size: 1.05rem;
  line-height: 1.75;
  opacity: 0.92;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.4);
}

.story {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 4rem 3rem;
  background: #02040c;
  color: #f5f7fb;
}

.story__content {
  max-width: 720px;
  margin-left: 1rem;
}

.story__title {
  font-size: clamp(2.2rem, 3.5vw, 4rem);
  line-height: 1.05;
  margin: 0 0 1rem;
}

.story__copy {
  margin: 0;
  padding-left: 1.4rem;
  max-width: 680px;
  font-size: 1.05rem;
  line-height: 1.75;
  opacity: 0.9;
}

.hero__canvas-wrapper {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: auto;
}

.hero__canvas {
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease;
}

.hero__canvas.visible-canvas {
  opacity: 1;
}

.hero__hover-menu {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.hero__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #000;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.9s ease;
}

body.page-loaded .hero__media {
  opacity: 1;
}

body.page-loaded .hero__media.hero-media--scroll-ready {
  opacity: var(--hero-scroll-fade, 1);
  transition: none;
}

body.page-loaded .hero__canvas-wrapper.hero-fade--scroll {
  opacity: var(--hero-scroll-fade, 1);
  transition: none;
}

.hero__video,
.hero__fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.hero__fallback {
  display: block;
}

.hero__video.visible,
.hero__fallback.visible {
  opacity: 1;
}
