:root {
  --fondo: #f3f2ee;
  --carta: #ffffff;
  --inchiostro: #17171b;
  --grigio: #8b8a92;
  --linea: rgba(23, 23, 27, 0.09);
  --accento: #4b4ef0;
  --accento-tenue: #eeeeff;
  --vetro: rgba(255, 255, 255, 0.55);
}

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

html, body { height: 100%; }

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

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(10px, 3vh, 28px) 14px;
}

.card {
  position: relative;
  width: min(440px, 100%);
  background: var(--carta);
  border-radius: 22px;
  padding: clamp(12px, 2.6vh, 20px) clamp(14px, 3.6vw, 20px) clamp(12px, 2.6vh, 18px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 0 0 1px var(--linea), 0 18px 40px -18px rgba(23, 23, 27, 0.22), 0 4px 10px -6px rgba(23, 23, 27, 0.12);
}

.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(8px, 2vh, 16px);
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand__mark {
  width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: 9px;
  background: var(--inchiostro);
  fill: none;
  stroke: #fff;
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.brand__txt { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-size: 11.5px; color: var(--grigio); font-weight: 500; }
.brand__cat { font-size: clamp(15px, 4vw, 17px); font-weight: 650; font-stretch: 108%; letter-spacing: -0.01em; }

.clear {
  font: inherit;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--inchiostro);
  background: transparent;
  border: 1px solid var(--linea);
  border-radius: 999px;
  height: 30px;
  padding: 0 13px;
  cursor: pointer;
  transition: opacity 0.25s, background-color 0.2s, border-color 0.2s;
}
.clear:disabled { opacity: 0.35; cursor: default; }
@media (hover: hover) {
  .clear:not(:disabled):hover { background: var(--fondo); border-color: rgba(23, 23, 27, 0.16); }
}

.label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11.5px;
  font-weight: 550;
  color: var(--grigio);
  margin-bottom: 7px;
}
.label__n { font-weight: 500; transition: color 0.25s; }
.label__n.is-on { color: var(--accento); }
.label--panel { margin-top: clamp(10px, 2.2vh, 16px); }

/* the glass shelf: two rows of room, a floor line and a slow sheen that sweeps on every landing */
.shelf {
  position: relative;
  height: 84px;
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(246, 246, 250, 0.7), rgba(236, 236, 242, 0.55));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), inset 0 0 0 1px rgba(23, 23, 27, 0.07), inset 0 -10px 18px -14px rgba(75, 78, 240, 0.25);
  overflow: hidden;
  --sheen: -40%;
}

.shelf__floor {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 7px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(23, 23, 27, 0.14) 12%, rgba(23, 23, 27, 0.14) 88%, transparent);
}

.shelf__sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent calc(var(--sheen) - 14%), rgba(255, 255, 255, 0.85) var(--sheen), transparent calc(var(--sheen) + 14%));
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.shelf__hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  color: var(--grigio);
  transition: opacity 0.3s;
}
.shelf__hint.is-off { opacity: 0; }

.slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.slot {
  height: 30px;
  border-radius: 999px;
  border: 1px dashed rgba(23, 23, 27, 0.16);
  opacity: 0;
  transition: opacity 0.3s;
}
.slot.is-empty { opacity: 1; }

.show {
  margin-top: clamp(12px, 2.6vh, 20px);
  width: 100%;
  height: clamp(40px, 6.4vh, 46px);
  border: 0;
  border-radius: 999px;
  background: var(--inchiostro);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}
.show__n { display: inline-block; }
.show__arrow { width: 15px; height: 15px; fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-left: 3px; transition: transform 0.3s cubic-bezier(0.3, 1.6, 0.5, 1); }
@media (hover: hover) {
  .show:hover .show__arrow { transform: translateX(3px); }
}

/* the chips live in one layer over the card: GSAP and the physics own .chip, CSS owns .chip__in */
.chips { position: absolute; inset: 0; pointer-events: none; }

.chip {
  position: absolute;
  left: 0;
  top: 0;
  height: 30px;
  pointer-events: auto;
  cursor: pointer;
  will-change: transform;
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  color: var(--inchiostro);
  -webkit-tap-highlight-color: transparent;
}

.chip__in {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px 0 12px;
  border-radius: 999px;
  background: var(--carta);
  border: 1px solid rgba(23, 23, 27, 0.11);
  box-shadow: 0 1px 2px rgba(23, 23, 27, 0.06);
  font-size: 12.5px;
  font-weight: 550;
  white-space: nowrap;
  transition: transform 0.25s cubic-bezier(0.3, 1.5, 0.5, 1), box-shadow 0.25s, background-color 0.3s, border-color 0.3s, color 0.3s;
}

.chip__ico {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  opacity: 0.55;
  transition: transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1), opacity 0.25s;
}

.chip.is-on .chip__in {
  background: var(--accento-tenue);
  border-color: rgba(75, 78, 240, 0.32);
  color: #2b2dba;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 3px 8px -4px rgba(75, 78, 240, 0.45);
}
.chip.is-on .chip__ico { transform: rotate(45deg); opacity: 0.8; }

@media (hover: hover) {
  .chip:hover .chip__in, .chip.is-hover .chip__in { transform: translateY(-1px); box-shadow: 0 4px 10px -4px rgba(23, 23, 27, 0.22); }
  .chip.is-on:hover .chip__in, .chip.is-on.is-hover .chip__in { box-shadow: 0 5px 12px -5px rgba(75, 78, 240, 0.55); }
  .chip:hover .chip__ico, .chip.is-hover .chip__ico { opacity: 1; }
}
.chip:active .chip__in, .chip.is-press .chip__in { transform: scale(0.95); }

.cursor {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  z-index: 10;
  fill: var(--inchiostro);
  stroke: #fff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.18));
  pointer-events: none;
  opacity: 0;
}

@media (max-height: 460px) {
  .shelf { height: 76px; }
}
