:root {
  --carta: #f4f1ea;      /* warm white page */
  --inchiostro: #151412; /* near-black ink */
  --grigio: #8f8a80;     /* mono labels */
  --linea: #dcd6ca;      /* hairlines */
  --accento: #e8641c;    /* drill-bit orange, used only for the lens and the mark */
  --spento: .2;          /* opacity of the names that are not in front */
  --fs: 40px;            /* name size, set by the script from the drum radius */
}

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

html { background: var(--carta); }
html.lenis, html.lenis body { height: auto; }

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

.solo-lettore { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.mono, .marchio, .conto, .righello__capo, .dato__etichetta, .dato__ramo, .coda__piede {
  font-family: 'Geist Mono Variable', 'Geist Mono', ui-monospace, monospace;
  font-size: clamp(10px, min(1vw, 1.7vh), 12px);
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ---- the stage, pinned while the drum turns ---- */
.palco {
  position: relative;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: clamp(14px, 3.2vh, 32px) clamp(16px, 3.4vw, 44px);
  overflow: hidden;
}

.testa { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.marchio { display: inline-flex; align-items: center; gap: .7em; color: var(--inchiostro); }
.marchio__segno { width: 1.6em; height: 1.6em; fill: none; stroke: var(--accento); stroke-width: 1.4; stroke-linejoin: round; }
.conto { color: var(--inchiostro); font-variant-numeric: tabular-nums; }
.conto__chiaro { color: var(--grigio); }

.corpo {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 14em);
  align-items: center;
  gap: clamp(12px, 3vw, 48px);
  min-height: 0;
}

/* ---- the ruler and its lens ---- */
.righello {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  font-size: clamp(12px, min(1.5vw, 2.1vh), 18px);
}
.righello__tacche { position: relative; width: 1.6em; height: var(--alto-righello, 300px); }
.righello__capo { color: var(--grigio); font-size: clamp(9px, min(.9vw, 1.5vh), 11px); }

.tacca {
  position: absolute;
  left: 0;
  width: .75em;
  height: 1px;
  background: var(--inchiostro);
  opacity: .2;
  transform: translateY(-50%);
  transition: width .18s cubic-bezier(.3, 0, .2, 1), opacity .18s linear, background-color .18s linear;
}
.tacca.is-m { width: .875em; opacity: .45; }
.tacca.is-l { width: 1em; opacity: .55; }
.tacca.is-xl { width: 1.25em; opacity: .65; }
.tacca.is-xxl { width: 1.5em; opacity: 1; background: var(--accento); height: 1.5px; }

/* ---- the drum ---- */
.tamburo {
  position: relative;
  height: 100%;
  min-width: 0;
  perspective: var(--prospettiva, 1200px);
}
.tamburo__fondo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
  transform: translateZ(calc(var(--raggio, 300px) * -1));
}
.tamburo__ruota {
  list-style: none;
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
}
.voce {
  position: absolute;
  left: 0;
  top: 0;
  white-space: nowrap;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  font-size: var(--fs);
  line-height: 1;
}
.voce__testo {
  display: block;
  opacity: var(--spento);
  font-weight: 430;
  letter-spacing: -.025em;
  transition: opacity .3s linear, font-weight .35s cubic-bezier(.3, 0, .2, 1), letter-spacing .35s cubic-bezier(.3, 0, .2, 1);
}
.voce.is-active .voce__testo { opacity: 1; font-weight: 620; letter-spacing: -.035em; }

.tamburo__guida {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 50%;
  height: 1px;
  background: var(--linea);
  pointer-events: none;
}

/* ---- the year and the line of work ---- */
.dato { display: grid; gap: .55em; align-content: center; justify-items: start; }
.dato__etichetta { color: var(--grigio); }
.dato__anno {
  display: inline-flex;
  font-size: calc(var(--fs) * 1.05);
  font-weight: 560;
  letter-spacing: -.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cifra { display: inline-block; height: 1em; overflow: hidden; width: .6em; }
.striscia { display: block; width: .6em; word-spacing: 100vw; line-height: 1; white-space: normal; text-align: center; will-change: transform; }
.dato__ramo { display: block; height: 1.3em; overflow: hidden; color: var(--inchiostro); }
.dato__ramo-testo { display: block; line-height: 1.3em; white-space: nowrap; }

/* ---- after the drum ---- */
.coda {
  min-height: 60vh;
  display: grid;
  align-content: center;
  gap: clamp(18px, 5vh, 48px);
  padding: 0 clamp(16px, 3.4vw, 44px) clamp(20px, 5vh, 48px);
  border-top: 1px solid var(--linea);
}
.coda__frase { font-size: min(7vw, 8vh, 72px); font-weight: 560; letter-spacing: -.035em; line-height: 1.02; }
.coda__piede { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; color: var(--grigio); }

/* ---- narrow boxes: the year goes under the drum ---- */
@media (max-width: 719px) {
  .corpo { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 8px 12px; }
  .righello { grid-row: 1; }
  .tamburo { grid-row: 1; }
  .dato { grid-column: 1 / -1; grid-row: 2; grid-template-columns: auto auto 1fr; align-items: baseline; gap: 10px; padding-bottom: 2px; }
  .dato__ramo { justify-self: end; }
}
