.page-wipe {
  --wipe-color: #ddd;
  --wipe-ease: cubic-bezier(.625, .05, 0, 1);
  position: fixed;
  inset: 0;
  z-index: 10000;
  overflow: hidden;
  isolation: isolate;
  pointer-events: none;
}

.page-wipe-panel {
  position: absolute;
  inset: 0;
  background: var(--wipe-color);
}

.page-wipe-edge {
  position: absolute;
  inset-inline: 0;
  overflow: hidden;
}

.page-wipe-edge::before {
  content: "";
  position: absolute;
  left: -12.5%;
  width: 125%;
  height: 500%;
  border-radius: 50%;
  background: var(--wipe-color);
}

.page-wipe-top {
  bottom: calc(100% - 1px);
  height: 15vw;
  transform-origin: bottom;
}
.page-wipe-top::before { top: 0 }

.page-wipe-bottom {
  top: calc(100% - 1px);
  height: 20vw;
  transform-origin: top;
}
.page-wipe-bottom::before { bottom: 0 }

.page-wipe-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(205px, 24vw, 410px);
  height: auto;
  overflow: hidden;
  transform: translate(-50%, -50%);
}
.page-wipe-mark g { transform-box: view-box }

@media (prefers-reduced-motion: no-preference) {
  html[data-page-wipe="cover"] .page-wipe-panel {
    animation: page-wipe-cover 1s var(--wipe-ease) both;
  }
  html[data-page-wipe="cover"] .page-wipe-top {
    animation: page-wipe-bend 1s var(--wipe-ease) both;
  }
  html[data-page-wipe="cover"] .page-wipe-mark g {
    animation: page-wipe-mark-in .51s cubic-bezier(.16, 1, .3, 1)
      calc(.40s + var(--letter) * .007s) both;
  }
  html[data-page-wipe="reveal"] .page-wipe-panel {
    animation: page-wipe-reveal 1s var(--wipe-ease) both;
  }
  html[data-page-wipe="reveal"] .page-wipe-bottom {
    animation: page-wipe-flatten 1s var(--wipe-ease) both;
  }
  html:is([data-page-wipe="hold"], [data-page-wipe="reveal"]) .page-wipe-mark g {
    animation: page-wipe-mark-out .53s cubic-bezier(.85, 0, .15, 1)
      calc(.035s + var(--reverse-letter) * .007s) both;
  }

  html[data-page-wipe="cover"] body > :is(main:not(.home-content), header, footer, section),
  html[data-page-wipe="cover"] body > main.home-content > :is(.board, section) {
    animation: page-wipe-content-out 1s cubic-bezier(.625, .05, 0, 1) both;
  }
  html[data-page-wipe="reveal"] body > :is(main:not(.home-content), header, footer, section),
  html[data-page-wipe="reveal"] body > main.home-content > :is(.board, section) {
    animation: page-wipe-content-in 1s cubic-bezier(.625, .05, 0, 1) both;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-wipe { display: none }
}

@keyframes page-wipe-cover {
  from { transform: translateY(100%) }
  to { transform: translateY(0) }
}
@keyframes page-wipe-reveal {
  from { transform: translateY(0) }
  to { transform: translateY(-100%) }
}
@keyframes page-wipe-bend {
  from { transform: scaleY(0) }
  to { transform: scaleY(1) }
}
@keyframes page-wipe-mark-in {
  from { transform: translateY(105%) }
  to { transform: translateY(0) }
}
@keyframes page-wipe-mark-out {
  from { transform: translateY(0) }
  to { transform: translateY(-105%) }
}
@keyframes page-wipe-content-out {
  from { translate: 0 0 }
  to { translate: 0 -15dvh }
}
@keyframes page-wipe-content-in {
  from { translate: 0 25dvh }
  to { translate: 0 0 }
}
@keyframes page-wipe-flatten {
  from { transform: scaleY(1) }
  to { transform: scaleY(0) }
}
