:root {
  --carta: #f5eee9;          /* the rosy paper of the page, from the site */
  --bianco: #fbf8f6;         /* the warm white of the caption card */
  --inchiostro: #373f1d;     /* the dark olive ink of the titles, from the site */
  --salvia: #8f8f7b;         /* small text and the thin lines, a deeper take on the site's sage */
  --linea: rgba(55, 63, 29, .16); /* the hairline of the orbit and the rules */
  --accento: #5c6e21;        /* the only accent: the site's olive, for the label and the caption rule */
  --ombra: rgba(40, 34, 20, .30); /* the soft shadow under each photo */
  --foto: clamp(64px, min(15vw, 19vh), 240px); /* the width of a photo (the site uses 240 on a computer, 120 on a phone) */
}

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

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

body {
  background: var(--carta);
  color: var(--inchiostro);
  font-family: 'Inter Tight Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a { color: inherit; text-decoration: none; }

.etichetta {
  font-size: clamp(9.5px, min(1vw, 1.8vh), 12px);
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--salvia);
}
.etichetta--accento { color: var(--accento); }

.riga { display: inline-block; }

/* ---- the opening, the section above ---- */
.apertura {
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(14px, 3.2vh, 36px) clamp(16px, 4vw, 56px);
  overflow: hidden;
}

.barra { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.marchio {
  font-family: 'Fraunces Variable', Georgia, serif;
  font-variation-settings: 'opsz' 48, 'SOFT' 50;
  font-weight: 340;
  font-size: clamp(15px, min(1.7vw, 3.4vh), 22px);
  letter-spacing: -.01em;
}
.barra__voci { display: flex; gap: clamp(12px, 2.2vw, 32px); font-size: clamp(11px, min(1.1vw, 2.4vh), 14px); }
.barra__voci a { position: relative; color: var(--inchiostro); opacity: .72; transition: opacity .3s; }
@media (hover: hover) { .barra__voci a:hover { opacity: 1; } }

.apertura__testo { display: grid; gap: clamp(8px, 2vh, 18px); }
.apertura__titolo {
  font-family: 'Fraunces Variable', Georgia, serif;
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  font-weight: 220;
  font-size: clamp(34px, min(8.4vw, 13vh), 132px);
  line-height: .98;
  letter-spacing: -.025em;
  max-width: 12ch;
}

.scendi { display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--salvia); }
.scendi__freccia { display: block; }

/* ---- the section with the cloud of photos ---- */
.equilibrio {
  position: relative;
  height: 100vh;
  overflow: hidden;
  border-top: 1px solid var(--linea);
}

.nuvola {
  position: absolute;
  inset: clamp(12px, 4.5vh, 56px) clamp(10px, 3vw, 64px);
}

