:root {
  --fondo: #ffffff;
  --inchiostro: #0e1a14;
  --bosco: #1d6b40;
  --germoglio: #4fb35e;
  --crema: #f5f0e4;
  --grigio: #6f7470;
  --grigio-chiaro: #a3a8a4;
  --linea: rgba(14, 26, 20, 0.09);
}

* { 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;
}

.plot {
  display: grid;
  gap: clamp(12px, 3vh, 16px);
  width: min(340px, calc(100vw - 32px));
}

.plot__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 12px;
  color: var(--grigio);
  white-space: nowrap;
}
.plot__brand { color: var(--inchiostro); font-weight: 650; font-size: 13px; letter-spacing: -0.01em; }
.plot__where { overflow: hidden; text-overflow: ellipsis; }

/* the pill: GSAP scales this element; the green, the sheen and the knob live inside */
.plant {
  --k: 48px;
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 60px;
  padding: 6px 16px 6px 6px;
  border-radius: 999px;
  background: var(--inchiostro);
  color: #fff;
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    0 1px 1px rgba(14, 26, 20, 0.08),
    0 6px 12px -6px rgba(14, 26, 20, 0.35),
    0 18px 32px -18px rgba(14, 26, 20, 0.55);
  -webkit-tap-highlight-color: transparent;
}
.plant::after {
  /* a fine grain and a soft top light, like a lacquered surface */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0) 46%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .06 0'/></filter><rect width='120' height='120' filter='url(%23g)'/></svg>");
  pointer-events: none;
  z-index: 3;
}
.plant:focus-visible { outline: 2px solid var(--germoglio); outline-offset: 3px; }

.plant__green {
  position: absolute;
  left: calc(6px + var(--k) / 2); top: 50%;
  width: 0; height: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #2a8a52 0%, var(--bosco) 55%, #17573a 100%);
  z-index: -1;
  pointer-events: none;
}
.plant__sheen {
  position: absolute;
  top: -20%; bottom: -20%;
  left: 0;
  width: 70px;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.16) 50%, rgba(255, 255, 255, 0) 100%);
  transform: translateX(-120px) skewX(-18deg);
  pointer-events: none;
  z-index: 1;
}

.plant__knob {
  position: relative;
  flex: none;
  width: var(--k); height: var(--k);
  border-radius: 50%;
  background: radial-gradient(circle at 38% 28%, #fffdf7 0%, var(--crema) 55%, #e6dfcd 100%);
  box-shadow: inset 0 -2px 3px rgba(60, 40, 20, 0.12), 0 2px 6px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06);
  z-index: 2;
}
.pot { display: block; width: 100%; height: 100%; overflow: visible; }
.pot__rim { fill: none; stroke: rgba(60, 40, 20, 0.12); stroke-width: 0.8; }

.soil { fill: url(#terra); }
.soil__edge { fill: none; stroke: #a37a50; stroke-width: 0.9; stroke-linecap: round; }
.soil__grit ellipse { fill: #2c1d10; opacity: 0.55; }
.root { fill: none; stroke: #e8d9bf; stroke-width: 0.8; stroke-linecap: round; opacity: 0.9; }
.root--fine { stroke-width: 0.5; opacity: 0.7; }
.stem { fill: none; stroke: #5aa955; stroke-width: 2; stroke-linecap: round; }
.leaf__rib { fill: none; stroke: rgba(20, 70, 35, 0.45); stroke-width: 0.45; stroke-linecap: round; }
.bud { fill: #7fd07a; }
.seed__line { fill: none; stroke: rgba(80, 50, 20, 0.6); stroke-width: 0.45; stroke-linecap: round; }
.dust circle { fill: #6b4a2d; opacity: 0; }

.plant__words {
  position: relative;
  flex: 1;
  height: 100%;
  margin-left: 12px;
  z-index: 2;
}
.plant__label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  font-size: 16px;
  font-weight: 560;
  font-variation-settings: "wdth" 100;
  letter-spacing: -0.008em;
  white-space: nowrap;
}
.plant__label--on { opacity: 0; font-weight: 620; }

.plant__price {
  position: relative;
  z-index: 2;
  flex: none;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.plot__count {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  row-gap: 8px;
  column-gap: 12px;
}
.tally {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  color: var(--grigio);
  white-space: nowrap;
}
.tally__num {
  display: inline-flex;
  color: var(--inchiostro);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  height: 1.2em;
  line-height: 1.2em;
  overflow: hidden;
}
.digit { display: inline-block; height: 1.2em; overflow: hidden; }
.digit__col { display: flex; flex-direction: column; }
.digit__col span { display: block; height: 1.2em; text-align: center; }
.sep { display: inline-block; }
.tally__plus {
  font-size: 12px;
  font-weight: 650;
  color: var(--bosco);
  opacity: 0;
}
.tally__goal {
  font-size: 12px;
  color: var(--grigio-chiaro);
  white-space: nowrap;
}
.goal {
  grid-column: 1 / -1;
  grid-row: 2;
  position: relative;
  height: 2px;
  border-radius: 2px;
  background: var(--linea);
  overflow: hidden;
}
.goal__bar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2a8a52, var(--germoglio));
  transform-origin: 0 50%;
}

.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; }
}
