:root {
  --fondo: #fafafa;
  --carta: #ffffff;
  --inchiostro: #0d0d0f;
  --grigio: #6b6b73;
  --filo: rgba(13, 13, 15, 0.08);
  --pillola: #0d0d0f;
  --pillola-testo: #ffffff;
  --ombra: 0 1px 2px rgba(13, 13, 15, 0.06), 0 8px 24px -12px rgba(13, 13, 15, 0.18);
  --ombra-su: 0 2px 4px rgba(13, 13, 15, 0.08), 0 22px 44px -18px rgba(13, 13, 15, 0.38);
  --gap: clamp(5px, 1vw, 10px);
  --raggio: clamp(8px, 1.4vw, 14px);
}

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

html, body { height: 100%; }

body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  justify-items: center;
  align-items: start;
  padding: clamp(12px, 3vh, 32px) 16px;
}

.work {
  width: min(100%, 980px, 150vh);
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 2vh, 18px);
}

.top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.top__head { display: grid; gap: 4px; }

.top__brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: clamp(11px, 1.6vh, 13px);
  color: var(--grigio);
  font-weight: 500;
}

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

.top__title {
  font-size: clamp(18px, min(4.4vw, 5.2vh), 40px);
  line-height: 1;
  font-weight: 640;
  font-stretch: 96%;
  letter-spacing: -0.02em;
}

.count {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: clamp(11px, 1.6vh, 13px);
  color: var(--grigio);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.count__num {
  display: inline-flex;
  height: 1.25em;
  overflow: hidden;
  color: var(--inchiostro);
  font-weight: 600;
}

.count__col { display: inline-flex; flex-direction: column; line-height: 1.25em; }
.count__col span { height: 1.25em; }

.filters {
  position: relative;
  align-self: flex-start;
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--carta);
  box-shadow: inset 0 0 0 1px var(--filo), 0 1px 2px rgba(13, 13, 15, 0.04);
}

.filters__pill {
  position: absolute;
  top: 3px;
  left: 0;
  height: calc(100% - 6px);
  border-radius: 999px;
  background: var(--pillola);
  box-shadow: 0 1px 2px rgba(13, 13, 15, 0.2), 0 4px 10px -4px rgba(13, 13, 15, 0.35);
}

.filter {
  position: relative;
  z-index: 1;
  border: 0;
  background: none;
  font: inherit;
  font-size: clamp(11px, 1.7vh, 13px);
  font-weight: 560;
  color: var(--grigio);
  padding: clamp(5px, 1vh, 8px) clamp(10px, 1.6vw, 16px);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.25s ease;
}

.filter span { display: inline-block; }
.filter.is-on { color: var(--pillola-testo); }
.filter:focus-visible { outline: 2px solid var(--inchiostro); outline-offset: 2px; }

@media (hover: hover) {
  .filter:not(.is-on):hover { color: var(--inchiostro); }
}

.grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: var(--riga, 80px);
  grid-auto-flow: dense;
  gap: var(--gap);
}

.tile { position: relative; }
.tile.is-gone { display: none; }
.tile--big { grid-column: span 2; grid-row: span 2; }
.tile--wide { grid-column: span 2; }

.card {
  position: absolute;
  inset: 0;
  border-radius: var(--raggio);
  overflow: hidden;
  background: #e9e9ec;
  box-shadow: var(--ombra);
  transition: transform 0.45s cubic-bezier(0.22, 1.3, 0.36, 1), box-shadow 0.45s ease;
  cursor: pointer;
}

.card__img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.card__info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: clamp(6px, 1.2vh, 12px) clamp(8px, 1.2vw, 14px);
  font-size: clamp(9px, 1.5vh, 12px);
  color: #fff;
  background: linear-gradient(to top, rgba(10, 10, 14, 0.55), rgba(10, 10, 14, 0));
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.22, 1.2, 0.36, 1), opacity 0.3s ease;
}

.card__info b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__info i { font-style: normal; opacity: 0.8; font-variant-numeric: tabular-nums; }

.card.is-hover,
.tile:focus-visible .card {
  transform: translateY(-3px);
  box-shadow: var(--ombra-su);
}

.card.is-hover .card__img { transform: scale(1.04); }
.card.is-hover .card__info { transform: translateY(0); opacity: 1; }

.tile:focus-visible { outline: none; }

.pointer {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  fill: #0d0d0f;
  stroke: #ffffff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  pointer-events: none;
  opacity: 0;
  z-index: 20;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
}

@media (max-width: 520px) {
  .top { align-items: flex-start; flex-direction: column; gap: 6px; }
}
