:root {
  --fondo: #000000;          /* the page */
  --opaco: #141416;          /* the matte graphite pill */
  --opaco-alto: #1d1d21;     /* the top of the pill, a touch lighter */
  --testo: #f2f2f4;          /* the label on the matte */
  --spento: #8a8a92;         /* the hint and the secondary text */
  --argento-1: #f4f5f7;      /* the brightest silver */
  --argento-2: #c3c6cd;      /* the mid silver */
  --argento-3: #8d919b;      /* the shadowed silver */
  --inciso: #2a2c31;         /* the label pressed into the foil */
  --accento: #b9c4ff;        /* the cold blue glint in the foil */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--fondo);
  color: var(--testo);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  height: 100%;
  display: grid;
  place-items: center;
  /* the plan hangs below the button: the pair sits a little higher so the button never jumps */
  padding-bottom: min(150px, 34vh);
}
.fit { transform-origin: 50% 50%; }
.col {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 300px;
}

/* ---------------- the pill ---------------- */
.btn {
  --p: 0;                     /* how much foil is stamped, 0 to 1 */
  --gx: 50%;                  /* where the pointer is, for the glint */
  --gy: 30%;
  position: relative;
  width: 264px;
  height: 60px;
  border: 0;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.btn__matte {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, var(--opaco-alto), var(--opaco) 60%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    inset 0 -1px 0 rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 14px 28px -14px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}
.btn__glint {
  position: absolute;
  inset: 0;
  background: radial-gradient(120px 60px at var(--gx) var(--gy), rgba(185, 196, 255, 0.13), transparent 70%);
  opacity: 0;
  transition: opacity 0.35s ease;
}
@media (hover: hover) {
  .btn:hover .btn__glint { opacity: 1; }
}
.btn:focus-visible { outline: none; }
.btn:focus-visible .btn__matte { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 0 0 2px var(--accento); }

/* the foil: brushed silver, revealed from the left by --p */
.foil {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  clip-path: inset(0 calc((1 - var(--p)) * 100%) 0 0 round 999px);
  background:
    linear-gradient(100deg, var(--argento-3) 0%, var(--argento-1) 22%, var(--argento-2) 40%, var(--argento-1) 58%, var(--argento-3) 78%, var(--argento-2) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), inset 0 -2px 3px rgba(0, 0, 0, 0.28);
}
.foil__brush {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.16) 0 1px, rgba(0, 0, 0, 0.05) 1px 2px, rgba(255, 255, 255, 0) 2px 3px);
  mix-blend-mode: overlay;
}
.foil__band {
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  width: 70px;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.95) 45%, rgba(185, 196, 255, 0.7) 55%, transparent);
  filter: blur(4px);
  opacity: 0.55;
  transform: translateX(-90px) skewX(-14deg);
}
/* the hot edge of the stamping die, riding on the front of the foil */
.foil__edge {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, transparent, #ffffff 30%, var(--accento) 70%, transparent);
  box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.55);
  opacity: 0;
}

/* ---------------- the two faces ---------------- */
.face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px 0 20px;
  pointer-events: none;
}
.face--matte { clip-path: inset(0 0 0 calc(var(--p) * 100%)); }
.face--foil {
  color: var(--inciso);
  clip-path: inset(0 calc((1 - var(--p)) * 100%) 0 0);
  /* the label pressed into the foil: a light lip under, a shade over */
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7), 0 -1px 0 rgba(0, 0, 0, 0.12);
}
.badge {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.face--foil .badge { filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.7)); }
.badge__tick { stroke-dasharray: 12; stroke-dashoffset: 12; }

.label {
  flex: 1;
  height: 22px;
  overflow: hidden;
  font-size: 16px;
  font-weight: 600;
  font-stretch: 104%;
  letter-spacing: -0.005em;
  line-height: 22px;
  text-align: left;
}
.label__win { display: flex; flex-direction: column; }
.label__a, .label__b { display: block; height: 22px; white-space: nowrap; }

.hold {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  font-stretch: 96%;
  color: var(--spento);
}
.face--foil .hold { color: var(--inciso); opacity: 0.75; }
.hold svg { width: 18px; height: 18px; transform: rotate(-90deg); }
.hold__track { fill: none; stroke: currentColor; stroke-opacity: 0.3; stroke-width: 1.6; }
.hold__fill { fill: none; stroke: var(--testo); stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.face--foil .hold__fill { stroke: var(--inciso); }

.hint {
  margin-top: 14px;
  height: 16px;
  font-size: 12px;
  font-stretch: 96%;
  letter-spacing: 0.01em;
  color: var(--spento);
}

/* ---------------- the plan ---------------- */
.plan {
  position: absolute;
  top: 100%;
  left: calc(50% - 146px);
  width: 264px;
  height: 0;
  margin-top: 4px;
  overflow: hidden;
  /* room for the shadow without cutting it flat */
  padding: 0 14px 18px;
  box-sizing: content-box;
}
.plan__in {
  position: relative;
  opacity: 0;
  visibility: hidden;
  border-radius: 18px;
  padding: 16px 18px 14px;
  background: linear-gradient(180deg, #17171a, #101012);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 0 0 1px rgba(255, 255, 255, 0.06), 0 18px 30px -18px rgba(0, 0, 0, 0.95);
}
/* a thread of foil along the top edge of the plan */
.plan__in::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--argento-1), var(--accento), transparent);
  opacity: 0.8;
}
.plan__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.plan__name { font-size: 13px; font-weight: 600; font-stretch: 104%; }
.plan__price { font-size: 11px; color: var(--spento); font-stretch: 94%; white-space: nowrap; }
.plan__price b { font-size: 15px; font-weight: 650; color: var(--testo); margin-right: 3px; font-variant-numeric: tabular-nums; }
.plan__perks { list-style: none; margin-top: 12px; display: grid; gap: 8px; }
.plan__perks li { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: #d6d6db; font-stretch: 98%; }
.plan__perks svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--argento-2); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.plan__perks path { stroke-dasharray: 16; stroke-dashoffset: 16; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.cursor {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  fill: #ffffff;
  stroke: #000000;
  stroke-width: 1.3;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
  pointer-events: none;
  opacity: 0;
  z-index: 5;
}

/* reduced motion: no wipe, the foil fades in place (the script drives the opacities) */
.ridotto .foil, .ridotto .face--foil, .ridotto .face--matte { clip-path: none; }
.ridotto .foil, .ridotto .face--foil { opacity: var(--p); }
.ridotto .face--matte { opacity: calc(1 - var(--p)); }
