/* ===== Vault / meteorite scroll sequence (replaces the static work grid) ===== */

.vault-sequence {
  position: relative;
  height: 350vh;
  margin-top: 64px;
}

.vault-sticky {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
}

.vault-media {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.vault-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}

.vault-video-door {
  opacity: 1;
}

.vault-media-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(8, 9, 12, 0.55) 0%,
    rgba(8, 9, 12, 0.05) 22%,
    rgba(8, 9, 12, 0.05) 70%,
    rgba(8, 9, 12, 0.75) 100%
  );
  pointer-events: none;
}

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

.vault-label {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 16px;
  opacity: 0;
  transform: translateY(12px);
}

/* Gold's label reads to the fragment's left (as the viewer faces the
   screen); the other three read to their fragment's right. Reversing the
   flex order puts the text before the line instead of moving the anchor
   point — see initVaultSequence's xPercent branch for the matching
   left/right anchor logic. */
.vault-label-gold {
  flex-direction: row-reverse;
}

.vault-label-line {
  width: 110px;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan-400), transparent);
}

.vault-label-gold .vault-label-line {
  background: linear-gradient(90deg, transparent, var(--cyan-400));
}

.vault-label-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream-100);
  white-space: nowrap;
}

.vault-label-text em {
  font-style: normal;
  color: var(--cyan-400);
  text-shadow: 0 0 12px var(--cyan-glow);
}

/* On-screen centers of the four separated fragments in the split video's
   final frame, measured directly against that frame with a 10% reference
   grid (gold lower-left-center, amethyst upper-center, diamond lower-
   center, quartz right) — earlier values here were eyeballed and drifted
   noticeably from the actual fragment positions. Centering is done in JS
   via xPercent/yPercent: -50 (see initVaultSequence), so top/left here are
   each fragment's center point, not a label corner. */
.vault-label-gold {
  top: 49%;
  left: 31%;
}

.vault-label-amethyst {
  top: 29%;
  left: 51%;
}

.vault-label-amethyst .vault-label-line {
  background: linear-gradient(90deg, var(--purple-400), transparent);
}

.vault-label-amethyst .vault-label-text em {
  color: var(--purple-400);
  text-shadow: 0 0 12px rgba(192, 132, 252, 0.6);
}

.vault-label-diamond {
  top: 71%;
  left: 49%;
}

.vault-label-quartz {
  top: 51%;
  left: 73%;
}

.vault-label-quartz .vault-label-line {
  background: linear-gradient(90deg, var(--purple-400), transparent);
}

.vault-label-quartz .vault-label-text em {
  color: var(--purple-400);
  text-shadow: 0 0 12px rgba(192, 132, 252, 0.6);
}

@media (prefers-reduced-motion: reduce) {
  .vault-sequence {
    height: auto;
  }

  .vault-sticky {
    position: relative;
    height: 70svh;
  }

  .vault-video-door {
    display: none;
  }

  .vault-video-meteorite {
    opacity: 1;
  }

  .vault-label {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@media (max-width: 780px) {
  .vault-sequence {
    height: 300vh;
  }

  .vault-label-text {
    font-size: 0.6875rem;
  }

  .vault-label-line {
    width: 60px;
  }

  /* object-fit: cover forced this landscape (1920x1066) video to fill a
     tall portrait box, cropping hard and leaving only the center visible —
     switched to contain below so the whole frame shows, letterboxed
     against the starfield canvas behind it. Contain on a portrait box is
     always width-constrained here (video render height 1920:1066 of the
     full viewport width is far shorter than any phone's viewport height),
     so the rendered strip is exactly 100vw wide by ~55.52vw tall
     (1066/1920), vertically centered in the 100svh box. Left stays the
     desktop x% — width isn't cropped in this framing, only letterboxed
     top/bottom — but top is recomputed from box-relative % to
     strip-relative %: 50svh + (desktop-top% - 50%) * 55.52vw. */
  .vault-video-door,
  .vault-video-meteorite {
    object-fit: contain;
  }

  .vault-label-gold {
    left: 31%;
    top: calc(50svh - 0.56vw);
  }

  .vault-label-amethyst {
    left: 51%;
    top: calc(50svh - 11.66vw);
  }

  .vault-label-diamond {
    left: 49%;
    top: calc(50svh + 11.66vw);
  }

  .vault-label-quartz {
    left: 73%;
    top: calc(50svh + 0.56vw);
  }
}
