:root {
  --carta: #fffcf8;          /* the paper of the page */
  --giallo: #f8edd3;         /* the warm yellow the paper turns once the ring has turned */
  --inchiostro: #12110e;     /* the ink of the type */
  --fumo: rgba(18, 17, 14, 0.58);
  --filo: rgba(18, 17, 14, 0.14);
  --lime: #e7e72b;           /* the one accent: the figures and the pill */
  --ocra: #d69b3e;           /* the earth tones of the colour tiles */
  --ottanio: #337c83;
  --salvia: #5f8763;
  --argilla: #a3867d;
  --m: min(100vw, 100vh);    /* the short side of the screen: everything in the ring is measured on it */
  --titolo: 'Newsreader Variable', Georgia, serif;
  --testo: 'Mona Sans Variable', system-ui, sans-serif;
  --molla: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  background: var(--carta);
  color: var(--inchiostro);
  font-family: var(--testo);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.5s ease;
}
body.is-giallo { background: var(--giallo); }
a { color: inherit; text-decoration: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---- the top bar ---- */
.testa {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(12px, 2.4vh, 22px) clamp(14px, 3vw, 32px);
  font-size: clamp(10px, 1.6vh, 12.5px);
  letter-spacing: 0.01em;
  pointer-events: none;
}
.testa p { margin: 0; display: flex; align-items: center; gap: 0.5em; }
.testa__marca { font-weight: 640; }
.testa__marca svg { width: 1.4em; height: 1.4em; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.testa__voce { color: var(--fumo); }

.occhiello {
  margin: 0 0 0.9em;
  font-size: clamp(9px, calc(var(--m) * 0.026), 12px);
  font-weight: 560;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fumo);
}

/* ---- the opening ---- */
.apertura {
  min-height: 78vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  padding: 16vh 7vw 0;
}
.apertura__titolo {
  margin: 0;
  max-width: 14ch;
  font-family: var(--titolo);
  font-weight: 380;
  font-size: clamp(26px, min(7vw, 8.2vh), 76px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.apertura__titolo em, .voce__titolo em { font-style: italic; font-weight: 340; }
.apertura__frase {
  margin: 1.1em 0 0;
  max-width: 34ch;
  font-size: clamp(11px, min(2vw, 2.1vh), 15px);
  line-height: 1.45;
  color: var(--fumo);
}
.apertura__filo {
  display: block;
  width: 1px;
  height: clamp(40px, 12vh, 110px);
  margin-top: clamp(14px, 3.4vh, 30px);
  background: var(--inchiostro);
  transform-origin: 50% 0;
  transform: scaleY(0.34);
}

/* ---- the pinned ring ---- */
.cerchio { position: relative; }
.palco {
  position: relative;
  height: 100vh;
  overflow: clip;
}
.orbita {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  overflow: visible;
  pointer-events: none;
}
.orbita circle {
  fill: none;
  stroke: var(--filo);
  stroke-width: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  vector-effect: non-scaling-stroke;
}
.anello {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
}
.tessera {
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
  width: calc(var(--m) * var(--l, 0.12));
  aspect-ratio: var(--r, 1.5);
  transform: scale(0);
}
.tessera__galla { position: absolute; inset: 0; }
.tessera__dentro {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 2px;
  transition: transform 0.45s var(--molla), box-shadow 0.45s ease;
}
.tessera--foto .tessera__dentro {
  background: #d8d2c6;
  box-shadow: 0 1px 1px rgba(18, 17, 14, 0.08), 0 6px 14px -6px rgba(18, 17, 14, 0.28), 0 22px 40px -22px rgba(18, 17, 14, 0.4);
}
.tessera--foto .tessera__dentro::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 252, 248, 0.22);
  background: linear-gradient(160deg, rgba(255, 252, 248, 0.16), transparent 42%);
  pointer-events: none;
}
.tessera img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scale(1.06);
  transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.tessera--colore .tessera__dentro { mix-blend-mode: multiply; }
.tessera--colore .tessera__dentro::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='80' height='80' filter='url(%23g)' opacity='0.5'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  opacity: 0.6;
}
.tessera--ocra .tessera__dentro { background: var(--ocra); }
.tessera--ottanio .tessera__dentro { background: var(--ottanio); }
.tessera--salvia .tessera__dentro { background: var(--salvia); }
.tessera--argilla .tessera__dentro { background: var(--argilla); }

