/* The payout notification that runs from the shop to the bank: the notifications of Larkfold, an app for people who
   sell online, on pure black. Each notification is one element moved by GSAP (.note); its look lives in the children
   (the dim layer, the sheen, the edge, the body), so GSAP's inline transform never fights the CSS. */
:root {
  --page: #000000;           /* the page */
  --glass-top: #1d1f23;      /* the glass, at the top */
  --glass-bottom: #111215;   /* the glass, at the bottom */
  --edge: rgba(255, 255, 255, 0.075); /* the edge at rest */
  --ink: #f1f2f4;            /* the words */
  --muted: #8b8f98;          /* the small words */
  --faint: #4b4f57;          /* the rail and the glyphs at rest */
  --accent: #6ff0b0;         /* the money: the spark, the bank, the icon */
  --accent-deep: #0f3a28;    /* the icon tile */
  --button: #f2f3f5;         /* the main button */
  --button-ink: #0a0b0c;     /* the words on it */
}

* {
  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 {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
}

/* the dock: as wide as a notification, as tall as the front one plus the edges peeking behind it (set by script.js) */
.dock {
  position: relative;
  width: min(90vw, 360px);
  height: 118px;
}

.dock__glow {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -18px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 34%, transparent), transparent);
  filter: blur(14px);
  opacity: 0;
  pointer-events: none;
}

.dock__stack {
  position: absolute;
  inset: 0;
}

.dock__count {
  position: absolute;
  right: -7px;
  top: -9px;
  z-index: 40;
  min-width: 26px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 640;
  font-variation-settings: 'wdth' 100;
  font-variant-numeric: tabular-nums;
  color: var(--button-ink);
  background: linear-gradient(180deg, #ffffff, #d9dbe0);
  box-shadow: 0 0 0 2px var(--page), 0 4px 10px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
}

/* ---- one notification ---- */
.note {
  position: absolute;
  left: 50%;
  top: 0;
  width: 156px;
  height: 40px;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--glass-top), var(--glass-bottom));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 0 0 1px var(--edge),
    0 1px 2px rgba(0, 0, 0, 0.6),
    0 14px 30px -10px rgba(0, 0, 0, 0.85),
    0 34px 60px -28px rgba(0, 0, 0, 0.9);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  transition: box-shadow 0.3s;
  transform-origin: 50% 100%;
  opacity: 0;
}

.note.is-dragging {
  cursor: grabbing;
}

/* a thin grain of light at the top of the glass */
.note::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 38%);
  pointer-events: none;
}

.note__dim {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: #000;
  opacity: 0;
  pointer-events: none;
}

.note__sheen {
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  width: 46%;
  z-index: 6;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.07) 45%, rgba(255, 255, 255, 0.11) 50%, rgba(255, 255, 255, 0.07) 55%, transparent);
  transform: translateX(-120%) skewX(-12deg);
  pointer-events: none;
}

.note__edge {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 7;
  overflow: visible;
  pointer-events: none;
  filter: drop-shadow(0 0 3px color-mix(in srgb, var(--accent) 80%, transparent));
}

.note__edge-spark {
  x: 0.5px;
  y: 0.5px;
  width: calc(100% - 1px);
  height: calc(100% - 1px);
  rx: 21.5px;
  fill: none;
  stroke: #eafff4;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-dasharray: 0.09 0.91;
  stroke-dashoffset: 0.25;
  opacity: 0;
}

/* the pill it starts as */
.note__mini {
  position: absolute;
  left: 0;
  top: 0;
  width: 156px;
  height: 40px;
  padding: 0 14px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  z-index: 3;
}

.mini__icon {
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--accent-deep);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}

.mini__icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mini__word {
  color: var(--muted);
  font-weight: 520;
}

.mini__amount {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

/* the full notification, always as wide as the dock */
.note__body {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--w, 320px);
  padding: 13px 14px 0;
  opacity: 0;
  z-index: 2;
}

.note__face {
  all: unset;
  box-sizing: border-box;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: 12px;
  cursor: inherit;
}

.note__face:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent);
  outline-offset: 4px;
}

