/* The audio cleanup that clears the waveform as you scroll. Colours in :root (the Playground palette). */
:root {
  --fondo: #0b0d10;
  --pannello: #14171c;
  --pannello-basso: #101318;
  --inchiostro: #eef1f4;
  --secondario: #8a929e;
  --spento: #2a2f37;
  --bordo: rgba(255, 255, 255, 0.07);
  --rumore: #5d6470;
  --accento: #6ee7c8;
  --accento-scuro: #2fb79a;
}

* { 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;
  height: 100lvh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 2vh, 16px);
  padding: clamp(6px, 2vh, 28px) 10px;
  overflow: hidden;
  background:
    radial-gradient(55% 45% at 50% 42%, rgba(110, 231, 200, 0.07), transparent 70%),
    var(--fondo);
}

.pannello {
  position: relative;
  container-type: inline-size;
  width: min(640px, 94vw, 128vh);
  padding: 4.6cqw 5cqw 5cqw;
  border-radius: 4.2cqw;
  background: linear-gradient(180deg, var(--pannello), var(--pannello-basso));
  box-shadow:
    0 0 0 1px var(--bordo),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 2px 4px rgba(0, 0, 0, 0.3),
    0 20px 40px -16px rgba(0, 0, 0, 0.6),
    0 60px 120px -40px rgba(47, 183, 154, 0.18);
  overflow: hidden;
}
.pannello__luce {
  position: absolute;
  inset: -20% auto -20% 0;
  width: 30%;
  background: linear-gradient(100deg, transparent, rgba(160, 255, 228, 0.12), transparent);
  transform: translateX(-160%) skewX(-12deg);
  pointer-events: none;
  opacity: 0;
}

.testa {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2cqw;
  margin-bottom: 3.2cqw;
}
.marchio {
  display: inline-flex;
  align-items: center;
  gap: 1.5cqw;
  font-size: max(11px, 2.7cqw);
  font-weight: 650;
  letter-spacing: -0.01em;
}
.marchio svg {
  width: max(14px, 3.4cqw);
  height: max(14px, 3.4cqw);
  fill: none;
  stroke: var(--accento);
  stroke-width: 1.7;
  stroke-linecap: round;
}
.file {
  display: inline-flex;
  align-items: center;
  gap: 1.2cqw;
  padding: 0.9cqw 1.8cqw;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px var(--bordo);
  color: var(--secondario);
  font-size: max(9px, 2cqw);
  white-space: nowrap;
}
.file svg { width: max(10px, 2.3cqw); height: max(10px, 2.3cqw); fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linejoin: round; }
.file__durata { color: var(--inchiostro); font-variant-numeric: lining-nums; opacity: 0.8; }

/* the Before / After switch: the cream pill slides to After when the cleanup is done */
.ab {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 2.6cqw;
  padding: 0.6cqw;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px var(--bordo);
  font-size: max(9px, 2cqw);
  font-weight: 560;
}
.ab__pillola {
  position: absolute;
  top: 0.6cqw;
  bottom: 0.6cqw;
  left: 0.6cqw;
  width: calc(50% - 0.6cqw);
  border-radius: 99px;
  background: linear-gradient(180deg, #2a3038, #20252c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 6px rgba(0, 0, 0, 0.4);
}
.ab__voce {
  position: relative;
  padding: 0.9cqw 3.2cqw;
  text-align: center;
  color: var(--secondario);
}

.onda {
  position: relative;
  height: min(26cqw, 22vh);
  min-height: 70px;
  margin-bottom: 3cqw;
  border-radius: 2.4cqw;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)),
    #0e1115;
  box-shadow: inset 0 0 0 1px var(--bordo), inset 0 10px 30px -18px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}
.onda__tela { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* the cleaning head: a thin bright line with a soft glow, moved by the script */
.testina {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  margin-left: -1px;
  background: linear-gradient(180deg, transparent, var(--accento) 18%, var(--accento) 82%, transparent);
  box-shadow: 0 0 12px rgba(110, 231, 200, 0.7);
  pointer-events: none;
}
.testina__luce {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 1px;
  width: 18cqw;
  background: linear-gradient(90deg, transparent, rgba(110, 231, 200, 0.1));
}

.fasi {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.4cqw;
  margin-bottom: 3.2cqw;
}
.fase {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.2cqw;
  padding: 1.3cqw 1.6cqw;
  border-radius: 1.8cqw;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px var(--bordo);
  color: var(--secondario);
  font-size: max(9px, 1.95cqw);
  white-space: nowrap;
  overflow: hidden;
}
.fase__segno {
  flex: none;
  width: max(11px, 2.6cqw);
  height: max(11px, 2.6cqw);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  display: grid;
  place-items: center;
}
.fase__segno svg { width: 70%; height: 70%; fill: none; stroke: #07120f; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.fase.is-fatta { color: var(--inchiostro); }

.misure {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 4cqw;
}
.misura { display: grid; gap: 0.6cqw; }
.misura__nome { font-size: max(9px, 1.9cqw); color: var(--secondario); }
.misura__valore {
  font-size: max(16px, 5.4cqw);
  font-weight: 650;
  font-variation-settings: 'wdth' 88;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: lining-nums;
}
.misura__valore small { margin-left: 0.6cqw; font-size: 0.4em; font-weight: 500; color: var(--secondario); letter-spacing: 0; }
.misura--chiarezza { grid-template-columns: 1fr auto; align-items: end; column-gap: 2cqw; }
.misura--chiarezza .misura__nome { grid-column: 1 / -1; }
.misura__barra {
  position: relative;
  height: max(4px, 1cqw);
  margin-bottom: 1.2cqw;
  border-radius: 99px;
  background: var(--spento);
  overflow: hidden;
}
.misura__pieno {
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accento-scuro), var(--accento));
  box-shadow: 0 0 10px rgba(110, 231, 200, 0.45);
}
.esporta {
  display: inline-flex;
  align-items: center;
  gap: 1.2cqw;
  padding: 1.6cqw 3cqw;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 0 1px var(--bordo);
  color: var(--secondario);
  font-size: max(10px, 2.2cqw);
  font-weight: 600;
  white-space: nowrap;
}
.esporta svg { width: max(11px, 2.4cqw); height: max(11px, 2.4cqw); fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.esporta__spunta { stroke-dasharray: 1; stroke-dashoffset: 1; }
.esporta.is-pronta {
  color: #07120f;
  background: linear-gradient(180deg, #8ff0d6, var(--accento));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 6px 20px -6px rgba(110, 231, 200, 0.6);
}

.invito { font-size: max(10px, 1.5vh); color: var(--secondario); letter-spacing: 0.02em; }

@media (max-width: 560px) {
  .fasi { grid-template-columns: repeat(2, 1fr); }
  .misure { grid-template-columns: 1fr 1fr; }
  .esporta { grid-column: 1 / -1; justify-content: center; }
  .file__durata { display: none; }
}
