/* The store currency switcher with the prices that roll: the bag of Oda Clay, an invented ceramics studio shop, on a
   white page. The whole card is scaled by the script to fit the window (height too), so every size here is in plain
   pixels. Every price is three parts: the symbol, the whole part (drums lined up on the decimal point, from the right)
   and the cents (from the left), so a currency without cents folds them away and grows digits on the left. */
:root {
  --page: #ffffff;          /* the page */
  --card: #ffffff;          /* the card */
  --ink: #17140f;           /* the words */
  --muted: #8a8378;         /* the small words */
  --line: #efebe4;          /* the thin lines */
  --tile: #f6f1e9;          /* the tiles behind the pieces */
  --accent: #c4552f;        /* the accent: the coin, the sheen, the focus */
  --pay: #17140f;           /* the checkout button */
  --pay-ink: #fbf8f3;       /* the words on the button */
}

* { box-sizing: border-box; }
html { touch-action: manipulation; }
html, body { margin: 0; overflow-x: clip; }
body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.bag {
  position: relative;
  width: 332px;
  padding: 18px 18px 18px;
  border-radius: 24px;
  background: var(--card);
  box-shadow:
    inset 0 0 0 1px rgba(23, 20, 15, .07),
    0 1px 1px rgba(23, 20, 15, .04),
    0 8px 18px -8px rgba(60, 40, 20, .14),
    0 34px 60px -28px rgba(60, 40, 20, .24);
  isolation: isolate;
}

/* a warm light at the top of the card, and a grain so fine it only takes the flatness away */
.bag__glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(120% 60% at 85% -12%, color-mix(in srgb, var(--accent) 11%, transparent), transparent 62%),
    radial-gradient(80% 40% at 0% 0%, rgba(240, 225, 200, .45), transparent 70%);
}
.bag__glow::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

