:root {
  --avorio: #f2efea;
  --avorio-chiaro: #f9f8f6;
  --pietra: #241f21;
  --pietra-tenue: #7a716d;
  --farina: #e9e778;
  --coast: #f76c46;
  --fairway: #bacfa3;
  --forest: #c6af88;
  --reclaimed: #85a1c5;
  --accento: var(--coast);
  --raggio: clamp(14px, 1.6vw, 24px);
  --molla: cubic-bezier(.175, .885, .32, 1.275);
  --ritorno: cubic-bezier(.19, 1, .22, 1);
}

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

html { background: var(--avorio); }
html.lenis, html.lenis body { height: auto; }

body {
  background: var(--avorio);
  color: var(--pietra);
  font-family: 'Mona Sans Variable', 'Mona Sans', 'Helvetica Neue', Arial, sans-serif;
  font-size: clamp(11px, min(1vw, 1.7vh), 14px);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* the section: tall, with a stage that stays on screen */
.pila { position: relative; height: 750vh; }
.palco {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100lvh;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 15% 0%, var(--avorio-chiaro) 0%, rgba(249, 248, 246, 0) 60%),
    var(--avorio);
}

.grana {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.14 0 0 0 0 0.12 0 0 0 0 0.12 0 0 0 0.08 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}

/* the bar above the card */
.testa {
  position: absolute;
  z-index: 2;
  top: 0;
  left: var(--lato);
  right: var(--lato);
  height: var(--alto);
  display: flex;
  align-items: center;
  justify-content: space-between;
  --lato: clamp(10px, 2.6vw, 40px);
  --alto: clamp(38px, min(8vh, 6vw), 72px);
}
.palco { --lato: clamp(10px, 2.6vw, 40px); --alto: clamp(38px, min(8vh, 6vw), 72px); }
.marchio {
  font-size: clamp(13px, min(1.35vw, 2.4vh), 19px);
  font-weight: 640;
  font-variation-settings: 'wdth' 112;
  letter-spacing: -0.02em;
}
.marchio em { font-style: normal; font-weight: 420; font-variation-settings: 'wdth' 88; color: var(--pietra-tenue); }
.scendi {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: clamp(10px, 0.85vw, 12px);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 560;
  color: var(--pietra-tenue);
}
.scendi svg { width: 10px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* the card that holds the stack */
.card {
  position: absolute;
  top: var(--alto);
  left: var(--lato);
  right: var(--lato);
  bottom: var(--lato);
  border-radius: var(--raggio);
  overflow: hidden;
  isolation: isolate;
  background: #3a3330;
  box-shadow:
    0 1px 1px rgba(36, 31, 33, 0.06),
    0 6px 14px -6px rgba(36, 31, 33, 0.22),
    0 30px 60px -24px rgba(36, 31, 33, 0.35),
    0 60px 120px -40px rgba(36, 31, 33, 0.25);
}
/* the 1px edge that catches the light, brighter on top */
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 6;
  border-radius: inherit;
  pointer-events: none;
  padding: 1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.08) 30%, rgba(255, 255, 255, 0.04) 70%, rgba(255, 255, 255, 0.18));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.strati { position: absolute; inset: 0; }
.strato {
  position: absolute;
  inset: -1px -2px;
  overflow: hidden;
  --reveal: 100%;
  clip-path: inset(var(--reveal) 0 0 0);
}
.strato:first-child { clip-path: none; }
.strato__in {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 124%;
  transform-origin: 50% 0%;
  will-change: transform;
}
/* the photo of the material fills the print, cropped to its centre */
.strato__in img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; user-select: none; -webkit-user-drag: none; }
/* the lit lip of the blind: one bright hairline right at the edge */
.strato__labbro {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--reveal);
  height: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.75) 35%, rgba(255, 255, 255, 0.35) 70%, rgba(255, 255, 255, 0.1));
  pointer-events: none;
}
/* the shadow the blind casts on the print it covers */
.ombra {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: clamp(30px, 9vh, 90px);
  opacity: 0;
  background: linear-gradient(180deg, rgba(20, 16, 14, 0) 0%, rgba(20, 16, 14, 0.28) 100%);
  pointer-events: none;
  will-change: transform, opacity;
}

/* window light, a soft vignette and the scrim under the words */
.luce {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(70% 60% at 78% 8%, rgba(255, 246, 228, 0.32) 0%, rgba(255, 246, 228, 0) 70%),
    radial-gradient(40% 45% at 0% 0%, rgba(20, 16, 14, 0.4) 0%, rgba(20, 16, 14, 0) 100%),
    linear-gradient(200deg, rgba(20, 16, 14, 0) 35%, rgba(20, 16, 14, 0.7) 100%),
    radial-gradient(140% 120% at 50% 40%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.28) 100%);
}

