:root {
  --fondo: #ffffff;
  --inchiostro: #0b0c0e;
  --grigio: #71717a;
  --grigio-chiaro: #a1a1aa;
  --linea: rgba(11, 12, 14, 0.08);
  --accento: #17b26a;
  --pomello: #ffffff;
}

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

.dock {
  display: grid;
  gap: clamp(12px, 3vh, 18px);
  width: min(360px, calc(100vw - 32px));
}

.dock__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 12px;
  color: var(--grigio);
  white-space: nowrap;
}
.dock__bike { color: var(--inchiostro); font-weight: 600; font-size: 13px; }
.dock__where { overflow: hidden; text-overflow: ellipsis; }

/* the pill: one element for GSAP's scale, the fill and the knob live inside */
.unlock {
  --k: calc(clamp(60px, 15vh, 68px) - 12px);
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: clamp(60px, 15vh, 68px);
  padding: 6px;
  border-radius: 999px;
  background: var(--inchiostro);
  color: #fff;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06), 0 10px 24px -12px rgba(0, 0, 0, 0.45);
  -webkit-tap-highlight-color: transparent;
}
.unlock:focus-visible { outline: 2px solid var(--accento); outline-offset: 3px; }

.unlock__fill {
  position: absolute;
  left: calc(6px + var(--k) / 2); top: 50%;
  width: 0; height: 0;
  border-radius: 50%;
  background: var(--accento);
  z-index: -1;
  pointer-events: none;
}

.unlock__knob {
  position: relative;
  flex: none;
  width: var(--k); height: var(--k);
  border-radius: 50%;
  background: var(--pomello);
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.28);
  display: grid;
  place-items: center;
  z-index: 2;
}
.lock, .wheel {
  grid-area: 1 / 1;
  overflow: visible;
}
.lock { width: calc(var(--k) * 0.66); height: calc(var(--k) * 0.66); }
.wheel { width: calc(var(--k) * 0.86); height: calc(var(--k) * 0.86); }

.lock__arco {
  fill: none;
  stroke: url(#acciaio);
  stroke-width: 3.4;
  stroke-linecap: round;
}
.lock__arco-luce {
  fill: none;
  stroke: #fff;
  stroke-width: 0.9;
  stroke-linecap: round;
  opacity: 0.85;
}
.lock__ombra { fill: rgba(0, 0, 0, 0.14); }
.lock__corpo { fill: url(#corpo); }
.lock__bordo { stroke: rgba(255, 255, 255, 0.28); stroke-width: 0.9; stroke-linecap: round; }
.lock__foro { fill: #a7b0ba; }
.lock__vite { stroke: rgba(255, 255, 255, 0.35); stroke-width: 1.6; stroke-linecap: round; }

.wheel__gomma { fill: none; stroke: #16181b; stroke-width: 3.2; }
.wheel__gomma-luce { fill: none; stroke: rgba(255, 255, 255, 0.5); stroke-width: 0.5; }
.wheel__battistrada { fill: none; stroke: #3b3f45; stroke-width: 1.2; stroke-dasharray: 1.4 1.9; }
.wheel__cerchio { fill: none; stroke: #9aa2ab; stroke-width: 1.2; }
.wheel__raggi line { stroke: #8a929b; stroke-width: 0.45; stroke-linecap: round; }
.wheel__mozzo { fill: #2a2d31; stroke: #b9c0c7; stroke-width: 0.8; }
.wheel__perno { fill: #e9edf0; }
.wheel__valvola { fill: #c6ccd2; }

.unlock__words {
  position: relative;
  flex: 1;
  height: 100%;
  margin-left: 10px;
  margin-right: 22px;
}
.unlock__label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(15px, 4.2vh, 17px);
  font-weight: 560;
  font-variation-settings: "wdth" 100;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.unlock__label--on, .unlock__label--end { opacity: 0; }
.unlock__label--on { font-weight: 600; }

.dock__note {
  position: relative;
  height: 18px;
  font-size: 12px;
  color: var(--grigio);
  text-align: center;
}
.dock__state { position: absolute; inset: 0; white-space: nowrap; }
.dock__state--ride { opacity: 0; color: var(--inchiostro); }
.dock__time { font-weight: 600; }

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