/* The word that stretches when you scroll fast: one word on warm white, a thin rule under it, a hairline ruler at the
   edge, one accent. */
:root {
  --fondo: #f4f1ea;      /* warm white paper */
  --inchiostro: #1b1a17; /* the word */
  --accento: #d9542b;    /* the one accent: the rule at full speed */
  --riga: #c9c3b6;       /* the rule and the ruler at rest */
  --nota: #9a948a;       /* the small line of text */
  --schermo: 100vh;
}
@supports (height: 100lvh) {
  :root { --schermo: 100lvh; }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--fondo); }
body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* the page that runs: long enough for a good fling */
.corsa {
  position: relative;
  height: 700vh;
}

.palco {
  position: sticky;
  top: 0;
  height: 100vh;
  height: var(--schermo);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: grab;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.palco.premuto { cursor: grabbing; }

/* the ruler: short ticks every 12px, a longer one every 60px; the script moves it with the page */
.righello {
  position: absolute;
  top: 0;
  bottom: 0;
  right: clamp(8px, 2.6vw, 28px);
  width: 13px;
  opacity: 0;
  background-image:
    linear-gradient(var(--riga) 0 1px, transparent 1px),
    linear-gradient(var(--riga) 0 1px, transparent 1px);
  background-size: 7px 12px, 13px 60px;
  background-position: right 0 top 0, right 0 top 0;
  background-repeat: repeat-y;
  -webkit-mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
}

.gruppo {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.parola {
  /* the script measures the size so the word fits even fully stretched */
  font-size: 96px;
  font-weight: 640;
  line-height: 1;
  white-space: nowrap;
}

/* each letter: GSAP moves the outer span, the script writes the width and weight on the inner one */
.lettera {
  display: inline-block;
  will-change: transform;
}
.lettera > span {
  display: inline-block;
}

.misura {
  position: absolute;
  left: 50%;
  top: 100%;
  height: 9px;
  margin-top: clamp(8px, 2vh, 16px);
  transform: translateX(-50%);
}
.linea {
  position: absolute;
  left: 0;
  right: 0;
  top: 4px;
  height: 1px;
  background: var(--riga);
  transform-origin: 50% 50%;
}
.tacca {
  position: absolute;
  top: 0;
  width: 1px;
  height: 9px;
  background: var(--riga);
  transform-origin: 50% 50%;
}
[data-tick-a] { left: 0; }
[data-tick-b] { right: 0; }

.nota {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(14px, 5vh, 40px);
  text-align: center;
  font-size: clamp(10px, min(2.8vw, 2.4vh), 13px);
  letter-spacing: 0.02em;
  color: var(--nota);
  opacity: 0;
}
