:root {
  --fondo: #ffffff;
  --inchiostro: #16151a;
  --crema: #f6f1e7;
  --velluto: #7c1b2b;
  --ottone: #c9a15a;
  --carta: #f7f2e8;
  --grigio: #8a8790;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
}

/* the frame keeps room under the pill for the tag that drops */
.frame {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  width: min(320px, 92vw);
  height: min(236px, 56vh);
  padding-top: 18px;
}

/* the pill: the button for GSAP (scale, x), the layers inside for CSS */
.c {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 60px;
  padding: 0 26px 0 20px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--crema);
  font: inherit;
  font-size: 16px;
  font-weight: 580;
  font-variation-settings: "wdth" 100;
  letter-spacing: -0.005em;
  cursor: pointer;
  isolation: isolate;
  overflow: visible;
  max-width: 92vw;
  -webkit-tap-highlight-color: transparent;
}
.c:focus-visible { outline: 2px solid var(--ottone); outline-offset: 4px; }

.c__skin, .c__glow, .c__velvet, .c__sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}
.c__skin {
  z-index: -4;
  background: linear-gradient(180deg, #24232a 0%, var(--inchiostro) 58%, #0f0e12 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    0 1px 1px rgba(22, 21, 26, 0.16),
    0 6px 14px -6px rgba(22, 21, 26, 0.3),
    0 22px 40px -22px rgba(22, 21, 26, 0.55);
}
.c__glow {
  z-index: -3;
  overflow: hidden;
  opacity: 0;
  background: radial-gradient(120px 80px at var(--gx, 50%) var(--gy, 50%), rgba(255, 236, 205, 0.16), transparent 70%);
}
/* the velvet: two halves that close from the sides like a stage curtain */
.c__velvet {
  z-index: -2;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.12) 0 1px, transparent 1px 7px),
    linear-gradient(180deg, #9a2638 0%, var(--velluto) 55%, #5e1220 100%);
  box-shadow: inset 0 1px 0 rgba(255, 210, 200, 0.22), inset 0 -1px 0 rgba(0, 0, 0, 0.35);
}
.c__velvet--l { clip-path: inset(0 100% 0 0 round 999px 0 0 999px); }
.c__velvet--r { clip-path: inset(0 0 0 100% round 0 999px 999px 0); }
.c__sheen {
  z-index: -1;
  overflow: hidden;
  opacity: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 240, 220, 0.28) 48%, transparent 64%);
  background-size: 260% 100%;
  background-position: 120% 0;
}

/* the rail window: the hanger alone at rest, the rail and the hooks while it looks for a free one */
.c__rail {
  position: relative;
  flex: none;
  width: 22px;
  height: 26px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9px, #000 calc(100% - 9px), transparent);
          mask-image: linear-gradient(90deg, transparent, #000 9px, #000 calc(100% - 9px), transparent);
}
.c__rail-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 5px;
  height: 1px;
  background: linear-gradient(90deg, rgba(201, 161, 90, 0.35), var(--ottone), rgba(201, 161, 90, 0.35));
  opacity: 0;
}
.c__hooks {
  position: absolute;
  left: 0;
  top: 5px;
  width: 400px;
  height: 24px;
  overflow: visible;
  opacity: 0;
}
.c__hooks path {
  fill: none;
  stroke: rgba(246, 241, 231, 0.34);
  stroke-width: 1.3;
  stroke-linecap: round;
}
.c__hooks path.is-free { stroke: var(--ottone); }
.c__hanger {
  position: absolute;
  left: 50%;
  top: 3px;
  width: 22px;
  height: 22px;
  margin-left: -11px;
}
.c__hanger svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.h__bar { opacity: 0.45; }

.c__labels {
  position: relative;
  display: block;
  height: 22px;
  overflow: hidden;
}
.c__label {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  width: max-content;
  height: 22px;
  line-height: 22px;
  white-space: nowrap;
  opacity: 0;
}
.c__label[data-l="idle"] { opacity: 1; }
.c__sep { margin: 0 0.42em; opacity: 0.5; }
.c__num { color: #f2d49b; font-weight: 640; }

.note {
  position: absolute;
  left: 0;
  right: 0;
  top: 94px;
  margin: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 460;
  color: var(--grigio);
  white-space: nowrap;
}

/* the tag: the drop is cut along the middle of the pill, so the tag comes out from under it */
.drop {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 48px;
  width: 120px;
  height: 190px;
  margin-left: -60px;
  clip-path: inset(0 -120px -160px -120px);
  pointer-events: none;
}
.fall { position: absolute; inset: 0; }
.swing {
  position: absolute;
  left: 50%;
  top: 0;
  width: 104px;
  margin-left: -52px;
  padding-top: 30px;
}
.thread {
  position: absolute;
  left: 50%;
  top: 22px;
  width: 1px;
  height: 22px;
  margin-left: -0.5px;
  background: linear-gradient(180deg, #6b5a3c, #a58a58);
}
.tag {
  position: relative;
  margin-top: 8px;
  display: grid;
  justify-items: center;
  padding: 17px 11px 10px;
  border-radius: 9px 9px 7px 7px;
  background:
    radial-gradient(140% 90% at 30% 0%, rgba(255, 255, 255, 0.85), transparent 60%),
    linear-gradient(180deg, #fbf7ef, var(--carta) 60%, #efe8da);
  color: var(--inchiostro);
  box-shadow:
    inset 0 0 0 1px rgba(120, 96, 52, 0.14),
    inset 0 1px 0 #fff,
    0 1px 1px rgba(22, 21, 26, 0.08),
    0 8px 14px -8px rgba(22, 21, 26, 0.22),
    0 22px 30px -18px rgba(60, 30, 20, 0.3);
}
.tag__eye {
  position: absolute;
  left: 50%;
  top: 5px;
  width: 9px;
  height: 9px;
  margin-left: -4.5px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #3b3426 0 1.6px, transparent 1.9px), radial-gradient(circle at 35% 30%, #f3dba6, var(--ottone) 55%, #8a6a32);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}
.tag__house {
  margin-top: 2px;
  font-size: 7.5px;
  font-weight: 620;
  letter-spacing: 0.12em;
  white-space: nowrap;
  text-transform: uppercase;
  color: var(--velluto);
  font-variation-settings: "wdth" 112;
}
.tag__no {
  margin-top: 2px;
  font-size: 34px;
  line-height: 1;
  font-weight: 720;
  letter-spacing: -0.02em;
  font-variation-settings: "wdth" 122;
}
.tag__perf {
  width: 100%;
  height: 1px;
  margin: 9px 0 6px;
  background-image: linear-gradient(90deg, rgba(22, 21, 26, 0.28) 50%, transparent 50%);
  background-size: 5px 1px;
}
.tag__foot {
  display: flex;
  justify-content: space-between;
  width: 100%;
  font-size: 8px;
  font-weight: 520;
  letter-spacing: 0.04em;
  color: var(--grigio);
}

@media (max-width: 400px) {
  .c { height: 56px; font-size: 15px; padding: 0 22px 0 18px; gap: 9px; }
  .drop { top: 46px; }
  .note { top: 90px; font-size: 12px; }
}
