:root {
  --carta: #fffcf8;
  --inchiostro: #12110e;
  --lime: #e7e72b;
  --sabbia: #d0c4b1;
  --grigio: #6e6c66;
  --a-alto: #1d4446;   /* the teal field of the libraries slide */
  --a-basso: #0e2224;
  --b-alto: #3a4628;   /* the olive field of the classes slide */
  --b-basso: #1a2112;
  --c-alto: #1c3550;   /* the blue field of the internet slide */
  --c-basso: #0c1826;
  --g: min(54vh, 34vw);
}

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

.corsa { position: relative; height: 600vh; }
.palco { position: sticky; top: 0; height: 100vh; height: 100lvh; overflow: hidden; background: var(--carta); }

/* the opening page */
.apertura {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: clamp(64px, 15vh, 150px) clamp(20px, 6vw, 80px) 0;
}
.apertura__sopra { font-size: clamp(10px, 1.5vmin, 12px); letter-spacing: 0.08em; text-transform: uppercase; color: var(--grigio); font-weight: 520; }
.apertura__titolo {
  margin-top: clamp(8px, 1.8vh, 18px); font-family: "Newsreader Variable", Georgia, serif; font-weight: 380; font-variation-settings: "opsz" 72;
  font-size: clamp(28px, min(7.2vw, 9vh), 88px); line-height: 0.98; letter-spacing: -0.025em; max-width: 13ch;
}
.apertura__titolo em, .testo__titolo em { font-style: italic; font-weight: 340; }
.apertura__sotto { margin-top: clamp(8px, 1.6vh, 16px); max-width: 38ch; font-size: clamp(12px, 1.9vmin, 16px); line-height: 1.4; color: #3c3a35; }
.invito { margin-top: clamp(10px, 2vh, 20px); display: inline-flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--grigio); }
.invito svg { width: 9px; height: 12px; }

/* word masks (built in the script) */
.parola { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.06em 0.04em 0.1em; margin: -0.06em -0.04em -0.1em; }
.parola__dentro { display: inline-block; will-change: transform; }

/* the window that opens on the slides */
.finestra {
  position: absolute; inset: 0; overflow: hidden; border-radius: 0; will-change: transform;
  box-shadow: 0 1px 0 rgba(18, 17, 14, 0.06), 0 24px 60px -24px rgba(18, 17, 14, 0.45), 0 8px 18px -10px rgba(18, 17, 14, 0.3);
}
.finestra__dentro { position: absolute; inset: 0; will-change: transform; }

.lastra { position: absolute; inset: 0; overflow: hidden; color: var(--carta); }
.lastra__dentro { position: absolute; inset: 0; will-change: transform; }
.lastra--a { --alto: var(--a-alto); --basso: var(--a-basso); }
.lastra--b { --alto: var(--b-alto); --basso: var(--b-basso); }
.lastra--c { --alto: var(--c-alto); --basso: var(--c-basso); }
.lastra + .lastra { box-shadow: 0 -1px 0 rgba(255, 252, 248, 0.18), 0 -30px 60px -20px rgba(0, 0, 0, 0.5); }

.fondo { position: absolute; inset: 0; background: radial-gradient(ellipse 80% 70% at 68% 40%, var(--alto), var(--basso) 75%); will-change: transform; }
.fondo__luce { position: absolute; width: 70vmax; height: 70vmax; right: -18vmax; top: -24vmax; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 246, 214, 0.16), rgba(255, 246, 214, 0) 70%); }
.fondo__giri { position: absolute; width: 120vmax; height: 120vmax; left: 50%; top: 50%; transform: translate(-28%, -50%); fill: none; stroke: rgba(255, 252, 248, 0.06); stroke-width: 0.6; }
.fondo__grana {
  position: absolute; inset: 0; opacity: 0.22; mix-blend-mode: overlay; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}

.lastra__corpo {
  position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center;
  gap: clamp(24px, 5vw, 80px); padding: clamp(70px, 11vh, 110px) clamp(24px, 7vw, 110px) clamp(70px, 12vh, 120px);
}
.grafico { position: relative; width: var(--g); height: var(--g); justify-self: center; order: 2; }
.grafico__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.anello__binario { fill: none; stroke: rgba(255, 252, 248, 0.16); stroke-width: 1; stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.anello__arco { fill: none; stroke: var(--carta); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: 1; filter: drop-shadow(0 0 6px rgba(255, 252, 248, 0.12)); }
.anello__tacca { stroke: var(--lime); stroke-width: 2; stroke-linecap: round; opacity: 0; }
.punto--si { fill: var(--lime); }
.punto--no { fill: none; stroke: rgba(255, 252, 248, 0.7); stroke-width: 1.2; }
.barre__base { stroke: rgba(255, 252, 248, 0.4); stroke-width: 1; }
.barre__media { stroke: rgba(255, 252, 248, 0.35); stroke-width: 0.8; stroke-dasharray: 2 3; }
.barra { fill: rgba(255, 252, 248, 0.26); }
.barra--noi { fill: var(--lime); }
.barra__valore { font-family: "Mona Sans Variable", sans-serif; font-size: 10.5px; font-weight: 600; fill: var(--carta); text-anchor: middle; font-variant-numeric: tabular-nums; }
.barra__nome { font-family: "Mona Sans Variable", sans-serif; font-size: 9px; font-weight: 480; fill: rgba(255, 252, 248, 0.66); text-anchor: middle; letter-spacing: 0.02em; }
.barre__media-nome { font-family: "Mona Sans Variable", sans-serif; font-size: 7px; fill: rgba(255, 252, 248, 0.55); letter-spacing: 0.04em; }

.grafico__centro { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--g) * 0.04); }
.cifra { display: block; overflow: hidden; padding: 0 0.04em; line-height: 1; }
.cifra__dentro {
  display: flex; align-items: baseline; justify-content: center; font-weight: 640; font-stretch: 96%;
  font-size: calc(var(--g) * 0.25); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; will-change: transform;
}
.cifra__dentro i { font-style: normal; font-weight: 420; font-size: 0.5em; margin-left: 0.04em; letter-spacing: 0; }
[data-grafico="punti"] .cifra__dentro { font-size: calc(var(--g) * 0.19); }
.cifra__dentro .cifra__in { font-family: "Newsreader Variable", Georgia, serif; font-style: italic; font-weight: 340; font-size: 0.56em; margin: 0 0.16em; }
.pillola-dato {
  position: relative; display: grid; place-items: center; height: calc(var(--g) * 0.11); min-height: 22px; border-radius: 999px;
  background: var(--lime); color: var(--inchiostro); overflow: hidden; will-change: transform, width;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 6px 14px -6px rgba(231, 231, 43, 0.45);
}
.pillola-dato__testo { position: absolute; inset: 0; display: grid; place-items: center; white-space: nowrap; font-size: clamp(10px, calc(var(--g) * 0.05), 15px); font-weight: 560; letter-spacing: 0.01em; }

