/* One continuous turntable field—from the headline marquee through the hero's lower rule. */
#hero {
  isolation: isolate;
  overflow: visible !important;
  background-color: transparent !important;
}

#hero::before {
  --hero-parallax-distance: 156px;
  content: '';
  position: absolute;
  z-index: -1;
  top: -156px;
  right: 0;
  left: 0;
  height: var(--hero-art-height, calc(70vh + 156px));
  pointer-events: none;
  transform: translate3d(0, var(--hero-parallax-y, 0px), 0);
  will-change: transform;
  background-color: #000;
  background-image:
    linear-gradient(to bottom, transparent var(--hero-fade-start, 44%), rgba(0, 0, 0, .9) var(--hero-fade-mid, 72%), #000 100%),
    linear-gradient(to right, #000 0%, rgba(0, 0, 0, .96) 30%, rgba(0, 0, 0, .54) 46%, transparent 66%),
    url('/images/hero-turntable.jpg?v=3');
  background-position: center, center, right top -6%;
  background-repeat: no-repeat;
  background-size: 100% 100%, 100% 100%, cover;
}

#about:target > .qa > .grid:first-child [data-motion],
#about.about-anchor-landing > .qa > .grid:first-child [data-motion] {
  opacity: 1 !important;
  transform: none !important;
}

#about {
  scroll-margin-top: 0;
}

/* The desktop hero must paint as one complete frame on a direct visit. The
   headline and its copy are intentionally not re-hidden by the deferred
   motion setup; lower-page entrance effects remain unchanged. */
@media (min-width: 768px) {
  #hero .q27 > [data-motion] {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    will-change: auto !important;
  }

  /* Avoid promoting the full-size artwork before the page has finished its
     first paint. The compositor is enabled only when parallax is enabled. */
  #hero::before {
    will-change: auto;
  }

  html.hero-parallax-ready #hero::before {
    will-change: transform;
  }
}

/* Keep the continuous image visible under the header and ticker; retain the ticker's black signal label. */
#hero > .relative > .absolute.inset-0.z-0 > .absolute.inset-0.qr,
#site-header,
.ucr-newsbar {
  background-color: transparent !important;
  background-image: none !important;
}

@media (max-width: 767px) {
  /* These direct mobile targets must land flush; the global anchor margin reveals the prior section. */
  #about,
  #catalog,
  #contact {
    scroll-margin-top: 0;
  }

  #contact::after {
    content: '';
    display: block;
    height: 2rem;
  }

  #hero::before {
    top: -128px;
    height: var(--hero-art-height, calc(70vh + 128px));
    background-image:
      linear-gradient(to bottom, transparent var(--hero-fade-start, 44%), rgba(0, 0, 0, .9) var(--hero-fade-mid, 72%), #000 100%),
      radial-gradient(ellipse 34% 26% at 82% 44%, rgba(0, 0, 0, .40) 0%, rgba(0, 0, 0, .20) 48%, transparent 78%),
      linear-gradient(to right, #000 0%, rgba(0, 0, 0, .96) 30%, rgba(0, 0, 0, .54) 46%, transparent 66%),
      url('/images/hero-turntable.jpg?v=3');
    background-position: center, center, center, right -9rem top -10%;
    background-size: 100% 100%, 100% 100%, 100% 100%, auto 82%;
    filter: brightness(.86);
  }
}

@media (min-width: 768px) {
  /* Closed Recently Played: retain more of the needle's reflection before fading. */
  #hero:not(:has(.drr-recently-played.is-recent-open, .drr-recently-played.is-recent-hover-open)) {
    --hero-fade-start: 52%;
    --hero-fade-mid: 82%;
    --hero-overlay-fade-start: 68%;
    --hero-overlay-fade-mid: 90%;
  }
}

@media (min-width: 768px) {
  #hero::before { --hero-parallax-distance: 156px; }

  #hero > .relative > .absolute.inset-0.z-0 {
    background: linear-gradient(to bottom, transparent var(--hero-overlay-fade-start, 58%), rgba(0, 0, 0, .88) var(--hero-overlay-fade-mid, 84%), #000 100%);
    pointer-events: none;
  }
}

@media (min-width: 768px) and (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    html.hero-parallax-ready #hero::before {
      animation: hero-image-scroll-parallax linear both;
      animation-timeline: scroll();
      animation-range: 0 100vh;
    }
  }
}

@keyframes hero-image-scroll-parallax {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(0, var(--hero-parallax-distance), 0); }
}

@media (prefers-reduced-motion: reduce) {
  #hero::before { animation: none; }
}
