:root {
  --fondo: #ecebea;      /* the warm light grey of the page */
  --inchiostro: #0c1114; /* the ink */
  --accento: #52667e;    /* the one accent: the brackets of the current page */
  --linea: rgba(12, 17, 20, 0.12);
  --mono: "Red Hat Mono Variable", ui-monospace, monospace;
  --sans: "Manrope Variable", system-ui, sans-serif;
  --testo-voce: clamp(11px, 0.62rem + 0.32vw, 14px);
}

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

html, body { height: 100%; }

body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.palco {
  position: relative;
  height: 100vh;
  min-height: 320px;
  overflow: hidden;
  isolation: isolate;
}

/* the hairline grid behind everything, as faint as on the watchmaker's loader */
.griglia {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(to right, rgba(12, 17, 20, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(12, 17, 20, 0.03) 1px, transparent 1px);
  background-size: calc(100% / 6) 100%, 100% calc(100% / 4);
  background-position: -0.5px 0, 0 -0.5px;
  mask-image: radial-gradient(120% 90% at 50% 45%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 45%, #000 40%, transparent 100%);
}

/* ---------- the header ---------- */
.testata {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: clamp(14px, 3.2vh, 26px) clamp(16px, 3.4vw, 40px);
}

.testata__riga {
  position: absolute;
  left: clamp(16px, 3.4vw, 40px);
  right: clamp(16px, 3.4vw, 40px);
  bottom: 0;
  height: 1px;
  background: var(--linea);
  transform-origin: 50% 50%;
}

.gruppo {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.6vw, 40px);
  min-width: 0;
}
.gruppo--dx { justify-content: flex-end; }

.voce, .apri {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: var(--testo-voce);
  font-weight: 450;
  --sp: 0.02em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  padding: 10px 2px;
  -webkit-tap-highlight-color: transparent;
}

/* the element GSAP presses; the brackets move with a CSS variable */
.voce__corpo {
  display: inline-flex;
  align-items: center;
  --g: 0.55;
}
.par {
  display: inline-block;
  color: var(--inchiostro);
  opacity: calc(1 - var(--g) * 1.1);
  will-change: transform;
}
.par--sx { transform: translateX(calc(var(--g) * -1ch)); }
.par--dx { transform: translateX(calc(var(--g) * 1ch)); }
.voce.attiva .par { color: var(--accento); }

.lettere { display: inline-flex; gap: var(--sp, 0); padding: 0 0.3ch; }
.marchio__sotto .lettere, .mono .lettere { padding: 0; }
.l { display: inline-block; width: 1ch; text-align: center; letter-spacing: 0; }
.l--spazio { width: 1ch; }

.marchio {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 4px 6px;
}
.marchio__nome {
  display: inline-flex;
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(16px, 0.9rem + 0.7vw, 24px);
  gap: 0.34em; /* a gap, not letter-spacing: the tracking after the last letter would push the name off centre */
  line-height: 1;
}
.marchio__nome .m { display: inline-block; }
.marchio__sotto {
  font-family: var(--mono);
  font-size: clamp(8px, 0.45rem + 0.2vw, 10px);
  --sp: 0.24em;
  text-transform: uppercase;
  opacity: 0.6;
  display: inline-flex;
}

/* [+] Menu: the plus is drawn, its upright folds away into a minus */
.apri { gap: 0.6ch; }
.apri__par { display: inline-block; }
.apri__segno {
  width: 1ch;
  height: 1ch;
  margin: 0 0.15ch;
  overflow: visible;
}
.apri__segno path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.apri__vert { transform-box: fill-box; transform-origin: 50% 50%; }
.apri__testo { display: inline-flex; }
.apri__corpo { display: inline-flex; align-items: center; }

/* ---------- the opening under the header ---------- */
.apertura {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
  gap: clamp(10px, 2.4vh, 22px);
  padding: 0 16px;
  pointer-events: none;
}
.mono {
  font-family: var(--mono);
  font-size: clamp(10px, 0.55rem + 0.25vw, 13px);
  --sp: 0.06em;
  text-transform: uppercase;
  display: inline-flex;
  justify-content: center;
  white-space: nowrap;
}
.mono--piano { opacity: 0.55; text-transform: none; --sp: 0.02em; }
.titolo {
  font-family: var(--sans);
  font-weight: 400;
  font-size: min(11vw, 13vh, 128px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  display: grid;
  justify-items: center;
}
.titolo .riga { display: block; overflow: hidden; padding: 0 0.04em 0.06em; }
.titolo .riga > span { display: block; }

.scorri {
  position: absolute;
  left: 50%;
  bottom: clamp(14px, 3.4vh, 28px);
  transform: translateX(-50%);
  opacity: 0.55;
}

/* ---------- the full list behind [+] Menu ---------- */
.indice {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: var(--fondo);
  padding: calc(clamp(14px, 3.2vh, 26px) * 2 + 44px) clamp(16px, 3.4vw, 40px) clamp(16px, 4vh, 36px);
  display: flex;
  align-items: flex-end;
  clip-path: inset(0% 0% 100% 0%);
  visibility: hidden;
}
.indice__lista { list-style: none; width: 100%; }
.indice__voce { border-top: 1px solid var(--linea); }
.indice__voce:last-child { border-bottom: 1px solid var(--linea); }
.indice__voce a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(4px, 1.1vh, 12px) 0;
}
.indice__nome {
  display: block;
  overflow: hidden;
  font-weight: 450;
  font-size: min(9vw, 8.4vh, 96px);
  letter-spacing: -0.04em;
  line-height: 1.02;
  padding-bottom: 0.04em;
}
.indice__nome > span { display: block; }
.indice__nome { will-change: transform; }
.indice__tag { opacity: 0.55; }
.indice__voce.attiva .indice__tag { opacity: 1; color: var(--accento); }

@media (hover: hover) {
  .indice__voce a:hover .indice__tag { opacity: 1; }
}

/* the outer links go away on narrow screens: there [+] Menu is the way in */
@media (max-width: 860px) {
  .voce--lontana { display: none; }
}
@media (max-width: 620px) {
  .gruppo--sx .voce { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .par { transition: none; }
}
