:root {
  --bg: #ffffff;
  --ink: #17181c;
  --soft: rgba(23, 24, 28, 0.56);
  --line: rgba(23, 24, 28, 0.1);
  --panel: #f4f4f1;
  --panel-dim: #dcdcd7;
  --accent: #e4572e;
  --good: #159a5c;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 18px 10px;
}

/* the cart is the page someone is about to leave: its outline is one svg path, so the top edge can stretch */
.xp { position: relative; width: min(326px, 100%); height: 356px; }
.xp__shape { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.xp__shape path { fill: var(--panel); stroke: var(--line); stroke-width: 1; transition: fill 0.4s ease; }
.xp.is-open .xp__shape path { fill: var(--panel-dim); }

.xp__grip { position: absolute; left: 50%; top: 0; z-index: 2; width: 64px; height: 22px; margin-left: -32px; display: grid; place-items: center; border-radius: 10px; }
.xp__grip i { display: block; width: 34px; height: 4px; border-radius: 4px; background: rgba(23, 24, 28, 0.2); transition: background 0.2s ease, width 0.3s cubic-bezier(0.3, 1.6, 0.5, 1); }
.xp__grip:active i { width: 26px; }

.xp__page { position: absolute; inset: 0; padding: 26px 18px 14px; display: flex; flex-direction: column; transition: opacity 0.4s ease, filter 0.4s ease; }
.xp.is-open .xp__page { opacity: 0.4; filter: blur(1.500px); }
.xp__head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 2px 10px; }
.xp__head h2 { font-size: 17px; font-weight: 720; font-stretch: 106%; letter-spacing: -0.01em; }
.xp__head span { font-size: 12.5px; font-weight: 600; color: var(--soft); }
.xp__rows { list-style: none; }
.xp__rows li { display: flex; align-items: center; gap: 12px; height: 62px; border-top: 1px solid var(--line); }
.xp__tile { flex: none; width: 44px; height: 44px; border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(23, 24, 28, 0.06), inset 0 10px 14px -8px rgba(255, 255, 255, 0.7); }
.xp__tile--a { background: linear-gradient(150deg, #e9dcc6, #cdb892); }
.xp__tile--b { background: linear-gradient(150deg, #a9b08a, #6f7a55); }
.xp__what { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.xp__what b { font-size: 14px; font-weight: 660; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xp__what span { font-size: 12px; font-weight: 560; color: var(--soft); }
.xp__price { font-size: 13.5px; font-weight: 640; }
.xp__total { display: flex; align-items: center; gap: 8px; height: 50px; border-top: 1px solid var(--line); font-size: 14px; font-weight: 640; }
.xp__total > span:first-child { flex: 1; }
.xp__tag { padding: 3px 7px 2px; border-radius: 7px; background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); font-size: 11.5px; font-weight: 720; opacity: 0; }
.xp__sum { font-size: 17px; font-weight: 740; }
.xp__roll { display: block; overflow: hidden; }
.xp__roll > span { display: block; white-space: nowrap; }

/* the cart's own way forward, at the bottom */
.xp__go { order: 9; flex: none; height: 46px; margin-top: auto; border-radius: 23px; background: #ffffff; box-shadow: 0 0 0 1px rgba(23, 24, 28, 0.1), 0 1px 2px rgba(23, 24, 28, 0.05); font-size: 14px; font-weight: 700; font-stretch: 104%; transition: transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1), box-shadow 0.25s ease; }
.xp__go:active { transform: scale(0.97); }

/* closed without using it, the offer waits here as a tab */
.xp__pill { align-self: flex-start; margin-top: 2px; display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px 0 10px; border-radius: 17px; background: #ffffff; box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 34%, transparent), 0 6px 14px -8px color-mix(in srgb, var(--accent) 60%, transparent); color: var(--accent); font-size: 12.5px; font-weight: 700; letter-spacing: 0.01em; visibility: hidden; opacity: 0; transition: box-shadow 0.25s ease; }
.xp__pill svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.300; stroke-linejoin: round; }
.xp__pill:active { box-shadow: 0 0 0 1px var(--accent), 0 2px 6px -4px var(--accent); }

/* ---- the pop-up ---- */
.xp__pop { position: absolute; z-index: 3; left: 14px; right: 14px; top: 30px; padding: 20px 18px 8px; border-radius: 22px; background: #ffffff; box-shadow: 0 0 0 1px rgba(23, 24, 28, 0.06), 0 2px 4px rgba(23, 24, 28, 0.05), 0 14px 28px -10px rgba(23, 24, 28, 0.2), 0 34px 60px -30px rgba(23, 24, 28, 0.38); visibility: hidden; opacity: 0; outline: none; will-change: transform; }
.xp__x { position: absolute; right: 10px; top: 10px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--soft); transition: background 0.2s ease, color 0.2s ease, transform 0.3s cubic-bezier(0.3, 1.6, 0.5, 1); }
.xp__x svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.700; stroke-linecap: round; }
.xp__x:active { transform: scale(0.88); }
.xp__eyebrow { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: 0.01em; }
.xp__title { --w: 106; margin-top: 5px; font-size: 27px; line-height: 1.08; font-weight: 780; font-variation-settings: "wdth" var(--w); letter-spacing: -0.02em; white-space: nowrap; }
.xp__sub { margin-top: 8px; font-size: 13px; line-height: 1.42; font-weight: 540; color: var(--soft); }
.xp__sub b { color: var(--ink); font-weight: 700; }

/* a ticket: dashed edge, two bites on the sides, the time left running out along the bottom */
.xp__coupon { --tone: var(--accent); position: relative; display: flex; align-items: center; height: 54px; margin-top: 14px; padding: 0 7px 0 18px; border-radius: 14px; background: color-mix(in srgb, var(--tone) 7%, #ffffff); border: 1.500px dashed color-mix(in srgb, var(--tone) 50%, transparent); overflow: hidden; transition: background 0.3s ease, border-color 0.3s ease; }
.xp__coupon.is-copied { --tone: var(--good); border-style: solid; }
.xp__coupon::before, .xp__coupon::after { content: ""; position: absolute; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: #ffffff; box-shadow: inset 0 0 0 1.500px color-mix(in srgb, var(--tone) 50%, transparent); }
.xp__coupon::before { left: -9px; }
.xp__coupon::after { right: -9px; }
.xp__code { flex: 1; display: flex; font-size: 19px; font-weight: 780; font-stretch: 112%; letter-spacing: 0.14em; color: var(--ink); }
.xp__code i { display: block; font-style: normal; }
.xp__copy { position: relative; z-index: 1; height: 36px; min-width: 74px; padding: 0 14px; border-radius: 10px; background: #ffffff; box-shadow: 0 0 0 1px rgba(23, 24, 28, 0.1), 0 1px 2px rgba(23, 24, 28, 0.06); font-size: 13px; font-weight: 700; color: var(--tone); transition: color 0.3s ease, transform 0.3s cubic-bezier(0.3, 1.6, 0.5, 1); }
.xp__copy:active { transform: scale(0.94); }
.xp__copy .xp__roll { height: 18px; line-height: 18px; }
.xp__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2.500px; }
.xp__bar b { display: block; height: 100%; background: var(--tone); opacity: 0.55; transform-origin: 0 50%; transition: background 0.3s ease; }

.xp__apply { --fill: var(--ink); position: relative; width: 100%; height: 48px; margin-top: 12px; display: flex; align-items: center; justify-content: center; border-radius: 24px; background: var(--fill); color: #ffffff; font-size: 14.5px; font-weight: 700; font-stretch: 104%; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 10px 18px -12px var(--fill); transition: transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1), background 0.35s ease; }
.xp__apply:active { transform: scale(0.97); }
.xp__apply.is-done { --fill: var(--good); }
.xp__apply svg { width: 0; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: width 0.3s ease, margin 0.3s ease; }
.xp__apply.is-done svg { width: 18px; margin-right: 7px; }
.xp__apply path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.xp__apply .xp__roll { height: 20px; line-height: 20px; }
.xp__no { display: block; width: 100%; height: 36px; margin-top: 2px; font-size: 12.5px; font-weight: 640; color: var(--soft); border-radius: 12px; transition: color 0.2s ease; }

@media (hover: hover) {
  .xp__grip:hover i { background: rgba(23, 24, 28, 0.36); }
  .xp__x:hover { background: rgba(23, 24, 28, 0.06); color: var(--ink); }
  .xp__copy:hover { transform: translateY(-1px); }
  .xp__apply:hover { transform: scale(1.015); }
  .xp__no:hover { color: var(--ink); }
  .xp__go:hover { box-shadow: 0 0 0 1px rgba(23, 24, 28, 0.2), 0 6px 14px -8px rgba(23, 24, 28, 0.3); }
  .xp__pill:hover { box-shadow: 0 0 0 1px var(--accent), 0 8px 16px -8px var(--accent); }
}

/* the demo's own pointer */
.xp__cursor { position: absolute; z-index: 5; left: 0; top: 0; width: 22px; height: 22px; margin: -3px 0 0 -4px; pointer-events: none; opacity: 0; }
.xp__cursor svg { display: block; width: 100%; height: 100%; fill: var(--ink); stroke: #ffffff; stroke-width: 1.400; stroke-linejoin: round; filter: drop-shadow(0 2px 3px rgba(23, 24, 28, 0.3)); }

@media (max-width: 345px) {
  .xp__title { font-size: 25px; }
  .xp__code { font-size: 17.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .xp__shape path, .xp__page, .xp__apply, .xp__apply svg, .xp__x, .xp__copy, .xp__grip i { transition: none; }
}
