body {
  --rp-gutter: max(0px, calc((100% - var(--frame)) / 2));
  --rp-fade-depth: 710px;
  --rp-left-art: max(123px, calc(var(--rp-gutter) + var(--rp-gutter) / 4 + 10px));
  --rp-right-art: max(146px, calc(var(--rp-gutter) + var(--rp-gutter) / 2 + 8px));
  position: relative;
  isolation: isolate;
  background: linear-gradient(to bottom, #efebe7, #f4f1ee 52%, white)
    top center / 100% var(--rp-fade-depth) no-repeat, white;
}

/* Scale the two food arrangements independently of the space between them. */
body::before {
  content: "";
  pointer-events: none;
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: clamp(180px, calc(75vw - 910px), 740px);
  border-image: url(header-meduolis.webp) 0 26% 0 24% fill /
    0 var(--rp-right-art) 0 var(--rp-left-art) stretch;
  mask-image: linear-gradient(to bottom, black 57%, transparent);
}

.rp-mast {
  position: relative;
  background: transparent;
}

.rp-mast::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0 0 auto;
  height: clamp(42px, 3.25vw, 58px);
  background: url(girlianda-spalvota.webp) center top / auto 100% repeat-x;
}

.rp-mast .rp-head {
  position: relative;
  padding-top: clamp(40px, 3.15vw, 56px);
}

.rp-footer.rp-frame {
  --rp-foot-edge: max(0px, calc(var(--rp-gutter) - 12px));
  position: relative;
  isolation: isolate;
  width: 100%;
  margin-top: 38px;
  padding: 25px 0 18px;
  background: linear-gradient(to bottom, white 10px, #fdfbf8 45%, #faf5ef);
}

.rp-footer::before {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  inset: 0;
  border-image: url(kaledu-apacia.webp) 0 26% 0 24% fill /
    0 var(--rp-foot-edge) 0 var(--rp-foot-edge) stretch;
  mask-image: linear-gradient(to bottom, transparent 8%, rgb(0 0 0 / 25%) 23%, black 52%);
}

.rp-footer .rp-footgrid,
.rp-footer .rp-copy {
  width: min(calc(100% - 48px), var(--frame));
  margin-inline: auto;
}

/* Where the page has narrow gutters, hang the footer artwork below the links. */
@media (max-width: 1450px) {
  .rp-footer.rp-frame {
    --rp-foot-edge: clamp(110px, 12vw, 172px);
    --rp-foot-band: clamp(84px, 8vw, 116px);
    padding-bottom: var(--rp-foot-band);
  }

  .rp-footer::before {
    top: auto;
    height: var(--rp-foot-band);
  }
}

@media (max-width: 900px) {
  .rp-footer .rp-footgrid,
  .rp-footer .rp-copy {
    width: calc(100% - 28px);
  }
}

@media (max-width: 740px) {
  body {
    --rp-left-art: clamp(71px, 20vw, 115px);
    --rp-right-art: clamp(80px, 23vw, 132px);
    --rp-fade-depth: 235px;
  }

  body::before {
    height: clamp(115px, 30vw, 156px);
  }

  .rp-mast::before {
    height: 32px;
  }

  .rp-mast .rp-head {
    padding-top: 30px;
  }

  .rp-mast .rp-logo {
    padding-inline-start: clamp(40px, 12vw, 76px);
  }

  .rp-footer.rp-frame {
    --rp-foot-edge: clamp(84px, 23vw, 118px);
    --rp-foot-band: 77px;
    margin-top: 25px;
    padding-top: 20px;
  }

  .rp-footer .rp-copy {
    padding-inline-end: 48px;
  }
}
