:root {
  --fondo: #01060e;      /* the blue-black of the table and of the veil */
  --avorio: #dcd6c7;     /* the warm ivory of the text and of the line drawings */
  --carta: #e9e2cf;      /* the paper of tickets, cards and photographs */
  --inchiostro: #10192a; /* the ink printed on the paper */
  --blu: #00408a;        /* the club blue: stripes, ribbons, pennants */
  --metallo: #b9b2a0;    /* brass and steel */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--fondo); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  background: var(--fondo);
  color: var(--avorio);
  font-family: 'Inter Variable', system-ui, sans-serif;
  font-weight: 350;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.corsa { position: relative; height: 1000vh; }
.palco {
  position: sticky; top: 0;
  height: 100vh; height: 100lvh;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 60% at 50% 55%, rgba(0, 64, 138, 0.14), transparent 70%),
    var(--fondo);
}
.tela { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.testa {
  position: absolute; z-index: 4; left: 0; right: 0; top: 0;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: clamp(12px, 2.6vh, 26px) clamp(14px, 3vw, 40px);
  font-size: clamp(10px, 1.6vh, 13px); letter-spacing: 0.02em;
  pointer-events: none;
}
.marchio { display: inline-flex; align-items: center; gap: 8px; font-family: 'Fraunces Variable', Georgia, serif; font-size: 1.25em; font-weight: 400; letter-spacing: 0; }
.marchio svg { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.3; }
.testa__nota { opacity: 0.6; white-space: nowrap; }

.etichetta {
  font-family: 'JetBrains Mono Variable', ui-monospace, monospace;
  font-size: clamp(9px, 1.4vh, 11px); text-transform: uppercase; letter-spacing: 0.16em;
  opacity: 0.62;
}

.apertura, .chiusura {
  position: absolute; z-index: 3; inset: 0;
  display: grid; place-content: center; text-align: center; gap: clamp(10px, 2vh, 18px);
  padding: 0 clamp(16px, 6vw, 80px);
  pointer-events: none;
}
.apertura__titolo, .chiusura__titolo {
  font-family: 'Fraunces Variable', Georgia, serif;
  font-weight: 300; font-variation-settings: 'opsz' 144, 'SOFT' 50;
  font-size: min(8.4vw, 9.5vh, 112px); line-height: 0.98; letter-spacing: -0.02em;
  max-width: 12ch; margin: 0 auto;
}
.apertura__titolo em, .chiusura__titolo em { font-style: italic; font-weight: 300; color: var(--carta); }
.apertura__titolo em { padding-right: 0.1em; }
.chiusura { visibility: hidden; }

/* the reference box the chosen object flies to: on a wide screen on the right, on a narrow one at the top */
.riferimento {
  position: absolute; z-index: 2;
  left: 52%; top: 17%; width: 38%; height: 62%;
  pointer-events: none; visibility: hidden;
}
.riferimento__angoli { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.riferimento__angoli path { fill: none; stroke: var(--avorio); stroke-width: 1; opacity: 0.55; }
.riferimento__cartellino {
  position: absolute; left: 0; top: calc(100% + 12px);
  font-family: 'JetBrains Mono Variable', ui-monospace, monospace;
  font-size: clamp(9px, 1.35vh, 11px); letter-spacing: 0.08em; text-transform: uppercase;
  opacity: 0.7; white-space: nowrap;
}
.riferimento__cartellino span { position: absolute; left: 0; top: 0; }

.ricordi { position: absolute; z-index: 3; inset: 0; pointer-events: none; }
.ricordo {
  position: absolute; left: clamp(16px, 7vw, 110px); top: 50%; transform: translateY(-50%);
  width: min(36vw, 460px);
  display: grid; gap: clamp(8px, 1.6vh, 14px);
}
.ricordo [data-riga], .riferimento__cartellino span { visibility: hidden; }
.ricordo__titolo {
  font-family: 'Fraunces Variable', Georgia, serif;
  font-weight: 300; font-variation-settings: 'opsz' 144, 'SOFT' 50;
  font-size: min(5.2vw, 7.4vh, 72px); line-height: 1; letter-spacing: -0.015em;
}
.ricordo__testo { font-size: clamp(12px, 2vh, 17px); line-height: 1.45; max-width: 30ch; opacity: 0.82; }
.ricordo [data-riga] { will-change: transform, opacity; }

.scorri {
  position: absolute; z-index: 3; left: 50%; bottom: clamp(12px, 3vh, 28px); transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px;
  font-size: clamp(10px, 1.5vh, 12px); letter-spacing: 0.04em; opacity: 0.6; white-space: nowrap;
}
.scorri svg { width: 9px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }

/* narrow screens: the box on top, the text underneath */
@media (max-aspect-ratio: 1/1), (max-width: 700px) {
  .riferimento { left: 9%; width: 82%; top: 13%; height: 40%; }
  .riferimento__cartellino { top: calc(100% + 8px); }
  .ricordo { left: 9%; right: 9%; width: auto; top: auto; bottom: 7%; transform: none; gap: 6px; }
  .ricordo__titolo { font-size: min(8.4vw, 6.4vh, 46px); }
  .ricordo__testo { font-size: clamp(11px, 1.9vh, 15px); }
  .testa__nota { display: none; }
}
