* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: auto; /* keep instant; smooth scroll fights the scrubbing */
}

body {
  background: #000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #fff;
}

/* The video stays pinned to the viewport while the page scrolls underneath */
.video-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;   /* fallback */
  height: 100svh;  /* accounts for mobile browser chrome show/hide */
  overflow: hidden;
  z-index: 1;
  touch-action: pan-y; /* avoid pinch-zoom fighting the scrub */
}

#scrollVideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* fill the screen, crop edges. Use "contain" to letterbox instead */
  background: #000;
}

/* Overlay text on top of the video */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
  padding: 24px;
}

.title {
  font-size: clamp(1.6rem, 6vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
  transition: opacity 0.4s ease;
}

.scroll-hint {
  position: absolute;
  bottom: calc(40px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  opacity: 0.85;
  transition: opacity 0.4s ease;
}

.arrow {
  width: 14px;
  height: 14px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
  animation: bob 1.6s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(45deg); }
  50% { transform: translateY(8px) rotate(45deg); }
}

/* Thin progress bar at the bottom of the viewport */
.progress {
  position: absolute;
  left: 0;
  bottom: env(safe-area-inset-bottom, 0);
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  z-index: 3;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: #fff;
  transition: width 0.08s linear;
}

/* The invisible tall element that creates scroll distance.
   Bigger height = slower / smoother scrub. */
.scroll-track {
  position: relative;
  z-index: 0;
  height: 800vh;
}

/* Loading spinner shown until the video can be scrubbed */
.loader {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  transition: opacity 0.5s ease;
}

.loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Mobile: shorter scroll distance so scrubbing doesn't feel endless */
@media (max-width: 768px) {
  .scroll-track {
    height: 400vh;
  }

  .scroll-hint {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
  }
}