.hero-panorama-scenery,
.hero-panorama-wash {
  display: none;
}

@media (min-width: 901px) {
  body main .hero-panorama {
    --panorama-wash: 255 255 255;
    --panorama-copy-end: calc(var(--page-gutter, 32px) + min(32vw, 530px));
    --panorama-photo-left: 34%;
    --panorama-blend: linear-gradient(90deg, transparent, #000 25%);
    --panorama-focal-point: right center;
    position: relative;
    isolation: isolate;
    overflow: hidden;
  }

  body main .hero-panorama-dark {
    --panorama-wash: 7 26 54;
  }

  .hero-panorama > .hero-panorama-scenery {
    display: block;
    position: absolute;
    inset: 0;
    z-index: -1;
    background-position: var(--panorama-focal-point);
    background-size: cover;
    background-repeat: no-repeat;
    pointer-events: none;
  }

  body main .hero-panorama > .hero-panorama-wash {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
      url("../replacements/hero-edge-pattern.svg") left center /
        min(320px, calc(var(--page-gutter, 32px) + clamp(80px, 12vw, 220px))) 100% no-repeat,
      radial-gradient(
        ellipse min(760px, 52vw) 83% at calc(var(--page-gutter, 32px) + 160px) 48%,
        rgb(var(--panorama-wash)) 29%,
        rgb(var(--panorama-wash) / 96%) 53%,
        rgb(var(--panorama-wash) / 65%) 75%,
        rgb(var(--panorama-wash) / 0) 100%
      ),
      linear-gradient(90deg,
        rgb(var(--panorama-wash) / 75%),
        rgb(var(--panorama-wash) / 88%) var(--panorama-copy-end),
        rgb(var(--panorama-wash) / 0) calc(var(--panorama-copy-end) + clamp(100px, 12vw, 260px))
      );
  }

  body main .hero-panorama-dark > .hero-panorama-wash {
    background:
      url("../replacements/hero-edge-pattern.svg") left center /
        min(310px, calc(var(--page-gutter, 32px) + 130px)) 100% no-repeat,
      linear-gradient(90deg,
        #122c51 0%, #071a36f7 12%, #071a36ed var(--panorama-copy-end),
        #071a3600 calc(var(--panorama-copy-end) + clamp(100px, 13vw, 300px))
      );
    background-blend-mode: soft-light, normal;
  }

  body main .hero-panorama-dark-image:not(.hero-panorama-dark) > .hero-panorama-wash {
    background:
      url("../replacements/hero-edge-pattern.svg") left center /
        min(320px, calc(var(--page-gutter, 32px) + 130px)) 100% no-repeat,
      linear-gradient(90deg,
        #edf6ffef 0%, #fff 15%, #fffffff5 var(--panorama-copy-end),
        #ffffff00 calc(var(--panorama-copy-end) + clamp(135px, 15vw, 350px))
      );
  }

  body main:is(#main-content, main) .hero-panorama.merlin-split-hero:not(.hero-panorama-wide) .merlin-hero-grid > .merlin-hero-frame {
    left: var(--panorama-photo-left) !important;
    mask-image: var(--panorama-blend) !important;
  }

  body main:is(#main-content, main) .hero-panorama.merlin-split-hero .merlin-hero-frame::after {
    content: none !important;
  }

  body main:is(#main-content, main) .hero-panorama.merlin-split-hero .merlin-hero-grid > .merlin-hero-copy {
    z-index: 2 !important;
  }

  body main .hero-panorama-wide:not(.hero-panorama-journey) .merlin-hero-frame > :is(.merlin-hero-art,.merlin-hero-photo) {
    visibility: hidden;
  }

  body main .hero-panorama-journey .merlin-hero-frame > img {
    visibility: hidden;
  }

  /* Keep the journey markers above the wash and preserve the mountain panorama beneath them. */
  body main:is(#main-content, main) .hero-panorama-journey .merlin-hero-grid > .merlin-hero-frame {
    z-index: 2;
    pointer-events: none;
  }

  body main:is(#main-content, main) .hero-panorama-journey .merlin-hero-grid > .merlin-hero-copy {
    z-index: 3 !important;
  }

  body main#main-content #section-02 .hero-panorama-feature {
    --panorama-copy-end: calc(var(--page-gutter) + min(35vw, 740px));
  }

  body main#main-content #section-02 .hero-panorama-feature .meet-merlin__art {
    inset: 0 0 0 34%;
    mask-image: var(--panorama-blend);
  }

  body main#main-content #section-03 .hero-panorama-feature {
    --panorama-copy-end: calc(var(--page-gutter) + min(41vw, 830px));
  }

  body main#main-content #section-03 .hero-panorama-feature .art {
    inset: 0 0 0 37% !important;
    z-index: 0;
    clip-path: none !important;
    mask-image: var(--panorama-blend);
  }

  body main#main-content #section-03 .hero-panorama-feature .art::before {
    content: none;
  }

  body main#main-content #section-10 .hero-panorama-feature {
    --panorama-copy-end: calc(var(--page-gutter) + min(37vw, 760px));
  }

  body main#main-content #section-10 .hero-panorama-feature .hero-art {
    inset: 0 0 0 34% !important;
    mask-image: var(--panorama-blend);
  }

  body main#main-content #section-10 .hero-panorama-feature .intro {
    z-index: 2;
  }
}

@media (min-width: 1703px) {
  body main .hero-panorama {
    --panorama-photo-left: clamp(34%, calc(var(--page-gutter) + 460px), 46%);
  }
}

/* Keep the decorative layers independent of page-level content grid rules. */
body main .hero-panorama > :is(.hero-panorama-scenery, .hero-panorama-wash) {
  width: auto !important;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
}

@media (max-width: 900px) {
  body main .hero-panorama > :is(.hero-panorama-scenery, .hero-panorama-wash) {
    display: none !important;
  }
}

/* The photo frame or the full-width scenery supplies the hero artwork. */
@media (min-width: 901px) {
  body main:is(#main-content, main) .hero-panorama.merlin-split-hero {
    background-image: none !important;
  }
}
