/* Carry the shadow sky into the illustrated world behind the content panels. */
.home-page { --world-fade-depth: clamp(180px, 20vw, 320px); }

.home-page .hero-shadow { padding-bottom: 64px; }

.home-page .hero-shadow::after {
  content: '';
  position: absolute;
  z-index: 1;
  inset: auto 0 -1px;
  height: var(--world-fade-depth);
  background: linear-gradient(to bottom,
    rgba(41, 29, 56, 0),
    rgba(41, 29, 56, 0.24) 28%,
    rgba(41, 29, 56, 0.8) 72%,
    var(--g-night) 100%);
  pointer-events: none;
}

.home-page #how { padding-top: clamp(24px, 3vw, 48px); }

.home-page #how::before {
  content: '';
  position: absolute;
  inset: -1px 0 auto;
  height: calc(var(--world-fade-depth) * 1.3);
  background: linear-gradient(to bottom,
    var(--g-night),
    rgba(41, 29, 56, 0.9) 18%,
    rgba(41, 29, 56, 0.4) 60%,
    rgba(41, 29, 56, 0));
  pointer-events: none;
}

.home-page #how > .container { z-index: 1; }

/* Let the sunset rise behind the preceding panel before the download section. */
.home-page #every-run { z-index: 1; }

.home-page #download {
  --download-fade-depth: clamp(220px, 24vw, 360px);
  position: relative;
  isolation: isolate;
  background: none;
  padding-top: clamp(130px, 12vw, 190px);
}

.home-page #download::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: calc(var(--download-fade-depth) * -0.65) 0 0;
  background:
    linear-gradient(to bottom,
      rgba(41, 29, 56, 0.2),
      rgba(41, 29, 56, 0) 55%,
      var(--g-night) 100%),
    url('../images/ui/high-score-backdrop.jpg') center / cover;
  --download-sky-mask: linear-gradient(to bottom,
    transparent,
    rgba(0, 0, 0, 0.12) calc(var(--download-fade-depth) * 0.35),
    rgba(0, 0, 0, 0.65) calc(var(--download-fade-depth) * 0.8),
    #000 calc(var(--download-fade-depth) * 1.4));
  -webkit-mask-image: var(--download-sky-mask);
  mask-image: var(--download-sky-mask);
  pointer-events: none;
}

.home-page #download > .container { position: relative; z-index: 1; }

.world-scroll-cue {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-top: 20px;
  color: var(--g-cream);
  opacity: 0.75;
  transition: opacity 0.2s ease;
}

.world-scroll-cue:hover,
.world-scroll-cue:focus-visible { opacity: 1; }

.world-scroll-cue svg {
  width: 25px;
  height: 25px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: worldScrollHint 2.8s ease-in-out infinite;
}

@keyframes worldScrollHint {
  0%, 100% { transform: translateY(-3px); opacity: 0.55; }
  50% { transform: translateY(3px); opacity: 1; }
}

/* Content stays visible without JavaScript; only observed panels get an entrance. */
.home-page .section-reveal {
  transition: opacity 0.75s ease, transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.home-page .reveal-pending {
  opacity: 0;
  transform: translateY(28px);
}

@media (prefers-reduced-motion: reduce) {
  .world-scroll-cue svg { animation: none; }
  .home-page .section-reveal { opacity: 1; transform: none; transition: none; }
}

@media print {
  .world-scroll-cue { display: none; }
  .home-page .section-reveal { opacity: 1; transform: none; }
}

