/* ==========================================================================
   HOME SCROLL RECESSION — Sticky Home Blur Ready for Incoming Work Cards
   - Solid #151515 .home background stays completely static (zero halos/edges)
   - Oversized .home__grid & .home__stage progressively blur & scale down on scroll
   - Future Work cards inside #work (z-index: 2) will rise naturally over the blurred Home
   - Navigation dock stays fixed, sharp, and above everything (z-index: 100)
   ========================================================================== */

.home {
  position: sticky;
  top: 0;
  z-index: 1;
}

.work-stage {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: transparent;
}

/* Native CSS Scroll-Driven Recession (Compositor-driven, 100% reversible) */
@supports ((animation-timeline: scroll()) and (animation-range: 0px 100vh)) {
  @media (prefers-reduced-motion: no-preference) {
    .home__grid {
      will-change: transform, filter;
      animation: home-grid-recede linear both;
      animation-timeline: scroll(root block);
      animation-range: 0px 100dvh;
    }

    .home__stage {
      will-change: transform, filter;
      animation: home-content-recede linear both;
      animation-timeline: scroll(root block);
      animation-range: 0px 100dvh;
    }

    .home__statement {
      will-change: transform, opacity, filter;
      animation: home-statement-exit linear both;
      animation-timeline: scroll(root block);
      animation-range: 0px 45dvh;
    }
  }
}

/* Oversized seamless grid scales down & blurs (solid #151515 behind remains static) */
@keyframes home-grid-recede {
  0% {
    filter: blur(0px);
    transform: scale3d(1, 1, 1);
  }
  20% {
    filter: blur(2.5px);
    transform: scale3d(0.975, 0.975, 1);
  }
  60% {
    filter: blur(11px);
    transform: scale3d(0.915, 0.915, 1);
  }
  100% {
    filter: blur(22px);
    transform: scale3d(0.84, 0.84, 1);
  }
}

/* Home foreground content (BLUE, floating character & shadow) scales down & blurs */
@keyframes home-content-recede {
  0% {
    filter: blur(0px) brightness(1);
    transform: scale3d(1, 1, 1);
  }
  20% {
    filter: blur(3px) brightness(0.94);
    transform: scale3d(0.99, 0.99, 1);
  }
  60% {
    filter: blur(13px) brightness(0.74);
    transform: scale3d(0.96, 0.96, 1);
  }
  100% {
    filter: blur(24px) brightness(0.45);
    transform: scale3d(0.92, 0.92, 1);
  }
}

/* Alpha Tango-inspired upward fade & soft blur exit on scroll (100% reversible) */
@keyframes home-statement-exit {
  0% {
    opacity: 1;
    filter: blur(0px);
    transform: translate3d(0, 0, 0);
  }
  100% {
    opacity: 0;
    filter: blur(6px);
    transform: translate3d(0, -44px, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home {
    position: relative;
  }
}
