:root {
  --carta: #f5f1ea;          /* the warm paper of the page */
  --carta-2: #ece6dc;        /* the paper a shade darker, behind the photo */
  --inchiostro: #1f1c19;     /* the ink of the type */
  --tenue: #77706a;          /* the quiet grey of the notes */
  --accento: #a4513f;        /* the one accent, clay: the sale and the focus */
  --cartoncino: #fbf8f2;     /* the ivory card of the price tag */
  --filo: #8d857c;           /* the thread */
  --u: min(1vw, 1.45vh);     /* one unit, measured on the width and the height */
}

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

html, body { height: 100%; }

body {
  background:
    radial-gradient(120% 90% at 30% 20%, #fbf8f3 0%, var(--carta) 55%, #efe9e0 100%);
  color: var(--inchiostro);
  font-family: 'Inter Tight Variable', system-ui, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.scena {
  min-height: 100%;
  height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(12px, calc(var(--u) * 3), 48px);
}

.pezzo {
  position: relative;
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(20px, calc(var(--u) * 5), 64px);
  align-items: center;
}

/* ---- the photo ---- */
.foto {
  position: relative;
  aspect-ratio: 4 / 4.6;
  max-height: min(78vh, 600px);
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: var(--carta-2);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .7) inset,
    0 30px 60px -30px rgba(40, 28, 18, .35),
    0 12px 24px -12px rgba(40, 28, 18, .18);
}

.foto__img,
.foto__tinta {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 45%;
  display: block;
}

.foto__tinta { opacity: 0; }

.foto__grana {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .16;
  mix-blend-mode: overlay;
  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='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* the eyelet the thread hangs from: a little brass ring set into the corner of the photo */
.foto__occhiello {
  position: absolute;
  top: 18px;
  right: 34px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, transparent 3px, #c9a46a 3.5px, #f0d9a8 4.6px, #a07c43 6.4px, transparent 7px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}

/* ---- the tag on its thread ---- */
.appeso {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  z-index: 3;
  pointer-events: none;
}

.filo {
  position: absolute;
  left: -5px;
  top: 0;
  width: 10px;
  height: var(--lunghezza, 70px);
  overflow: visible;
}
.filo line {
  stroke: var(--filo);
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

.cartellino,
.ombra {
  position: absolute;
  left: calc(var(--larg-tag) / -2);
  top: var(--lunghezza, 70px);
  width: var(--larg-tag);
  height: calc(var(--larg-tag) * 1.56);
  border-radius: 7px 7px 9px 9px;
}

.appeso { --larg-tag: clamp(64px, calc(var(--u) * 10.5), 104px); }

.ombra {
  background: rgba(30, 20, 12, .32);
  filter: blur(9px);
  opacity: .55;
}

.cartellino {
  pointer-events: auto;
  cursor: grab;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0) 45%),
    var(--cartoncino);
  box-shadow:
    0 0 0 1px rgba(60, 45, 30, .1),
    0 1px 0 rgba(255, 255, 255, .9) inset,
    0 2px 4px rgba(40, 28, 18, .12);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(var(--larg-tag) * .26) calc(var(--larg-tag) * .1) calc(var(--larg-tag) * .1);
  font-size: calc(var(--larg-tag) * .105);
  color: var(--inchiostro);
  overflow: hidden;
}

/* the dashed stitching just inside the edge */
.cartellino::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px dashed rgba(60, 45, 30, .28);
  border-radius: 5px 5px 6px 6px;
  pointer-events: none;
}

/* the hole, with its reinforcing ring */
.cartellino__buco {
  position: absolute;
  top: calc(var(--larg-tag) * .1);
  left: 50%;
  width: calc(var(--larg-tag) * .11);
  height: calc(var(--larg-tag) * .11);
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--carta-2);
  box-shadow: 0 0 0 2px #d8cbb4, 0 0 0 2.6px rgba(60, 45, 30, .2), inset 0 1px 1px rgba(0, 0, 0, .25);
}

.cartellino__marca {
  font-family: 'Fraunces Variable', serif;
  font-style: italic;
  font-variation-settings: 'opsz' 9, 'SOFT' 100;
  font-size: 1em;
  letter-spacing: .02em;
}

.cartellino__riga {
  width: 60%;
  height: 1px;
  background: rgba(60, 45, 30, .25);
  margin: .55em 0 .5em;
}

.cartellino__taglia {
  font-size: .82em;
  letter-spacing: .18em;
  color: var(--tenue);
  text-transform: uppercase;
}

.cartellino__prezzo {
  display: flex;
  align-items: flex-start;
  margin-top: .3em;
  font-family: 'Fraunces Variable', serif;
  font-variation-settings: 'opsz' 72;
  font-weight: 420;
  font-size: 2.15em;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
}
.valuta { font-size: .5em; margin-top: .18em; margin-right: .06em; }

