/* Scroll-scrubbed payment demonstration. One progress value drives every layer. */
.pay-demo {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: none;
  height: 480svh;
  margin: 0;
  padding: 0;
  overflow: clip;
  background: #1f1f1f;
  color: #fff;
}
.pay-demo__pin {
  position: sticky;
  top: 72px;
  height: calc(100svh - 72px);
  overflow: hidden;
}
.pay-demo__layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  align-items: center;
  gap: 56px;
  width: min(1240px, calc(100% - 80px));
  height: 100%;
  margin: 0 auto;
  padding: 12px 0 20px;
}
.pay-demo__story {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  height: 100%;
  padding: 8px 0;
}
.pay-demo h2 {
  margin: 0 0 36px;
  max-width: 11ch;
  font-size: clamp(40px, 3.4vw, 64px);
  font-weight: 550;
  line-height: 0.98;
  letter-spacing: -0.05em;
}
.pay-demo__stage {
  position: relative;
  height: min(100%, 760px);
  min-width: 0;
  min-height: 420px;
  background:
    radial-gradient(60% 50% at 70% 45%, #2a2a2a 0%, transparent 70%);
}
.pay-demo__apple,
.pay-demo__phone {
  position: absolute;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  margin: 0;
}
.pay-demo__apple {
  z-index: 1;
  top: 0;
  left: 0;
  width: min(88%, 760px);
  transform: translate3d(0, var(--apple-y, 0px), 0) scale(var(--apple-s, 1));
  opacity: var(--apple-o, 1);
  transform-origin: 42% 18%;
}
.pay-demo__phone {
  z-index: 2;
  right: 0;
  bottom: 0;
  width: min(42%, 360px);
  height: 72%;
  transform: translate3d(var(--phone-x, 18px), var(--phone-y, 36px), 0) scale(var(--phone-s, 0.78));
  transform-origin: 72% 100%;
  filter: drop-shadow(0 28px 36px #00000073);
}
.pay-demo__well {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 22px;
  /* The footage is keyed to transparency, so it sits straight on the section. */
  background: transparent;
}
.pay-demo__well canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 22px;
  background: transparent;
  /* the footage crops the phone at its bottom edge; let that edge dissolve */
  -webkit-mask-image: linear-gradient(#000 90%, transparent 100%);
  mask-image: linear-gradient(#000 90%, transparent 100%);
  opacity: 0;
}
.pay-demo.is-ready .pay-demo__well canvas {
  opacity: 1;
}
.pay-demo__withheld {
  position: absolute;
  inset: 16px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 24px;
  border-radius: 16px;
  background: #1f1f1f;
  color: #c5cdc6;
  font-size: 15px;
  line-height: 1.45;
  text-align: center;
}
.pay-demo__phone {
  display: flex;
  justify-content: center;
}
.pay-demo__device {
  position: relative;
  height: 100%;
  max-height: 100%;
  width: auto;
  max-width: min(100%, 420px);
  aspect-ratio: 897 / 1752;
}
.pay-demo__screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.pay-demo__screen--transaction {
  opacity: 0;
}
.pay-demo__banner {
  position: absolute;
  z-index: 2;
  left: 7%;
  right: 7%;
  top: 12.5%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 10px 8px 8px;
  border: 1px solid #ffffff24;
  border-radius: 18px;
  background: #2c2c2e;
  box-shadow: 0 10px 24px #00000055;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", var(--sans);
  opacity: var(--banner-opacity, 0);
  translate: 0 var(--banner-y, -130%);
  pointer-events: none;
}
.pay-demo__banner img {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 8px;
}
.pay-demo__banner-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  line-height: 1.15;
}
.pay-demo__banner-copy strong {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.pay-demo__banner-copy span,
.pay-demo__banner time {
  color: #d2d2d6;
  font-size: 13px;
  font-weight: 400;
}
.pay-demo__banner time {
  flex: none;
}
/* Captured → Categorized: the transaction sheet rises over Home, like the app's own detail view.
   Sized in container units so it scales with the phone. */
.pay-demo__device { container-type: inline-size; }
.pay-demo__txn {
  position: absolute;
  z-index: 1;
  left: 10.2%;
  right: 10.2%;
  top: 19%;
  bottom: 4.3%;
  display: flex;
  flex-direction: column;
  padding: 3.2cqw 7cqw 7cqw;
  border-radius: 8cqw 8cqw 10cqw 10cqw;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(214,255,99,.07), transparent 60%),
    #1c1c1e;
  box-shadow: 0 -8cqw 16cqw rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.08);
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", var(--sans);
  opacity: min(1, calc(var(--tx, 0) * 3));
  transform: translateY(calc((1 - var(--tx, 0)) * 16%));
  pointer-events: none;
}
.pay-demo__txn p, .pay-demo__txn strong, .pay-demo__txn small, .pay-demo__txn dl, .pay-demo__txn dd { margin: 0; }
.pay-demo__txn-grab { align-self: center; width: 11cqw; height: 1.2cqw; border-radius: 1cqw; background: rgba(255,255,255,.22); }
.pay-demo__txn-head { display: flex; align-items: center; gap: 3.6cqw; margin-top: 7cqw; }
.pay-demo__txn-mark { display: grid; place-items: center; flex: none; width: 13cqw; height: 13cqw; border-radius: 50%; background: #fff; }
.pay-demo__txn-mark img { width: 10.6cqw; height: 10.6cqw; }
.pay-demo__txn-head p { font-size: 4.9cqw; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.pay-demo__txn-head small { display: block; margin-top: .6cqw; color: #8e8e93; font-size: 3.4cqw; }
.pay-demo__txn-amount { margin-top: 7cqw !important; color: #fff; font-size: 15cqw; font-weight: 600; line-height: 1; letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.pay-demo__txn-amount span { font-size: 8.4cqw; color: #8e8e93; letter-spacing: -.02em; }

.pay-demo__txn-category { display: flex; align-items: center; justify-content: space-between; gap: 3cqw; margin-top: 8cqw; padding: 3.4cqw 3.4cqw 3.4cqw 4.4cqw; border-radius: 4.4cqw; background: #2c2c2e; }
.pay-demo__txn-label { color: #8e8e93; font-size: 3.6cqw; }
.pay-demo__txn-chip { position: relative; display: grid; min-width: 26cqw; height: 8.4cqw; }
.pay-demo__txn-chip > span { grid-area: 1 / 1; display: inline-flex; align-items: center; justify-content: center; gap: 1.6cqw; padding: 0 3.4cqw; border-radius: 99px; font-size: 3.6cqw; font-weight: 500; white-space: nowrap; }
.pay-demo__txn-detecting { color: transparent; background: linear-gradient(90deg, #6e6e73, #f2f2f7, #6e6e73) 0 0 / 200% 100%; -webkit-background-clip: text; background-clip: text; animation: pay-txn-shimmer 1.2s linear infinite; opacity: calc(1 - var(--cat, 0)); }
.pay-demo__txn-coffee { background: var(--accent, #d6ff63); color: #141414; opacity: var(--cat, 0); transform: scale(calc(.86 + var(--cat, 0) * .14)); }
.pay-demo__txn-coffee img { width: 3.6cqw; height: 3.6cqw; }

.pay-demo__txn-rows { margin-top: 4cqw !important; }
.pay-demo__txn-rows div { display: flex; justify-content: space-between; gap: 3cqw; padding: 3.4cqw .4cqw; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 3.6cqw; }
.pay-demo__txn-rows div:last-child { border-bottom: 0; }
.pay-demo__txn-rows dt { color: #8e8e93; }
.pay-demo__txn-rows dd { color: #f2f2f7; }
@keyframes pay-txn-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .pay-demo__txn-detecting { animation: none; color: #8e8e93; background: none; } }

.pay-demo__rail {
  position: relative;
  margin-top: 8px;
}
.pay-demo__track {
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 2px;
  border-radius: 2px;
  background: #2f2f2f;
  overflow: hidden;
}
.pay-demo__fill {
  display: block;
  width: 100%;
  height: 100%;
  background: #d6ff63;
  transform: scaleY(var(--progress, 0));
  transform-origin: top center;
}
.pay-demo__nodes {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  padding: 0;
}
.pay-demo__nodes button {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0 10px 22px;
  border: 0;
  background: transparent;
  color: #7a807b;
  font: inherit;
  font-size: clamp(22px, 1.8vw, 30px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.05;
  text-align: left;
  cursor: pointer;
  transition: color 220ms ease, font-size 220ms ease;
}
.pay-demo__nodes button em {
  font-style: normal;
  font-size: 0.42em;
  letter-spacing: 0.08em;
  color: #8d948e;
}
.pay-demo__nodes button.is-done {
  color: #b7beb8;
}
.pay-demo__nodes button[aria-current="step"] {
  color: #fff;
  font-size: clamp(32px, 2.6vw, 44px);
}
.pay-demo__nodes button[aria-current="step"] em {
  color: #d6ff63;
}
.pay-demo__nodes button:focus-visible {
  outline: 2px solid #d6ff63;
  outline-offset: 4px;
  border-radius: 4px;
}
.pay-demo__moment {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.pay-demo__fine {
  margin: 28px 0 0 22px;
  color: #6f7772;
  font-size: 13px;
}
.pay-demo.is-withheld .pay-demo__well canvas {
  visibility: hidden;
}
.pay-demo.is-withheld .pay-demo__withheld {
  visibility: visible;
}
.pay-demo__withheld {
  visibility: hidden;
}

@media (max-width: 860px) {
  .pay-demo {
    height: 360svh;
  }
  .pay-demo__pin {
    top: 60px;
    height: calc(100svh - 60px);
    min-height: 0;
  }
  .pay-demo__layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    align-items: stretch;
    width: min(100% - 20px, 480px);
    gap: 14px;
    padding: 4px 0 10px;
  }
  .pay-demo__story {
    height: auto;
  }
  .pay-demo h2 {
    margin-bottom: 12px;
    max-width: 16ch;
    font-size: 30px;
  }
  .pay-demo__nodes button {
    gap: 8px;
    padding: 5px 0 5px 16px;
    font-size: 16px;
  }
  .pay-demo__nodes button[aria-current="step"] {
    font-size: 22px;
  }
  .pay-demo__fine {
    margin: 12px 0 0 16px;
  }
  .pay-demo__stage {
    height: 100%;
    min-height: 0;
    background: none;
  }
  .pay-demo__apple {
    width: 100%;
    transform-origin: 50% 0;
  }
  .pay-demo__phone {
    width: min(78%, 300px);
    height: 74%;
    right: 11%;
    transform-origin: 50% 100%;
  }
  .pay-demo__well,
  .pay-demo__well canvas {
    border-radius: 16px;
  }
  .pay-demo__device {
    height: 100%;
    max-width: 100%;
  }
  .pay-demo__banner {
    left: 4%;
    right: 4%;
    gap: 8px;
    min-height: 48px;
    padding: 6px 8px;
    border-radius: 14px;
  }
  .pay-demo__banner img {
    width: 28px;
    height: 28px;
  }
  .pay-demo__banner-copy strong {
    font-size: 13px;
  }
  .pay-demo__banner-copy span,
  .pay-demo__banner time {
    font-size: 11px;
  }
  .pay-demo__category {
    top: 35.4%;
    right: 12%;
    width: 54px;
    height: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pay-demo {
    height: auto;
  }
  .pay-demo__pin {
    position: relative;
    top: auto;
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 72px 0;
  }
  .pay-demo__layout {
    height: auto;
  }
  .pay-demo__stage {
    flex: none;
  }
  .pay-demo__nodes button,
  .pay-demo__fill {
    transition: none;
  }
}

@media (max-width: 860px) and (max-height: 740px) {
  .pay-demo h2 {
    font-size: 26px;
    margin-bottom: 8px;
  }
  .pay-demo__stage {
    height: 100%;
    min-height: 0;
  }
}
