:root {
  --fondo: #ffffff;
  --pillola: #0c0c0e;
  --accento: #3ddc84;
  --accento-scuro: #23a862;
  --testo: #f6f6f7;
  --testo-2: rgba(246, 246, 247, 0.58);
  --testo-3: rgba(246, 246, 247, 0.3);
  --linea: rgba(255, 255, 255, 0.12);
  --box-hi: #4be894;
  --box-lo: #1f9d59;
  --larga: 360px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--fondo);
  color: var(--testo);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  padding: 16px;
  overflow: hidden;
}

/* the pill: one element that is both the small island and the open live activity; GSAP moves the
   width, the height and the radius, the content inside fades between the two states */
.island {
  position: absolute;
  left: 50%;
  top: clamp(24px, 22vh, 150px);
  width: 156px;
  height: 38px;
  margin-left: -78px;
  border-radius: 19px;
  background: var(--pillola);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 18px 40px -18px rgba(12, 12, 14, 0.55), 0 3px 10px -4px rgba(12, 12, 14, 0.35);
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* an invisible box as big as the open pill: the preview frames it, whatever size the pill has */
.frame {
  position: absolute;
  left: 50%;
  top: clamp(24px, 22vh, 150px);
  width: var(--larga);
  height: var(--alta, 168px);
  margin-left: calc(var(--larga) / -2);
  pointer-events: none;
}

.compact {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.mini {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--accento);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mini--done { position: absolute; left: 34px; opacity: 0; }
.compact__txt { min-width: 64px; }

.full {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--larga);
  padding: 15px 18px 14px;
}

.row { display: flex; align-items: center; }
.row--top { gap: 8px; font-size: 12px; color: var(--testo-2); }
.app {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--accento);
  display: grid;
  place-items: center;
}
.app svg { width: 16px; height: 16px; fill: none; stroke: #0c0c0e; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.app svg path:first-child { fill: #0c0c0e; }
.brand { color: var(--testo); font-weight: 600; }
.eta { margin-left: auto; }

.row--main { margin-top: 10px; gap: 12px; align-items: flex-end; }
.title {
  flex: 1;
  min-width: 0;
  font-size: 19px;
  line-height: 1.15;
  font-weight: 640;
  font-variation-settings: "wdth" 96;
  letter-spacing: -0.012em;
}
.mins {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 3px;
  color: var(--accento);
  min-width: 70px;
  justify-content: flex-end;
}
.mins__num {
  font-size: 30px;
  line-height: 1;
  font-weight: 700;
  font-variation-settings: "wdth" 88;
  letter-spacing: -0.02em;
}
.mins__unit { font-size: 13px; font-weight: 600; }
.mins__done {
  position: absolute;
  right: 0;
  bottom: -3px;
  width: 34px;
  height: 34px;
  fill: none;
  stroke: var(--accento);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}

.sub { margin-top: 3px; font-size: 12.5px; color: var(--testo-2); }

/* rolling text: a one-line window, the old line leaves before the new one comes in */
.roll {
  position: relative;
  display: block;
  height: 1.2em;
  overflow: hidden;
}
.roll--num { height: 1.05em; min-width: 1.3em; text-align: right; }
.roll__line { position: absolute; left: 0; right: 0; top: 0; white-space: nowrap; }
.roll--num .roll__line { text-align: right; }

/* the route: from the restaurant to home, the road is the progress bar */
.route {
  margin-top: 14px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 58px;
}
.stop {
  position: relative;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #1d1e22;
  display: grid;
  place-items: center;
}
.stop svg { width: 17px; height: 17px; fill: none; stroke: var(--testo-2); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.stop--to svg { stroke: var(--testo); }
.steam {
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 14px;
  height: 12px;
  margin-left: -7px;
}
.steam i {
  position: absolute;
  bottom: 0;
  width: 2px;
  height: 7px;
  border-radius: 2px;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0));
}
.steam i:nth-child(1) { left: 2px; }
.steam i:nth-child(2) { left: 6px; height: 9px; }
.steam i:nth-child(3) { left: 10px; }

.road {
  position: relative;
  flex: 1;
  height: 58px;
}
.road__dash,
.road__fill {
  position: absolute;
  left: 0;
  bottom: 12px;
  height: 2px;
  border-radius: 2px;
}
.road__dash {
  right: 0;
  background: repeating-linear-gradient(to right, var(--linea) 0 6px, transparent 6px 10px);
}
.road__fill {
  width: 0;
  background: linear-gradient(to right, var(--accento-scuro), var(--accento));
  box-shadow: 0 0 10px rgba(61, 220, 132, 0.35);
}

