:root {
  --carta: #f4f1ea;      /* the warm paper of the brand book */
  --inchiostro: #151412; /* the ink of the letter in the middle */
  --spento: #b8b1a3;     /* the ink of the letters turned away */
  --accento: #2437c9;    /* the one accent: guides, the chosen weight */
  --filo: rgba(21, 20, 18, 0.12);
  --sans: 'Instrument Sans Variable', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Geist Mono Variable', ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--carta); color: var(--inchiostro); }
body { font-family: var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }

.corsa { position: relative; height: 300vh; }
.palco {
  position: sticky; top: 0; height: 100vh; height: 100lvh; max-height: 100vh;
  overflow: hidden; isolation: isolate;
  --lettera: min(44vh, 30vw);
}

.testa {
  position: absolute; z-index: 5; top: clamp(14px, 3.4vh, 30px); left: clamp(16px, 3vw, 36px); right: clamp(16px, 3vw, 36px);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.marca { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.marca svg { width: 20px; height: 20px; }
.etichetta { font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: #6f695e; }
.etichetta span { color: var(--inchiostro); margin-left: 10px; }

.pesi {
  position: absolute; z-index: 5; left: 50%; top: clamp(50px, 10vh, 92px); transform: translateX(-50%);
  display: flex; padding: 3px; border-radius: 999px; background: rgba(21, 20, 18, 0.05);
  box-shadow: inset 0 0 0 1px var(--filo);
}
.pesi__fondo {
  position: absolute; top: 3px; left: 0; height: calc(100% - 6px); width: 60px; border-radius: 999px;
  background: #fffdf8; box-shadow: 0 1px 2px rgba(21, 20, 18, 0.12), 0 6px 16px -8px rgba(21, 20, 18, 0.3), inset 0 0 0 1px rgba(21, 20, 18, 0.06);
}
.pesi button {
  position: relative; z-index: 1; border: 0; background: none; cursor: pointer; color: #7a7366;
  font: inherit; font-size: 13px; padding: 7px 14px; border-radius: 999px; transition: color 0.3s;
}
.pesi button[data-peso="400"] { font-weight: 400; }
.pesi button[data-peso="500"] { font-weight: 500; }
.pesi button[data-peso="600"] { font-weight: 600; }
.pesi button[data-peso="700"] { font-weight: 700; }
.pesi button[aria-checked="true"] { color: var(--inchiostro); }
.pesi button:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }
@media (hover: hover) { .pesi button:hover { color: var(--inchiostro); } }

.guide { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.guida {
  position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(36, 55, 201, 0.32) 12%, rgba(36, 55, 201, 0.32) 88%, transparent);
  transform-origin: 50% 50%;
}
.guida--base { background: linear-gradient(90deg, transparent, rgba(36, 55, 201, 0.55) 12%, rgba(36, 55, 201, 0.55) 88%, transparent); }
.guida span {
  position: absolute; left: clamp(16px, 3vw, 36px); bottom: 5px; font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--accento);
}

.ruota {
  position: absolute; inset: 0; z-index: 2; outline: none; cursor: grab; touch-action: pan-y;
  user-select: none; -webkit-user-select: none;
}
.ruota.tira { cursor: grabbing; }
.ruota__in { position: absolute; inset: 0; transform-style: preserve-3d; }
.metro, .lettera {
  position: absolute; left: 50%; top: 58%; font-size: var(--lettera); line-height: 1; letter-spacing: -0.03em;
}
.metro { visibility: hidden; transform: translate(-50%, -50%); }
.metro i { display: inline-block; width: 0; height: 0; vertical-align: baseline; }
.lettera { will-change: transform; transform-style: preserve-3d; transform-origin: 0 0; visibility: hidden; }
.lettera__in { display: block; transform: translate(-50%, -50%); }
.lettera__g { display: block; }
.ruota:focus-visible .lettera.centro .lettera__g { text-decoration: underline 2px var(--accento); text-underline-offset: 0.12em; }

.cursore {
  position: absolute; z-index: 6; left: 0; top: 0; pointer-events: none; opacity: 0;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 7px 11px; border-radius: 999px; background: var(--inchiostro); color: var(--carta);
  white-space: nowrap;
}

.piede {
  position: absolute; z-index: 5; left: clamp(16px, 3vw, 36px); right: clamp(16px, 3vw, 36px); bottom: clamp(14px, 3.4vh, 30px);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 12px;
}
.nome, .peso { display: flex; flex-direction: column; gap: 3px; }
.peso { align-items: flex-end; text-align: right; }
.rullo { display: block; overflow: hidden; position: relative; height: 1.25em; line-height: 1.25em; font-size: 15px; font-weight: 500; }
.rullo > span { display: block; white-space: nowrap; }
.peso .rullo > span { text-align: right; }
.rullo--mono { font-family: var(--mono); font-size: 11px; font-weight: 400; color: #7a7366; letter-spacing: 0.04em; }
.aiuto { font-family: var(--mono); font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; color: #9a9284; text-align: center; }

.fine { padding: 26px 20px 40px; text-align: center; font-size: 12px; color: #8b8477; }

@media (max-width: 560px) {
  .etichetta span { display: none; }
  .pesi { top: clamp(46px, 11vh, 70px); }
  .pesi button { font-size: 11.5px; padding: 6px 9px; }
  .aiuto { display: none; }
  .palco { --lettera: min(40vh, 42vw); }
  .piede { grid-template-columns: 1fr 1fr; }
  .rullo { font-size: 13px; }
}
