.stamp-moment {
  --stamp-accent: #bc8069;
  --stamp-dark: #4a3362;
  --stamp-ink: color-mix(in srgb, var(--stamp-accent) 36%, var(--stamp-dark));
  --stamp-impact: 370ms;
  --stamp-delay: 0ms;
  --stamp-at-impact: calc(var(--stamp-delay) + var(--stamp-impact));
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  min-height: 104px;
  margin-block: 11px 4px;
  padding: 2px 15px 2px 4px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--stamp-accent) 42%, #d1b890);
  border-radius: 9px;
  color: #4a2621;
  background:
    radial-gradient(ellipse at 14% 31%, #fff9e5 4%, transparent 68%),
    repeating-linear-gradient(0deg, transparent 0 7px, #ab875109 7px 8px),
    linear-gradient(108deg, #f4e8c9, #fff4de 62%, #f3e5c9);
  box-shadow: inset 0 1px #fffaf0, 0 2px 0 #835e3930;
}

.stamp-moment--academic {
  --stamp-dark: #164d50;
  background:
    radial-gradient(ellipse at 16% 35%, #ffffef, transparent 71%),
    repeating-linear-gradient(0deg, transparent 0 7px, #3e746605 7px 8px),
    linear-gradient(109deg, #e5ede0, #f8f4e2 64%, #e6ebda);
}

.stamp-moment--complete {
  --stamp-dark: #694224;
  background:
    radial-gradient(ellipse at 13% 40%, #fff6d7, transparent 74%),
    repeating-linear-gradient(0deg, transparent 0 7px, #ac7a3620 7px 8px),
    linear-gradient(107deg, #f4e2b7, #fff2d1 60%, #f5dfaa);
}

.stamp-moment::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 5px;
  border: 1px solid color-mix(in srgb, var(--stamp-accent) 24%, transparent);
  border-radius: 5px;
  pointer-events: none;
}

.stamp-moment__stage {
  position: relative;
  display: block;
  width: 100%;
  height: 99px;
  pointer-events: none;
}

.stamp-moment__rest, .stamp-moment__contact {
  position: absolute;
  left: 50%;
  display: block;
  pointer-events: none;
}

.stamp-moment__rest {
  top: 10px;
  width: 79px;
  height: 79px;
  border: 1px dashed color-mix(in srgb, var(--stamp-accent) 43%, transparent);
  border-radius: 50%;
  transform: translateX(-50%) rotate(-9deg);
  opacity: .59;
}

.stamp-moment--academic .stamp-moment__rest { border-radius: 20%; }
.stamp-moment--complete .stamp-moment__rest { inset-block-start: 8px; width: 83px; height: 83px; }

.stamp-moment__contact {
  top: 31px;
  width: 88px;
  height: 47px;
  border-radius: 50%;
  background: radial-gradient(ellipse, #6b3c2a40 2%, #89563612 48%, transparent 71%);
  transform: translateX(-50%) scale(.45);
  opacity: 0;
  animation: stamp-contact var(--stamp-impact) var(--stamp-delay) ease-in both,
    stamp-shadow-out 250ms var(--stamp-at-impact) ease-out forwards;
}

.stamp-moment__ink {
  position: absolute;
  z-index: 1;
  top: 8px;
  left: 50%;
  display: grid;
  place-items: center;
  width: 83px;
  height: 83px;
  color: var(--stamp-ink);
  opacity: .94;
  transform: translateX(-50%) rotate(-9deg);
  animation: stamp-ink 385ms var(--stamp-at-impact) ease-out both;
}

.stamp-moment--academic .stamp-moment__ink { --stamp-rotation: -5deg; }
.stamp-moment--complete .stamp-moment__ink { --stamp-rotation: 7deg; }

.stamp-moment__contour {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.stamp-moment__icon {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  font-size: 33px;
}

.stamp-moment__icon > svg, .stamp-moment__icon > span, .stamp-moment__icon > span > svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
}

.stamp-moment__drop {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 4px;
  width: 94px;
  height: 56px;
  transform: translateX(-50%);
  animation: stamp-approach var(--stamp-impact) var(--stamp-delay) cubic-bezier(.61,.01,.84,.52) both;
}

.stamp-moment__tool {
  position: absolute;
  inset: 0;
  display: block;
  transform-origin: 50% 78%;
  animation: stamp-withdraw 530ms var(--stamp-at-impact) cubic-bezier(.2,.55,.4,1) both;
}

.stamp-moment__tool i {
  position: absolute;
  left: 50%;
  display: block;
  transform: translateX(-50%);
}

.stamp-moment__handle {
  z-index: 3;
  top: 0;
  width: 34px;
  height: 19px;
  border: 1px solid #833e24;
  border-radius: 52% 46% 41% 40%;
  background: linear-gradient(144deg, #f2b372 5%, #be6f41 58%, #824027 94%);
  box-shadow: inset 0 2px #ffdb9caa, 0 3px 0 #7d3927;
}

.stamp-moment__shank {
  z-index: 2;
  top: 14px;
  width: 17px;
  height: 24px;
  border: 1px solid #8e4a29;
  border-radius: 40% 43% 4px 4px;
  background: linear-gradient(90deg, #a05535, #e9a161 33% 53%, #ab5731 74%, #79381f);
}

.stamp-moment__wood {
  z-index: 1;
  top: 33px;
  width: 79px;
  height: 15px;
  border: 1px solid #824629;
  border-radius: 47% 47% 25% 25% / 40% 40% 31% 31%;
  background: linear-gradient(180deg, #e3a067 0 41%, #b96e42 45% 59%, #a45b36 60%);
  box-shadow: inset 0 3px #ffd49d99, inset 0 -2px #8f4729;
}

.stamp-moment__rubber {
  top: 43px;
  width: 74px;
  height: 12px;
  border: 1px solid #443157;
  border-radius: 35% 35% 44% 44% / 43% 43% 31% 31%;
  background: linear-gradient(180deg, color-mix(in srgb, var(--stamp-dark) 65%, #8f72ac), var(--stamp-dark));
  box-shadow: 0 2px #32293b;
}

.stamp-moment--academic .stamp-moment__wood { border-radius: 13px 13px 7px 7px; width: 74px; }
.stamp-moment--academic .stamp-moment__rubber { border-radius: 7px; width: 70px; }

.stamp-moment__paper-bits {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 52px;
  width: 1px;
  height: 1px;
}

.stamp-moment__paper-bits i {
  --stamp-bit-x: -38px;
  --stamp-bit-y: -22px;
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 6px;
  border-radius: 1px;
  background: color-mix(in srgb, var(--stamp-accent) 77%, #fff1c8);
  transform: scale(0);
  animation: stamp-bit 410ms var(--stamp-at-impact) ease-out both;
}

.stamp-moment__paper-bits i:nth-child(2) { --stamp-bit-x: -25px; --stamp-bit-y: 20px; height: 4px; }
.stamp-moment__paper-bits i:nth-child(3) { --stamp-bit-x: 46px; --stamp-bit-y: -16px; width: 3px; }
.stamp-moment__paper-bits i:nth-child(4) { --stamp-bit-x: 34px; --stamp-bit-y: 24px; width: 5px; height: 3px; }
.stamp-moment__paper-bits i:nth-child(5) { --stamp-bit-x: 23px; --stamp-bit-y: -31px; width: 3px; height: 3px; }

.stamp-moment__caption {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 4px;
  padding-block: 10px;
  overflow-wrap: anywhere;
}

.stamp-moment__caption small {
  color: var(--stamp-dark);
  font: 850 .69rem/1.15 system-ui, sans-serif;
  letter-spacing: .115em;
  text-transform: uppercase;
}

.stamp-moment__caption strong {
  color: #4a261d;
  font: 700 clamp(1.22rem, 3.3vw, 1.68rem)/1.04 var(--heading-font);
  letter-spacing: -.025em;
}

.stamp-moment__caption > span {
  color: #654b3d;
  font: 625 .875rem/1.25 system-ui, sans-serif;
}

@keyframes stamp-approach {
  0% { transform: translate(-138%, -75%) rotate(-21deg) scale(1.16); opacity: 0; }
  21% { opacity: 1; }
  57% { transform: translate(-60%, -31%) rotate(-10deg) scale(1.07); }
  100% { transform: translate(-50%, 0) rotate(-4deg) scale(1); opacity: 1; }
}

@keyframes stamp-withdraw {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  12% { transform: translateY(2px) scale(1.07, .81); }
  33% { transform: translate(2px, -10px) rotate(4deg) scale(.99, 1.07); opacity: 1; }
  57% { opacity: .80; }
  100% { transform: translate(16px, -55px) rotate(19deg) scale(.83); opacity: 0; }
}

@keyframes stamp-contact {
  from { transform: translate(-50%, -17px) scale(1.31); opacity: 0; }
  76% { opacity: .62; }
  to { transform: translate(-50%, 2px) scale(.7); opacity: 1; }
}

@keyframes stamp-shadow-out {
  to { transform: translate(-50%, -8px) scale(.94); opacity: 0; }
}

@keyframes stamp-ink {
  0% { transform: translateX(-50%) rotate(-4deg) scale(.8,.71); opacity: 0; }
  9% { transform: translate(-50%,2px) rotate(-5deg) scale(.96,.82); opacity: .92; }
  38% { transform: translate(-50%,-3px) rotate(var(--stamp-rotation, -9deg)) scale(1.05,1.07); opacity: 1; }
  69% { transform: translate(-50%,1px) rotate(var(--stamp-rotation, -9deg)) scale(.985,.98); }
  100% { transform: translateX(-50%) rotate(var(--stamp-rotation, -9deg)) scale(1); opacity: .94; }
}

@keyframes stamp-bit {
  0% { transform: translate(0,0) scale(.25) rotate(0); opacity: 0; }
  17% { opacity: .88; }
  82% { opacity: .28; }
  100% { transform: translate(var(--stamp-bit-x), var(--stamp-bit-y)) scale(.73) rotate(113deg); opacity: 0; }
}

@media (max-width: 540px) {
  .stamp-moment { min-height: 91px; grid-template-columns: 89px minmax(0, 1fr); gap: 7px; padding-right: 10px; }
  .stamp-moment__stage { height: 88px; margin-inline-start: -2px; }
  .stamp-moment__ink { width: 72px; height: 72px; }
  .stamp-moment__rest { width: 68px; height: 68px; }
  .stamp-moment--complete .stamp-moment__rest { width: 72px; height: 72px; }
  .stamp-moment__drop { top: -2px; }
  .stamp-moment__icon { width: 29px; height: 29px; font-size: 27px; }
}

.stamp-moment--compact {
  --stamp-ink: var(--stamp-compact-ink, color-mix(in srgb, var(--stamp-accent) 36%, var(--stamp-dark)));
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  width: var(--stamp-compact-width, 72px);
  height: var(--stamp-compact-height, 57px);
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  pointer-events: none;
}

.stamp-moment--compact *, .stamp-moment--compact *::before, .stamp-moment--compact *::after {
  pointer-events: none;
}

.stamp-moment--compact::before, .stamp-moment--compact .stamp-moment__rest { display: none; }
.stamp-moment--compact .stamp-moment__stage { height: 100%; margin: 0; }
.stamp-moment--compact .stamp-moment__ink { top: 0; width: 100%; height: 100%; }
.stamp-moment--compact .stamp-moment__icon { width: 36%; height: 44%; }
.stamp-moment--compact .stamp-moment__contact { top: 32%; width: 94%; height: 38%; }
.stamp-moment--compact .stamp-moment__drop { top: -3%; width: 100%; height: 58%; }
.stamp-moment--compact .stamp-moment__handle { width: 34%; height: 36%; }
.stamp-moment--compact .stamp-moment__shank { top: 25%; width: 18%; height: 44%; }
.stamp-moment--compact .stamp-moment__wood { top: 61%; width: 86%; height: 29%; }
.stamp-moment--compact .stamp-moment__rubber { top: 79%; width: 80%; height: 22%; }
.stamp-moment--compact .stamp-moment__paper-bits { top: 52%; scale: .65; }
.stamp-moment--compact .stamp-moment__caption {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 590px) {
  .stamp-moment--compact { width: var(--stamp-compact-width, 60px); height: var(--stamp-compact-height, 47px); }
}

@media (prefers-reduced-motion: reduce) {
  .stamp-moment__drop, .stamp-moment__contact, .stamp-moment__paper-bits { display: none; }
  .stamp-moment__ink { animation: none; opacity: .94; transform: translateX(-50%) rotate(var(--stamp-rotation, -9deg)); }
}
