:root {
  --carta: #f4eee6;        /* the warm paper of the last screen */
  --inchiostro: #16120f;   /* the ink of the footer */
  --argilla: #cc532d;      /* terracotta, the colour of a roof tile: the name and the accents */
  --argilla-chiara: #ec8a62;
  --argilla-scura: #8f3519;
  --fumo: rgba(244, 238, 230, 0.56);
  --filo: rgba(244, 238, 230, 0.14);
  --testo: 'Geist Variable', system-ui, sans-serif;
  --titolo: 'Big Shoulders Display Variable', 'Arial Narrow', sans-serif;
  --molla: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  background: var(--inchiostro);
  color: var(--carta);
  font-family: var(--testo);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

/* ---- the last screen ---- */
.ultima {
  position: relative;
  height: 100vh;
  background: var(--carta);
  color: var(--inchiostro);
  display: grid;
  align-content: center;
  justify-items: start;
  gap: clamp(14px, 3.2vh, 30px);
  padding: clamp(20px, 6vh, 64px) clamp(20px, 7vw, 120px);
  overflow: hidden;
}
.ultima__marca {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0;
  font-size: clamp(12px, 1.9vh, 15px);
  font-weight: 560;
  letter-spacing: 0.01em;
}
.ultima__marca svg { width: 24px; height: 14px; fill: none; stroke: var(--argilla); stroke-width: 1.6; stroke-linecap: round; }
.ultima__titolo {
  margin: 0;
  font-family: var(--titolo);
  font-weight: 760;
  text-transform: uppercase;
  font-size: min(8.4vw, 10.5vh, 116px);
  line-height: 0.9;
  letter-spacing: 0.002em;
  max-width: 15ch;
  text-wrap: balance;
}
.ultima__nota {
  margin: 0;
  max-width: 34ch;
  font-size: clamp(12px, 1.9vh, 15px);
  line-height: 1.45;
  color: rgba(22, 18, 15, 0.6);
}

/* the elastic pill of the last screen: the tone swells from the bottom with an overshoot */
.pillola {
  position: relative;
  isolation: isolate;
  display: inline-grid;
  place-items: center;
  height: clamp(38px, 6.4vh, 50px);
  padding: 0 clamp(18px, 2.6vh, 26px);
  border-radius: 999px;
  border: 1px solid var(--inchiostro);
  overflow: hidden;
  font-size: clamp(13px, 2vh, 15px);
  font-weight: 560;
}
.pillola__fondo {
  position: absolute; inset: 0; z-index: -1;
  background: var(--inchiostro);
  border-radius: inherit;
  transform-origin: 50% 100%;
}
.pillola__testo { color: var(--carta); transition: color 0.3s ease; }

/* ---- the footer ---- */
.ft {
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: clamp(18px, 5.4vh, 56px) clamp(16px, 3.4vw, 52px) clamp(12px, 2.6vh, 26px);
  overflow: hidden;
  background:
    radial-gradient(120% 70% at 50% 108%, rgba(204, 83, 45, 0.13), transparent 62%),
    var(--inchiostro);
}
.ft::before {
  /* a fine grain over the ink */
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
.ft__alto {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  align-items: start;
  gap: clamp(12px, 3vw, 48px);
  padding-bottom: clamp(12px, 3vh, 30px);
  border-bottom: 1px solid var(--filo);
}
.ft__etichetta { margin: 0 0 clamp(6px, 1.2vh, 12px); font-size: clamp(11px, 1.6vh, 13px); color: var(--fumo); }
.ft__mail {
  display: inline-block;
  font-size: min(3.1vw, 4.6vh, 40px);
  font-weight: 480;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.ft__colonne { display: flex; align-items: flex-start; gap: clamp(18px, 3vw, 56px); }
.ft__lista { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(2px, 0.6vh, 6px); font-size: clamp(12px, 1.9vh, 15px); }
.ft__lista a { color: var(--carta); }

/* the jumping letters of the links: one span per letter, a hairline outline in text-shadow when they jump */
[data-salta] { display: inline-block; }
.l { display: inline-block; transform-origin: 50% 70%; white-space: pre; transition: color 0.25s ease; }
[data-salta].su-sopra .l { color: var(--argilla-chiara); }

/* back to top: a pill with a round tone that fills it, the arrow centred in its circle */
.su {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: clamp(36px, 6vh, 46px);
  padding: 0 4px 0 clamp(12px, 1.8vh, 18px);
  border: 1px solid var(--filo);
  border-radius: 999px;
  background: rgba(244, 238, 230, 0.04);
  cursor: pointer;
  overflow: hidden;
  font-size: clamp(12px, 1.8vh, 14px);
  font-weight: 520;
  white-space: nowrap;
}
.su__fondo {
  position: absolute; z-index: -1;
  /* the fill grows from the circle on the right: its centre is the circle's centre */
  right: 4px; top: 50%;
  width: calc(clamp(36px, 6vh, 46px) - 10px); aspect-ratio: 1;
  margin-top: calc((clamp(36px, 6vh, 46px) - 10px) / -2);
  border-radius: 50%;
  background: var(--argilla);
  transform: scale(0);
}
.su__tondo {
  position: relative;
  display: grid; place-items: center;
  width: calc(clamp(36px, 6vh, 46px) - 10px); aspect-ratio: 1;
  border-radius: 50%;
  background: var(--argilla);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 4px 10px -4px rgba(204, 83, 45, 0.7);
}
.su__tondo svg { width: 44%; height: 44%; fill: none; stroke: var(--carta); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; display: block; transform-origin: 50% 50%; transform-box: fill-box; }
.su:focus-visible, .pillola:focus-visible, .ft a:focus-visible { outline: 1.5px solid var(--argilla-chiara); outline-offset: 4px; }

/* ---- the name ---- */
.ft__nome {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.ft__gomma {
  position: relative;
  /* exactly as tall as the capitals: its bottom edge is the baseline, so the stretch grows from the floor */
  height: var(--cap, 140px);
  transform-origin: 50% 100%;
  will-change: transform;
}
.ft__parola, .ft__righe {
  display: block;
  font-family: var(--titolo);
  font-weight: 820;
  text-transform: uppercase;
  white-space: nowrap;
  letter-spacing: 0;
  /* the size, the trim and the shift come from the script, measured on the ink of the font */
  font-size: var(--fs, 200px);
  line-height: 1;
  margin-top: var(--mt, 0px);
  transform: translateX(var(--dx, 0px));
}
.ft__parola {
  /* the tile: lit on top, darker at the floor */
  background: linear-gradient(180deg, var(--argilla-chiara) 0%, var(--argilla) 34%, var(--argilla) 70%, var(--argilla-scura) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.ft__righe {
  /* thin stretch marks inside the letters that show only while the rubber is pulled past its rest */
  position: absolute; inset: 0;
  background: repeating-linear-gradient(180deg, rgba(255, 236, 222, 0.0) 0 5px, rgba(255, 236, 222, 0.32) 5px 6px);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  opacity: 0;
}
.ft__ombra {
  /* the contact shadow on the floor: wider and darker when the name is squashed */
  position: absolute; left: 50%; bottom: -6px;
  width: 92%; height: 22px;
  margin-left: -46%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.55), transparent);
  filter: blur(4px);
  transform-origin: 50% 50%;
}
.ft__cap {
  /* the cap line that rides on the top of the letters, with the reading of the stretch */
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 0;
  border-top: 1px dashed rgba(236, 138, 98, 0.42);
  will-change: transform;
}
.ft__cap span {
  position: absolute; right: 0; bottom: 6px;
  font-size: clamp(10px, 1.5vh, 12px);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--argilla-chiara);
}
.ft__base { position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--filo); }

.ft__piede {
  position: relative;
  display: flex; justify-content: space-between; gap: 12px;
  padding-top: clamp(10px, 2vh, 18px);
  font-size: clamp(10px, 1.6vh, 13px);
  color: var(--fumo);
}
.ft__piede p { margin: 0; }

/* ---- small screens ---- */
@media (max-width: 720px) {
  .ft__alto { grid-template-columns: minmax(0, 1fr) auto; row-gap: clamp(10px, 2.4vh, 18px); }
  .ft__scrivi { grid-column: 1 / -1; }
  .ft__mail { font-size: min(6.4vw, 5.4vh, 30px); }
  .ft__colonne { gap: 18px; }
  .ft__lista { grid-auto-flow: row; }
  .su__testo { display: none; }
  .su { padding: 0 4px; }
  .ft__piede-centro { display: none; }
}
@media (max-height: 460px) {
  .ft__lista:last-child { display: none; }
}
@media (hover: hover) and (pointer: fine) {
  .ft__lista a, .ft__mail, .ft__piede a { cursor: pointer; }
}
