/* Kessler Body Works, the certified marques: big names on light grey, a photo pasted in a sticky square */
:root {
  --carta: #f0f0ee;            /* the page (the site's light grey is #F0F0F0) */
  --inchiostro: #0e0e0e;       /* the names and the small type */
  --accento: #c8401e;          /* the small square and the tick at the end of the hairline */
  --filo: rgba(14, 14, 14, 0.24); /* the hairline from the name to the photo */
  --bordo-riga: rgba(0, 0, 0, 0.1);
  --nero: #000000;             /* the square behind the photos */
  --spento: 0.1;               /* the names that are not active (the site uses 10%) */
  --cambio: 0.1s;              /* how fast a name lights up (the site uses 100 ms) */
  --largo: 104;                /* the width axis of the active name */
  --bordo: clamp(16px, 2.2vw, 32px);
  --h0: min(5.75rem, 7vw, 10.6vh);
  --lato: min(19vw, 32vh);
  --mono: 0.875rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  background: var(--carta);
  color: var(--inchiostro);
  font-family: 'Mona Sans Variable', 'Mona Sans', system-ui, sans-serif;
  font-weight: 400;
  overflow-x: hidden;
}
p { margin: 0; }

.mono {
  font-size: var(--mono);
  line-height: 1.15;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 450;
  font-variation-settings: 'wdth' 100;
}

.pagina { padding-inline: var(--bordo); }

/* the heading stays on top while the list passes under it, as on the site */
.testa {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  padding-block: clamp(14px, 3vh, 28px) 10px;
  pointer-events: none;
}
.testa__nota { max-width: 25ch; opacity: 0.62; }

.lista {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
}

.nomi {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.25rem;
}
.nomi li { display: block; }
.nome {
  display: inline-block;
  font-size: var(--h0);
  line-height: 0.95em;
  letter-spacing: -0.01em;
  font-weight: 500;
  font-variation-settings: 'wdth' 100;
  margin-top: -0.05em;
  padding-bottom: 0.06em;
  white-space: nowrap;
  color: var(--inchiostro);
  text-decoration: none;
  opacity: var(--spento);
  transition:
    opacity var(--cambio) cubic-bezier(0.19, 1, 0.22, 1),
    font-variation-settings 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
}
.nome.is-on { opacity: 1; font-variation-settings: 'wdth' var(--largo); }
.nome:focus { outline: none; }
.nome:focus-visible { outline: 1px solid var(--accento); outline-offset: 4px; }
.metro {
  position: absolute;
  visibility: hidden;
  pointer-events: none;
  transition: none;
  opacity: 1;
  font-variation-settings: 'wdth' var(--largo);
}

/* the small square of 0.4rem that slides to the active name (the site's own list component) */
.quadratino {
  position: absolute;
  left: 0;
  top: 0;
  width: 0.4rem;
  height: 0.4rem;
  background: var(--accento);
  opacity: 0;
  pointer-events: none;
}

/* ours: a hairline from the active name to the photo */
.guida {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 1px;
  pointer-events: none;
}
.guida__riga {
  position: absolute;
  inset: 0;
  background: var(--filo);
  transform-origin: 0 50%;
}
.guida__tacca {
  position: absolute;
  right: 0;
  top: -3px;
  width: 1px;
  height: 7px;
  background: var(--accento);
}

.colonna { position: relative; }
.incolla {
  position: sticky;
  top: calc(50vh - var(--lato) / 2 - 0.6rem);
  width: var(--lato);
}

.quadro {
  position: relative;
  width: var(--lato);
  height: var(--lato);
  margin: 0;
  background: var(--nero);
  overflow: hidden;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06), 0 22px 44px -28px rgba(0, 0, 0, 0.55);
}
.pila { position: absolute; inset: 0; isolation: isolate; }
.scatto { position: absolute; inset: 0; overflow: hidden; }
.scatto img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos, 50% 50%);
  filter: grayscale(1) contrast(1.08) brightness(0.94);
  user-select: none;
}
.velo { position: absolute; inset: 0; background: var(--nero); opacity: 0; pointer-events: none; }
.quadro__luce {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0) 42%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.didascalia {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}
.rullo {
  position: relative;
  width: 100%;
  min-width: 0;
  height: calc(var(--mono) * 2.3 + 14px);
  overflow: hidden;
  border-top: 1px solid var(--bordo-riga);
}
.voce { position: absolute; left: 0; top: 8px; right: 0; }
.voce__anno { margin-top: 4px; opacity: 0.5; }
.conta { white-space: nowrap; order: -1; opacity: 0.62; font-variant-numeric: tabular-nums; }

.piede {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-block: 18px 22px;
  border-top: 1px solid var(--bordo-riga);
}
.piede__nota { opacity: 0.5; }

@media (hover: hover) {
  .nome { cursor: pointer; }
  .nome:active { opacity: 0.72; }
}

/* the phone: the photo sits on top, smaller, and the names scroll under it */
@media (max-width: 640px) {
  :root {
    --h0: min(10.6vw, 8.4vh);
    --lato: min(31vw, 26vh);
    --mono: 0.6875rem;
  }
  .testa { position: static; grid-template-columns: 1fr; padding-block: 12px 8px; }
  .testa__nota { display: none; }
  .lista { display: flex; flex-direction: column; }
  .colonna {
    order: -1;
    position: sticky;
    top: 0;
    z-index: 2;
    margin-inline: calc(var(--bordo) * -1);
    padding: 8px var(--bordo) 10px;
    background: var(--carta);
  }
  .colonna::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 22px;
    background: linear-gradient(var(--carta), rgba(240, 240, 238, 0));
    pointer-events: none;
  }
  .incolla { position: static; display: flex; gap: 14px; width: auto; }
  .quadro { flex: none; }
  .didascalia { flex: 1; justify-content: flex-end; margin-top: 0; min-width: 0; }
  .nomi { padding-left: 1rem; }
  .guida { display: none; }
  .piede { flex-direction: column; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .nome { transition: opacity 0.2s linear; }
}
