/* Pay with friends — hero: full-bleed background video, floating chips, centered stack */

.pwf-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 5vw, 52px);
  width: 100%;
  max-width: none;
  margin-inline: 0;
  --pwf-hero-video-fade-solid-end: 56%;
  --pwf-hero-video-fade-mid: 78%;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  padding-inline: var(--padding);
  padding-block: clamp(40px, 8vw, 60px);
  box-sizing: border-box;
  overflow: hidden;
  isolation: isolate;
}

body.page-under-nav-hero .pwf-hero {
  --pwf-top-pull: clamp(16px, 3.5vw, 44px);
  margin-top: calc(-1 * var(--pwf-top-pull));
  padding-top: calc(var(--navbar-height) + var(--section-stack-padding-y));
  min-height: calc(100vh + var(--pwf-top-pull));
  min-height: calc(100svh + var(--pwf-top-pull));
  min-height: calc(100lvh + var(--pwf-top-pull));
}

.pwf-hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: var(--color-bg);
}

.pwf-hero__bg-video {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center;
  -webkit-mask-image: linear-gradient(
    to bottom,
    #000 0%,
    #000 var(--pwf-hero-video-fade-solid-end),
    rgba(0, 0, 0, 0.5) var(--pwf-hero-video-fade-mid),
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    #000 0%,
    #000 var(--pwf-hero-video-fade-solid-end),
    rgba(0, 0, 0, 0.5) var(--pwf-hero-video-fade-mid),
    transparent 100%
  );
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* Light wash over the video for legibility */
.pwf-hero__bg::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: color-mix(in srgb, var(--color-bg) 42%, transparent);
}

.pwf-hero__chips {
  position: absolute;
  inset: 0;
  z-index: 1;
  box-sizing: border-box;
  padding: clamp(12px, 3vw, 28px);
  pointer-events: none;
}

.pwf-hero__chips:not(.pwf-hero__chips--ready) .pwf-hero__chip {
  opacity: 0;
}

.pwf-hero__chips--ready .pwf-hero__chip {
  opacity: 1;
  transition: opacity 0.32s ease;
}

/* Bottom dissolve — paints above chips so they fade under the same bg mask as the video */
.pwf-hero__scene-fade {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent 0%,
    transparent 58%,
    color-mix(in srgb, var(--color-bg) 72%, transparent) 88%,
    var(--color-bg) 100%
  );
}

.pwf-hero__inner {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: var(--max-width);
  text-align: center;
}

.pwf-hero .hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.pwf-hero .hero__cta-primary .hero__action-icon {
  filter: brightness(0) invert(1);
}

.pwf-hero__title {
  margin: 0;
  max-width: 100%;
  font-size: clamp(2.5rem, 5vw + 1.25rem, 7.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.05em;
  color: var(--color-black);
}

.pwf-hero__subtitle {
  margin: 0;
  max-width: min(920px, 100%);
  font-size: clamp(1.125rem, 1.5vw + 0.75rem, var(--font-main));
  font-weight: 400;
  line-height: 1.35;
  color: var(--color-black);
}

.pwf-hero__chip {
  position: absolute;
  left: var(--pwf-left, 50%);
  top: var(--pwf-top, 50%);
  width: max-content;
  max-width: min(36vw, 300px);
  transform: translate(-50%, -50%);
  will-change: transform;
}

.pwf-hero__chip-shift {
  display: block;
  will-change: transform;
}

.pwf-hero.pwf-hero--reduce-motion .pwf-hero__chip-shift {
  transform: none !important;
}

.pwf-hero__chip-inner {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.6vw, 18px);
  direction: ltr;
  max-width: 100%;
  padding: clamp(8px, 1.8vw, var(--padding));
  border-radius: 9999px;
  background: rgba(250, 253, 252, 0.8);
  box-shadow:
    0 12px 40px rgba(19, 24, 26, 0.18),
    0 2px 8px rgba(19, 24, 26, 0.08);
  opacity: 1;
  transition: opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1);
  box-sizing: border-box;
}

.pwf-hero__chip-inner.is-hiding {
  opacity: 0;
}

.pwf-hero__chip-amount {
  margin: 0;
  font-size: clamp(1rem, 2.6vw + 0.55rem, 3rem);
  font-weight: 600;
  line-height: 1;
  color: var(--color-black);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 0;
}

.pwf-hero__chip-flag {
  position: relative;
  flex-shrink: 0;
  width: clamp(28px, 4.2vw + 10px, 42px);
  height: clamp(28px, 4.2vw + 10px, 42px);
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-black);
}

.pwf-hero__chip-flag img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 768px) {
  .pwf-hero__chip {
    max-width: min(34vw, 220px);
  }

  .pwf-hero__chip-amount {
    font-size: clamp(0.875rem, 2.2vw + 0.4rem, 1.35rem);
  }

  .pwf-hero__chip-inner {
    gap: clamp(6px, 1.4vw, 10px);
    padding: clamp(6px, 1.8vw, 10px);
  }

  .pwf-hero__chip-flag {
    width: clamp(24px, 3.6vw + 8px, 36px);
    height: clamp(24px, 3.6vw + 8px, 36px);
  }
}

@media (max-width: 480px) {
  .pwf-hero__chip {
    max-width: min(38vw, 168px);
  }

  .pwf-hero__chip-amount {
    font-size: clamp(0.75rem, 2vw + 0.35rem, 1.125rem);
  }
}