.orbita {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.orbita ellipse {
  fill: none;
  stroke: var(--linea);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1 1;
}

.centro {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(30rem, 62%);
  transform: translate(-50%, -50%);
  z-index: 50;
  display: grid;
  justify-items: center;
  gap: clamp(6px, 1.8vh, 18px);
  text-align: center;
  pointer-events: none;
}
.centro a { pointer-events: auto; }
.centro__titolo {
  font-family: 'Fraunces Variable', Georgia, serif;
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  font-weight: 240;
  font-size: clamp(24px, min(5.2vw, 8.4vh), 84px);
  line-height: 1;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.centro__frase {
  font-size: clamp(11px, min(1.15vw, 2.2vh), 15px);
  line-height: 1.45;
  color: color-mix(in srgb, var(--inchiostro) 74%, transparent);
  max-width: 34ch;
  text-wrap: balance;
}
.centro__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 3px;
  font-size: clamp(10.5px, min(1.05vw, 2vh), 13px);
  font-weight: 500;
  color: var(--accento);
}
.centro__link svg { display: block; transition: transform .5s cubic-bezier(.34, 1.56, .64, 1); }
@media (hover: hover) { .centro__link:hover svg { transform: translateX(4px); } }

/* ---- one photo ---- */
.foto {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--foto);
  aspect-ratio: 4 / 5;
  margin-left: calc(var(--foto) / -2);
  margin-top: calc(var(--foto) * -.625);
  outline: none;
  cursor: pointer;
  --d: 1;   /* depth: 0 at the back of the ellipse, 1 at the front (written by the script) */
  --v: 0;   /* how open the photo is, 0 to 1 (written by the script) */
  -webkit-tap-highlight-color: transparent;
}
.foto__ombra {
  position: absolute;
  inset: 12% 8% -4%;
  border-radius: 6px;
  background: var(--ombra);
  filter: blur(calc(var(--foto) * .07));
  opacity: calc(var(--v) * (.25 + .6 * var(--d)));
  transform: translateY(calc(var(--foto) * (.02 + .05 * var(--d))));
  pointer-events: none;
}
.foto__quadro {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: clamp(2px, calc(var(--foto) * .02), 4px);
  background: #d9d2c3;
  clip-path: inset(50%);
  filter: brightness(calc(.84 + .16 * var(--d))) saturate(calc(.5 + .5 * var(--d)));
}
.foto img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-select: none;
}
.foto:focus-visible .foto__quadro { outline: 1px solid var(--accento); outline-offset: -1px; }

/* the caption: a warm white card that rises inside the bottom of the photo */
.foto__nota {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 5%;
  display: grid;
  gap: 2px;
  padding: clamp(4px, calc(var(--foto) * .045), 9px) clamp(5px, calc(var(--foto) * .05), 10px);
  border-radius: 2px;
  background: var(--bianco);
  box-shadow: 0 6px 16px -8px rgba(40, 34, 20, .5);
  visibility: hidden;
}
.foto__nome {
  font-family: 'Fraunces Variable', Georgia, serif;
  font-variation-settings: 'opsz' 24, 'SOFT' 100;
  font-weight: 360;
  font-size: clamp(10px, calc(var(--foto) * .09), 19px);
  line-height: 1.05;
  white-space: nowrap;
}
.foto__posto {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: clamp(7px, calc(var(--foto) * .052), 11px);
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--salvia);
  white-space: nowrap;
}
.foto__posto::before {
  content: '';
  flex: 0 0 auto;
  width: clamp(6px, calc(var(--foto) * .05), 12px);
  height: 1px;
  background: var(--accento);
  transform-origin: 0 50%;
  transform: scaleX(var(--riga, 0));
}

/* ---- the camps, the section below ---- */
.campi {
  padding: clamp(28px, 9vh, 120px) clamp(16px, 4vw, 56px) clamp(24px, 6vh, 64px);
  border-top: 1px solid var(--linea);
  display: grid;
  gap: clamp(20px, 6vh, 64px);
}
.campi__elenco { list-style: none; border-top: 1px solid var(--linea); }
.campo {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(12px, 2.6vh, 26px) 0;
  border-bottom: 1px solid var(--linea);
}
.campo__nome {
  font-family: 'Fraunces Variable', Georgia, serif;
  font-variation-settings: 'opsz' 96, 'SOFT' 100;
  font-weight: 260;
  font-size: clamp(20px, min(3.6vw, 6vh), 52px);
  letter-spacing: -.02em;
}
.campo__riga { font-size: clamp(10.5px, min(1.1vw, 2.2vh), 14px); color: var(--salvia); text-align: right; }
.campi__piede { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--salvia); }

@media (max-width: 560px) {
  .barra__voci a:nth-child(3) { display: none; }
  .centro { width: 60%; }
  .centro__frase { max-width: 24ch; }
}
@media (max-width: 420px) {
  .centro__frase { display: none; }
}

/* without GSAP: the photos sit on the ellipse, open */
.senza-gsap .foto__quadro { clip-path: none; }
.senza-gsap .foto { --v: 1; }
