/* The spiral staircase of words: a made-up quarterly, Coil. The stage sticks while you scroll; the words of the spiral
   are placed in 3D by the script, which also reads the colours below for the accent. */
:root {
  --carta: #f2efe8;          /* the page */
  --inchiostro: #141414;     /* the words in front */
  --tenue: #9a958b;          /* the small text and the hairlines */
  --accento: #2b45ff;        /* the word on the reading line */
}

* {
  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;
}

/* ---------------------------------------------------------------- the stage */
.corsa {
  position: relative;
  height: 600lvh; /* 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: 3;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: clamp(16px, 3vw, 32px) clamp(16px, 4vw, 56px);
}

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

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

/* the reading line: a hairline across the middle with a tick at each end */
.livello {
  position: absolute;
  left: clamp(16px, 4vw, 56px);
  right: clamp(16px, 4vw, 56px);
  top: 50%;
  height: 1px;
  background: var(--tenue);
  opacity: 0.55;
  transform-origin: 50% 50%;
  pointer-events: none;
}

.livello__tacca {
  position: absolute;
  top: -5px;
  width: 1px;
  height: 11px;
  background: var(--tenue);
}

.livello__tacca--sx {
  left: 0;
}

.livello__tacca--dx {
  right: 0;
}

/* the spiral */
.scena {
  position: absolute;
  inset: 0;
  perspective: 1400px;
  perspective-origin: 50% 50%;
  pointer-events: none;
}

.elica {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
}

.voce {
  position: absolute;
  left: 0;
  top: 0;
  font-size: 64px; /* the script sets it */
  line-height: 1;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: -0.01em;
  will-change: transform, opacity;
  transform-origin: 0 0;
}

/* the contents page that the spiral lays down into: page numbers and hairlines, placed by the script */
.indice {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.indice__titolo {
  position: absolute;
  margin: 0;
  color: var(--tenue);
  font-size: 13px;
  font-weight: 480;
  opacity: 0;
}

.riga {
  position: absolute;
  height: 1px;
}

.riga__filo {
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: var(--tenue);
  opacity: 0.45;
  transform-origin: 0 50%;
  transform: scaleX(0);
}

.riga__pagina {
  position: absolute;
  right: 0;
  bottom: 6px;
  color: var(--tenue);
  font-size: 13px;
  font-weight: 480;
  font-variant-numeric: tabular-nums;
  opacity: 0;
}

.cenno {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(18px, 4vh, 36px);
  margin: 0;
  text-align: center;
  color: var(--tenue);
  font-size: 13px;
  font-weight: 480;
}

.dopo {
  display: grid;
  place-items: center;
  min-height: 60lvh;
  padding: 0 24px;
}

.dopo__testo {
  max-width: 30ch;
  margin: 0;
  color: var(--tenue);
  font-size: clamp(16px, 1.4vw, 19px);
  text-align: center;
  line-height: 1.5;
}
