:root {
  --fondo: #0e0d0c;          /* the stage: almost black, a touch warm */
  --inchiostro: #ece7df;     /* names, ticks, numbers */
  --tenue: #8a847b;          /* labels */
  --spento: rgba(236, 231, 223, 0.16); /* the ticks still to fill */
  --accento: #f0732a;        /* the one accent: the needle and the symbol */
  --cornice: #1a1816;        /* the specimen frames */
  --D: min(44vw, 60vh);      /* the dial's diameter */
}

* {
  box-sizing: border-box;
}

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

body {
  overflow-x: hidden;
}

.etichetta,
.didascalia,
.lettura,
.dato .rullo {
  font-family: 'Geist Mono Variable', ui-monospace, monospace;
}

.etichetta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 11px;
  font-weight: 450;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.etichetta--tenue {
  color: var(--tenue);
}

.marchio {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  font-variation-settings: 'wdth' 112;
  letter-spacing: -0.01em;
}

.marchio__segno {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.giu {
  width: 10px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ------------------------------------------------------------ the opening and the end */
.apertura {
  display: grid;
  align-content: center;
  gap: clamp(12px, 3vh, 24px);
  height: 90vh;
  height: 90lvh;
  padding: 24px clamp(18px, 6vw, 80px);
}

.apertura__titolo {
  margin: 0;
  font-size: clamp(34px, min(8vw, 13vh), 112px);
  font-weight: 560;
  font-variation-settings: 'wdth' 88;
  line-height: 0.96;
  letter-spacing: -0.035em;
}

.coda {
  display: grid;
  place-items: center;
  height: 30vh;
}

/* ------------------------------------------------------------ the stage */
.minerali {
  position: relative;
  height: 420vh;
}

.palco {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    'testa testa testa'
    'nomi centro dati'
    'piede piede piede';
  height: 100vh;
  height: 100lvh;
  padding: clamp(16px, 4vh, 36px) clamp(18px, 4vw, 56px);
  overflow: hidden;
}

.testa {
  grid-area: testa;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* the names: the one being shown at full strength, the others at .15 */
.nomi {
  grid-area: nomi;
  align-self: center;
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nome {
  font-size: clamp(26px, min(4.4vw, 7.6vh), 68px);
  --w: 92;
  --p: 520;
  font-weight: var(--p);
  font-variation-settings: 'wdth' var(--w);
  line-height: 1.04;
  letter-spacing: -0.03em;
  opacity: 0.15;
  white-space: nowrap;
}

/* ------------------------------------------------------------ the dial and the carousel */
.centro {
  grid-area: centro;
  position: relative;
  align-self: center;
  width: var(--D);
  height: var(--D);
  margin: 0 clamp(12px, 3vw, 40px);
}

.quadrante,
.quadrante svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.tacche line {
  stroke-width: 0.5;
  stroke-linecap: round;
}

.tacche--spente line {
  stroke: var(--spento);
}

.tacche--piene {
  --angle: 0deg;
  -webkit-mask-image: conic-gradient(from 0deg at 50% 50%, #fff 0deg, #fff var(--angle), transparent var(--angle));
  mask-image: conic-gradient(from 0deg at 50% 50%, #fff 0deg, #fff var(--angle), transparent var(--angle));
}

.tacche--piene line {
  stroke: var(--inchiostro);
}

.tacche line.lunga {
  stroke-width: 0.7;
}

.ago {
  overflow: visible;
}

.ago path {
  fill: none;
  stroke: var(--accento);
  stroke-width: 1.1;
  stroke-linecap: round;
}

.giostra {
  position: absolute;
  top: 0;
  left: 50%;
  width: calc(var(--D) * 1.56);
  height: 100%;
  margin-left: calc(var(--D) * -0.78);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 26%, #000 74%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 26%, #000 74%, transparent);
  pointer-events: none;
}

.giostra__binario {
  position: absolute;
  top: 0;
  left: 50%;
  display: flex;
  width: calc(var(--D) * 0.66 * 5);
  height: 100%;
  margin-left: calc(var(--D) * -0.33);
}

.campione {
  display: grid;
  place-items: center;
  flex: 0 0 20%;
  margin: 0;
}

.campione__foto {
  position: relative;
  width: calc(var(--D) * 0.44);
  height: calc(var(--D) * 0.56);
  overflow: hidden;
  border-radius: calc(var(--D) * 0.03);
  background: #000;
  box-shadow: 0 0 0 1px rgba(236, 231, 223, 0.07), 0 18px 40px -18px rgba(0, 0, 0, 0.9);
}

.campione__foto img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* the copper specimen sits low in its photo: a closer crop */
.campione__foto--vicino img {
  transform: scale(1.32);
  transform-origin: 50% 78%;
}

/* a soft band of light that slides across the specimen when it lands in the middle */
.campione__riflesso {
  position: absolute;
  inset: -20% -60%;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 246, 232, 0.16) 49%, rgba(255, 246, 232, 0.05) 53%, transparent 60%);
  mix-blend-mode: screen;
  transform: translateX(-60%);
  opacity: 0;
}

/* ------------------------------------------------------------ symbol, number, caption */
.dati {
  grid-area: dati;
  align-self: center;
  justify-self: end;
  display: grid;
  gap: clamp(12px, 3vh, 26px);
  z-index: 2;
}

.dato {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.rullo {
  display: block;
  height: 1.15em;
  overflow: hidden;
  line-height: 1.15;
}

.dato .rullo {
  font-size: clamp(22px, min(3vw, 5.4vh), 44px);
  font-weight: 380;
  letter-spacing: -0.02em;
}

.rullo__colonna {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.rullo__colonna > span {
  display: block;
  height: 1.15em;
  white-space: nowrap;
}

.rullo__colonna--simbolo {
  color: var(--accento);
}

.piede {
  grid-area: piede;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.didascalia,
.lettura {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--tenue);
}

.rullo--riga .rullo__colonna {
  align-items: flex-start;
}

.lettura {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--inchiostro);
  font-variant-numeric: tabular-nums;
}

.lettura__n b {
  display: inline-block;
  min-width: 3ch;
  font-weight: inherit;
  text-align: right;
}

.lettura__riga {
  width: 18px;
  height: 1px;
  background: var(--tenue);
}

/* ------------------------------------------------------------ narrow screens: the names become a row */
@media (max-width: 719px) {
  :root {
    --D: min(60vw, 46vh);
  }

  .palco {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto auto;
    grid-template-areas:
      'testa'
      'centro'
      'nomi'
      'piede';
    padding: 14px 16px;
  }

  .testa .etichetta {
    display: none;
  }

  .dati {
    grid-area: testa;
    grid-auto-flow: column;
    gap: 14px;
    align-self: center;
  }

  .dato {
    gap: 0;
  }

  .dato .etichetta {
    font-size: 9px;
  }

  .dato .rullo {
    font-size: 18px;
  }

  .centro {
    justify-self: center;
    margin: 6px 0;
  }

  .nomi {
    display: flex;
    gap: 16px;
    justify-self: start;
    width: max-content;
    margin: 4px 0 8px;
  }

  .nome {
    font-size: 20px;
  }

  .didascalia,
  .lettura {
    font-size: 10px;
  }
}
