.stamp-wrap {
  position: relative;
  isolation: isolate;
  width: 55px;
  height: 57px;
  margin-top: 4px;
  flex: none;
}

.stamp-wrap > img, .postage-light {
  position: absolute;
  inset: 1px 0;
  display: block;
  width: 55px;
  height: 55px;
  pointer-events: none;
}

.postage-light {
  opacity: 0;
  mask-image: url("./assets/accents/postage-frame.webp"), url("./assets/accents/postage-star.webp");
  mask-position: center;
  mask-size: contain;
  mask-repeat: no-repeat;
  background: linear-gradient(126deg, transparent 37%, #ffe8a1a6 49%, transparent 62%) 100% 0 / 260% 100%;
}

@keyframes postage-light-pass {
  from { background-position: 100% 0; opacity: 0; }
  31% { opacity: .92; }
  71% { opacity: .69; }
  to { background-position: 0 0; opacity: 0; }
}

.draw-imprint {
  position: relative;
  isolation: isolate;
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
}

.imprint-shadow {
  position: absolute;
  inset: 42px -17px -12px;
  background: radial-gradient(ellipse, #03150bcc 6%, #03150b64 39%, transparent 72%);
  opacity: .58;
}

.draw-medallion {
  position: absolute;
  inset: 0;
  animation: seal-arrival 420ms 70ms both;
}

.entry-seal.brass-medallion { display: block; position: relative; }

.brass-medallion > img, .medallion-light {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.medallion-light {
  opacity: 0;
  mask-image: url("./assets/accents/medallion-rim.webp");
  mask-position: center;
  mask-size: contain;
  mask-repeat: no-repeat;
  background: linear-gradient(118deg, transparent 24%, #fff2bb9e 42%, #ffc76c3c 54%, transparent 65%) 100% 0 / 160% 100%;
}

.sheet-draw.is-stamping .draw-medallion { animation: medallion-press 310ms ease-in-out both; }
.sheet-draw.is-stamping .imprint-shadow { animation: imprint-contact 310ms ease-in-out both; }

@supports (mask-image: url("")) {
  .stamp-wrap.is-reflecting .postage-light { animation: postage-light-pass 490ms ease-in-out both; }
  .entry-seal .medallion-light { animation: medallion-light-pass 420ms ease-in-out 74ms both; }
  .sheet-draw.is-stamping .medallion-light { animation: medallion-light-pass 310ms ease-in-out both; }
}

@keyframes medallion-press {
  from { transform: none; }
  46% { transform: translateY(2px) scale(.985); }
  to { transform: none; }
}

@keyframes imprint-contact {
  from { opacity: .58; transform: none; }
  46% { opacity: 1; transform: translateY(-1px) scale(.71, .42); }
  to { opacity: .58; transform: none; }
}

@keyframes medallion-light-pass {
  from { opacity: 0; background-position: 100% 0; }
  38% { opacity: .79; }
  to { opacity: 0; background-position: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  .stamp-wrap.is-reflecting .postage-light,
  .entry-seal .medallion-light,
  .sheet-draw.is-stamping :is(.draw-medallion, .imprint-shadow, .medallion-light) {
    animation: none;
  }
}
