/* The hold to send transfer button with the flying coin. A dark desk (a cold light behind, a mint haze from below,
   a fine grain) and in the middle the pill of Halden, a made-up bank: smoked glass with a hairline edge. Inside one
   rounded box (.tx__body, moved only by GSAP): the glass, the mint charge that grows from the avatar while you hold,
   the light under the pointer, the reflection that crosses when the money leaves, the edges on top. Then the row:
   the avatar in its ring, two lines of words, the lock. Under the pill the receipt waits, hidden; above it the coin. */
:root {
  --page: #07080a;            /* the desk */
  --haze: #18202a;            /* the cold light behind the button */
  --mint: #6ff2c2;            /* the accent: ring, charge, tick */
  --mint-deep: #13795a;       /* the mint in shadow */
  --gold: #e9c98a;            /* the coin */
  --gold-deep: #8a6630;       /* the coin's rim in shadow */
  --glass: #12161b;           /* the smoked glass of the pill */
  --ink: #f3f5f7;             /* the words */
  --muted: rgba(243, 245, 247, 0.55); /* the small line under the words */
  --warn: #ffb59a;            /* the line when you let go too soon */
  --paper: #e9ece8;           /* the receipt */
  --paper-ink: #1b2026;       /* the words on the receipt */
  --avatar-a: #e48a64;        /* the avatar, light side */
  --avatar-b: #7a3b4a;        /* the avatar, dark side */
}

* {
  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;
}

/* the desk: a cold light behind, a faint mint from below and a fine grain */
.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
  background:
    radial-gradient(min(80vw, 640px) min(46vh, 320px) at 50% 42%, color-mix(in srgb, var(--haze) 92%, transparent), transparent 72%),
    radial-gradient(min(120vw, 900px) min(70vh, 520px) at 50% 128%, color-mix(in srgb, var(--mint-deep) 18%, transparent), transparent 70%),
    radial-gradient(min(50vw, 380px) min(30vh, 220px) at 18% 8%, rgba(255, 255, 255, 0.035), transparent 70%),
    var(--page);
}

.stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.85 0 0 0 0 0.95 0 0 0 0 0.92 0 0 0 0.07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

.tx {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  padding-bottom: min(64px, 12vh);
  display: grid;
  justify-items: center;
}

/* the mint the button throws on the desk under it */
.tx__spill {
  position: absolute;
  left: 50%;
  top: 46px;
  width: 96%;
  height: 46px;
  margin-left: -48%;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--mint) 46%, transparent), color-mix(in srgb, var(--mint-deep) 18%, transparent) 55%, transparent);
  filter: blur(16px);
  opacity: 0.1;
  pointer-events: none;
}

.tx__btn {
  position: relative;
  z-index: 2;
  width: 100%;
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

.tx__btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--mint) 80%, white);
  outline-offset: 5px;
}

.tx__body {
  --mx: 30%;
  --my: 50%;
  position: relative;
  display: block;
  width: 100%;
  height: 60px;
  border-radius: 999px;
  isolation: isolate;
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.85),
    0 8px 18px -10px rgba(0, 0, 0, 0.9),
    0 28px 54px -24px rgba(0, 0, 0, 1),
    0 14px 34px -22px color-mix(in srgb, var(--mint) 30%, transparent);
}

.tx__fill,
.tx__charge,
.tx__shine,
.tx__sweep,
.tx__edge {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
}

/* smoked glass: deep, a little lighter at the top, with a soft frost */
.tx__fill {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0) 46%, rgba(0, 0, 0, 0.22)),
    radial-gradient(120% 160% at 24% 0%, rgba(160, 190, 210, 0.08), transparent 60%),
    var(--glass);
}

/* the mint that grows from the avatar while you hold */
.tx__charge-light {
  position: absolute;
  left: 4px;
  top: 50%;
  width: 120px;
  height: 120px;
  margin-top: -60px;
  border-radius: 50%;
  transform-origin: 30px 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--mint) 34%, transparent), color-mix(in srgb, var(--mint-deep) 22%, transparent) 50%, transparent);
  opacity: 0;
}

.tx__shine-light {
  position: absolute;
  inset: 0;
  background: radial-gradient(160px 90px at var(--mx) var(--my), rgba(255, 255, 255, 0.09), transparent 70%);
  opacity: 0;
}

.tx__sweep-band {
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  width: 26%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12) 46%, rgba(220, 255, 240, 0.2) 50%, rgba(255, 255, 255, 0.12) 54%, transparent);
}

/* the hairline edge: light at the top, shadow at the bottom */
.tx__edge {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.075),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5);
}

.tx__row {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 12px 0 4px;
  gap: 10px;
}

/* the avatar and its ring */
.tx__who {
  position: relative;
  flex: none;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
}

.tx__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.tx__ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 1.2;
  stroke-dasharray: 0.9 2.62;
}

.tx__ring-arc {
  fill: none;
  stroke: var(--mint);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 0 1;
  filter: drop-shadow(0 0 3px color-mix(in srgb, var(--mint) 55%, transparent));
}

.tx__ring-pulse {
  fill: none;
  stroke: var(--mint);
  stroke-width: 1.2;
  opacity: 0;
}

.tx__sparks line {
  stroke: var(--mint);
  stroke-width: 1.4;
  stroke-linecap: round;
  opacity: 0;
}

