:root {
  --fondo: #020a19;
  --chiaro: #d5e0ff;
  --vetro: rgba(213, 224, 255, 0.05);
  --linea: rgba(213, 224, 255, 0.1);
  --profondo: #052261;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--fondo); color: var(--chiaro); }
body {
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }

/* the run: six chapters of scroll under one still stage */
.corsa { position: relative; height: calc(var(--capitoli, 6) * 85vh + 100vh); }
.palco {
  position: sticky; top: 0;
  height: 100vh; height: 100lvh; max-height: 100vh;
  overflow: hidden;
}

/* the horizon behind: a floor of thin lines running to a vanishing point */
.orizzonte { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.orizzonte line { stroke: var(--chiaro); vector-effect: non-scaling-stroke; }
.orizzonte .bagliore { fill: url(#bagliore); }

.testa {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(14px, 2.6vh, 28px) clamp(16px, 2.8vw, 40px);
  z-index: 3;
}
.marchio { display: flex; align-items: center; gap: 8px; font-weight: 700; font-stretch: 112%; letter-spacing: 0.22em; text-transform: uppercase; font-size: 13px; }
.marchio svg { width: 15px; height: 15px; fill: var(--chiaro); }
.testa__voci { display: flex; gap: 22px; font-family: 'JetBrains Mono Variable', monospace; font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; }
.testa__voci a { opacity: 0.6; transition: opacity 0.33s linear; }
@media (hover: hover) { .testa__voci a:hover { opacity: 1; } }

/* the index on the left: a thin bar marks the open chapter */
.indice {
  position: absolute; left: clamp(16px, 2.8vw, 40px); top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 2px;
  z-index: 3;
}
.voce {
  position: relative; display: flex; align-items: center;
  padding: 9px 0 9px 14px;
  font-family: 'JetBrains Mono Variable', monospace;
  font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase;
  background: none; border: 0; color: var(--chiaro); cursor: pointer;
  text-align: left; white-space: nowrap;
}
.voce:focus-visible { outline: 1px solid var(--linea); outline-offset: 2px; }
.voce__barra {
  position: absolute; left: 0; top: 50%;
  width: 2px; height: 14px; margin-top: -7px;
  background: var(--chiaro);
  transform-origin: 50% 50%;
}
.voce__nome { display: block; min-width: 9ch; }

/* the chapter */
.contenuto {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 72px clamp(16px, 6vw, 80px) 64px;
  text-align: center;
  z-index: 2;
  pointer-events: none;
}
.etichetta {
  display: none;
  font-family: 'JetBrains Mono Variable', monospace;
  font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase;
  margin-bottom: 18px;
}
.titolo {
  font-weight: 700; font-stretch: 108%;
  text-transform: uppercase;
  font-size: clamp(24px, min(4.4vw, 7.2vh), 64px);
  line-height: 1; letter-spacing: 0.04em;
  margin-bottom: clamp(12px, 2.6vh, 26px);
  text-shadow: 0 0 28px rgba(120, 160, 255, 0.18);
}
.titolo .char { will-change: opacity; }
.testo {
  max-width: 34em;
  font-weight: 300; font-size: clamp(13px, min(1.15vw, 2.1vh), 16px);
  line-height: 1.6; letter-spacing: -0.01em;
  opacity: 0.6;
  margin-bottom: clamp(16px, 3.4vh, 34px);
}
.azione { pointer-events: auto; min-height: 52px; display: flex; }
.azione.vuota .smussato { display: none; }

/* the bevelled button: glass behind, the edge drawn in SVG, two trails of light on it */
.smussato {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 18px 28px;
  font-weight: 700; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  background: var(--vetro);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  clip-path: var(--taglio, none);
}
.smussato__bordo { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 2; }
.smussato__bordo path { fill: none; }
.smussato__base { stroke: var(--linea); stroke-width: 2; }
.smussato__scia { stroke: var(--chiaro); stroke-width: 1; stroke-linecap: round; }
.smussato__alone { stroke: rgba(160, 190, 255, 0.55); stroke-width: 4; stroke-linecap: round; filter: blur(3px); }
.smussato__lampo { position: absolute; inset: 0; background: var(--chiaro); opacity: 0; clip-path: var(--taglio, none); }
.smussato__icona { width: 11px; height: 11px; fill: var(--chiaro); position: relative; z-index: 1; }
.smussato__testo { position: relative; z-index: 1; min-width: 8ch; text-align: left; }
.smussato:focus-visible { outline: 1px solid var(--chiaro); outline-offset: 4px; }

.piede {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: clamp(12px, 2.4vh, 26px) clamp(16px, 2.8vw, 40px);
  font-family: 'JetBrains Mono Variable', monospace;
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  z-index: 3;
}
.piede__scorri { display: flex; align-items: center; gap: 8px; opacity: 0.6; }
.piede__scorri svg { width: 8px; height: 11px; fill: none; stroke: var(--chiaro); stroke-width: 1.2; }
.piede__ora { opacity: 0.6; }
.piede__ora b { font-weight: 500; opacity: 1; color: var(--chiaro); display: inline-block; min-width: 8ch; text-align: left; }

/* on the phone, as on the original: the index becomes the label above the title, the chapter sits low and to the left */
@media (max-width: 640px) {
  .indice, .testa__voci { display: none; }
  .etichetta { display: block; }
  .contenuto { align-items: flex-start; justify-content: flex-end; text-align: left; padding: 64px 18px 52px; }
  .titolo { font-size: clamp(22px, min(8.4vw, 7vh), 40px); }
  .testo { font-size: 13px; line-height: 1.55; max-width: none; }
  .smussato { padding: 15px 22px; }
  .azione { min-height: 46px; }
}
@media (max-height: 460px) {
  .testo { line-height: 1.45; }
}
