:root {
  --fondo: #ffffff;
  --inchiostro: #151514;
  --grigio: #8a8781;
  --filo: #dcd8d0;
  --carta: #fbfaf6;
  --bordo-carta: #e6e2d8;
  --accento: #d63d2a;
}

* { box-sizing: border-box; margin: 0; }

html, body { height: 100%; }

body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: 'Archivo Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.stamp-demo {
  width: min(360px, calc(100vw - 40px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* the stack: the newest notice on top, the older ones a little lower and smaller behind it */
.stack {
  position: relative;
  width: 100%;
  height: min(232px, 48vh);
}

.toast {
  position: absolute;
  left: 0;
  right: 0;
  top: min(84px, 18vh);
  will-change: transform, opacity;
}

.toast__paper {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 92px;
  padding: 16px 116px 16px 18px;
  background: var(--carta);
  border: 1px solid var(--bordo-carta);
  border-radius: 6px;
  box-shadow: 0 1px 1px rgba(30, 26, 20, 0.04), 0 10px 24px -14px rgba(30, 26, 20, 0.28);
  transform-origin: 50% 100%;
}

.toast__text { display: grid; gap: 4px; }

.toast__shop {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--grigio);
}

.toast__title {
  font-size: 17px;
  font-weight: 560;
  font-variation-settings: 'wdth' 100;
  letter-spacing: -0.01em;
}

.toast__meta {
  font-size: 12.5px;
  color: var(--grigio);
  font-variant-numeric: tabular-nums;
}

/* the ink: invisible until the stamp lands */
.toast__ink {
  position: absolute;
  right: 36px;
  top: 50%;
  width: 72px;
  height: 72px;
  margin-top: -36px;
  overflow: visible;
  opacity: 0;
  pointer-events: none;
}

.toast__ring {
  fill: none;
  stroke: var(--accento);
  stroke-width: 4.6;
}

.toast__ring--thin { stroke-width: 1.8; }

.toast__paid {
  fill: var(--accento);
  font-family: 'Archivo Variable', system-ui, sans-serif;
  font-size: 27px;
  font-weight: 800;
  font-variation-settings: 'wdth' 118;
  letter-spacing: 0.06em;
}

.toast__date {
  fill: var(--accento);
  font-family: 'Archivo Variable', system-ui, sans-serif;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.toast__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.25s ease, background-color 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.toast__close svg { width: 10px; height: 10px; }
.toast__close path { stroke: var(--inchiostro); stroke-width: 1.4; stroke-linecap: round; fill: none; }

/* the stamp: a separate element above the paper, so the paper can dip under it */
.toast__stamp {
  position: absolute;
  right: 22px;
  top: 0;
  width: 54px;
  height: 81px;
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(0 6px 6px rgba(30, 26, 20, 0.18));
}

.toast__stamp svg { width: 100%; height: 100%; display: block; }

.pay {
  position: relative;
  height: 50px;
  min-width: 188px;
  padding: 0 34px;
  border: 1px solid var(--inchiostro);
  border-radius: 999px;
  background: var(--inchiostro);
  color: var(--fondo);
  font: inherit;
  font-size: 15px;
  font-weight: 520;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pay__label { display: inline-block; font-variation-settings: 'wdth' 100; transition: font-variation-settings 0.5s cubic-bezier(.34, 1.56, .64, 1); }

.note {
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grigio);
}

.pay:focus-visible, .toast__close:focus-visible { outline: 2px solid var(--accento); outline-offset: 3px; }

@media (hover: hover) {
  .pay:hover .pay__label { font-variation-settings: 'wdth' 112; }
  .toast__close:hover { opacity: 1; background: rgba(21, 21, 20, 0.06); }
}

@media (max-width: 420px) {
  .toast__paper { padding-right: 104px; min-height: 86px; }
  .toast__title { font-size: 16px; }
  .toast__ink { width: 64px; height: 64px; margin-top: -32px; right: 32px; }
  .toast__stamp { right: 17px; width: 50px; height: 75px; }
}
