/* The pay button with the fingerprint that lights up from the core. One graphite pill alone on a white page: the
   body is a gradient with a line of light on top, a 1px edge, a fine grain and soft layered shadows. GSAP moves
   .pay__body (press, hum), .pay__words (width), the layers and the ridges of the print (drawn again every frame by
   script.js); the CSS styles the rest. */
:root {
  --page: #ffffff;                        /* the page */
  --pill-top: #26272c;                    /* the pill, at the top */
  --pill-bottom: #131417;                 /* the pill, at the bottom */
  --edge: rgba(255, 255, 255, 0.09);      /* the 1px edge */
  --well: #0b0c0e;                        /* the round well of the print */
  --ridge: #4a4d55;                       /* the ridges at rest */
  --ink: #f4f2ee;                         /* the words */
  --muted: #8f9198;                       /* the small words */
  --amber: #ffb34d;                       /* the accent: the lit ridges, the check, Paid */
}

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

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
}

/* ------------------------------------------------------------------ the pill */
.pay {
  --mx: 30%;
  --my: 0%;
  --hot: 0;                      /* 1 while the pointer is over it */
  --p: 0;                        /* how much of the print is lit, 0 to 1 (moved by script.js) */
  --paid: 0;                     /* 0 rest, 1 paid */
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  height: 60px;
  max-width: calc(100vw - 24px);
  padding: 0 24px 0 8px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  isolation: isolate;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
}

.pay:focus-visible {
  outline: none;
}

.pay:focus-visible .pay__body {
  box-shadow: 0 0 0 3px var(--page), 0 0 0 5px var(--amber);
}

.pay__body {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  box-shadow:
    0 1px 1px rgba(20, 22, 28, 0.18),
    0 4px 8px -2px rgba(20, 22, 28, 0.16),
    0 16px 30px -12px rgba(20, 22, 28, 0.34),
    0 30px 50px -24px rgba(255, 150, 40, calc(var(--paid) * 0.55));
}

.pay__glass,
.pay__warm,
.pay__glow,
.pay__sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

/* the body: gradient, line of light on top, grain */
.pay__glass {
  background: linear-gradient(180deg, var(--pill-top), var(--pill-bottom));
  box-shadow:
    inset 0 0 0 1px var(--edge),
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -10px 18px -12px rgba(0, 0, 0, 0.85);
}

.pay__glass::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0.1;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* the warm light that leaks from the well into the body while the print lights up */
.pay__warm {
  opacity: calc(var(--p) * 0.8 + var(--paid) * 0.2);
  background: radial-gradient(90px 70px at 30px 50%, rgba(255, 179, 77, 0.2), rgba(255, 179, 77, 0.04) 60%, transparent 80%);
  box-shadow: inset 0 0 0 1px rgba(255, 179, 77, calc(var(--paid) * 0.3)), inset 0 1px 0 rgba(255, 220, 170, calc(var(--paid) * 0.22));
}

/* the light under the pointer */
.pay__glow {
  opacity: calc(var(--hot) * 0.9);
  background: radial-gradient(140px 90px at var(--mx) var(--my), rgba(255, 255, 255, 0.08), transparent 70%);
  transition: opacity 0.35s ease;
}

/* the gleam that crosses the pill once it is paid */
.pay__sheen {
  overflow: hidden;
}

.pay__sheen i {
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  width: 46%;
  opacity: 0;
  background: linear-gradient(100deg, transparent 10%, rgba(255, 200, 130, 0.1) 44%, rgba(255, 236, 205, 0.2) 50%, rgba(255, 200, 130, 0.1) 56%, transparent 90%);
  transform: translateX(-120%);
}

/* ------------------------------------------------------------------ the print in its well */
.print {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #18191d, var(--well) 70%);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.9),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 1px 0 rgba(255, 255, 255, 0.08);
}

/* the warmth under the finger: grows with the lit ridges */
.print__heat {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  opacity: calc(var(--p) * 0.9);
  background: radial-gradient(circle at 50% 52%, rgba(255, 179, 77, 0.28), rgba(255, 179, 77, 0.06) 55%, transparent 72%);
}

.print__svg {
  position: absolute;
  inset: 0;
  width: 44px;
  height: 44px;
  overflow: visible;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.print__base path {
  stroke: var(--ridge);
  stroke-width: 1.15;
  transition: stroke 0.3s ease;
}

.print__lit path {
  stroke: var(--amber);
  stroke-width: 1.45;
}

.print__lit {
  filter: drop-shadow(0 0 1.2px rgba(255, 170, 60, 0.6));
}

.print__check {
  stroke: var(--amber);
  stroke-width: 2.6;
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
  filter: drop-shadow(0 0 2px rgba(255, 170, 60, 0.6));
}

/* ------------------------------------------------------------------ the words */
.pay__words {
  position: relative;
  display: block;
  height: 40px;
  min-width: 0;
  overflow: hidden;
}

.pay__layer {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  height: 40px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
}

.pay__layer[data-layer='rest'] {
  opacity: 1;
  visibility: visible;
}

.pay__t {
  font-size: 15.5px;
  font-weight: 600;
  font-stretch: 100%;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.pay__t b,
.pay__s b {
  font-weight: inherit;
  font-variant-numeric: tabular-nums;
}

.pay__s {
  font-size: 12.5px;
  font-weight: 450;
  color: var(--muted);
  line-height: 1.15;
}

.pay__layer--paid .pay__t {
  font-stretch: 112%;
  font-weight: 650;
  color: #fff6ea;
}

.pay__layer--paid .pay__s {
  color: rgba(255, 214, 160, 0.66);
}

@media (hover: hover) {
  .pay:hover {
    --hot: 1;
  }
  .pay:hover .print__base path {
    stroke: #62656e;
  }
}

@media (max-width: 360px) {
  .pay__t {
    font-size: 14.5px;
  }
  .pay__s {
    font-size: 12px;
  }
}
