:root {
  --fondo: #ffffff;
  --inchiostro: #0a0a0a;
  --grigio: #71717a;
  --grigio-chiaro: #a1a1aa;
  --morbido: #f4f4f5;
  --linea: rgba(10, 10, 10, 0.08);
  --accento: #2f8f5b;
  --chioma: #3da56b;
  --chioma-chiara: #7cc99a;
  --tronco: #6b5544;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

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

.donor {
  display: grid;
  justify-items: center;
  gap: clamp(16px, 4vh, 26px);
  width: min(300px, calc(100vw - 32px));
}

/* the pad keeps room above the button for the fan of amounts and for the trees */
.pad {
  position: relative;
  display: grid;
  justify-items: center;
  padding-top: clamp(64px, 16vh, 84px);
}

.amounts {
  position: absolute;
  left: 50%;
  bottom: calc(48px + 16px);
  width: 0;
  height: 0;
}
.amt {
  position: absolute;
  left: -27px;
  bottom: 0;
  width: 54px;
  height: 34px;
  border-radius: 17px;
  background: #fff;
  border: 1px solid var(--linea);
  box-shadow: 0 1px 2px rgba(10, 10, 10, 0.06), 0 6px 16px -8px rgba(10, 10, 10, 0.25);
  font-size: 14px;
  font-weight: 560;
  font-variation-settings: "wdth" 100;
  opacity: 0;
  visibility: hidden;
}
.amt span { display: block; }
@media (hover: hover) {
  .amt:hover { border-color: rgba(10, 10, 10, 0.2); }
}
.amt:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }

/* the grove sits on the button's top edge, a touch behind it */
.grove {
  position: absolute;
  left: 50%;
  bottom: 46px;
  width: 220px;
  height: 44px;
  margin-left: -110px;
  overflow: visible;
  pointer-events: none;
}
.tree__trunk { stroke: var(--tronco); stroke-width: 1.6; stroke-linecap: round; fill: none; }
.tree__crown { fill: var(--chioma); }
.tree__shine { fill: var(--chioma-chiara); opacity: 0.55; }
.tree__shadow { fill: rgba(10, 10, 10, 0.08); }

.donate {
  position: relative;
  z-index: 1;
  width: 176px;
  height: 48px;
  border-radius: 24px;
  overflow: hidden;
  background: var(--inchiostro);
  color: #fff;
  box-shadow: 0 1px 1px rgba(10, 10, 10, 0.2), 0 10px 22px -12px rgba(10, 10, 10, 0.55);
}
.donate:focus-visible { outline: 2px solid var(--accento); outline-offset: 3px; }
.donate__fill {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: var(--accento);
  transform: scaleX(0);
}
.donate__face {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
}
.sap { width: 18px; height: 18px; flex: none; overflow: visible; }
.sap__stem, .sap__soil { stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; fill: none; }
.sap__leaf { fill: currentColor; }
.donate__words {
  position: relative;
  display: grid;
  height: 20px;
  overflow: hidden;
}
.donate__label {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 560;
  line-height: 20px;
  white-space: nowrap;
}
.donate__label--done { opacity: 0; }
.tick { width: 15px; height: 15px; flex: none; }
.tick path { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.raised { width: 100%; text-align: center; }
.raised__line { font-size: 13px; color: var(--grigio); }
.raised__sum {
  display: inline-block;
  color: var(--inchiostro);
  font-weight: 600;
}
.bar {
  position: relative;
  height: 4px;
  margin: 10px auto 0;
  width: min(220px, 100%);
  border-radius: 2px;
  background: var(--morbido);
  overflow: hidden;
}
.bar__fill, .bar__gain {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 100%;
  border-radius: 2px;
  transform-origin: 0 50%;
}
.bar__fill { z-index: 1; background: var(--inchiostro); transform: scaleX(0.62); }
.bar__gain { background: var(--accento); transform: scaleX(0); }
.raised__note { margin-top: 10px; font-size: 12px; color: var(--grigio-chiaro); }

.ghost {
  position: absolute; left: 0; top: 0;
  width: 22px; height: 22px;
  fill: var(--inchiostro);
  stroke: #fff; stroke-width: 1.2; stroke-linejoin: round;
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
  z-index: 5;
}

@media (prefers-reduced-motion: reduce) {
  .ghost { display: none; }
}