/* the label under a photo: shown on hover, it holds the place and the share of people who can walk there */
.tessera__nota {
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.38em 0.4em 0.38em 0.75em;
  border-radius: 99px;
  background: var(--inchiostro);
  color: var(--carta);
  font-size: clamp(9px, calc(var(--m) * 0.022), 11.5px);
  font-weight: 540;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -4px) scale(0.86);
  transform-origin: 50% 0;
  transition: opacity 0.2s ease, transform 0.4s var(--molla);
  pointer-events: none;
  z-index: 2;
}
.tessera__nota b {
  font-weight: 640;
  font-variant-numeric: tabular-nums;
  padding: 0.12em 0.5em;
  border-radius: 99px;
  background: var(--lime);
  color: var(--inchiostro);
}
@media (hover: hover) and (pointer: fine) {
  .tessera--foto { cursor: default; }
  .tessera--foto:hover { z-index: 3; }
  .tessera--foto:hover .tessera__dentro {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 1px 1px rgba(18, 17, 14, 0.08), 0 12px 22px -8px rgba(18, 17, 14, 0.34), 0 34px 60px -26px rgba(18, 17, 14, 0.5);
  }
  .tessera--foto:hover img { transform: scale(1); }
  .tessera--foto:hover .tessera__nota { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* the words in the middle of the ring */
.centro {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--m) * 0.5);
  transform: translate(-50%, -50%);
  display: grid;
  text-align: center;
  pointer-events: none;
}
.voce { grid-area: 1 / 1; align-self: center; }
.voce { position: relative; }
.voce .occhiello { opacity: 0; position: absolute; left: 0; right: 0; bottom: 100%; } /* out of the flow, so the headline itself sits on the centre of the ring */
.voce__titolo {
  margin: 0;
  font-family: var(--titolo);
  font-weight: 380;
  font-size: calc(var(--m) * 0.064);
  line-height: 1.06;
  letter-spacing: -0.018em;
}
.maschera { display: inline-block; overflow: clip; overflow-clip-margin: 0.2em; padding-bottom: 0.08em; margin-bottom: -0.08em; vertical-align: top; }
.parola { display: inline-block; opacity: 0; }

/* ---- the close ---- */
.chiusura {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8vh 7vw 12vh;
  gap: clamp(14px, 3vh, 26px);
}
.chiusura__frase {
  margin: 0;
  max-width: 22ch;
  font-family: var(--titolo);
  font-size: clamp(19px, min(4.4vw, 5vh), 40px);
  line-height: 1.12;
  letter-spacing: -0.015em;
}
.chiusura__nota { margin: 0; font-size: clamp(10px, min(1.8vw, 1.9vh), 13px); color: var(--fumo); }

.pillola {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  height: 2.9em;
  padding: 0 1.15em 0 1.35em;
  border-radius: 99px;
  font-size: clamp(12px, min(2vw, 2.2vh), 15px);
  font-weight: 560;
  isolation: isolate;
}
.pillola__fondo {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--lime);
  box-shadow: inset 0 0 0 1px rgba(18, 17, 14, 0.12), 0 8px 18px -10px rgba(18, 17, 14, 0.45);
  transition: transform 0.5s var(--molla);
}
.pillola__testo { display: grid; overflow: clip; line-height: 1.25; height: 1.25em; }
.pillola__riga { grid-area: 1 / 1; display: block; transition: transform 0.45s var(--molla); }
.pillola__riga + .pillola__riga { transform: translateY(100%); }
.pillola__freccia { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.45s var(--molla); }
@media (hover: hover) and (pointer: fine) {
  .pillola:hover .pillola__fondo { transform: scale(1.05, 1.1); }
  .pillola:hover .pillola__riga { transform: translateY(-100%); }
  .pillola:hover .pillola__riga + .pillola__riga { transform: translateY(0); transition-delay: 0.02s; }
  .pillola:hover .pillola__freccia { transform: translateX(4px); }
}
.pillola:active .pillola__fondo { transform: scale(0.96); }

.grana {
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (prefers-reduced-motion: reduce) {
  body, .tessera__dentro, .tessera img, .tessera__nota, .pillola__fondo, .pillola__riga, .pillola__freccia { transition: none; }
}
