/* The terms of service window with the key sentences taking weight on scroll. Colours in :root (the Playground palette). */
:root {
  --fondo: #f4f1ea;
  --carta: #ffffff;
  --inchiostro: #16181b;
  --chiaro: #a7a39b;
  --secondario: #6f6b64;
  --bordo: rgba(22, 24, 27, 0.08);
  --accento: #0f7a63;
  --evidenza: rgba(15, 122, 99, 0.13);
  --spento: #e9e6df;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--fondo); }
body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: 'Instrument Sans Variable', 'Instrument 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(8px, 2vh, 18px);
  padding: clamp(10px, 3vh, 36px) clamp(10px, 4vw, 60px);
  overflow: hidden;
  background:
    radial-gradient(60% 50% at 50% 38%, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0) 70%),
    var(--fondo);
}

/* ---- the window ---- */
.finestra {
  width: min(500px, 92vw);
  height: min(600px, 84vh);
  display: flex;
  flex-direction: column;
  background: var(--carta);
  border: 1px solid var(--bordo);
  border-radius: clamp(14px, 2.2vh, 20px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 1px 2px rgba(22, 24, 27, 0.05),
    0 8px 18px -8px rgba(22, 24, 27, 0.12),
    0 30px 60px -24px rgba(22, 24, 27, 0.22);
  overflow: hidden;
}

.testa {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.4vh, 12px);
  padding: clamp(10px, 2vh, 18px) clamp(12px, 2.4vh, 20px);
  border-bottom: 1px solid var(--bordo);
}
.marchio {
  flex: none;
  width: clamp(26px, 4.6vh, 34px);
  height: clamp(26px, 4.6vh, 34px);
  border-radius: 9px;
  background: linear-gradient(160deg, #13896f, #0b5e4c);
  display: grid;
  place-items: center;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 4px 10px -4px rgba(11, 94, 76, 0.6);
}
.marchio svg { width: 60%; height: 60%; fill: none; stroke: #fff; stroke-width: 1.4; stroke-linejoin: round; }
.testa__testi { min-width: 0; flex: 1; }
.testa__titolo {
  font-size: clamp(13px, min(1.6vw, 2.5vh), 16px);
  font-weight: 620;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.testa__sotto {
  margin-top: 2px;
  color: var(--secondario);
  font-size: clamp(9.5px, min(1.15vw, 1.8vh), 12px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.punti {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px 4px 7px;
  border-radius: 999px;
  background: var(--evidenza);
  color: var(--accento);
  font-size: clamp(9.5px, min(1.15vw, 1.8vh), 12px);
  font-weight: 560;
  font-variant-numeric: tabular-nums;
}
.punti__ruota { display: inline-block; height: 1.2em; line-height: 1.2em; overflow: hidden; }
.punti__colonna { display: flex; flex-direction: column; }
.punti__colonna span { display: block; height: 1.2em; text-align: center; }

/* ---- the reading area ---- */
.lettura {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.testo {
  padding: clamp(12px, 3vh, 26px) clamp(16px, 3.4vh, 30px) 0 clamp(14px, 3vh, 26px);
  font-size: clamp(12px, min(1.6vw, 2.35vh), 15.5px);
  line-height: 1.55;
  color: var(--chiaro);
  font-weight: 400;
  will-change: transform;
}
.testo p + p { margin-top: 0.85em; }
.chiave {
  --peso: 400;
  font-weight: var(--peso);
  font-stretch: 100%;
  color: var(--chiaro);
  background-image: linear-gradient(var(--evidenza), var(--evidenza));
  background-repeat: no-repeat;
  background-size: 0% 100%;
  background-position: 0 0;
  border-radius: 3px;
  padding: 1px 2px;
  margin: 0 -2px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.testo__fine {
  margin: 1.6em 0 2.4em;
  color: var(--chiaro);
  font-size: 0.78em;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
}

/* the reading line: where the key sentences are read */
.riga-lettura {
  position: absolute;
  left: 0;
  width: 3px;
  height: 2.2em;
  top: 42%;
  margin-top: -1.1em;
  border-radius: 0 3px 3px 0;
  background: var(--accento);
  opacity: 0.85;
}

.velo {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 30%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--carta) 88%);
  pointer-events: none;
}

.binario {
  position: absolute;
  top: 12px;
  bottom: 12px;
  right: 7px;
  width: 3px;
  border-radius: 3px;
  background: var(--spento);
}
.binario__pomo {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 22%;
  border-radius: 3px;
  background: #c9c5bd;
}

/* ---- the buttons ---- */
.piede {
  display: flex;
  gap: 10px;
  padding: clamp(10px, 2vh, 16px) clamp(12px, 2.4vh, 20px);
  border-top: 1px solid var(--bordo);
  background: linear-gradient(#fff, #fcfbf9);
}
.tasto {
  appearance: none;
  border: 0;
  font: inherit;
  font-size: clamp(12px, min(1.5vw, 2.2vh), 14.5px);
  font-weight: 560;
  height: clamp(36px, 6.4vh, 46px);
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}
.tasto--vuoto {
  flex: 0 0 auto;
  padding: 0 1.3em;
  background: transparent;
  color: var(--secondario);
  box-shadow: inset 0 0 0 1px var(--bordo);
}
.tasto--pieno {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  padding: 0 1.2em;
  color: var(--secondario);
  background: var(--spento);
  overflow: hidden;
  isolation: isolate;
}
.tasto--pieno:disabled { cursor: not-allowed; }
.tasto__luce {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, #24272b, #121315);
  opacity: 0;
  border-radius: inherit;
}
.lucchetto { width: 1.05em; height: 1.05em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.lucchetto rect { fill: currentColor; fill-opacity: 0.12; }
.tasto__scritte { position: relative; display: inline-grid; overflow: hidden; height: 1.3em; line-height: 1.3em; }
.tasto__scritta { grid-area: 1 / 1; white-space: nowrap; }
.tasto__scritta--dopo { opacity: 0; }

@media (hover: hover) {
  .tasto--vuoto:hover { color: var(--inchiostro); box-shadow: inset 0 0 0 1px rgba(22, 24, 27, 0.18); }
}

.nota {
  color: var(--secondario);
  font-size: clamp(10px, min(1.2vw, 1.9vh), 12.5px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fondo-pagina {
  padding: 30px 20px 40px;
  text-align: center;
  color: var(--chiaro);
  font-size: 12px;
}
