/* The document that encrypts line by line as you scroll. Colours in :root (the Playground palette). */
:root {
  --fondo: #faf8f4;
  --carta: #ffffff;
  --inchiostro: #17161a;
  --spento: #b9b4ab;
  --secondario: #75716a;
  --bordo: rgba(23, 22, 26, 0.08);
  --cifra: #8b93a8;
  --accento: #1f6f5c;
  --accento-tenue: rgba(31, 111, 92, 0.1);
}

* { 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: 300vh; }
.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, 1.8vh, 16px);
  padding: clamp(10px, 3vh, 40px) clamp(12px, 5vw, 80px);
  overflow: hidden;
  text-align: center;
}

.occhiello {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 9px;
  border: 1px solid var(--bordo);
  border-radius: 999px;
  background: var(--carta);
  color: var(--secondario);
  font-size: clamp(10px, min(1.2vw, 2vh), 13px);
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(23, 22, 26, 0.04);
}
.occhiello svg { width: 1.1em; height: 1.1em; fill: none; stroke: var(--accento); stroke-width: 1.4; stroke-linejoin: round; }

.titolo {
  font-size: clamp(19px, min(4.2vw, 5.4vh), 50px);
  line-height: 1.04;
  font-weight: 620;
  font-stretch: 92%;
  letter-spacing: -0.025em;
}
.titolo__spento { color: var(--spento); transition: color 0.6s ease; }
.titolo.e-fatto .titolo__spento { color: var(--cifra); }

.carta {
  position: relative;
  width: min(600px, 100%);
  background: var(--carta);
  border: 1px solid var(--bordo);
  border-radius: clamp(12px, 2vh, 18px);
  box-shadow: 0 1px 2px rgba(23, 22, 26, 0.04), 0 18px 48px -18px rgba(23, 22, 26, 0.18);
  text-align: left;
  overflow: hidden;
}
.carta__testa {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: clamp(7px, 1.6vh, 13px) clamp(10px, 2vh, 18px);
  border-bottom: 1px solid var(--bordo);
  font-size: clamp(10px, min(1.3vw, 2.1vh), 13.5px);
}
.carta__nome { font-weight: 560; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lucchetto { display: inline-flex; width: 1.5em; height: 1.5em; flex: none; }
.lucchetto svg { width: 100%; height: 100%; overflow: visible; }
.lucchetto__arco { fill: none; stroke: var(--secondario); stroke-width: 1.6; stroke-linecap: round; }
.lucchetto__corpo { fill: none; stroke: var(--secondario); stroke-width: 1.6; }
.lucchetto__foro { fill: var(--secondario); }
.lucchetto.e-chiuso .lucchetto__arco,
.lucchetto.e-chiuso .lucchetto__corpo { stroke: var(--accento); }
.lucchetto.e-chiuso .lucchetto__corpo { fill: var(--accento-tenue); }
.lucchetto.e-chiuso .lucchetto__foro { fill: var(--accento); }

.stato {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(23, 22, 26, 0.05);
  color: var(--secondario);
  font-weight: 540;
  font-size: 0.92em;
  white-space: nowrap;
  transition: background-color 0.4s ease, color 0.4s ease;
}
.stato__testo { display: inline-block; }
.stato.e-fatto { background: var(--accento-tenue); color: var(--accento); }

.foglio {
  position: relative;
  padding: clamp(8px, 2vh, 20px) clamp(10px, 2.2vh, 22px);
}
.righe { display: flex; flex-direction: column; }
.riga {
  height: 1.78em;
  line-height: 1.78em;
  white-space: nowrap;
  overflow: hidden;
  font-size: clamp(10px, min(1.6vw, 2.6vh), 15.5px);
  color: var(--inchiostro);
  margin: 0 -6px;
  padding: 0 6px;
  border-radius: 6px;
}
.riga--titolo { font-weight: 620; }
.riga span { display: inline-block; white-space: pre; }
.riga .c {
  font-family: 'JetBrains Mono Variable', 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.84em;
  font-weight: 420;
  color: var(--cifra);
}
.riga .m {
  font-family: 'JetBrains Mono Variable', 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.84em;
  font-weight: 560;
  color: var(--accento);
}

.scansione {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1.78em;
  font-size: clamp(10px, min(1.6vw, 2.6vh), 15.5px);
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(180deg, rgba(31, 111, 92, 0) 0%, var(--accento-tenue) 70%, rgba(31, 111, 92, 0) 100%);
}
.scansione::after {
  content: '';
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 14%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accento), transparent);
  opacity: 0.7;
}

.carta__piede {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: clamp(6px, 1.4vh, 11px) clamp(10px, 2vh, 18px);
  border-top: 1px solid var(--bordo);
  color: var(--secondario);
  font-size: clamp(9.5px, min(1.2vw, 1.9vh), 12.5px);
  background: #fcfbf9;
}
.carta__piede svg { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; }
.carta__piede span { display: inline-block; }

.chiusa {
  min-height: 1.3em;
  font-size: clamp(12px, min(1.9vw, 2.8vh), 21px);
  font-weight: 480;
  letter-spacing: -0.01em;
}
.chiusa .parola { display: inline-block; opacity: 0; }
.chiusa b { color: var(--accento); font-weight: 600; }

.piede {
  padding: 28px 16px 36px;
  text-align: center;
  font-size: 12px;
  color: var(--secondario);
}
