/* The fogged glass toast: an ivory pay button on a black page and, under it, the notifications of the payments in
   dark glass, each with a patch of breath fog on its right where Undo is written with a fingertip. The fog is
   painted by script.js in the colour below. */
:root {
  --page: #000000;          /* the page */
  --button: #efe9dc;        /* the pay button */
  --button-hover: #f8f4ec;  /* the pay button under the pointer */
  --button-ink: #1b1916;    /* its words */
  --glass: #1e1d22;         /* a notification's glass, at the top */
  --glass-low: #131216;     /* and at the bottom */
  --glass-line: rgba(255, 255, 255, 0.08);    /* its edge */
  --ink: #f4f0e8;           /* the words on a notification */
  --muted: #a39d93;         /* the quieter words */
  --fog: #e2e7eb;           /* the breath fog on the glass */
  --paid: #e6c063;          /* the word Paid and its tick */
}

* {
  box-sizing: border-box;
}

/* a tap is a click at once: no wait for a double tap, no zoom */
html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Golos Text Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

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

/* the button and, under it, the room for the notifications (script.js sets the height from MAX) */
.wallet {
  position: relative;
  width: min(380px, 100%);
  height: 304px;
}

/* ---------------------------------------------------------------- the pay button */
.pay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: var(--button);
  color: var(--button-ink);
  font: inherit;
  font-size: 16px;
  font-weight: 620;
  letter-spacing: -0.01em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  transition: background-color 0.2s ease, transform 0.16s cubic-bezier(0.23, 1, 0.32, 1);
}

@media (hover: hover) and (pointer: fine) {
  .pay:hover {
    background: var(--button-hover);
  }
}

.pay:active {
  transform: scale(0.985);
}

.pay:focus-visible {
  outline: 2px solid var(--button);
  outline-offset: 4px;
}

/* the words roll when the next payment comes up (both lines share one cell while they pass) */
.pay__label {
  display: grid;
  overflow: hidden;
  line-height: 24px;
  white-space: nowrap;
}

.pay__label > span {
  grid-area: 1 / 1;
  text-align: center;
}

/* ---------------------------------------------------------------- the notifications */
/* they come out from under the button: above its bottom edge the stack is cut off */
.stack {
  position: absolute;
  top: 74px;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  pointer-events: none;
  clip-path: inset(-14px -40px -80px -40px);
}

.stack__list {
  position: relative;
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* dark glass: a light along its top edge and a faint sheen across it */
.toast {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 70px;
  padding: 0 9px 0 18px;
  border-radius: 18px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.035) 46%, rgba(255, 255, 255, 0) 62%),
    linear-gradient(180deg, var(--glass), var(--glass-low));
  box-shadow: inset 0 0 0 1px var(--glass-line), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

/* the gap under each notification counts as the notification: the pointer can go from one to the next without
   the time starting again in between */
.toast::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 10px;
}

.toast__text {
  flex: 1;
  min-width: 0;
}

.toast__title,
.toast__body {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast__title {
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.toast__body {
  margin-top: 2px;
  font-size: 13px;
  line-height: 18px;
  font-weight: 440;
  color: var(--muted);
}

/* the Undo button is the patch of fog: the words are written in it by the fingertip, on the canvas */
.toast__undo {
  position: relative;
  flex: none;
  width: 112px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.16s cubic-bezier(0.23, 1, 0.32, 1);
}

.toast__undo canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  transition: filter 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .toast__undo:hover canvas {
    filter: brightness(1.12);
  }
}

.toast__undo:active {
  transform: scale(0.97);
}

.toast__undo:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.toast__close {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color 0.18s ease, color 0.18s ease;
}

/* a finger gets a bigger target than the drawn cross */
.toast__close::before {
  content: '';
  position: absolute;
  inset: -7px -3px;
}

@media (hover: hover) and (pointer: fine) {
  .toast__close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--ink);
  }
}

.toast__close:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.toast__close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* after Undo, where the fog was: the mark of a step back */
.toast__back {
  flex: none;
  width: 112px;
  height: 24px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* once the fog has gone: Paid, with a tick that draws itself */
.toast__paid {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 112px;
  height: 32px;
  color: var(--paid);
  font-size: 13.5px;
  font-weight: 620;
}

.toast__paid svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