/* the names of the collections, down the left side */
.binario {
  position: absolute;
  z-index: 3;
  left: clamp(14px, 2.4vw, 36px);
  top: clamp(14px, min(4vh, 3vw), 40px);
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: clamp(10px, 1.2vw, 16px);
  row-gap: clamp(8px, 1.4vh, 14px);
  color: #fff;
}
.binario__titolo {
  grid-column: 1 / -1;
  font-size: clamp(10px, 0.85vw, 12px);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  opacity: 0.85;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}
.binario__riga {
  position: relative;
  width: 1px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 1px;
  overflow: hidden;
}
.binario__pieno {
  position: absolute;
  inset: 0;
  background: #fff;
  transform-origin: 50% 0%;
  transform: scaleY(0);
}
.binario__nomi { list-style: none; display: grid; gap: clamp(2px, 0.6vh, 6px); }
.nome {
  appearance: none;
  border: 0;
  background: none;
  color: #fff;
  font: inherit;
  font-size: clamp(11px, min(1vw, 1.8vh), 14px);
  text-align: left;
  cursor: pointer;
  opacity: 0.5;
  font-weight: 450;
  font-variation-settings: 'wdth' 92;
  padding: 2px 0;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
  transition: opacity 0.5s var(--ritorno), font-variation-settings 0.5s var(--ritorno), font-weight 0.5s var(--ritorno), transform 0.5s var(--molla);
}
.nome[aria-current="true"] { opacity: 1; font-weight: 620; font-variation-settings: 'wdth' 118; transform: translateX(3px); }
.nome:focus-visible { outline: 1px solid #fff; outline-offset: 3px; border-radius: 3px; }
@media (hover: hover) {
  .nome:hover { opacity: 0.9; }
}

/* the words of the collection */
.testo {
  position: absolute;
  z-index: 3;
  left: clamp(14px, 2.4vw, 36px);
  bottom: clamp(14px, min(4vh, 3vw), 40px);
  width: min(58%, 720px);
  color: #fff;
}
.etichette { display: flex; align-items: center; gap: 8px; margin-bottom: clamp(8px, 1.8vh, 18px); }
.tag {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: clamp(24px, min(2.4vw, 3.8vh), 32px);
  padding: 0 clamp(10px, 1vw, 14px) 0 clamp(7px, 0.7vw, 10px);
  color: var(--pietra);
  font-size: clamp(11px, min(1vw, 1.8vh), 14px);
  font-weight: 600;
  font-variation-settings: 'wdth' 100;
}
.tag__fondo {
  position: absolute;
  inset: 0;
  border-radius: 30px;
  background: var(--accento);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 4px 10px -4px rgba(0, 0, 0, 0.35);
  transform-origin: 0% 50%;
}
.tag__icona { position: relative; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.tag__nome { position: relative; display: inline-block; transform-origin: 0% 50%; }
.conto {
  font-size: clamp(11px, min(1vw, 1.8vh), 14px);
  color: #fff;
}
.conto b { font-weight: 640; font-variant-numeric: tabular-nums; }
.conto--breve {
  display: none;
  height: clamp(24px, 3.8vh, 32px);
  align-items: center;
  padding: 0 10px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.titolo {
  font-size: clamp(19px, min(3.6vw, 6.2vh), 64px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 520;
  font-variation-settings: 'wdth' 96;
  text-wrap: balance;
  text-shadow: 0 1px 20px rgba(0, 0, 0, 0.18);
}
.parola { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.parola > span { display: inline-block; }

.bottone {
  display: inline-flex;
  gap: 4px;
  margin-top: clamp(10px, 2.2vh, 24px);
  color: var(--pietra);
  text-decoration: none;
  font-size: clamp(10px, min(0.85vw, 1.6vh), 12px);
  text-transform: uppercase;
  letter-spacing: -0.02em;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}
.bottone > span {
  display: inline-flex;
  align-items: center;
  height: clamp(32px, min(3.2vw, 5.4vh), 44px);
  border-radius: 12px;
  background: var(--avorio-chiaro);
  box-shadow: inset 0 1px 0 #fff, 0 1px 1px rgba(0, 0, 0, 0.12), 0 8px 18px -8px rgba(0, 0, 0, 0.45);
  transition: margin 0.3s var(--ritorno), transform 0.25s var(--ritorno), background-color 0.4s var(--ritorno);
}
.bottone__icona { justify-content: center; aspect-ratio: 1; }
.bottone__icona svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.5s cubic-bezier(.12, 1.2, .16, 2.35); }
.bottone__nome { padding: 0 clamp(12px, 1.2vw, 16px); }
.bottone:active > span { transform: scale(0.96); }
.bottone:focus-visible { outline: 1px solid #fff; outline-offset: 4px; border-radius: 14px; }
@media (hover: hover) {
  .bottone:hover .bottone__icona { margin-right: 12px; transition: margin 0.5s var(--molla), transform 0.25s var(--ritorno), background-color 0.4s var(--ritorno); background: var(--accento); }
  .bottone:hover .bottone__icona svg { transform: scale(1.07) translateX(1px); }
}

/* the catalogue, bottom right */
.catalogo {
  position: absolute;
  z-index: 3;
  right: clamp(14px, 2vw, 32px);
  bottom: clamp(14px, min(4vh, 3vw), 40px);
  display: flex;
  gap: clamp(12px, 1.4vw, 20px);
  padding: clamp(10px, 1.1vw, 16px);
  width: clamp(220px, 24vw, 340px);
  border-radius: 16px;
  color: var(--pietra);
  text-decoration: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(249, 248, 246, 0.9));
  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(0, 0, 0, 0.1), 0 14px 30px -12px rgba(0, 0, 0, 0.45);
  transition: transform 0.5s var(--molla), box-shadow 0.5s var(--ritorno);
  -webkit-tap-highlight-color: transparent;
}
.catalogo__testo { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.catalogo__nome { font-size: clamp(13px, min(1.3vw, 2.2vh), 19px); line-height: 1.1; font-weight: 520; letter-spacing: -0.02em; }
.catalogo__conto { margin-top: 4px; font-size: clamp(10px, 0.85vw, 12px); color: var(--pietra-tenue); }
.catalogo__conto b { color: var(--pietra); font-weight: 640; font-variant-numeric: tabular-nums; }
.catalogo__scarica {
  margin-top: auto;
  padding-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: clamp(10px, 0.85vw, 12px);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}
.catalogo__scarica svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.5s var(--molla); }
.catalogo__copertina {
  position: relative;
  flex: none;
  width: clamp(58px, 5.6vw, 80px);
  aspect-ratio: 3 / 4;
  border-radius: 4px 6px 6px 4px;
  overflow: hidden;
  background: var(--accento);
  box-shadow: inset 2px 0 0 rgba(0, 0, 0, 0.12), inset 3px 0 0 rgba(255, 255, 255, 0.2), 0 2px 4px rgba(0, 0, 0, 0.18), 0 10px 18px -8px rgba(0, 0, 0, 0.4);
  transform-origin: 50% 100%;
  transition: transform 0.5s var(--molla), background-color 0.5s var(--ritorno);
}
.catalogo__copertina img {
  position: absolute;
  left: 14%;
  right: 14%;
  top: 30%;
  width: 72%;
  height: 46%;
  object-fit: cover;
  object-position: 50% 45%;
  border-radius: 2px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4), 0 2px 5px rgba(0, 0, 0, 0.25);
}
.catalogo__marchio {
  position: absolute;
  left: 14%;
  top: 10%;
  font-size: 6px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--pietra);
  opacity: 0.8;
  white-space: nowrap;
}
.catalogo:active { transform: scale(0.98); }
.catalogo:focus-visible { outline: 1px solid #fff; outline-offset: 3px; }
@media (hover: hover) {
  .catalogo:hover { transform: translateY(-3px); box-shadow: inset 0 1px 0 #fff, 0 2px 4px rgba(0, 0, 0, 0.1), 0 22px 40px -14px rgba(0, 0, 0, 0.5); }
  .catalogo:hover .catalogo__copertina { transform: rotate(-4deg) translateY(-2px); }
  .catalogo:hover .catalogo__scarica svg { transform: translateY(2px); }
}

/* narrow screens: names in a row on top, the catalogue folds into a count beside the tag */
@media (max-width: 640px) {
  .binario { grid-template-columns: 1fr; right: 14px; }
  .binario__titolo { display: none; }
  .binario__riga { width: 100%; height: 1px; grid-row: 2; }
  .binario__pieno { transform-origin: 0% 50%; }
  .binario__nomi { display: flex; gap: 14px; grid-row: 1; }
  .nome[aria-current="true"] { transform: none; }
  .testo { width: auto; right: 14px; }
  .catalogo { display: none; }
  .conto--breve { display: inline-flex; }
  .scendi span { display: none; }
}
@media (max-height: 480px) {
  .catalogo__conto { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .nome, .bottone > span, .catalogo, .catalogo__copertina { transition: opacity 0.3s, background-color 0.3s; }
}
