/* The member price button of Loam & Lane, a made-up home goods shop: one small product card alone on white, a single blue accent. */
:root {
  --fondo: #ffffff;
  --carta: #ffffff;
  --bordo: #ebeae6;
  --tinta: #f4f3f0;          /* the thumbnail, the veil over the hidden price */
  --testo: #16150f;
  --testo-2: #5f5d55;
  --testo-3: #9d9a90;
  --accento: #2f4fe0;        /* the single accent: the member price, the pill, the saving */
  --accento-chiaro: #eaeefe;
  --lino: #e8dfd0;           /* the linen of the drawn throw, a neutral */
  --ombra: 26, 28, 40;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
html { font-size: clamp(9px, min(4.2vw, 3.3vh), 19px); }
body {
  background: var(--fondo);
  color: var(--testo);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.stage { height: 100vh; display: grid; place-items: center; padding: 2vh 4vw; }

/* the card */
.card {
  position: relative;
  width: min(18.5em, 92vw);
  padding: 1.15em 1.15em 1.05em;
  border-radius: 1.4em;
  background: var(--carta);
  box-shadow:
    0 1px 1px rgba(var(--ombra), .05),
    0 6px 14px -6px rgba(var(--ombra), .10),
    0 26px 50px -26px rgba(var(--ombra), .26);
  display: grid;
  gap: 1em;
  isolation: isolate;
}
.card__edge {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2;
  padding: 1px;
  background: linear-gradient(180deg, #f1f0ec, var(--bordo) 30%, #e2e0da);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* the product */
.prod { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .8em; align-items: center; }
.thumb {
  width: 3.4em; height: 3.4em; border-radius: .95em; display: grid; place-items: center;
  background: var(--tinta);
  box-shadow: inset 0 0 0 1px rgba(var(--ombra), .04);
}
.thumb svg { width: 2.7em; height: 2.7em; display: block; overflow: visible; }
.throw { fill: var(--lino); stroke: #b9ab94; stroke-width: .8; }
.throw--back { fill: #f0e9de; }
.weave { fill: none; stroke: #cbbfa9; stroke-width: .8; stroke-linecap: round; stroke-dasharray: .6 1.6; }
.fringe { fill: none; stroke: #b9ab94; stroke-width: .8; stroke-linecap: round; }
.prod__txt { display: grid; gap: .12em; min-width: 0; }
.brand { font-size: .68em; color: var(--testo-3); font-weight: 600; letter-spacing: .02em; }
.name { font-size: 1.06em; font-weight: 650; letter-spacing: -.015em; line-height: 1.15; }
.meta { font-size: .72em; color: var(--testo-2); }

/* the prices */
.prices { display: grid; gap: .45em; padding: .75em .85em; border-radius: .95em; border: 1px solid var(--bordo); }
.row { display: flex; justify-content: space-between; align-items: center; gap: .5em; min-height: 1.6em; }
.lab { font-size: .76em; color: var(--testo-2); font-weight: 540; white-space: nowrap; }
.lab--member { color: var(--accento); font-weight: 600; }
.full { position: relative; font-size: .92em; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--testo); }
.full__txt { display: inline-block; }
.strike {
  position: absolute; left: -.12em; right: -.12em; top: 52%; height: 1.5px; border-radius: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: 0 50%;
}
.full.is-old { color: var(--testo-3); }

.member { position: relative; display: inline-flex; align-items: center; gap: .4em; font-size: 1.14em; font-weight: 680; letter-spacing: -.02em; color: var(--accento); }
.save {
  display: inline-grid; place-items: center; height: 1.55em; padding: 0 .55em; border-radius: 99em;
  background: var(--accento-chiaro); font-size: .52em; font-weight: 650; letter-spacing: 0; color: var(--accento);
  opacity: 0; transform: scale(.6);
}
.save__txt { white-space: nowrap; }

/* the veil over the hidden price: a soft pill with the lock, in the same place as the digits */
.veil {
  position: absolute; right: -.25em; top: 50%; height: 1.5em; width: 4.6em; margin-top: -.75em;
  display: grid; place-items: center; border-radius: .5em;
  background: linear-gradient(90deg, rgba(244, 243, 240, .6), var(--tinta) 30%, var(--tinta));
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  z-index: 1;
}
.lock { width: .72em; height: .72em; display: block; fill: none; stroke: var(--testo-3); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }

/* the rolling digits: each digit is a window over a column 0-9 */
.roll { display: inline-flex; font-variant-numeric: tabular-nums; white-space: nowrap; }
.roll .ch { display: inline-block; position: relative; height: 1.15em; line-height: 1.15em; overflow: hidden; vertical-align: bottom;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 16%, #000 84%, transparent); mask-image: linear-gradient(180deg, transparent, #000 16%, #000 84%, transparent); }
.roll .col { display: block; will-change: transform; }
.roll .col span { display: block; height: 1.15em; text-align: center; }
.roll .fix { display: inline-block; height: 1.15em; line-height: 1.15em; vertical-align: bottom; }

/* the pill: the site's elastic pill, the label widens on the wdth axis, the ground swells with a bounce */
.pill {
  position: relative; height: 3em; width: 100%; justify-self: center;
  color: #fff; font-size: .9em; font-weight: 620;
  border-radius: 99em;
  touch-action: manipulation;
}
.pill__bg {
  position: absolute; inset: 0; border-radius: inherit; background: var(--accento);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .22) inset, 0 8px 18px -10px rgba(47, 79, 224, .8);
}
.pill__bg::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, .14), transparent 55%);
}
.pill__face { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: .45em; white-space: nowrap; pointer-events: none; }
.pill__face[data-face="spin"], .pill__face[data-face="add"], .pill__face[data-face="added"] { opacity: 0; }
.pill__txt { display: inline-block; font-stretch: 100%; transition: font-stretch .45s cubic-bezier(.34, 1.56, .64, 1); }
.dot { opacity: .6; }
@media (hover: hover) {
  .pill:hover .pill__txt { font-stretch: 112%; }
}
.spin { width: 1.45em; height: 1.45em; display: block; fill: none; }
.spin__track { stroke: rgba(255, 255, 255, .28); stroke-width: 2.4; }
.spin__arc { stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: .28 .72; }
.tick { width: 1.1em; height: 1.1em; display: block; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tick path { stroke-dasharray: 1 1; stroke-dashoffset: 1; }

.note { font-size: .7em; color: var(--testo-3); text-align: center; margin-top: -.35em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pill.is-hover .pill__txt { font-stretch: 112%; }
.pill__bg { transition: transform .5s cubic-bezier(.34, 1.56, .64, 1); }
@media (hover: hover) {
  .pill:hover .pill__bg { transform: scale(1.025, 1.08); }
}
.pill.is-hover .pill__bg { transform: scale(1.025, 1.08); }
.pill.is-round .pill__bg { transform: none; }
