/* The stats that count up on scroll. Colours in :root (the Playground palette). */
:root {
  --fondo: #ffffff;
  --scheda: #fafafa;
  --inchiostro: #0b0b0f;
  --secondario: #71717a;
  --tenue: #a1a1aa;
  --bordo: rgba(10, 10, 20, 0.07);
  --accento: #4f46e5;
  --accento-tenue: #e0e7ff;
  --ambra: #f59e0b;
  --ombra: 0 1px 2px rgba(10, 10, 20, 0.04), 0 10px 28px -14px rgba(10, 10, 20, 0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--fondo); }
body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: 'Mona Sans Variable', 'Mona Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.corsa { position: relative; height: 320vh; }
.palco {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 3.4vh, 34px);
  padding: clamp(12px, 4vh, 40px) clamp(14px, 4vw, 48px);
  overflow: hidden;
}

.testa { text-align: center; }
.testa__nota {
  font-size: clamp(11px, 1.7vh, 13px);
  font-weight: 560;
  color: var(--accento);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.testa__titolo {
  font-size: clamp(18px, min(4.2vw, 5.4vh), 42px);
  font-weight: 640;
  font-stretch: 105%;
  letter-spacing: -0.025em;
  line-height: 1.05;
}
.testa__titolo span { color: var(--secondario); }

.numeri {
  width: min(100%, 1040px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(8px, 1.6vw, 16px);
}

.dato {
  position: relative;
  background: var(--scheda);
  border: 1px solid var(--bordo);
  border-radius: clamp(12px, 1.8vw, 20px);
  padding: clamp(10px, 2.2vh, 22px) clamp(12px, 1.8vw, 22px) clamp(10px, 2.4vh, 22px);
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 1.1vh, 10px);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  transition: box-shadow 0.4s ease, border-color 0.4s ease, background-color 0.4s ease;
}
.dato.e-arrivato { background: #fff; box-shadow: var(--ombra); }
@media (hover: hover) {
  .dato:hover { border-color: rgba(79, 70, 229, 0.22); }
  .dato:hover .filo__pieno { background: var(--accento); }
}

.segno {
  width: 100%;
  height: clamp(28px, 8vh, 64px);
  overflow: visible;
}

/* the growth curve */
.curva__linea { fill: none; stroke: var(--accento); stroke-width: 1.8; stroke-linecap: round; }
.curva__area { fill: url(#sotto); }
.curva__punta { fill: #fff; stroke: var(--accento); stroke-width: 1.6; }

/* the daily bars */
.barra { fill: var(--accento-tenue); }
.barra.e-piena { fill: var(--accento); fill-opacity: 0.86; }
.barra.e-guasta { fill: var(--ambra); }

/* the stars */
.stella__contorno { fill: none; stroke: var(--tenue); stroke-width: 1.2; stroke-linejoin: round; }
.stella__piena { fill: var(--accento); }

/* the gauge */
.quadrante__fondo { fill: none; stroke: var(--accento-tenue); stroke-width: 4; stroke-linecap: round; }
.quadrante__arco { fill: none; stroke: var(--accento); stroke-width: 4; stroke-linecap: round; }
.quadrante__tacche line { stroke: var(--tenue); stroke-width: 1; }
.quadrante__ago { stroke: var(--inchiostro); stroke-width: 1.6; stroke-linecap: round; }
.quadrante__perno { fill: var(--inchiostro); }

/* the rolling number */
.cifra {
  display: flex;
  align-items: baseline;
  font-size: clamp(22px, min(3.6vw, 6.4vh), 52px);
  font-weight: 620;
  font-stretch: 100%;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.colonna {
  display: inline-block;
  height: 1em;
  overflow: hidden;
  /* a soft fade at the top and the bottom, like a real counter wheel */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 18%, #000 82%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 18%, #000 82%, transparent 100%);
}
.colonna__nastro { display: flex; flex-direction: column; }
.colonna__nastro span { display: block; height: 1em; line-height: 1em; text-align: center; }
.segno-fisso { display: inline-block; }
.dopo {
  font-size: 0.42em;
  font-weight: 520;
  color: var(--secondario);
  letter-spacing: 0;
  margin-left: 0.25em;
}

.filo {
  position: relative;
  display: block;
  height: 1px;
  background: var(--bordo);
  overflow: hidden;
}
.filo__pieno {
  position: absolute;
  inset: 0;
  background: var(--inchiostro);
  transform-origin: 0 50%;
  transform: scaleX(0);
  transition: background-color 0.3s ease;
}

.etichetta {
  font-size: clamp(11px, min(1.25vw, 2vh), 14px);
  font-weight: 540;
  color: var(--inchiostro);
  line-height: 1.3;
}
.etichetta span { display: block; color: var(--secondario); font-weight: 440; }

.nota { font-size: clamp(10px, 1.6vh, 12px); color: var(--tenue); }

.piede {
  min-height: 60vh;
  display: grid;
  place-items: center;
  color: var(--secondario);
  font-size: 15px;
  padding: 24px;
  text-align: center;
}

@media (max-width: 720px) {
  .numeri { grid-template-columns: repeat(2, 1fr); }
  .segno { height: clamp(22px, 6vh, 46px); }
  .cifra { font-size: clamp(20px, min(7vw, 6vh), 40px); }
  .etichetta { font-size: clamp(10px, min(3vw, 1.9vh), 13px); }
  .nota { display: none; }
}
@media (max-height: 460px) {
  .etichetta span { display: none; }
}