.testo { order: 1; max-width: 30ch; }
.testo__capitolo { font-size: clamp(10px, 1.4vmin, 12px); letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 252, 248, 0.6); font-weight: 520; }
.testo__titolo {
  margin-top: clamp(6px, 1.4vh, 14px); font-family: "Newsreader Variable", Georgia, serif; font-weight: 380; font-variation-settings: "opsz" 60;
  font-size: clamp(26px, min(4.6vw, 7vh), 64px); line-height: 1; letter-spacing: -0.022em;
}
.testo__frase { margin-top: clamp(8px, 1.6vh, 16px); font-size: clamp(13px, 1.9vmin, 17px); line-height: 1.42; color: rgba(255, 252, 248, 0.82); max-width: 34ch; }

/* the top bar: ink on paper, paper on the slides */
.testa {
  position: absolute; left: 0; right: 0; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: clamp(14px, 3vmin, 28px) clamp(16px, 4vw, 44px); color: var(--inchiostro); transition: color 0.45s ease;
}
.palco.scuro .testa, .palco.scuro .capitoli, .palco.scuro .nota { color: var(--carta); }
.marca { display: flex; align-items: center; gap: 8px; font-size: clamp(12px, 1.8vmin, 14px); font-weight: 600; letter-spacing: -0.005em; }
.marca svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }

.condividi {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 15px; border-radius: 999px;
  color: inherit; text-decoration: none; font-size: 12px; font-weight: 560; isolation: isolate;
}
.condividi__fondo { position: absolute; inset: 0; border-radius: inherit; border: 1px solid currentColor; opacity: 0.32; z-index: -1; transition: opacity 0.3s; }
.condividi__parole { position: relative; display: block; height: 1.2em; line-height: 1.2em; overflow: hidden; }
.condividi__parole span { display: block; }
.condividi__segno { width: 11px; height: 11px; }

/* the findings row */
.capitoli {
  position: absolute; left: 50%; bottom: clamp(18px, 4.5vh, 40px); transform: translateX(-50%); z-index: 5; display: flex; gap: clamp(14px, 2.6vw, 30px);
  font-size: clamp(11px, 1.6vmin, 13px); font-weight: 520; color: var(--inchiostro); opacity: 0; white-space: nowrap; transition: color 0.45s ease;
}
.capitoli__voce { opacity: 0.42; transition: opacity 0.35s ease; padding-bottom: 7px; }
.capitoli__voce.attiva { opacity: 1; }
.capitoli__segno { position: absolute; left: 0; bottom: 0; height: 2px; width: 10px; border-radius: 2px; background: var(--lime); transform-origin: 0 50%; }
.nota {
  position: absolute; right: clamp(16px, 4vw, 44px); bottom: clamp(18px, 4.5vh, 40px); z-index: 5; max-width: 26ch; text-align: right;
  font-size: 10px; line-height: 1.4; color: var(--inchiostro); opacity: 0; transition: color 0.45s ease;
}

@media (hover: hover) {
  .condividi:hover .condividi__fondo { opacity: 0.7; }
}

/* narrow screens: the graphic above, the words below */
@media (max-width: 760px), (max-aspect-ratio: 4/5) {
  :root { --g: min(44vh, 70vw); }
  .lastra__corpo { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; align-content: center; justify-items: center; text-align: center; gap: clamp(12px, 3vh, 26px); padding: 54px 22px 52px; }
  .grafico { order: 1; }
  .testo { order: 2; max-width: 32ch; }
  .testo__titolo { font-size: clamp(22px, min(7vw, 5.6vh), 40px); }
  .testo__frase { margin: 6px auto 0; font-size: clamp(12px, min(3.6vw, 3.2vh), 15px); }
  .nota { display: none; }
  .capitoli { bottom: clamp(12px, 3vh, 28px); }
}
@media (max-height: 520px) {
  .testo__capitolo { display: none; }
  .apertura__sotto { display: none; }
}
