/* ============================================================
   Sticky parallax hero — scoped to .sph-* classes so it can't
   collide with site.css. Loaded only on the lab entry template.
   ============================================================ */

.sph-block {
  position: relative;
  background: #000;
}

/* The sticky container pins to viewport-top for the duration of the
   block's scroll length. Its height is one viewport. */
.sph-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

/* Dark overlay so title + body text remain readable on bright photos. */
.sph-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.30), rgba(0, 0, 0, 0.55));
  z-index: 2;
  pointer-events: none;
}

/* Image container — what gets translated. It's slightly taller than the
   sticky container so there's slack to move into without exposing the bg. */
.sph-image {
  position: absolute;
  top: -50px;
  left: 0;
  width: 100%;
  height: calc(100% + 300px);  /* ~250px of slack at the bottom */
  will-change: transform;
  z-index: 1;
}
.sph-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Title + logo, centered in the sticky container. Title also drifts. */
.sph-title-outer {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.sph-logo {
  margin: 0 0 1rem;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  opacity: 0.8;
}
.sph-title-inner { will-change: transform; }
.sph-title-inner h1 {
  margin: 0;
  color: #fff;
  font-family: var(--font-serif);
  font-size: clamp(5rem, 14vw, 12.5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.9;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

/* Text scrolls up after the sticky container, passing over the pinned image.
   The huge top/bottom padding is what gives the hero its scroll length —
   make padding taller and the image stays pinned longer. */
.sph-text {
  position: relative;
  z-index: 4;
  max-width: 600px;
  margin: 0 0 0 auto;
  padding: 80vh 3rem 80vh;
  color: #fff;
}
/* Frost-glass card so the body copy stays legible no matter what's
   behind it on the pinned image. Backdrop-filter is safe here because
   .sph-text is a sibling of .sph-sticky, not an ancestor — it doesn't
   establish a containing block for the pinned element. */
.sph-text p {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.375rem;
  line-height: 1.7;
  padding: 1.75rem 2rem;
  background: rgba(22, 20, 18, 0.55);
  backdrop-filter: blur(20px) saturate(1.15);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
/* Browsers without backdrop-filter (older Firefox, some embedded webviews)
   still get a readable card via the solid-ish background + a soft shadow. */
@supports not (backdrop-filter: blur(1px)) {
  .sph-text p {
    background: rgba(22, 20, 18, 0.88);
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
  }
}
.sph-text .sph-name {
  font-weight: 700;
  margin-right: 0.5rem;
}

@media (max-width: 720px) {
  .sph-text {
    margin: 0;
    padding: 60vh 1.5rem 60vh;
  }
  .sph-text p {
    font-size: 1.125rem;
    padding: 1.25rem 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sph-image,
  .sph-title-inner { transition: none; }
}