/* the scooter sits on the road: its wheels touch the line */
.ride {
  position: absolute;
  left: 0;
  bottom: 13px;
  width: 68px;
  height: 51px;
  will-change: transform;
}
.scooter { display: block; width: 100%; height: 100%; overflow: visible; }
.scooter [data-pitch] { transform-box: view-box; transform-origin: 36px 44px; }
/* the spokes turn around the hub: the script writes rotate() in the wheel's own coordinates (0,0 is the hub),
   so no CSS origin here (fill-box/center put the pivot off the hub, the spokes are not symmetric, and they wobbled) */
.box-hi { stop-color: var(--box-hi); }
.box-lo { stop-color: var(--box-lo); }
.s-rack, .s-fork, .s-pipe, .s-bar { fill: none; stroke-linecap: round; }
.s-rack { stroke: #8d8f97; stroke-width: 1.4; }
.s-box { stroke: rgba(0, 0, 0, 0.25); stroke-width: 0.6; }
.s-box-lid { stroke: rgba(0, 0, 0, 0.28); stroke-width: 0.7; }
.s-box-mark { fill: #0c0c0e; opacity: 0.8; }
.s-box-steam { fill: none; stroke: #0c0c0e; stroke-width: 0.7; stroke-linecap: round; opacity: 0.7; }
.s-tyre { fill: #2a2b30; }
.s-tyre-hi { fill: none; stroke: #4a4b53; stroke-width: 0.7; }
.s-rim { fill: #15161a; stroke: #c4c6cd; stroke-width: 1.1; }
.s-spoke { fill: none; stroke: #c4c6cd; stroke-width: 0.8; stroke-linecap: round; }
.s-hub { fill: #e4e5ea; }
.s-pipe { stroke: #8d8f97; stroke-width: 1.8; }
.s-body { stroke: rgba(0, 0, 0, 0.18); stroke-width: 0.5; }
.s-trim { fill: none; stroke: rgba(255, 255, 255, 0.9); stroke-width: 0.8; stroke-linecap: round; }
.s-floor { fill: #4d4f56; }
.s-fork { stroke: #8d8f97; stroke-width: 2; }
.s-seat { fill: #2c2d32; }
.s-lamp { fill: #fff6cf; }
.s-bar { stroke: #2c2d32; stroke-width: 1.8; }
.s-leg { fill: none; stroke: #4a4b53; stroke-width: 3.8; stroke-linecap: round; stroke-linejoin: round; }
.s-boot { fill: none; stroke: #1f2024; stroke-width: 2.4; stroke-linecap: round; }
.s-jacket { fill: var(--accento-scuro); }
.s-arm { fill: none; stroke: var(--accento-scuro); stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.s-glove { fill: #1f2024; }
.s-helmet { fill: #f4f4f6; stroke: rgba(0, 0, 0, 0.2); stroke-width: 0.5; }
.s-visor { fill: #1c1d21; }
.s-stripe { fill: none; stroke: var(--accento); stroke-width: 1.2; stroke-linecap: round; }

.ride__beam {
  position: absolute;
  left: 90%;
  top: 22%;
  width: 58px;
  height: 26px;
  background: radial-gradient(ellipse at 0% 50%, rgba(255, 246, 207, 0.32), rgba(255, 246, 207, 0) 70%);
  clip-path: polygon(0 42%, 100% 0, 100% 100%, 0 58%);
  opacity: 0;
  pointer-events: none;
}
.puffs { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.puff {
  position: absolute;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 70%);
}

.steps {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--testo-3);
}
.step { transition: color 0.35s; font-variation-settings: "wdth" 100; }
.step.is-on { color: var(--testo); }

@media (hover: hover) {
  .island:hover { box-shadow: 0 1px 0 rgba(255, 255, 255, 0.09) inset, 0 22px 44px -18px rgba(12, 12, 14, 0.6), 0 3px 10px -4px rgba(12, 12, 14, 0.35); }
}

@media (max-width: 400px) {
  .full { padding: 13px 14px 12px; }
  .title { font-size: 17px; }
  .mins__num { font-size: 26px; }
}
