:root {
  --notte: #000000;          /* the background at the start */
  --notte-luce: #191919;     /* the soft light behind the wheel on black */
  --argento: #c6c7cf;        /* the silver the background turns into */
  --argento-luce: #e5e5e5;   /* the light in the middle of the silver */
  --testo-notte: #ffffff;    /* the words on black */
  --testo-argento: #191919;  /* the words on silver */
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--notte);
  color: var(--testo-notte);
  font-family: 'Hanken Grotesk Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

p, h1, h2, ol { margin: 0; padding: 0; }

/* ---------------------------------------------------------------- the stage */
.vista {
  position: relative;
  height: 500vh;
  height: 500lvh;
}

.palco {
  --l: 0;                     /* 0 = black, 1 = silver: moved by the script */
  --testo: color-mix(in srgb, var(--testo-argento) calc(var(--l) * 100%), var(--testo-notte));
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100lvh;
  overflow: hidden;
  color: var(--testo);
  background:
    radial-gradient(70% 62% at 50% 46%,
      color-mix(in srgb, var(--argento-luce) calc(var(--l) * 100%), var(--notte-luce)),
      color-mix(in srgb, var(--argento) calc(var(--l) * 100%), var(--notte)) 78%);
}

.tela {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
}

/* ---------------------------------------------------------------- the flat wheel, only without WebGL */
.ripiego {
  display: none;
  position: absolute;
  left: 50%;
  top: 44%;
  width: min(62vw, 56vh);
  height: auto;
  transform: translate(-50%, -50%);
  fill: none;
}
.senza-webgl .ripiego { display: block; }
.senza-webgl .tela, .senza-webgl .mirino { display: none; }
.ripiego-cerchio { stroke: #0d0d0e; stroke-width: 14; }
.ripiego-interno { stroke: #2a2a2c; stroke-width: 1; }
.ripiego-raggi line { stroke: #0d0d0e; stroke-width: 1.4; }
.ripiego-mozzo { fill: #1a1a1c; stroke: #3a3a3d; }
.senza-webgl .palco { --l: 1; }

/* ---------------------------------------------------------------- the crosshair on the hub */
.mirino {
  position: absolute;
  left: 0;
  top: 0;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  pointer-events: none;
  opacity: 0;
  will-change: transform;
}
.mirino path {
  stroke: var(--testo);
  stroke-width: 1;
  fill: none;
  opacity: .55;
  vector-effect: non-scaling-stroke;
}

/* ---------------------------------------------------------------- the index of the five stops */
.indice {
  position: absolute;
  left: clamp(18px, 3vw, 40px);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 14px;
  align-items: stretch;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: 0;
}
.indice-linea {
  position: relative;
  width: 1px;
  background: color-mix(in srgb, var(--testo) 18%, transparent);
}
.indice-pieno {
  position: absolute;
  inset: 0;
  background: var(--testo);
  transform-origin: top;
  transform: scaleY(0);
}
.indice ol {
  list-style: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(18px, 6vh, 56px);
}
.indice li {
  opacity: .35;
  transition: opacity .5s ease, transform .5s cubic-bezier(.33, 0, 0, 1);
}
.indice li.ora {
  opacity: 1;
  transform: translateX(3px);
}

/* ---------------------------------------------------------------- the words of each stop */
.racconto {
  position: absolute;
  left: clamp(16px, 11vw, 170px);
  right: clamp(16px, 4vw, 60px);
  bottom: clamp(18px, 8vh, 80px);
  pointer-events: none;
}
.capitolo {
  position: absolute;
  left: 0;
  bottom: 0;
  max-width: min(17em, 34vw);
  opacity: 0;
}
.occhiello {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .6;
  margin-bottom: .9em;
}
.titolo {
  font-weight: 450;
  font-size: clamp(20px, min(2.6vw, 4.8vh), 36px);
  line-height: 1.04;
  letter-spacing: -.02em;
  text-transform: uppercase;
}
.riga {
  margin-top: .8em;
  font-size: clamp(12px, min(1.1vw, 2vh), 15px);
  line-height: 1.45;
  opacity: .72;
  max-width: 26em;
}

.nota {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: 0;
}

/* ---------------------------------------------------------------- narrow screens: the words at the bottom, no index */
@media (max-width: 720px) {
  .indice { display: none; }
  .racconto { left: 16px; right: 16px; bottom: 16px; }
  .capitolo { max-width: 22em; }
  .titolo { font-size: clamp(19px, min(6vw, 5.4vh), 30px); }
  .riga { font-size: 12px; }
  .nota { display: none; }
}
