/* The index that comes into focus: the project index of a made-up designer. Three columns on a light grey: the facts
   and the palette on the left, the cover in the middle, the column of projects on the right, which the script slides
   up and down. */
:root {
  --fondo: #ececec;        /* the grey of the page */
  --inchiostro: #181818;   /* the text */
  --tenue: #8a8a8a;        /* the small text */
  --passo: 132px;          /* the height of one project in the column */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

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

.indice {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(16px, 3vw, 48px);
  height: 100%;
  padding: 64px clamp(16px, 2vw, 28px) 48px;
}

.testata {
  position: absolute;
  inset: 0 0 auto;
  display: flex;
  justify-content: space-between;
  padding: 18px clamp(16px, 2vw, 28px);
}

.firma,
.sopra {
  margin: 0;
  font-size: 12px;
}

.firma {
  font-family: 'Bricolage Grotesque Variable', system-ui, sans-serif;
  font-stretch: 75%;
  font-weight: 750;
  font-size: 22px;
  letter-spacing: -0.02em;
}

/* ---------------------------------------------------------------- the facts */
.fatti {
  display: grid;
  gap: 28px;
  font-size: 12px;
}

.fatti dl {
  display: grid;
  gap: 14px;
  margin: 0;
}

.fatti dl > div {
  display: grid;
  grid-template-columns: 90px 1fr;
}

.fatti dt,
.tavolozza__nome {
  margin: 0;
  color: var(--tenue);
}

.fatti dd {
  margin: 0;
}

.tavolozza {
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: center;
}

.tavolozza__campioni {
  display: flex;
  gap: 4px;
}

.tavolozza__campioni span {
  width: 22px;
  height: 14px;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

/* ---------------------------------------------------------------- the cover */
.copertina {
  margin: 0;
  aspect-ratio: 4492 / 3658;
}

.copertina__tela {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 3px;
}

/* ---------------------------------------------------------------- the column of projects */
.colonna {
  position: relative;
  height: 100%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
}

.voci {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* every project sits at the middle of the column; the script moves each one up or down by steps */
.voce {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: var(--passo);
  margin-top: calc(var(--passo) / -2);
}

.voce button {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  width: 100%;
  height: 100%;
  padding: 0 12px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
}

.voce__tipo {
  font-size: 11px;
  color: var(--tenue);
}

.voce__nome {
  font-family: 'Bricolage Grotesque Variable', system-ui, sans-serif;
  font-stretch: 75%;
  font-weight: 700;
  font-size: 26px;
  line-height: 0.95;
  text-transform: uppercase;
}

/* the short rule under the name is drawn, not typed */
.voce__nome::after {
  content: '';
  display: block;
  width: 14px;
  height: 1px;
  margin: 8px auto 0;
  background: currentColor;
}

.voce__frase {
  max-width: 30ch;
  font-size: 12px;
  line-height: 1.35;
}

.voce button:focus-visible {
  outline: 2px solid var(--inchiostro);
  outline-offset: -4px;
}

.aiuto {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  margin: 0;
  color: var(--tenue);
  font-size: 11px;
  text-align: center;
}

@media (max-width: 767px) {
  :root {
    --passo: 120px;
  }

  .indice {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
    align-items: start;
    gap: 18px;
    padding-top: 64px;
  }

  .copertina {
    grid-row: 1;
  }

  .fatti {
    grid-row: 2;
  }

  .colonna {
    grid-row: 3;
  }
}
