/* The word on the planet's ring: a made-up planetarium, Halo. The stage sticks while you scroll; the ring, the planet
   and the letters are drawn by the script, which also reads the colours below. */
:root {
  --carta: #f3f0e9;          /* the page, and the planet's face */
  --inchiostro: #151515;     /* the letters in front and the lines */
  --tenue: #9b968c;          /* the small text, the stars and the back of the ring */
  --accento: #e2471b;        /* the letter passing the front of the ring */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  background: var(--carta);
  color: var(--inchiostro);
  font-family: 'Archivo Variable', 'Archivo', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- the stage */
.corsa {
  position: relative;
  height: 520lvh; /* the script sets the real height from RIDE */
}

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

.testa {
  position: absolute;
  inset: 0 0 auto;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: clamp(16px, 3vw, 32px) clamp(16px, 4vw, 56px);
}

.marchio {
  color: var(--inchiostro);
  font-size: 20px;
  font-weight: 660;
  font-stretch: 82%;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.testa__nota {
  margin: 0;
  color: var(--tenue);
  font-size: 13px;
  font-weight: 460;
}

/* the stars: thin crosses, drawn by the script */
.cielo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.cielo line {
  stroke: var(--tenue);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

/* the planet and its ring */
.scena {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.pianeta {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.anello {
  fill: none;
  stroke: var(--inchiostro);
  stroke-width: 1;
  stroke-linecap: round;
}

.anello--fine {
  stroke-width: 0.6;
}

.pianeta__disco {
  fill: var(--carta);
}

.pianeta__bordo {
  fill: none;
  stroke: var(--inchiostro);
  stroke-width: 1.2;
}

.banda {
  fill: none;
  stroke: var(--tenue);
  stroke-width: 0.8;
}

.pianeta__ombra {
  fill: var(--inchiostro);
  opacity: 0.09;
}

/* the reading tick under the front of the ring */
.lettura {
  stroke: var(--accento);
  stroke-width: 1.4;
  stroke-linecap: round;
}

/* the letters, placed on the ring every frame */
.lettere {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
}

.lettera {
  position: absolute;
  left: 0;
  top: 0;
  line-height: 1;
  white-space: pre;
  will-change: transform, opacity;
  font-variation-settings: normal;
  /* a halo of paper around each letter, so the ring's hairlines stop short of it */
  text-shadow: 0 0 2px var(--carta), 0 0 3px var(--carta), 0 0 4px var(--carta);
}

/* the headline that lands under the planet once the ring is open */
.titolo {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(56px, 12vh, 104px);
  z-index: 3;
  text-align: center;
  pointer-events: none;
}

.titolo__riga {
  margin: 0;
  font-size: clamp(22px, min(5.2vw, 6.4vh), 54px);
  font-weight: 300;
  font-stretch: 78%;
  letter-spacing: -0.01em;
  line-height: 1.05;
}

.titolo__nota {
  margin: 8px 0 0;
  color: var(--tenue);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* the live readout and the hint */
.lettura-dati {
  position: absolute;
  left: clamp(16px, 4vw, 56px);
  bottom: clamp(14px, 3vh, 28px);
  z-index: 4;
  display: flex;
  gap: 16px;
  margin: 0;
  color: var(--tenue);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.lettura-dati b {
  color: var(--inchiostro);
  font-weight: 560;
}

.cenno {
  position: absolute;
  right: clamp(16px, 4vw, 56px);
  bottom: clamp(14px, 3vh, 28px);
  z-index: 4;
  margin: 0;
  color: var(--tenue);
  font-size: 12px;
}

.dopo {
  display: grid;
  place-items: center;
  min-height: 26vh;
  padding: 28px clamp(16px, 4vw, 56px);
  border-top: 1px solid rgba(21, 21, 21, 0.12);
}

.dopo__testo {
  max-width: 30ch;
  margin: 0;
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 340;
  font-stretch: 86%;
  line-height: 1.25;
  text-align: center;
}

@media (max-width: 480px) {
  .testa__nota {
    font-size: 12px;
  }

  .cenno {
    display: none;
  }
}
