:root {
  --fondo: #ffffff;
  --inchiostro: #17151a;
  --crema: #f7f0e3;
  --ambra: #a8621f;
  --ambra-scura: #6b3a12;
  --ottone: #d7a55a;
  --carta: #fbf6ec;
  --grigio: #8b8790;
}

*, *::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 above the pill for the check that comes up from behind it */
.frame {
  --py: min(124px, 30vh);
  position: relative;
  width: min(320px, 92vw);
  height: calc(var(--py) + 112px);
}

.row {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  top: var(--py);
  display: flex;
  justify-content: center;
}

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

.t__shell {
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: 999px;
  pointer-events: none;
}
.t__skin, .t__fill, .t__glow, .t__sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.t__skin {
  background: linear-gradient(180deg, #26232a 0%, var(--inchiostro) 58%, #0e0d11 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(23, 21, 26, 0.16),
    0 6px 14px -6px rgba(23, 21, 26, 0.3),
    0 22px 40px -22px rgba(23, 21, 26, 0.55);
}
/* the whisky amber that floods the pill from the slot once the tab is open */
.t__fill {
  background:
    radial-gradient(120% 140% at 18% 0%, rgba(255, 214, 150, 0.32), transparent 55%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #b86e27 0%, var(--ambra) 45%, var(--ambra-scura) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 226, 180, 0.4), inset 0 -1px 0 rgba(50, 20, 0, 0.45);
  clip-path: circle(0px at 32px 50%);
}
.t__glow {
  overflow: hidden;
  opacity: 0;
  background: radial-gradient(120px 80px at var(--gx, 50%) var(--gy, 50%), rgba(255, 228, 190, 0.17), transparent 70%);
}
.t__sheen {
  opacity: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 240, 215, 0.34) 48%, transparent 64%);
  background-size: 260% 100%;
  background-position: 120% 0;
}

/* the icon: the card above the slot at rest, the coupe rising out of it once the tab is open */
.t__icon {
  position: relative;
  flex: none;
  width: 26px;
  height: 26px;
}
.t__icon svg {
  display: block;
  width: 26px;
  height: 26px;
  overflow: visible;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card__body { stroke: currentColor; stroke-width: 1.5; fill: rgba(247, 240, 227, 0.06); }
.card__chip { fill: var(--ottone); }
.card__line { stroke: currentColor; stroke-width: 1.3; opacity: 0.45; }
.glass__bowl { stroke: currentColor; stroke-width: 1.5; }
.glass__stem { stroke: currentColor; stroke-width: 1.5; }
.glass__wine { fill: #ffd79b; opacity: 0.9; }
.glass__peel { stroke: #ffd79b; stroke-width: 1.3; }
.i__slot { stroke: rgba(247, 240, 227, 0.34); stroke-width: 1.5; }
.i__run {
  stroke: #ffe2b0;
  stroke-width: 1.6;
  stroke-dasharray: 22 200;
  stroke-dashoffset: 22;
  opacity: 0;
}

.t__labels {
  position: relative;
  display: block;
  height: 22px;
  overflow: hidden;
}
.t__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;
  font-variation-settings: "wdth" 100;
}
.t__label[data-l="idle"] { opacity: 1; }
.t__sep { margin: 0 0.42em; opacity: 0.55; }
.t__amt { color: #ffe2b0; font-weight: 640; font-variant-numeric: tabular-nums; }

.note {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--py) + 78px);
  height: 18px;
  margin: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 460;
  color: var(--grigio);
  white-space: nowrap;
}
.note__line { position: absolute; left: 0; right: 0; top: 0; }
.note__line[data-n="done"] { opacity: 0; }

/* the check: cut along the middle of the pill, so it comes up from behind it */
.rise {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 0;
  width: 170px;
  height: calc(var(--py) + 30px);
  margin-left: -85px;
  clip-path: inset(-60px -80px 0 -80px);
  pointer-events: none;
}
.check {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 138px;
  margin-left: -69px;
}
.check__tilt { position: relative; transform-origin: 50% 100%; }
.check__clip {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: -9px;
  width: 34px;
  height: 16px;
  margin-left: -17px;
  overflow: visible;
  filter: drop-shadow(0 1px 1px rgba(60, 35, 10, 0.3));
}
.clip__back { fill: none; stroke: #8f6a33; stroke-width: 1.3; }
.clip__face { fill: var(--ottone); stroke: #9c7233; stroke-width: 0.8; }
.clip__hinge { stroke: rgba(255, 244, 220, 0.75); stroke-width: 1; stroke-linecap: round; }
.check__paper {
  position: relative;
  display: grid;
  gap: 3px;
  padding: 14px 12px 40px;
  border-radius: 8px 8px 4px 4px;
  background:
    radial-gradient(140% 80% at 25% 0%, rgba(255, 255, 255, 0.9), transparent 60%),
    linear-gradient(180deg, #fdf9f1, var(--carta) 60%, #f1e9da);
  color: var(--inchiostro);
  box-shadow:
    inset 0 0 0 1px rgba(120, 92, 48, 0.14),
    inset 0 1px 0 #fff,
    0 1px 1px rgba(23, 21, 26, 0.08),
    0 8px 14px -8px rgba(23, 21, 26, 0.22),
    0 24px 30px -20px rgba(70, 36, 10, 0.32);
}
.check__house {
  font-size: 7.5px;
  font-weight: 640;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ambra);
  font-variation-settings: "wdth" 112;
}
.check__name {
  margin-bottom: 3px;
  font-size: 15px;
  font-weight: 680;
  letter-spacing: -0.01em;
  font-variation-settings: "wdth" 116;
}
.check__sep { margin: 0 0.3em; opacity: 0.4; }
.check__row {
  display: flex;
  justify-content: space-between;
  font-size: 8.5px;
  font-weight: 500;
  color: var(--grigio);
  font-variant-numeric: tabular-nums;
}
.check__row span:last-child { color: var(--inchiostro); font-weight: 560; }
.check__perf {
  height: 1px;
  margin: 4px 0 2px;
  background-image: linear-gradient(90deg, rgba(23, 21, 26, 0.26) 50%, transparent 50%);
  background-size: 5px 1px;
}
.check__row--total { font-size: 9px; }
.check__row--total span:last-child { color: var(--ambra-scura); font-weight: 700; }

@media (max-width: 400px) {
  .t { height: 56px; font-size: 15px; padding: 0 22px 0 17px; gap: 9px; }
  .rise { height: calc(var(--py) + 28px); }
  .note { top: calc(var(--py) + 72px); font-size: 12px; }
}
