/* Ordinary celebrations float over the journal without frames or fixed emblems. */
.completion-stamp:not(.is-day-complete) .completion-art {
  position: absolute;
  inset: 0 0 auto;
  height: 110px;
  pointer-events: none;
  --art-origin: 48px;
  --art-ease: cubic-bezier(.25, .27, .57, .72);
}

.completion-stamp:not(.is-day-complete) .completion-piece {
  position: absolute;
  top: var(--art-origin);
  left: 50%;
  width: 6px;
  height: 6px;
  color: var(--tone, #b98b95);
  background: currentColor;
  border-radius: 50%;
  opacity: 0;
}

.completion-stamp.is-animated:not(.is-day-complete) .completion-piece {
  animation-delay: calc(var(--delay, 0ms) * .62);
  animation-duration: 1270ms;
  animation-timing-function: var(--art-ease);
  animation-fill-mode: both;
}

/* Paper slips turn at different heights as they settle. */
.completion-stamp[data-celebration="confetti"] .completion-piece {
  width: 6px;
  height: 11px;
  border-radius: 2px 3px 2px 4px;
  background: linear-gradient(152deg, #fff6e5 3%, currentColor 56%);
}
.completion-stamp[data-celebration="confetti"] .completion-piece:nth-child(3n) {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}
.completion-stamp[data-celebration="confetti"] .completion-piece:nth-child(5n) {
  width: 7px;
  height: 15px;
}
.completion-stamp[data-celebration="confetti"].is-animated .completion-piece {
  animation-name: lover-confetti-drift;
  animation-duration: 1350ms;
}
@keyframes lover-confetti-drift {
  0% { opacity: 0; transform: translate(calc(var(--x) * .60 - 3px), calc(-36px + var(--y) * .11)) rotate(var(--angle)) scale(.72); }
  24% { opacity: .78; transform: translate(calc(var(--x) * .54 - 7px), calc(-23px + var(--y) * .14)) rotate(calc(var(--angle) + 30deg)) scale(1); }
  60% { opacity: .74; transform: translate(calc(var(--x) * .67 + 7px), calc(5px + var(--y) * .19)) rotate(calc(var(--angle) + 81deg)) scale(.93); }
  100% { opacity: 0; transform: translate(calc(var(--x) * .69 + 12px), calc(40px + var(--y) * .16)) rotate(calc(var(--angle) + 141deg)) scale(.66); }
}

/* Hearts rise in loose pairs, with outline and solid silhouettes. */
.completion-stamp[data-celebration="hearts"] .completion-piece {
  width: auto;
  height: auto;
  background: none;
  font: 500 16px/1 -apple-system, BlinkMacSystemFont, 'Segoe UI Symbol', sans-serif;
}
.completion-stamp[data-celebration="hearts"] .completion-piece::before { content: "♡"; }
.completion-stamp[data-celebration="hearts"] .completion-piece:nth-child(3n)::before { content: "♥"; font-size: 13px; }
.completion-stamp[data-celebration="hearts"] .completion-piece:nth-child(5n)::before { font-size: 19px; }
.completion-stamp[data-celebration="hearts"].is-animated .completion-piece {
  animation-name: lover-heart-rise;
  animation-duration: 1410ms;
}
@keyframes lover-heart-rise {
  0% { opacity: 0; transform: translate(calc(var(--x) * .25), calc(29px + var(--y) * .10)) rotate(-11deg) scale(.52); }
  25% { opacity: .84; transform: translate(calc(var(--x) * .47 - 4px), calc(9px + var(--y) * .16)) rotate(-7deg) scale(.98); }
  61% { opacity: .76; transform: translate(calc(var(--x) * .62 + 5px), calc(-18px + var(--y) * .19)) rotate(7deg) scale(1); }
  100% { opacity: 0; transform: translate(calc(var(--x) * .73 + 9px), calc(-45px + var(--y) * .16)) rotate(13deg) scale(.72); }
}

/* Paired pinpoints open into two tiny sheaves of light. */
.completion-stamp[data-celebration="fireworks"] .completion-piece {
  --glow-x: -48px;
  --glow-y: -13px;
  width: 9px;
  height: 2px;
  border-radius: 100%;
  background: linear-gradient(90deg, transparent, currentColor 62%, #fff4dc);
}
.completion-stamp[data-celebration="fireworks"] .completion-piece:nth-child(even) {
  --glow-x: 47px;
  --glow-y: 10px;
}
.completion-stamp[data-celebration="fireworks"] .completion-piece:nth-child(4n + 1) {
  width: 4px;
  height: 4px;
  background: currentColor;
}
.completion-stamp[data-celebration="fireworks"].is-animated .completion-piece {
  animation-name: lover-firework-burst;
  animation-duration: 1150ms;
}
.completion-stamp[data-celebration="fireworks"].is-animated .completion-piece:nth-child(even) {
  animation-delay: calc(var(--delay, 0ms) * .62 + 135ms);
}
@keyframes lover-firework-burst {
  0% { opacity: 0; transform: translate(var(--glow-x), calc(var(--glow-y) + 15px)) rotate(var(--angle)) scale(.30); }
  23% { opacity: .75; transform: translate(calc(var(--glow-x) + var(--x) * .17), calc(var(--glow-y) + var(--y) * .15)) rotate(var(--angle)) scale(.64); }
  53% { opacity: .86; transform: translate(calc(var(--glow-x) + var(--x) * .42), calc(var(--glow-y) + var(--y) * .35)) rotate(var(--angle)) scale(1); }
  100% { opacity: 0; transform: translate(calc(var(--glow-x) + var(--x) * .54), calc(var(--glow-y) + var(--y) * .43 + 9px)) rotate(var(--angle)) scale(.60); }
}

/* Two thin arches form a ribbon, tapering as they pass. */
.completion-stamp[data-celebration="ribbon"] .completion-piece {
  --ribbon-side: 1;
  width: 27px;
  height: 10px;
  background: none;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
}
.completion-stamp[data-celebration="ribbon"] .completion-piece:nth-child(even) { --ribbon-side: -1; }
.completion-stamp[data-celebration="ribbon"] .completion-piece::after {
  position: absolute;
  top: 2px;
  left: 16px;
  width: 24px;
  height: 10px;
  border: 1.5px solid currentColor;
  border-left-color: transparent;
  border-top-color: transparent;
  border-radius: 50%;
  content: "";
}
.completion-stamp[data-celebration="ribbon"] .completion-piece:nth-child(3n) { width: 20px; }
.completion-stamp[data-celebration="ribbon"] .completion-piece:nth-child(3n)::after { left: 11px; width: 18px; }
.completion-stamp[data-celebration="ribbon"].is-animated .completion-piece {
  animation-name: lover-ribbon-whip;
  animation-duration: 1410ms;
}
@keyframes lover-ribbon-whip {
  0% { opacity: 0; transform: translate(calc(-106px * var(--ribbon-side)), calc(17px + var(--y) * .13)) rotate(calc(26deg * var(--ribbon-side))) scale(.56, .79); }
  25% { opacity: .68; transform: translate(calc(-58px * var(--ribbon-side) - 8px), calc(-26px + var(--y) * .17)) rotate(calc(-15deg * var(--ribbon-side))) scale(.87, .91); }
  63% { opacity: .81; transform: translate(calc(24px * var(--ribbon-side) - 13px), calc(-8px + var(--y) * .21)) rotate(calc(12deg * var(--ribbon-side))) scale(1.04, 1); }
  100% { opacity: 0; transform: translate(calc(90px * var(--ribbon-side) - 14px), calc(23px + var(--y) * .13)) rotate(calc(24deg * var(--ribbon-side))) scale(.67, .82); }
}

/* A loose group crosses a shallow arc and twinkles at the crest. */
.completion-stamp[data-celebration="stars"] .completion-piece {
  width: 11px;
  height: 11px;
  clip-path: polygon(50% 0, 59% 37%, 100% 50%, 59% 62%, 50% 100%, 40% 63%, 0 50%, 40% 37%);
}
.completion-stamp[data-celebration="stars"] .completion-piece:nth-child(3n) { width: 7px; height: 7px; }
.completion-stamp[data-celebration="stars"].is-animated .completion-piece {
  animation-name: lover-star-orbit;
  animation-duration: 1430ms;
}
@keyframes lover-star-orbit {
  0% { opacity: 0; transform: translate(calc(-80px + var(--x) * .17), calc(22px + var(--y) * .17)) rotate(-12deg) scale(.32); }
  23% { opacity: .78; transform: translate(calc(-51px + var(--x) * .27), calc(-11px + var(--y) * .26)) rotate(-3deg) scale(.85); }
  46% { opacity: .65; transform: translate(calc(-8px + var(--x) * .36), calc(-32px + var(--y) * .24)) rotate(7deg) scale(.69); }
  63% { opacity: .92; transform: translate(calc(29px + var(--x) * .34), calc(-27px + var(--y) * .22)) rotate(18deg) scale(1.06); }
  100% { opacity: 0; transform: translate(calc(86px + var(--x) * .19), calc(11px + var(--y) * .15)) rotate(31deg) scale(.54); }
}

/* The petals first unfurl close together and then drift downward. */
.completion-stamp[data-celebration="bloom"] .completion-piece {
  width: 12px;
  height: 19px;
  border-radius: 72% 31% 66% 39%;
  background: linear-gradient(133deg, #fff4e1, currentColor 79%);
}
.completion-stamp[data-celebration="bloom"] .completion-piece:nth-child(3n) { width: 8px; height: 13px; }
.completion-stamp[data-celebration="bloom"].is-animated .completion-piece {
  animation-name: lover-petal-bloom;
  animation-duration: 1420ms;
}
@keyframes lover-petal-bloom {
  0% { opacity: 0; transform: translate(calc(var(--x) * .12), calc(var(--y) * .13)) rotate(var(--angle)) scale(.18, .44); }
  25% { opacity: .72; transform: translate(calc(var(--x) * .34), calc(var(--y) * .24 - 7px)) rotate(calc(var(--angle) + 29deg)) scale(.75, .93); }
  54% { opacity: .90; transform: translate(calc(var(--x) * .60), calc(var(--y) * .34 - 4px)) rotate(calc(var(--angle) + 56deg)) scale(1); }
  79% { opacity: .71; transform: translate(calc(var(--x) * .67 + 6px), calc(var(--y) * .34 + 11px)) rotate(calc(var(--angle) + 82deg)) scale(.89); }
  100% { opacity: 0; transform: translate(calc(var(--x) * .76 + 12px), calc(var(--y) * .29 + 29px)) rotate(calc(var(--angle) + 102deg)) scale(.65); }
}

/* A pen stroke draws the check in two passes, then the remaining ink drifts. */
.completion-stamp[data-celebration="stamp"] .completion-art::before,
.completion-stamp[data-celebration="stamp"] .completion-art::after {
  position: absolute;
  left: calc(50% - 19px);
  top: calc(var(--art-origin) - 5px);
  width: 20px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #9fae90, #6f896d);
  opacity: 0;
  transform-origin: left center;
  --stroke-angle: 43deg;
  content: "";
}
.completion-stamp[data-celebration="stamp"] .completion-art::after {
  left: calc(50% - 5px);
  top: calc(var(--art-origin) + 8px);
  width: 38px;
  --stroke-angle: -43deg;
}
.completion-stamp[data-celebration="stamp"].is-animated .completion-art::before {
  animation: lover-seal-drop 1240ms 95ms var(--art-ease) both;
}
.completion-stamp[data-celebration="stamp"].is-animated .completion-art::after {
  animation: lover-seal-drop 1070ms 265ms var(--art-ease) both;
}
@keyframes lover-seal-drop {
  0% { opacity: 0; transform: rotate(var(--stroke-angle)) scaleX(0); }
  7% { opacity: .74; }
  22%, 70% { opacity: .97; transform: rotate(var(--stroke-angle)) scaleX(1); }
  100% { opacity: 0; transform: rotate(var(--stroke-angle)) scaleX(1); }
}
.completion-stamp[data-celebration="stamp"] .completion-piece {
  --ink-x: -37px;
  --ink-y: -18px;
  width: 5px;
  height: 5px;
  background: #9daf94;
}
.completion-stamp[data-celebration="stamp"] .completion-piece:nth-child(2) {
  --ink-x: 41px;
  --ink-y: -17px;
  width: 4px;
  height: 4px;
  background: #ceaa9f;
}
.completion-stamp[data-celebration="stamp"] .completion-piece:nth-child(3) {
  --ink-x: 30px;
  --ink-y: 27px;
  width: 4px;
  height: 4px;
  background: #a9b49b;
}
.completion-stamp[data-celebration="stamp"] .completion-piece:nth-child(n + 4) { display: none; }
.completion-stamp[data-celebration="stamp"].is-animated .completion-piece {
  animation-name: lover-ink-spatter;
  animation-delay: calc(var(--delay, 0ms) * .40 + 360ms);
  animation-duration: 960ms;
}
@keyframes lover-ink-spatter {
  0% { opacity: 0; transform: translate(calc(var(--ink-x) * .65), calc(var(--ink-y) * .64)) scale(.4); }
  27% { opacity: .8; transform: translate(calc(var(--ink-x) * .86), calc(var(--ink-y) * .83)) scale(1); }
  100% { opacity: 0; transform: translate(var(--ink-x), var(--ink-y)) scale(.66); }
}

/* A diagonal trace of lilac dust follows a single narrow moving tail. */
.completion-stamp[data-celebration="comet"] .completion-piece {
  width: 4px;
  height: 4px;
}
.completion-stamp[data-celebration="comet"] .completion-piece:nth-child(4n) { width: 6px; height: 3px; }
.completion-stamp[data-celebration="comet"] .completion-piece:first-child {
  width: 43px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #bcafd3 62%, #f0e2c7 94%);
}
.completion-stamp[data-celebration="comet"] .completion-piece:first-child::after {
  position: absolute;
  top: -2px;
  right: -1px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #dfc5d3;
  content: "";
}
.completion-stamp[data-celebration="comet"].is-animated .completion-piece {
  animation-name: lover-comet-travel;
  animation-duration: 1370ms;
}
@keyframes lover-comet-travel {
  0% { opacity: 0; transform: translate(calc(-109px + var(--x) * .12), calc(37px + var(--y) * .08)) rotate(-20deg) scale(.60); }
  18% { opacity: .79; transform: translate(calc(-70px + var(--x) * .13), calc(19px + var(--y) * .11)) rotate(-19deg) scale(.92); }
  49% { opacity: .86; transform: translate(calc(-10px + var(--x) * .17), calc(-4px + var(--y) * .13)) rotate(-20deg) scale(1.04); }
  100% { opacity: 0; transform: translate(calc(92px + var(--x) * .21), calc(-38px + var(--y) * .19)) rotate(-23deg) scale(.74); }
}
