:root {
  --fondo: #f3efe8;
  --inchiostro: #16140f;
  --grigio: #8a8478;
  --riga: rgba(22, 20, 15, 0.14);
  --accento: #c8502a;
  --accento-chiaro: #e9a27f;
  --accento-scuro: #8f3216;
  --carta: #f8f5ef;
}

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

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

.palco {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.vista {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(14px, 4.2vmin, 40px) clamp(16px, 5vw, 64px);
}

.barra {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: clamp(11px, 1.6vmin, 13px);
  letter-spacing: 0.01em;
  color: var(--grigio);
  min-height: 28px;
}

.marchio {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--inchiostro);
  font-weight: 560;
  font-stretch: 110%;
}
.marchio svg { width: 13px; height: 13px; fill: none; stroke: var(--accento); stroke-width: 2.4; stroke-linecap: square; }

.barra-destra { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- l'indice ---- */
.righe {
  list-style: none;
  margin-top: auto;
  margin-bottom: auto;
  padding-top: clamp(8px, 3vmin, 28px);
}

.riga {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: clamp(5px, 1.3vmin, 12px) 0 clamp(4px, 1.1vmin, 10px);
  cursor: pointer;
}

.riga-linea {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--riga);
  transform-origin: left center;
}
.riga:first-child::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: var(--riga);
}

.riga-nome {
  font-size: clamp(24px, min(7.2vw, 8vh), 84px);
  line-height: 1.04;
  font-weight: 520;
  font-stretch: 100%;
  letter-spacing: -0.02em;
  white-space: nowrap;
  --wdth: 100;
  --wght: 520;
  font-variation-settings: 'wdth' var(--wdth), 'wght' var(--wght);
}

.riga-dati {
  display: flex;
  gap: clamp(8px, 2vw, 28px);
  font-size: clamp(10.5px, 1.5vmin, 13px);
  color: var(--grigio);
  white-space: nowrap;
  transition: color 0.35s ease;
}
.riga-dati .num { font-variant-numeric: tabular-nums; }

.riga.attiva .riga-dati { color: var(--inchiostro); }

/* ---- il progetto ---- */
.vista--progetto { visibility: hidden; }

.indietro {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font: inherit;
  font-size: clamp(11.5px, 1.7vmin, 13.5px);
  color: var(--inchiostro);
  background: none;
  border: 0;
  cursor: pointer;
  padding: 4px 10px 4px 4px;
  margin-left: -4px;
  border-radius: 999px;
}
.indietro-freccia {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--riga);
  transition: border-color 0.3s ease, background 0.3s ease;
}
.indietro-freccia svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) {
  .indietro:hover .indietro-freccia { border-color: var(--inchiostro); background: var(--carta); }
}
.indietro.premuto .indietro-freccia { background: var(--inchiostro); color: var(--fondo); border-color: var(--inchiostro); }

.titolo-progetto {
  margin-top: clamp(8px, 2.6vmin, 26px);
  font-size: 80px;
  line-height: 0.98;
  font-weight: 600;
  letter-spacing: -0.035em;
  white-space: nowrap;
  --wdth: 125;
  --wght: 600;
  font-variation-settings: 'wdth' var(--wdth), 'wght' var(--wght);
}

.dati {
  display: flex;
  gap: clamp(14px, 4vw, 48px);
  margin-top: clamp(8px, 2vmin, 18px);
  font-size: clamp(10.5px, 1.55vmin, 13px);
}
.dati dt { color: var(--grigio); margin-bottom: 2px; }
.dati dd { color: var(--inchiostro); white-space: nowrap; }
.dati .num { font-variant-numeric: tabular-nums; }

.immagine {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: clamp(10px, 2.6vmin, 24px);
  display: flex;
  flex-direction: column;
}

.immagine-dentro {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  border-radius: 3px;
  overflow: hidden;
  background: var(--accento);
}
.immagine-dentro svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.didascalia {
  margin-top: 8px;
  font-size: clamp(10.5px, 1.5vmin, 12.5px);
  color: var(--grigio);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- i pezzi del viaggio ---- */
.volo {
  position: absolute;
  left: 0;
  top: 0;
  visibility: hidden;
  white-space: nowrap;
  line-height: 1.04;
  letter-spacing: -0.02em;
  transform-origin: left top;
  --wdth: 100;
  --wght: 520;
  font-variation-settings: 'wdth' var(--wdth), 'wght' var(--wght);
  pointer-events: none;
  z-index: 3;
}

.fessura {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 2;
}
.bordo {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1.5px;
  margin-left: -0.75px;
  background: var(--accento-scuro);
  transform-origin: center top;
}

.puntatore {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  fill: var(--inchiostro);
  stroke: var(--fondo);
  stroke-width: 1.4;
  stroke-linejoin: round;
  visibility: hidden;
  pointer-events: none;
  z-index: 5;
  filter: drop-shadow(0 2px 3px rgba(22, 20, 15, 0.22));
}

@media (max-height: 460px) {
  .riga-dati .riga-ruolo { display: none; }
}