.bag__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.bag__mark {
  flex: none;
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(160deg, #fbf7f1, #efe6d9);
  box-shadow: inset 0 0 0 1px rgba(23, 20, 15, .06), 0 1px 2px rgba(23, 20, 15, .06);
}
.bag__mark svg {
  width: 18px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.bag__meta { display: grid; gap: 1px; min-width: 0; }
.bag__title { font-size: 15px; font-weight: 640; letter-spacing: -.01em; }
.bag__sub { font-size: 12px; color: var(--muted); }

/* the currency pill */
.cur {
  position: relative;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 9px 0 4px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff, #f7f3ec);
  box-shadow: inset 0 0 0 1px rgba(23, 20, 15, .1), 0 1px 2px rgba(23, 20, 15, .07), 0 4px 10px -6px rgba(60, 40, 20, .3);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 620;
  font-variation-settings: 'wdth' 100;
  cursor: pointer;
  transition: box-shadow .25s ease, font-variation-settings .35s cubic-bezier(.3, 1.6, .5, 1);
}
.cur[aria-expanded='true'] {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent), 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent), 0 4px 10px -6px rgba(60, 40, 20, .3);
}
@media (hover: hover) {
  .cur:hover { font-variation-settings: 'wdth' 112; }
}
.cur:focus-visible, .pay:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.cur__coin {
  width: 26px; height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #f08a5f, var(--accent) 55%, #8f3518);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -1px 2px rgba(80, 20, 0, .35), 0 1px 2px rgba(80, 30, 10, .3);
  color: #fff8f2;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.cur__sym { display: block; text-shadow: 0 1px 0 rgba(90, 25, 5, .35); }
.cur__sym.is-word { font-size: 8.5px; letter-spacing: .02em; }
.cur__code { font-variant-numeric: tabular-nums; letter-spacing: .02em; min-width: 30px; }
.cur__chev {
  width: 14px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* the pieces */
.bag__items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 4px 7px 7px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(246, 241, 233, .55), rgba(246, 241, 233, 0));
  box-shadow: inset 0 0 0 1px rgba(23, 20, 15, .045);
}
.item__thumb {
  flex: none;
  width: 48px; height: 48px;
  border-radius: 12px;
  background: radial-gradient(90% 80% at 40% 25%, #fffdf9, var(--tile));
  box-shadow: inset 0 0 0 1px rgba(23, 20, 15, .05);
}
.item__thumb--vase { background: radial-gradient(90% 80% at 40% 25%, #fbfbf6, #ecefe6); }
.item__thumb svg { width: 100%; height: 100%; display: block; }
.item__shadow { fill: rgba(60, 40, 20, .16); }
.item__text { display: grid; gap: 2px; min-width: 0; }
.item__name { font-size: 14px; font-weight: 600; letter-spacing: -.005em; }
.item__var { font-size: 12px; color: var(--muted); }
.item .price { margin-left: auto; padding-right: 6px; font-size: 14px; font-weight: 620; }

/* the sums */
.bag__sums {
  margin: 14px 2px 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 6px;
}
.sum { display: flex; align-items: center; }
.sum dt { font-size: 13px; color: var(--muted); }
.sum dd { margin: 0 0 0 auto; }
.price--sm { font-size: 13px; font-weight: 560; color: #4a443b; }

.bag__total {
  position: relative;
  margin: 12px 2px 14px;
  padding-top: 12px;
  border-top: 1px dashed #e4ddd2;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.bag__total-label {
  display: grid;
  gap: 2px;
  font-size: 14px;
  font-weight: 620;
}
.bag__total-label small { font-size: 11.5px; font-weight: 450; color: var(--muted); }
.price--big {
  margin-left: auto;
  font-size: 30px;
  font-weight: 660;
  letter-spacing: -.02em;
  font-variation-settings: 'wdth' 92;
}
/* the light that runs along the line above the total once it has rolled */
.bag__sheen {
  position: absolute;
  top: 0;
  left: 0;
  width: 110px;
  height: 1.5px;
  pointer-events: none;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent) 35%, #ffd2b8 50%, var(--accent) 65%, transparent);
  box-shadow: 0 0 10px 1px color-mix(in srgb, var(--accent) 35%, transparent);
  opacity: 0;
}

/* a price: symbol, whole part, cents */
.price {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.price__sym {
  display: inline-block;
  position: relative;
  overflow: hidden;
  line-height: 1.15;
  vertical-align: bottom;
}
.price__sym > span { display: inline-block; }
.price__sym.is-word > span { margin-right: .22em; font-size: .78em; letter-spacing: .02em; }
.price--big .price__sym > span { font-size: .72em; transform-origin: 50% 80%; }
.price--big .price__sym.is-word > span { font-size: .5em; }
.price__int, .price__frac { display: inline-flex; }
.price__frac { color: inherit; }
.price--big .price__frac { font-size: .62em; align-self: flex-start; padding-top: .14em; letter-spacing: 0; }
.slot {
  display: inline-block;
  position: relative;
  height: 1.15em;
  overflow: hidden;
  vertical-align: bottom;
}
.slot--d {
  /* the digit window fades at the top and the bottom, so the rolling digits come out of a soft edge */
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
}
.slot__in { display: block; }
.slot__in > span { display: block; height: 1.15em; text-align: center; }

/* the glass list */
.pop {
  position: absolute;
  top: 58px;
  right: 12px;
  width: 276px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  box-shadow:
    inset 0 0 0 1px rgba(23, 20, 15, .08),
    inset 0 1px 0 rgba(255, 255, 255, .9),
    0 18px 40px -14px rgba(60, 40, 20, .32),
    0 4px 12px -4px rgba(60, 40, 20, .12);
  transform-origin: 88% 0;
  z-index: 5;
}
.pop[hidden] { display: none; }
.pop__head, .pop__foot {
  margin: 0;
  padding: 4px 8px 6px;
  font-size: 11px;
  font-weight: 560;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.pop__foot { padding: 7px 8px 2px; text-transform: none; letter-spacing: 0; font-weight: 450; border-top: 1px solid var(--line); margin-top: 4px; }
.pop__list { position: relative; outline: none; }
.pop__hi {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(180deg, #f8f3ec, #f2ebe1);
  box-shadow: inset 0 0 0 1px rgba(23, 20, 15, .05);
  opacity: 0;
  pointer-events: none;
}
.pop__list:focus-visible .pop__hi { box-shadow: inset 0 0 0 1.5px var(--accent); }
.opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 8px;
  cursor: pointer;
  font-size: 13px;
}
.opt__coin {
  flex: none;
  width: 24px; height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(160deg, #fbf8f3, #ece4d8);
  box-shadow: inset 0 0 0 1px rgba(23, 20, 15, .08), 0 1px 1px rgba(23, 20, 15, .05);
  font-size: 12px;
  font-weight: 680;
  color: #4a443b;
  transition: background .3s ease, color .3s ease;
}
.opt__coin.is-word { font-size: 7.5px; letter-spacing: .02em; }
.opt[aria-selected='true'] .opt__coin {
  background: radial-gradient(circle at 35% 28%, #f08a5f, var(--accent) 55%, #8f3518);
  color: #fff8f2;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 1px 2px rgba(80, 30, 10, .3);
}
.opt__code { font-weight: 640; width: 30px; letter-spacing: .02em; }
.opt__name { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opt__total { margin-left: auto; white-space: nowrap; padding-left: 6px; font-variant-numeric: tabular-nums; font-weight: 560; color: #4a443b; font-size: 12.5px; }
.opt__check {
  flex: none;
  width: 14px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 14;
  stroke-dashoffset: 14;
}
.opt[aria-selected='true'] .opt__check { stroke-dashoffset: 0; }

/* the checkout button */
.pay {
  width: 100%;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #2b2620, var(--pay));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 1px 2px rgba(23, 20, 15, .3), 0 10px 20px -12px rgba(23, 20, 15, .6);
  color: var(--pay-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  font-variation-settings: 'wdth' 100;
  cursor: pointer;
  transition: transform .2s cubic-bezier(.3, 1.6, .5, 1), font-variation-settings .35s cubic-bezier(.3, 1.6, .5, 1);
}
.pay svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
@media (hover: hover) {
  .pay:hover { font-variation-settings: 'wdth' 114; }
}
.pay:active { transform: scale(.98); }

/* the drawn pointer of the pilot */
.pilot {
  position: absolute;
  left: 0; top: 0;
  width: 22px;
  fill: #17140f;
  stroke: #fff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .25));
  pointer-events: none;
  opacity: 0;
  z-index: 10;
}

@media (prefers-reduced-motion: reduce) {
  .cur, .pay, .opt__coin { transition: none; }
  .pilot { display: none; }
}
