@font-face {
  font-family: "Checkout Russo";
  src: url("../landing/russo-one.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Checkout Manrope";
  src: url("../landing/manrope-medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Checkout Manrope";
  src: url("manrope-extrabold.woff") format("woff");
  font-weight: 800;
  font-display: swap;
}

[data-checkout] .catalog-only { display: none; }
[data-checkout] #main { width: 100%; }
[data-checkout] .skip { z-index: 4; }
[data-checkout] body { background: #181125; }

.checkout-screen:not([hidden]) {
  --pile-width: clamp(13rem, 30vmin, 17.25rem);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: max(1.5rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right))
    max(.65rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
  background:
    radial-gradient(ellipse at 50% 42%, #614077 0%, #392448 32%, transparent 69%),
    linear-gradient(148deg, #32233f, #21162f 48%, #110e1b);
  color: #fbf7ff;
  font: 500 1rem/1.55 "Checkout Manrope", system-ui, sans-serif;
  text-align: center;
}
.checkout-wordmark {
  position: relative;
  z-index: 1;
  width: calc(var(--pile-width) * .93);
  aspect-ratio: 324 / 127;
  background: url("../landing/trample.webp") center / contain no-repeat;
}
.checkout-content {
  isolation: isolate;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 31rem);
  padding-block: clamp(1.75rem, 5vh, 3.75rem);
}
.checkout-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--pile-width);
  aspect-ratio: 4 / 3;
  margin-bottom: clamp(1rem, 2.7vh, 1.85rem);
}
.checkout-stage::before, .checkout-stage::after {
  content: "";
  pointer-events: none;
  position: absolute;
  z-index: -1;
  width: 195%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #d4bbff;
  -webkit-mask: url("rays-silver-mask.webp") center / contain no-repeat;
  mask: url("rays-silver-mask.webp") center / contain no-repeat;
  opacity: .15;
  animation: checkout-rays 240s linear infinite reverse;
}
.checkout-stage::after {
  width: 172%;
  background: #f3c5ff;
  -webkit-mask-image: url("rays-champagne-mask.webp");
  mask-image: url("rays-champagne-mask.webp");
  opacity: .12;
  animation: checkout-rays 172s linear infinite;
}
#order-pack:not([hidden]) {
  display: block;
  width: 93%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 .65rem .85rem #120a26a8);
}
[data-lumes="200"] #order-pack { width: 100%; }
#order-title {
  font: 400 clamp(2.65rem, 6vw, 3.9rem)/1.06 "Checkout Russo", "Arial Black", sans-serif;
  letter-spacing: -.035em;
  text-shadow: 0 .08em .22em #170d2899;
}
.checkout-account {
  margin-top: .55rem;
  color: #b1a3bd;
  font-size: clamp(.75rem, 1.1vw, .8125rem);
}
.checkout-buy:not([hidden]) {
  display: grid;
  place-items: center;
  width: min(100%, 14rem);
  min-height: 3.5rem;
  aspect-ratio: 520 / 139;
  margin-top: clamp(1.3rem, 3.4vh, 2rem);
  padding: .4rem .75rem .4rem 2.75rem;
  background: url("buy.webp") center / 100% 100% no-repeat;
  color: #0c2939;
  font: 800 1.1875rem/1.14 "Checkout Manrope", system-ui, sans-serif;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 .4rem .55rem #11112580);
}
@media (hover: hover) {
  .checkout-buy:hover { filter: brightness(1.1) drop-shadow(0 .45rem .65rem #11112580); }
}
.checkout-buy:active {
  background-image: url("buy-pressed.webp");
  color: #071c28;
  transform: translateY(2px);
}
.checkout-screen a:focus-visible { outline: 3px solid #f6da8b; outline-offset: 4px; }
#order-info {
  max-width: 25rem;
  margin-top: 1rem;
  color: #aa9bb6;
  font-size: .525rem;
  line-height: 1.6;
  text-wrap: balance;
}
#order-info a { position: relative; color: #b5a5c3; white-space: nowrap; }
#order-info a::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 50%;
  height: 44px;
  transform: translateY(-50%);
}
.checkout-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  column-gap: .85rem;
  color: #c2b4ce;
  font-size: .8125rem;
}
.checkout-meta a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; }
#order-details:not(:empty) { padding-right: .85rem; border-right: 1px solid #65516f; }
#order-mode { margin-bottom: .55rem; color: #ffe19d; font-size: .875rem; }
#order-message { margin-top: 1rem; max-width: 28rem; color: #e0d5eb; text-wrap: pretty; }
[data-checkout="return"] .checkout-stage, [data-checkout="invalid"] .checkout-stage,
[data-checkout="return"] .checkout-account, [data-checkout="invalid"] .checkout-account { display: none; }

.checkout-rain {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, #000 0 18%, #0005 39% 61%, #000 82% 100%);
  mask-image: linear-gradient(to right, #000 0 18%, #0005 39% 61%, #000 82% 100%);
}
.checkout-rain span {
  --size: clamp(.9rem, 1.5vw, 1.45rem);
  --alpha: .32;
  --turn: -24deg;
  position: absolute;
  top: 0;
  left: var(--lane);
  width: var(--size);
  aspect-ratio: 100 / 112;
  margin-left: calc(var(--size) / -2);
  background: url("lum-particle.webp") center / contain no-repeat;
  animation: checkout-fall calc(2 * var(--time)) linear calc(2 * var(--phase)) infinite;
}
.checkout-rain span:nth-child(3n+2) {
  --size: clamp(1.35rem, 2.6vw, 2.65rem);
  --alpha: .54;
  --turn: 31deg;
}
.checkout-rain span:nth-child(3n) {
  --size: clamp(2rem, 4vw, 3.9rem);
  --alpha: .82;
  --turn: -38deg;
}
@keyframes checkout-rays { to { transform: rotate(1turn); } }
@keyframes checkout-fall {
  0% { opacity: 0; transform: translate3d(0, -4.5rem, 0) rotate(var(--turn)) rotateY(-20deg); }
  12%, 81% { opacity: var(--alpha); }
  50% { transform: translate3d(var(--drift), 50vh, 0) rotate(12deg) rotateY(52deg); }
  100% { opacity: 0; transform: translate3d(0, calc(100vh + 4rem), 0) rotate(var(--turn)) rotateY(-30deg); }
}
@media (max-width: 40rem) {
  .checkout-rain span:nth-child(n+17) { display: none; }
}
@media (max-height: 40rem) {
  .checkout-screen:not([hidden]) {
    --pile-width: 10.75rem;
    padding-top: max(.8rem, env(safe-area-inset-top));
  }
  .checkout-content { padding-block: 1.1rem; }
  .checkout-stage { margin-bottom: .8rem; }
  .checkout-buy:not([hidden]) { margin-top: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .checkout-rain { display: none; }
  .checkout-rain span, .checkout-stage::before, .checkout-stage::after { animation: none; }
  .checkout-buy:active { transform: none; }
}