.note__icon {
  position: relative;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(120% 90% at 30% 0%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 60%),
    linear-gradient(160deg, #164d35, var(--accent-deep));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent), 0 6px 14px -6px rgba(0, 0, 0, 0.9);
}

.note__icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon__card,
.icon__chip {
  stroke: color-mix(in srgb, var(--accent) 60%, #ffffff 10%);
  stroke-width: 1.5;
}

.icon__arrow {
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.note__text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.note__title {
  position: relative;
  display: block;
  height: 18px;
  overflow: hidden;
  font-size: 14px;
  line-height: 18px;
  font-weight: 600;
  font-variation-settings: 'wdth' 104;
  white-space: nowrap;
}

.title__a,
.title__b {
  display: block;
}

.title__b {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
}

.note__meta {
  font-size: 12px;
  line-height: 15px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.note__amount {
  flex: none;
  font-size: 17px;
  font-weight: 640;
  font-variation-settings: 'wdth' 96;
  letter-spacing: -0.015em;
  align-self: flex-start;
  margin-top: 2px;
}

/* the rolling digits: every digit is a strip of 21 cells (blank, 0 to 9, 0 to 9) inside a window one cell tall */
.roll {
  display: inline-flex;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  line-height: 1.2em;
  height: 1.2em;
}

.roll__ch,
.roll__dg {
  display: inline-block;
  height: 1.2em;
}

.roll__dg {
  position: relative;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 22%, #000 78%, transparent);
}

.roll__strip {
  display: flex;
  flex-direction: column;
}

.roll__strip > span {
  display: block;
  height: 1.2em;
  text-align: center;
}

/* the rail from the shop to the bank */
.note__track {
  margin: 12px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 16px;
}

.track__end {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.track__bank {
  stroke: var(--faint);
}

.track__rail {
  --p: 0;
  position: relative;
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--faint) 0 3px, transparent 3px 6px);
}

.track__fill {
  position: absolute;
  inset: -0.5px 0;
  border-radius: 2px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 25%, transparent), var(--accent));
  transform-origin: 0 50%;
  transform: scaleX(var(--p));
}

.track__spark {
  position: absolute;
  top: 50%;
  left: calc(var(--p) * 100%);
  width: 18px;
  height: 3px;
  margin: -1.5px 0 0 -16px;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, #ffffff 80%);
  box-shadow: 0 0 10px 2px color-mix(in srgb, var(--accent) 70%, transparent), 0 0 2px #ffffff;
  opacity: 0;
}

.note__route {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  font-size: 11px;
  line-height: 14px;
  color: var(--muted);
  white-space: nowrap;
}

.note__route span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.note__balance {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
  padding: 9px 0 11px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  line-height: 15px;
}

.balance__label {
  color: var(--muted);
}

.balance__value {
  margin-left: auto;
  font-weight: 600;
  color: var(--ink);
}

.balance__chev {
  width: 12px;
  height: 12px;
  flex: none;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.2s;
}

/* the receipt under the notification, closed with a height of 0 */
.note__receipt {
  height: 0;
  overflow: hidden;
}

.receipt__in {
  position: relative;
  padding: 4px 0 14px;
}

/* the tear line of a receipt: a row of little notches */
.receipt__cut {
  display: block;
  height: 1px;
  margin: 0 -14px 10px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.14) 0 4px, transparent 4px 8px);
  transform-origin: 0 50%;
}

.receipt__rows {
  margin: 0;
}

.receipt__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 12.5px;
  line-height: 16px;
}

.receipt__row dt {
  color: var(--muted);
}

.receipt__row dd {
  margin: 0;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.receipt__ref {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  font-variation-settings: 'wdth' 92;
}

.receipt__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.receipt__btn {
  all: unset;
  box-sizing: border-box;
  flex: 1;
  height: 38px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  font-variation-settings: 'wdth' 100;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.3, 1.6, 0.5, 1), background-color 0.2s, font-variation-settings 0.3s;
}

.receipt__btn--main {
  flex: 1.5;
  color: var(--button-ink);
  background: linear-gradient(180deg, #ffffff, var(--button));
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12), 0 6px 14px -8px rgba(255, 255, 255, 0.4);
}

.receipt__btn:active {
  transform: scale(0.965);
}

.receipt__btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent);
  outline-offset: 2px;
}

@media (hover: hover) {
  .note.is-front:hover {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.11),
      inset 0 0 0 1px rgba(255, 255, 255, 0.13),
      0 1px 2px rgba(0, 0, 0, 0.6),
      0 18px 36px -10px rgba(0, 0, 0, 0.9),
      0 40px 70px -28px rgba(0, 0, 0, 0.95);
  }

  .note:hover .balance__chev {
    stroke: var(--ink);
  }

  .receipt__btn:hover {
    font-variation-settings: 'wdth' 112;
    background-color: rgba(255, 255, 255, 0.1);
  }

  .receipt__btn--main:hover {
    background: linear-gradient(180deg, #ffffff, #ffffff);
  }
}
