:root {
  --carta: #f8f1e7;      /* warm cream paper */
  --inchiostro: #3a1f1c; /* brown-bordeaux ink */
  --accento: #e8642c;    /* citrus orange, the only accent */
  --pietra: #e9dccb;     /* a warm neutral for hairlines and shadows */
  --vasetto: min(15vw, 21vh); /* base width of one jar: it is drawn 1.3 times as tall */
}

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

.palco {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.palco.preso { cursor: grabbing; }

/* the header */
.testa {
  position: absolute;
  left: 0; right: 0;
  top: max(14px, 3.4vh);
  display: grid;
  justify-items: center;
  gap: 4px;
  z-index: 4;
  pointer-events: none;
}
.marchio {
  margin: 0;
  font-family: "Fraunces Variable", Georgia, serif;
  font-variation-settings: "SOFT" 60, "WONK" 1, "opsz" 72;
  font-weight: 560;
  font-size: clamp(17px, min(3.2vw, 4.4vh), 34px);
  letter-spacing: -0.01em;
  line-height: 1;
}
.sotto {
  margin: 0;
  font-size: clamp(8.5px, min(1.05vw, 1.5vh), 11.5px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-stretch: 110%;
  opacity: 0.62;
}

/* the soft shape and the ring of text behind the row */
.fondo {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.forma {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(80vw, 118vh);
  aspect-ratio: 1000 / 760;
  translate: -50% 47%;
}
.forma svg { display: block; width: 100%; height: 100%; }
.sigillo {
  position: absolute;
  left: 50%;
  top: 50%;
  top: auto;
  bottom: 0;
  width: min(66vw, 96vh);
  aspect-ratio: 1;
  translate: -50% 40%;
}
.sigillo svg { display: block; width: 100%; height: 100%; overflow: visible; }
.sigillo text {
  font-family: "Fraunces Variable", Georgia, serif;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  font-weight: 420;
  font-size: 38px;
  letter-spacing: 0.04em;
  fill: var(--accento);
  text-transform: uppercase;
}

/* the row, tilted by ten degrees around the middle of the stage */
.fila {
  position: absolute;
  inset: 0;
  z-index: 2;
  transform: rotate(10deg);
  transform-origin: 50% 52%;
}
.vasetto {
  position: absolute;
  left: 50%;
  top: 52%;
  width: var(--vasetto);
  aspect-ratio: 200 / 260;
  margin-left: calc(var(--vasetto) / -2);
  margin-top: calc(var(--vasetto) * -0.65);
  will-change: transform, filter;
}
.vasetto__corpo {
  position: absolute;
  inset: 0;
  transform-origin: 50% 90%;
}
.vasetto__corpo > svg { display: block; width: 100%; height: 100%; overflow: visible; }
.vasetto__ombra {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -5%;
  height: 12%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(58, 31, 28, 0.32), rgba(58, 31, 28, 0));
  transform-origin: 50% 50%;
}
.vasetto text { font-family: "Fraunces Variable", Georgia, serif; }
.vasetto .piccolo { font-family: "Mona Sans Variable", system-ui, sans-serif; font-stretch: 115%; }

/* the name of the jar in the middle, rolling when it changes */
.nome {
  position: absolute;
  left: 0; right: 0;
  bottom: max(40px, 8.4vh);
  margin: 0;
  height: 1.3em;
  overflow: hidden;
  text-align: center;
  z-index: 4;
  font-family: "Fraunces Variable", Georgia, serif;
  font-style: italic;
  font-variation-settings: "SOFT" 100, "opsz" 48;
  font-weight: 380;
  font-size: clamp(15px, min(2.1vw, 3vh), 24px);
  color: var(--carta);
  pointer-events: none;
}
.nome__in { display: inline-block; white-space: nowrap; }
.invito {
  position: absolute;
  left: 50%;
  bottom: max(16px, 3.4vh);
  translate: -50% 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 4;
  font-size: clamp(8.5px, min(1vw, 1.45vh), 11px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-stretch: 110%;
  color: var(--carta);
  opacity: 0.7;
  white-space: nowrap;
  pointer-events: none;
}
.invito svg { width: 20px; height: 10px; }

/* the pill that follows the pointer over a jar */
.pillola {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
}
.pillola__testo {
  position: absolute;
  left: 0;
  top: 0;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  height: 34px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--inchiostro);
  color: var(--carta);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-stretch: 112%;
  font-weight: 560;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 8px 22px -10px rgba(58, 31, 28, 0.55);
}

@media (max-width: 600px) {
  :root { --vasetto: min(24vw, 19vh); }
  .forma { width: min(104vw, 118vh); }
  .nome { bottom: max(34px, 7.2vh); }
}

@media (hover: none) {
  .pillola { display: none; }
}
