/* The headline that tightens as it grows: one word on warm white, a thin rule under it, one accent. */
:root {
  --fondo: #f4f1ea;      /* warm white paper */
  --inchiostro: #1b1a17; /* the word */
  --accento: #d9542b;    /* the one accent: the rule once the word has settled */
  --riga: #c9c3b6;       /* the rule while it is measuring */
  --nota: #9a948a;       /* the small line of text */
}

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

html, body { height: 100%; }

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

.scena {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  cursor: pointer;
  touch-action: pan-y;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

/* the word and its rule share a centre; GSAP scales the word, the script writes the spacing on each letter */
.palco {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.parola {
  /* the full headline size: it is drawn at this size and scaled down for the small label */
  font-size: clamp(40px, min(23vw, 26vh), 168px);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transform-origin: 50% 62%;
  will-change: transform;
}

/* each letter: the script writes its weight and the space after it */
.lettera {
  display: inline-block;
}

/* the rule sits a fixed distance under the baseline; its width is written by the script every frame */
.misura {
  position: absolute;
  left: 50%;
  top: 100%;
  height: 9px;
  margin-top: clamp(6px, 1.6vh, 14px);
  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);
}
[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;
}

@media (prefers-reduced-motion: reduce) {
  .parola { will-change: auto; }
}