.tx__avatar {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(70% 70% at 32% 26%, rgba(255, 230, 205, 0.55), transparent 60%),
    radial-gradient(90% 90% at 70% 90%, rgba(30, 10, 25, 0.55), transparent 70%),
    linear-gradient(150deg, var(--avatar-a), var(--avatar-b));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    inset 0 -6px 10px rgba(0, 0, 0, 0.22),
    0 2px 6px rgba(0, 0, 0, 0.5);
}

.tx__avatar-face {
  font-size: 17px;
  font-weight: 640;
  font-stretch: 112%;
  color: rgba(255, 248, 240, 0.94);
  text-shadow: 0 1px 1px rgba(60, 20, 20, 0.4);
  letter-spacing: -0.01em;
}

/* two lines of words */
.tx__text {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 3px;
  text-align: left;
}

.tx__titles,
.tx__subs {
  display: grid;
}

.tx__title,
.tx__sub {
  grid-area: 1 / 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx__title {
  font-size: 16.5px;
  line-height: 20px;
  font-weight: 620;
  letter-spacing: -0.01em;
  font-stretch: var(--w, 100%);
  overflow: visible;
}

.tx__amt {
  display: inline-block;
  font-variant-numeric: proportional-nums;
  color: #fff;
}

.tx__sub {
  font-size: 12.5px;
  line-height: 15px;
  font-weight: 460;
  color: var(--muted);
}

.tx__sub--warn {
  color: var(--warn);
}

.tx__sub--ok {
  color: color-mix(in srgb, var(--mint) 82%, white);
}

/* the lock that opens and turns into a tick */
.tx__lock {
  position: relative;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.tx__lock svg {
  width: 20px;
  height: 20px;
  overflow: visible;
}

.tx__shackle,
.tx__keyhole {
  fill: none;
  stroke: rgba(243, 245, 247, 0.8);
  stroke-width: 1.7;
  stroke-linecap: round;
}

.tx__lock-body {
  fill: rgba(243, 245, 247, 0.16);
  stroke: rgba(243, 245, 247, 0.8);
  stroke-width: 1.5;
}

.tx__tick {
  fill: none;
  stroke: var(--mint);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 0 1;
}

/* the receipt under the pill: paper, a perforated top, two lines */
.tx__receipt {
  position: absolute;
  z-index: 1;
  left: 7%;
  right: 7%;
  top: 30px;
  height: 92px;
  overflow: hidden;
  border-radius: 0 0 16px 16px;
  pointer-events: none;
}

.tx__receipt-paper {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 62px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 8px 16px 6px;
  border-radius: 0 0 16px 16px;
  color: var(--paper-ink);
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), transparent 26%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.4), transparent 30%, transparent 70%, rgba(0, 0, 0, 0.05)),
    var(--paper);
  box-shadow: 0 14px 26px -12px rgba(0, 0, 0, 0.8), inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}

.tx__perf {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 7px;
  height: 1px;
  background: repeating-linear-gradient(90deg, rgba(27, 32, 38, 0.3) 0 4px, transparent 4px 8px);
}

.tx__line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  line-height: 15px;
  font-weight: 560;
  white-space: nowrap;
}

.tx__line .tx__k {
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx__v {
  font-variant-numeric: proportional-nums;
}

.tx__line--muted {
  font-size: 11px;
  font-weight: 460;
  color: rgba(27, 32, 38, 0.58);
}

/* the coin: gold with a rim and the euro sign */
.tx__coin {
  position: absolute;
  z-index: 4;
  left: 0;
  top: 0;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  pointer-events: none;
  opacity: 0;
}

.tx__coin-face {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  color: color-mix(in srgb, var(--gold-deep) 85%, black);
  background:
    radial-gradient(60% 60% at 34% 28%, rgba(255, 250, 230, 0.85), transparent 60%),
    radial-gradient(closest-side, var(--gold) 70%, color-mix(in srgb, var(--gold) 70%, var(--gold-deep)) 86%, var(--gold-deep) 100%);
  box-shadow:
    inset 0 0 0 1.5px color-mix(in srgb, var(--gold-deep) 60%, transparent),
    inset 0 0 0 3.5px color-mix(in srgb, var(--gold) 80%, white),
    0 6px 14px -4px rgba(0, 0, 0, 0.7),
    0 0 18px -4px color-mix(in srgb, var(--gold) 60%, transparent);
}

.tx__coin-face.is-back {
  background:
    radial-gradient(60% 60% at 66% 72%, rgba(255, 250, 230, 0.4), transparent 60%),
    radial-gradient(closest-side, color-mix(in srgb, var(--gold) 82%, var(--gold-deep)) 70%, var(--gold-deep) 100%);
}

.tx__coin-face.is-back span {
  opacity: 0.35;
}

/* the drawn pointer of the loop */
.tx__cursor {
  position: absolute;
  z-index: 5;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  margin: -3px 0 0 -4px;
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.6));
}

.tx__cursor path {
  fill: #fff;
  stroke: rgba(0, 0, 0, 0.55);
  stroke-width: 1;
  stroke-linejoin: round;
}

@media (max-width: 380px) {
  .tx__title {
    font-size: 15.5px;
  }
  .tx__sub {
    font-size: 12px;
  }
  .tx__row {
    gap: 8px;
    padding-right: 10px;
  }
  .tx__line {
    font-size: 11px;
  }
  .tx__line--muted {
    font-size: 10px;
  }
  .tx__receipt-paper {
    padding: 8px 12px 6px;
  }
}
