/* The prints that go into the index: a made-up photo archive, Sable, in the minimal style. The stage sticks while
   you scroll; the script places the prints and the slots, their colours come from the variables below. */
:root {
  --carta: #f3f0e8;          /* the page */
  --inchiostro: #141414;     /* the text and the frames */
  --tenue: #8a857b;          /* the small text and the empty slots */
  --accento: #e8412a;        /* the slot that is being filled and the final rule */
  --stampa-1: #c9b79c;       /* Dune: sand */
  --stampa-2: #7d8a8c;       /* Shore: grey water */
  --stampa-3: #e3ddd2;       /* Salt: a salt flat, almost white */
  --stampa-4: #9a8f80;       /* Quarry: stone */
  --stampa-5: #2b2d33;       /* Night: ink blue */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  background: var(--carta);
  color: var(--inchiostro);
  font-family: 'Archivo Variable', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

/* ---------------------------------------------------------------- the stage */
.corsa {
  position: relative;
  height: 560lvh; /* the script sets the real height from RIDE */
}

.palco {
  position: sticky;
  top: 0;
  height: 100lvh;
  overflow: hidden;
  background: var(--carta);
}

/* ---------------------------------------------------------------- the small text */
.testa {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: clamp(16px, 3vw, 32px) clamp(16px, 4.4vw, 60px);
}

.marchio {
  color: var(--inchiostro);
  font-size: 19px;
  font-weight: 650;
  font-stretch: 92%;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.testa__nota {
  margin: 0;
  color: var(--tenue);
  font-size: 14px;
  font-weight: 420;
}

/* ---------------------------------------------------------------- the prints */
.stampe {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* one element for the script (place and size), the child for the CSS (the picture) */
.stampa {
  position: absolute;
  left: 0;
  top: 0;
  width: 100px;
  height: 125px;
  outline: 1px solid rgba(20, 20, 20, 0);
  outline-offset: 3px;
  will-change: transform;
}

.stampa__foto {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--tono);
}

/* a tonal field: a lit sky, a horizon and the ground, all from the print's own colour */
.stampa__foto::before {
  content: '';
  position: absolute;
  inset: -6%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0.06) var(--orizzonte), rgba(0, 0, 0, 0.1) calc(var(--orizzonte) + 0.6%), rgba(0, 0, 0, 0.26) 100%),
    radial-gradient(120% 70% at var(--luce) 18%, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0) 60%);
  transform: scale(var(--zoom, 1));
  transform-origin: 50% 60%;
}

.stampa__foto::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: var(--orizzonte);
  height: 1px;
  background: rgba(20, 20, 20, 0.28);
}

/* ---------------------------------------------------------------- the measure beside the open print */
.quota {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  width: 1px;
  height: 100px;
  pointer-events: none;
}

.quota__riga {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 100%;
  background: var(--inchiostro);
  transform-origin: 50% 0;
}

.quota__riga::before,
.quota__riga::after {
  content: '';
  position: absolute;
  left: -4px;
  width: 9px;
  height: 1px;
  background: var(--inchiostro);
}

.quota__riga::before {
  top: 0;
}

.quota__riga::after {
  bottom: 0;
}

.quota__testo {
  position: absolute;
  left: 10px;
  top: 50%;
  color: var(--inchiostro);
  font-size: 12px;
  font-weight: 450;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transform: translateY(-50%);
}

.didascalia {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  margin: 0;
  color: var(--inchiostro);
  font-size: 15px;
  font-weight: 560;
  white-space: nowrap;
  transform: translateX(-50%);
  text-align: center;
}

.didascalia__nota {
  color: var(--tenue);
  font-weight: 420;
}

/* ---------------------------------------------------------------- the index row */
.indice {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0;
  padding: 0;
  list-style: none;
  pointer-events: none;
}

.posto {
  position: absolute;
  left: 0;
  top: 0;
}

.posto__vuoto {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(20, 20, 20, 0.22);
}

.posto__nome {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 9px);
  color: var(--tenue);
  font-size: 11px;
  font-weight: 450;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.4s ease;
}

.posto.e-pieno .posto__nome {
  color: var(--inchiostro);
}

.posto__segno {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  height: 2px;
  background: var(--accento);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* ---------------------------------------------------------------- the end */
.finale {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 2;
  width: calc(100% - 32px);
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.finale__titolo {
  margin: 0;
  font-size: clamp(30px, min(6.4vw, 9vh), 84px);
  font-weight: 300;
  font-stretch: 112%;
  letter-spacing: -0.02em;
  line-height: 1;
  opacity: 0;
}

.finale__riga {
  display: block;
  width: min(220px, 40%);
  height: 2px;
  margin: 18px auto 14px;
  background: var(--accento);
  transform: scaleX(0);
}

.finale__nota {
  margin: 0;
  color: var(--tenue);
  font-size: 15px;
  opacity: 0;
}

.cenno {
  position: absolute;
  right: clamp(16px, 4.4vw, 60px);
  top: 50%;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--tenue);
  font-size: 13px;
  writing-mode: vertical-rl;
}

.cenno svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------------------------------------------------------------- after the stage */
.piede {
  display: grid;
  place-items: center;
  min-height: 50lvh;
  padding: 48px clamp(16px, 4.4vw, 60px);
  border-top: 1px solid rgba(20, 20, 20, 0.12);
}

.piede p {
  max-width: 26em;
  margin: 0;
  color: var(--tenue);
  font-size: clamp(15px, 1.3vw, 18px);
  line-height: 1.5;
  text-align: center;
}

@media (max-width: 560px) {
  .testa__nota {
    font-size: 12px;
  }

  .didascalia {
    font-size: 13px;
  }

  .posto__nome {
    font-size: 9px;
    letter-spacing: 0.02em;
  }

  .cenno {
    display: none;
  }
}