.cifre { display: flex; }
.cifra {
  display: block;
  height: 1em;
  overflow: hidden;
}
.cifra__colonna {
  display: flex;
  flex-direction: column;
}
.cifra__colonna span { height: 1em; display: block; text-align: center; }

.cartellino__vecchio {
  margin-top: .3em;
  font-size: .85em;
  color: var(--tenue);
  text-decoration-color: var(--accento);
  opacity: 0;
}

.cartellino__codice {
  margin-top: auto;
  font-size: .7em;
  letter-spacing: .16em;
  color: var(--tenue);
}

.cartellino.in-saldo .cartellino__prezzo { color: var(--accento); }

/* ---- the panel ---- */
.pannello { display: flex; flex-direction: column; gap: clamp(10px, calc(var(--u) * 2.2), 22px); max-width: 380px; }

.marca {
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--tenue);
}

.nome {
  font-family: 'Fraunces Variable', serif;
  font-weight: 380;
  font-variation-settings: 'opsz' 144, 'SOFT' 50;
  font-size: clamp(30px, calc(var(--u) * 5.6), 58px);
  line-height: .98;
  letter-spacing: -.015em;
}

.nota { font-size: 14px; line-height: 1.5; color: var(--tenue); max-width: 30ch; }

.etichetta { font-size: 12px; letter-spacing: .08em; color: var(--tenue); margin-bottom: 10px; }
.etichetta b { font-weight: 560; color: var(--inchiostro); letter-spacing: .02em; margin-left: .4em; }

.campioni { display: flex; gap: 12px; }
.campione {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.campione span {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 55%),
    var(--c);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}
.campione::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--inchiostro);
  opacity: 0;
  transform: scale(.8);
  transition: opacity .3s, transform .45s cubic-bezier(.34, 1.56, .64, 1);
}
.campione[aria-checked="true"]::after { opacity: 1; transform: scale(1); }

.taglie {
  position: relative;
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(60, 45, 30, .07);
  box-shadow: inset 0 1px 2px rgba(60, 45, 30, .08);
}
.taglie__pillola {
  position: absolute;
  top: 4px;
  left: 0;
  height: calc(100% - 8px);
  width: 0;
  border-radius: 999px;
  background: #fffdf9;
  box-shadow: 0 1px 2px rgba(40, 28, 18, .16), 0 4px 10px -4px rgba(40, 28, 18, .2);
}
.taglia {
  position: relative;
  z-index: 1;
  min-width: 48px;
  padding: 9px 12px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 520;
  letter-spacing: .06em;
  color: var(--tenue);
  border-radius: 999px;
  cursor: pointer;
  transition: color .3s;
  -webkit-tap-highlight-color: transparent;
}
.taglia[aria-checked="true"] { color: var(--inchiostro); }

.borsa {
  position: relative;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 50px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #fbf7f1;
  font: inherit;
  font-size: 14px;
  font-weight: 560;
  letter-spacing: .04em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.borsa__fondo {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, #2c2824, var(--inchiostro));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .12) inset, 0 10px 22px -10px rgba(30, 20, 12, .55);
}
.borsa__testo { position: relative; }
.borsa__spunta {
  position: relative;
  width: 16px;
  height: 16px;
  display: none;
}
.borsa__spunta path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.borsa.fatto .borsa__spunta { display: block; }

button:focus-visible { outline: 2px solid var(--accento); outline-offset: 3px; }

@media (hover: hover) {
  .campione:hover span { transform: scale(1.06); }
  .campione span { transition: transform .35s cubic-bezier(.34, 1.56, .64, 1); }
  .taglia:hover { color: var(--inchiostro); }
}

/* ---- narrow: the photo on top, the panel below ---- */
@media (max-width: 720px) {
  .scena { padding: 12px; align-items: start; }
  .pezzo { grid-template-columns: 1fr; gap: 12px; }
  .foto { aspect-ratio: auto; height: min(40vh, 62vw); }
  .pannello { gap: 8px; max-width: none; }
  .nota { display: none; }
  .marca { font-size: 10px; }
  .nome { font-size: clamp(22px, 7vw, 34px); }
  .gruppi { display: flex; }
  .etichetta { margin-bottom: 6px; font-size: 11px; }
  .campione { width: 26px; height: 26px; }
  .taglia { min-width: 40px; padding: 7px 9px; font-size: 12px; }
  .borsa { height: 42px; padding: 0 22px; font-size: 13px; }
  .appeso { --larg-tag: clamp(52px, 15vw, 72px); }
  .foto__occhiello { right: 24vw; top: 12px; }
}

@media (max-width: 720px) and (max-height: 480px) {
  .marca { display: none; }
  .foto { height: min(34vh, 62vw); }
  .pannello { display: grid; grid-template-columns: auto auto; column-gap: 16px; row-gap: 8px; align-items: end; justify-content: start; }
  .nome { grid-column: 1 / -1; }
  .borsa { grid-column: 1 / -1; }
}
