.heritage-scroll { position: relative; }
.heritage-stage { position: relative; background: var(--paper2); }
.heritage-storefront { background: #241f19; color: #fbf8f2; }
.heritage-storefront-inner {
  max-width: var(--max);
  margin: auto;
  padding: 72px 28px;
  display: grid;
  grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr);
  gap: clamp(28px, 4vw, 70px);
  align-items: center;
}
.heritage-storefront .kicker { color: #d9bd8a; }
.heritage-storefront h2 { font-size: clamp(2rem, 4vw, 4.3rem); }
.heritage-storefront p:not(.kicker) { max-width: 32ch; color: #e5dcca; }
.heritage-storefront figure { margin: 0; min-width: 0; }
.heritage-storefront img { display: block; width: 100%; height: auto; aspect-ratio: 1024 / 605; }
.heritage-storefront figcaption { color: #e5dcca; line-height: 1.5; }
.heritage-flight { display: none; }
.heritage-skip { display: table; margin-top: 18px; }
#heritage-storefront { scroll-margin-top: 150px; }

@media (max-width: 1050px) {
  .heritage-storefront-inner { grid-template-columns: minmax(0, 1fr); }
  .heritage-storefront figure { width: min(100%, 800px); justify-self: center; }
}
@media (max-width: 680px) {
  .heritage-storefront-inner { padding: 44px 20px; gap: 24px; }
}

/* Every image remains visible in normal document flow until JS and both images are ready. */
@media (prefers-reduced-motion: no-preference) {
  .heritage-scroll.is-animated { height: calc(var(--heritage-height) * 2.3); }
  .is-animated .heritage-stage {
    position: sticky;
    top: var(--heritage-top);
    height: var(--heritage-height);
    isolation: isolate;
    overflow: hidden;
  }
  .is-animated .legacy-home,
  .is-animated .heritage-storefront { position: absolute; inset: 0; width: 100%; }
  .is-animated .legacy-home {
    padding-block: clamp(24px, 5vh, 70px);
    opacity: var(--clock-panel-opacity, 1);
    background: var(--paper2);
  }
  .is-animated .legacy-art { min-height: 0; }
  .is-animated .legacy-art img { width: auto; height: auto; max-height: min(470px, 52vh, calc(var(--heritage-view) * .64)); opacity: var(--original-clock-opacity, 1); }
  .is-animated .clock-halo { max-width: 100%; max-height: 100%; aspect-ratio: 1; }
  .is-animated .heritage-storefront { opacity: var(--storefront-opacity, 0); }
  .is-animated .legacy-home .editorial-copy { opacity: var(--clock-copy-opacity, 1); }
  .is-animated .heritage-storefront-inner > div,
  .is-animated .heritage-storefront figcaption { opacity: var(--storefront-copy-opacity, 0); }
  .is-animated .heritage-storefront-inner { height: 100%; padding-block: clamp(12px, 3vh, 28px); }
  .is-animated .heritage-storefront figure { width: min(100%, calc(var(--heritage-view) * 1.38)); justify-self: center; }
  .is-animated .heritage-flight {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
    pointer-events: none;
    will-change: transform;
    opacity: var(--flight-opacity, 0);
  }
  .heritage-flight img { position: absolute; inset: 0; width: 100%; height: 100%; }
  .heritage-flight-detail {
    clip-path: polygon(32% 3%, 44% 0, 57% 7%, 60% 20%, 73% 25%, 80% 22%, 93% 28%, 97% 42%, 92% 61%, 80% 78%, 59% 94%, 42% 99%, 25% 97%, 12% 88%, 5% 73%, 4% 57%, 11% 42%, 21% 33%, 34% 29%, 31% 23%, 26% 14%);
  }
  @media (min-width: 600px) and (max-height: 649px) {
    .is-animated .legacy-home, .is-animated .heritage-storefront-inner {
      grid-template-columns: minmax(0, .85fr) minmax(0, 1fr);
      align-items: center; align-content: center; gap: clamp(16px, 3vw, 40px);
      padding-block: 12px;
    }
    .is-animated .clock-halo { width: min(100%, calc(var(--heritage-view) * .68)); height: auto; }
  }
  @media (max-width: 1050px) {
    .heritage-scroll.is-animated { height: calc(var(--heritage-height) * 1.8); }
    .is-animated .legacy-home { align-content: center; gap: 24px; }
    .is-animated .legacy-art img { max-height: min(290px, 31vh, calc(var(--heritage-view) * .37)); }
    .is-animated .clock-halo { width: 270px; height: 270px; }
    .is-animated .heritage-storefront-inner { align-content: center; gap: 22px; }
    .is-animated .heritage-storefront figure { max-width: min(100%, calc(var(--heritage-view) * .95)); }
  }
}
