/* The cards that cross over: minimal. Warm paper, a brown ink, and one accent, the sand of a single card.
   Archivo, a variable sans with a wide width axis, for everything; the card titles widen in the middle. */
:root {
  --fondo: #f4f1ea;        /* the page */
  --carta: #fbfaf6;        /* the cards */
  --inchiostro: #2c2824;   /* the text and the drawings */
  --tenue: #8a8278;        /* the small print */
  --sabbia: #a89474;       /* the one sand card */
  --filo: rgba(44, 40, 36, 0.18); /* the hairlines */
  --raggio: 18px;          /* the corners of the cards */
}

* {
  box-sizing: border-box;
}

html {
  background: var(--fondo);
}

body {
  margin: 0;
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: 'Archivo Variable', 'Archivo', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.pagina {
  overflow-x: clip;
}

.apertura {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 72vh;
  padding: 10vh 6vw 6vh;
}

.occhiello,
.palco__nota {
  margin: 0 0 18px;
  color: var(--tenue);
  font-size: 13px;
  letter-spacing: 0.02em;
}

.apertura__titolo {
  max-width: 11ch;
  margin: 0;
  font-size: clamp(42px, 7.6vw, 110px);
  font-weight: 560;
  font-stretch: 78%;
  line-height: 0.94;
  letter-spacing: -0.025em;
}

.scendi {
  margin: 40px 0 0;
  color: var(--tenue);
  font-size: 13px;
}

/* the section is tall; inside it the stage stays still while the row slides */
.vantaggi {
  position: relative;
  height: 400vh;
}

.palco {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100lvh;
  overflow: hidden;
  border-top: 1px solid var(--filo);
}

.palco__nota {
  position: absolute;
  top: 28px;
  left: 6vw;
  margin: 0;
}

/* the rail is centred by CSS, the row inside it is moved by GSAP */
.binario {
  position: absolute;
  top: 50%;
  left: 0;
  translate: 0 -50%;
}

.fila {
  display: flex;
  align-items: center;
  gap: 4vw;
  width: max-content;
  padding: 0 24vw 0 86vw;
}

.carta {
  flex: none;
  display: grid;
  grid-template-rows: 1fr auto auto;
  width: clamp(250px, 28vw, 400px);
  height: clamp(320px, 52vh, 500px);
  padding: 22px 24px 26px;
  border-radius: var(--raggio);
  background: var(--carta);
  box-shadow: inset 0 0 0 1px var(--filo);
  will-change: transform;
}

.carta--sabbia {
  background: var(--sabbia);
  box-shadow: none;
}

.carta--sabbia .carta__testo {
  color: var(--inchiostro);
}

.carta__disegno {
  align-self: center;
  width: 100%;
  height: auto;
  max-height: 100%;
  fill: none;
  stroke: var(--inchiostro);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.carta__titolo {
  margin: 0 0 10px;
  font-size: clamp(28px, 2.9vw, 44px);
  font-weight: 520;
  font-stretch: 70%;
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.carta__testo {
  margin: 0;
  max-width: 28ch;
  color: var(--tenue);
  font-size: 14px;
  line-height: 1.45;
}

.chiusura {
  display: flex;
  align-items: center;
  min-height: 60vh;
  padding: 0 6vw;
  border-top: 1px solid var(--filo);
}

.chiusura__titolo {
  margin: 0;
  font-size: clamp(34px, 5vw, 72px);
  font-weight: 540;
  font-stretch: 80%;
  letter-spacing: -0.02em;
}

@media (max-width: 640px) {
  .fila {
    gap: 7vw;
    padding: 0 24vw 0 80vw;
  }

  .carta {
    width: 72vw;
    height: min(56vh, 420px);
    padding: 18px 20px 22px;
  }

  .carta__titolo {
    font-size: 30px;
  }
}

/* reduced motion: no stage and no slide, the cards straight in a grid that wraps */
@media (prefers-reduced-motion: reduce) {
  .vantaggi {
    height: auto;
  }

  .palco {
    position: relative;
    height: auto;
    padding: 72px 6vw 64px;
  }

  .palco__nota {
    position: static;
    margin-bottom: 24px;
  }

  .binario {
    position: static;
    translate: none;
  }

  .fila {
    flex-wrap: wrap;
    width: auto;
    padding: 0;
  }

  .carta {
    height: 380px;
  }

  .carta__titolo {
    font-stretch: 100%;
  }
}
