/* Payouts Hub — home-v3 / osc-page */

/* Figma section rhythm: 40px block padding → 80px between adjacent sections */
.phub-page {
  --phub-section-pad: 2.5rem;
  --phub-heading-gap: 2.5rem;
}

@media (max-width: 767px) {
  .phub-page > .osc-section {
    padding-block: var(--phub-section-pad);
  }

  .phub-page > .osc-hero .osc-hero__inner {
    padding-bottom: var(--phub-section-pad);
  }

  .phub-page > .osc-final {
    padding-top: var(--phub-section-pad);
    padding-bottom: 6.25rem;
  }

  .phub-page .osc-section .osc-heading {
    margin-bottom: var(--phub-heading-gap);
  }

  .phub-process__sticky {
    padding-bottom: 0;
  }

  .phub-process__sticky > .osc-heading {
    margin: 0 auto var(--phub-heading-gap);
    padding-bottom: 0;
  }

  .phub-process__steps {
    padding-bottom: 0;
  }
}

/* Hero subtitle — Figma 15076:8799: 16px / 22px, #ccc, single line on wide */
@media (min-width: 1024px) {
  .phub-page .cmp-hero--compare .osc-hero__copy p {
    max-width: none;
    color: #ccc;
    font-size: 16px;
    line-height: 22px;
    letter-spacing: -0.16px;
    white-space: nowrap;
  }
}

/* Stats bar — Figma 15090:10393 (bg asset: stats-bar-bg.svg) */
.phub-stats__panel {
  position: relative;
  margin-top: 0;
  padding: 0;
  border: none;
  border-radius: 20px;
  overflow: hidden;
  background: transparent;
}

/* SVG bar only fits single-row 4-col layout; 2×2 / 1-col stretch distorts the asset */
.phub-stats__panel::before {
  content: none;
}

@media (min-width: 1024px) {
  .phub-stats__panel::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: url('../../images/pages/payouts-hub/stats-bar-bg.svg') center center / 100% 100%
      no-repeat;
    pointer-events: none;
    z-index: 0;
  }
}

.phub-stats__row {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .phub-stats__row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .phub-stats__row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.phub-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px 16px;
  text-align: center;
}

@media (min-width: 1024px) {
  .phub-stats__panel {
    min-height: 120px;
  }
}

/* <1024px: 1-col or 2×2 — ambient glow (方案 A), no stretched SVG bar */
@media (max-width: 1023px) {
  .phub-stats__panel {
    border-radius: 20px;
    overflow: visible;
    background:
      radial-gradient(
        ellipse 115% 95% at 50% 52%,
        rgba(109, 62, 0, 0.36) 0%,
        rgba(7, 4, 0, 0) 72%
      ),
      radial-gradient(
        ellipse 100% 32% at 50% 0%,
        rgba(249, 135, 21, 0.12) 0%,
        transparent 65%
      );
  }
}

@media (max-width: 767px) {
  .phub-stats__panel {
    border-radius: 0;
  }

  .phub-stat {
    padding: 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .phub-stat:last-child {
    border-bottom: none;
  }
}

.phub-stat__label {
  margin: 0;
  color: #ccc;
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: -0.14px;
}

.phub-stat__value {
  margin: 0;
  color: #fff;
  font-size: clamp(20px, 2.2vw, 24px);
  font-weight: 700;
  line-height: 30px;
  letter-spacing: -0.24px;
}

/* Benefits — Figma 15076:9066 */
@media (min-width: 1024px) {
  .phub-benefits .osc-heading h2 {
    line-height: 68px;
  }
}

.phub-benefits__grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .phub-benefits__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .phub-benefits__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.phub-benefit {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 24px;
  padding: 24px;
  text-align: center;
}

.phub-benefit__icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 180px;
  flex-shrink: 0;
  overflow: hidden;
}

.phub-benefit__icon {
  width: 162px;
  height: 162px;
  max-width: 100%;
  object-fit: contain;
  mix-blend-mode: lighten;
}

/* Card 2 icon slightly larger in Figma (172px) */
.phub-benefit:nth-child(2) .phub-benefit__icon {
  width: 172px;
  height: 172px;
}

.phub-benefit__title {
  margin: 0;
  color: var(--brand);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.phub-benefit__text {
  margin: 0;
  min-height: 66px;
  color: #ccc;
  font-size: 16px;
  font-weight: 400;
  line-height: 22px;
  letter-spacing: -0.16px;
}

@media (max-width: 767px) {
  .phub-benefits__grid {
    gap: 16px;
  }

  .phub-benefit {
    gap: 12px;
    padding: 18px 16px 20px;
  }

  .phub-benefit__icon-wrap {
    height: 128px;
  }

  .phub-benefit__icon {
    width: 112px;
    height: 112px;
  }

  .phub-benefit:nth-child(2) .phub-benefit__icon {
    width: 120px;
    height: 120px;
  }

  .phub-benefit__text {
    min-height: 0;
  }
}

/* Scroll-driven payout process */
.phub-process {
  position: relative;
}

.phub-process__scroller {
  position: relative;
}

.phub-process__sticky {
  padding-bottom: 48px;
  overflow: visible;
}

/* PC: natural scroll (Blueberry-style — no sticky / extra vh trap) */
@media (min-width: 900px) {
  .phub-process__scroller {
    min-height: auto;
  }

  .phub-process__sticky {
    position: static;
    top: auto;
  }

  .phub-process {
    padding-bottom: 80px;
  }
}

.phub-process .osc-heading h2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  letter-spacing: -0.02em;
}

.phub-process .osc-heading h2 .cmp-heading-lines {
  line-height: 1.214;
}

@media (min-width: 1024px) {
  .phub-process .osc-heading h2 {
    font-size: 56px;
    line-height: 68px;
    letter-spacing: -0.56px;
  }

  .phub-process .osc-heading h2 .cmp-heading-lines {
    line-height: 68px;
  }

  .phub-process .osc-heading h2 .cmp-heading-lines:last-of-type {
    max-width: 30.9375rem; /* 495px — “Process Explained” */
  }
}

.phub-process__sticky > .osc-heading {
  margin: 0 auto var(--phub-heading-gap, 2.5rem);
  padding-bottom: 0;
}

@media (min-width: 900px) {
  .phub-process__sticky > .osc-heading {
    margin-bottom: 2.5rem; /* Figma 15076:9356 — 40px to timeline */
  }
}

.phub-process__rail {
  position: absolute;
  left: 50%;
  top: var(--phub-rail-top, 200px);
  bottom: var(--phub-rail-bottom, 80px);
  width: 6px;
  transform: translateX(-50%);
  background: transparent;
  border-radius: 999px;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.phub-process__line-fill {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  transform: scale3d(1, 0, 1);
  transform-origin: top center;
  background: rgba(249, 135, 21, 0.3);
  border-radius: 999px;
  will-change: transform;
}

.phub-process__steps {
  --phub-node-size: 68px;
  --phub-connector-span: 13.375rem; /* 214px — Figma horizontal line */
  --phub-rail-segment: 166px;
  --phub-card-max: 21.5rem; /* ~344px — Figma card + 32px padding */
  position: relative;
  display: block;
  width: 100%;
  max-width: 75rem; /* 1200px timeline */
  margin-inline: auto;
  margin-top: 0;
  padding: 0 0 80px;
  --phub-step-base: var(--phub-card-protrude, 0px);
  min-height: calc(
    var(--phub-step-base) + var(--phub-node-size) * 4 +
      var(--phub-rail-segment) * 3
  );
}

.phub-step {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(
    var(--phub-step-base, 0px) + var(--phub-step-index, 0) *
      (var(--phub-node-size) + var(--phub-rail-segment))
  );
  height: var(--phub-node-size);
  overflow: visible;
  display: grid;
  grid-template-columns: var(--phub-node-size) minmax(0, 1fr);
  grid-template-rows: var(--phub-node-size);
  gap: 12px;
  align-items: start;
}

.phub-step__node,
.phub-step__card {
  grid-row: 1;
  min-height: 0;
}

.phub-step__node {
  grid-column: 1;
  align-self: start;
  height: var(--phub-node-size);
  justify-content: flex-start;
}

.phub-step__card {
  grid-column: 2;
  align-self: center;
}

@media (min-width: 900px) {
  .phub-step {
    grid-template-columns: minmax(0, 1fr) var(--phub-node-size) minmax(0, 1fr);
    grid-template-rows: var(--phub-node-size);
    column-gap: var(--phub-connector-span);
    row-gap: 0;
  }

  .phub-step__node {
    justify-content: center;
  }

  .phub-step--left .phub-step__card {
    grid-column: 1;
    justify-self: end;
    width: 100%;
    max-width: var(--phub-card-max);
  }

  .phub-step--left .phub-step__node {
    grid-column: 2;
  }

  .phub-step--right .phub-step__card {
    grid-column: 3;
    justify-self: start;
    width: 100%;
    max-width: var(--phub-card-max);
  }

  .phub-step--right .phub-step__node {
    grid-column: 2;
  }

  .phub-step.is-active .phub-step__connector {
    transform: scale3d(1, 1, 1);
    transition: transform 0.55s ease-out;
  }

  .phub-step.is-current .phub-step__connector {
    background: #f98715;
  }

  /* PC scroll-scrub (see payouts-hub.js): no CSS transitions — values driven per frame */
  .phub-process--scrub .phub-step__card,
  .phub-process--scrub .phub-step__num,
  .phub-process--scrub .phub-step__connector {
    transition: none !important;
  }

  .phub-process--scrub .phub-step.is-active .phub-step__card,
  .phub-process--scrub .phub-step.is-active .phub-step__connector {
    transition: none !important;
  }
}

.phub-step__node {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 2;
}

.phub-step__num {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 4;
  width: var(--phub-node-size);
  height: var(--phub-node-size);
  border-radius: 999px;
  border: 1.147px solid #f98715;
  background: #070400;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 24px;
  letter-spacing: -0.2px;
  opacity: 0;
  transition: opacity 0.45s ease, border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}

.phub-step.is-active .phub-step__num {
  opacity: 1;
}

.phub-step.is-current .phub-step__num {
  border-color: #f98715;
  box-shadow: 0 0 24px rgba(249, 135, 21, 0.45);
}

.phub-step__card {
  position: relative;
  z-index: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 2rem;
  border-radius: 20px;
  border: none;
  background: #070400;
  isolation: isolate;
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.phub-step__card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(
    180deg,
    rgba(249, 135, 21, 0.32) 0%,
    rgba(249, 135, 21, 0.18) 100%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
}

.phub-step__card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
}

.phub-step--left .phub-step__card::before {
  background: linear-gradient(
    270deg,
    rgba(249, 135, 21, 0.52) 0%,
    rgba(249, 135, 21, 0.28) 32%,
    rgba(249, 135, 21, 0.16) 58%,
    rgba(249, 135, 21, 0.22) 100%
  );
}

.phub-step--right .phub-step__card::before {
  /* Steps 2 & 4 (right column): Figma — glow on card right edge */
  background: linear-gradient(
    270deg,
    rgba(249, 135, 21, 0.52) 0%,
    rgba(249, 135, 21, 0.28) 32%,
    rgba(249, 135, 21, 0.16) 58%,
    rgba(249, 135, 21, 0.22) 100%
  );
}

.phub-step--left .phub-step__card::after {
  background:
    radial-gradient(
      ellipse 90% 80% at 100% 0%,
      rgba(249, 135, 21, 0.4) 0%,
      rgba(249, 135, 21, 0.14) 45%,
      transparent 72%
    ),
    linear-gradient(
      270deg,
      rgba(249, 135, 21, 0.32) 0%,
      rgba(249, 135, 21, 0.1) 26%,
      rgba(7, 4, 0, 0.94) 55%,
      #070400 100%
    );
}

.phub-step--right .phub-step__card::after {
  background:
    radial-gradient(
      ellipse 90% 80% at 100% 0%,
      rgba(249, 135, 21, 0.4) 0%,
      rgba(249, 135, 21, 0.14) 45%,
      transparent 72%
    ),
    linear-gradient(
      270deg,
      rgba(249, 135, 21, 0.32) 0%,
      rgba(249, 135, 21, 0.1) 26%,
      rgba(7, 4, 0, 0.94) 55%,
      #070400 100%
    );
}

.phub-step__card > * {
  position: relative;
  z-index: 1;
}

.phub-step.is-current.phub-step--left .phub-step__card::before {
  background: linear-gradient(
    270deg,
    rgba(249, 135, 21, 0.68) 0%,
    rgba(249, 135, 21, 0.34) 32%,
    rgba(249, 135, 21, 0.2) 58%,
    rgba(249, 135, 21, 0.28) 100%
  );
}

.phub-step.is-current.phub-step--right .phub-step__card::before {
  background: linear-gradient(
    270deg,
    rgba(249, 135, 21, 0.68) 0%,
    rgba(249, 135, 21, 0.34) 32%,
    rgba(249, 135, 21, 0.2) 58%,
    rgba(249, 135, 21, 0.28) 100%
  );
}

.phub-step.is-active .phub-step__card {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.phub-step__connector {
  position: absolute;
  top: 0;
  width: 0;
  height: 2px;
  margin-top: -1px;
  background: rgba(249, 135, 21, 0.3);
  transform: scale3d(0, 1, 1);
  transform-origin: left center;
  pointer-events: none;
  z-index: 2;
}

.phub-step__kicker {
  display: none;
}

.phub-step__title {
  margin: 0;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 24px;
  letter-spacing: -0.2px;
}

.phub-step__text {
  margin: 0;
  color: #ccc;
  font-size: 16px;
  font-weight: 400;
  line-height: 22px;
  letter-spacing: -0.16px;
}

@media (max-width: 899px) {
  .phub-process__scroller {
    min-height: auto;
  }

  .phub-process__sticky {
    position: static;
    top: auto;
    padding-bottom: 0;
  }

  .phub-process__rail,
  .phub-step__node,
  .phub-step__connector {
    display: none;
  }

  .phub-process__steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 0;
    margin-top: 0;
    padding-bottom: 0;
  }

  .phub-step {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    height: auto;
    display: block;
    grid-template-columns: 1fr;
    overflow: hidden;
  }

  .phub-step__card {
    grid-column: 1;
    width: 100%;
    max-width: none;
    padding: 2rem 1.5rem;
    opacity: 0;
    --phub-mobile-enter-x: -100px;
    transform: translate3d(var(--phub-mobile-enter-x), 0, 0);
    transition:
      opacity 1s cubic-bezier(0.165, 0.84, 0.44, 1),
      transform 1s cubic-bezier(0.165, 0.84, 0.44, 1);
    transition-delay: 0s;
  }

  /* Blueberry Our Approach (mobile): slideInLeft on 1 & 3, slideInRight on 2 & 4 */
  .phub-step[data-phub-step-index='0'] .phub-step__card,
  .phub-step[data-phub-step-index='2'] .phub-step__card {
    --phub-mobile-enter-x: -100px;
  }

  .phub-step[data-phub-step-index='1'] .phub-step__card,
  .phub-step[data-phub-step-index='3'] .phub-step__card {
    --phub-mobile-enter-x: 100px;
  }

  .phub-step.is-active .phub-step__card {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }

  .phub-step[data-phub-step-index='0'].is-active .phub-step__card {
    transition-delay: 0.3s;
  }

  .phub-step[data-phub-step-index='1'].is-active .phub-step__card,
  .phub-step[data-phub-step-index='2'].is-active .phub-step__card,
  .phub-step[data-phub-step-index='3'].is-active .phub-step__card {
    transition-delay: 0.4s;
  }

  /* Mobile: full-width cards, light from top-right (Blueberry Our Approach) */
  .phub-step--left .phub-step__card::before,
  .phub-step--right .phub-step__card::before {
    background: linear-gradient(
      225deg,
      rgba(249, 135, 21, 0.55) 0%,
      rgba(249, 135, 21, 0.26) 34%,
      rgba(249, 135, 21, 0.14) 62%,
      rgba(249, 135, 21, 0.2) 100%
    );
  }

  .phub-step--left .phub-step__card::after,
  .phub-step--right .phub-step__card::after {
    background:
      radial-gradient(
        ellipse 78% 68% at 100% 0%,
        rgba(249, 135, 21, 0.42) 0%,
        rgba(249, 135, 21, 0.12) 46%,
        transparent 72%
      ),
      linear-gradient(
        225deg,
        rgba(249, 135, 21, 0.3) 0%,
        rgba(249, 135, 21, 0.08) 28%,
        rgba(7, 4, 0, 0.94) 58%,
        #070400 100%
      );
  }

  .phub-step.is-current.phub-step--left .phub-step__card::before,
  .phub-step.is-current.phub-step--right .phub-step__card::before {
    background: linear-gradient(
      225deg,
      rgba(249, 135, 21, 0.72) 0%,
      rgba(249, 135, 21, 0.36) 34%,
      rgba(249, 135, 21, 0.2) 62%,
      rgba(249, 135, 21, 0.28) 100%
    );
  }
}

/* Calculator — Figma 15076:10262 */
.phub-calc .osc-heading {
  gap: 8px;
}

@media (min-width: 1024px) {
  .phub-calc .osc-heading h2 {
    line-height: 68px;
  }
}

.phub-calc .osc-heading p {
  max-width: 910px;
  color: #999;
  font-size: 18px;
  line-height: 24px;
}

.phub-calc__card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px;
  border-radius: 20px;
  border: 1px solid rgba(249, 135, 21, 0.2);
  background: linear-gradient(180deg, #432100 0%, #070400 54.31%);
}

@media (min-width: 768px) {
  .phub-calc__card {
    padding: 60px 40px;
  }
}

.phub-calc__sliders {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
}

.phub-calc .aifo-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
}

.phub-calc .aifo-slider {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.phub-calc .aifo-h {
  margin: 0;
  color: #ccc;
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: -0.14px;
}

.phub-calc .aifo-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 20px;
}

@media (max-width: 480px) {
  .phub-calc .aifo-labels--split {
    font-size: 11px;
    gap: 2px;
  }
}

.phub-calc .aifo-track {
  position: relative;
  --track-h: 6px;
  --thumb: 24px;
  height: var(--thumb);
}

.phub-calc .aifo-block--size .aifo-track {
  --track-h: 7px;
}

.phub-calc .aifo-tag {
  position: absolute;
  top: 50%;
  width: var(--thumb);
  height: var(--thumb);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #f98715;
  box-shadow: none;
  padding: 0;
  font-size: 0;
  line-height: 0;
  overflow: hidden;
  cursor: grab;
  z-index: 5;
  user-select: none;
}

.phub-calc .aifo-tag:active {
  cursor: grabbing;
}

.phub-calc .aifo-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: var(--track-h);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.phub-calc .aifo-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background: #f98715;
  border-radius: 5px 0 0 5px;
}

.phub-calc .aifo-range {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 4;
}

.phub-calc__footer {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.phub-calc__result-row {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.phub-calc__receive-label {
  margin: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: -0.14px;
}

.phub-calc__receive-value {
  margin: 0;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  line-height: 30px;
  letter-spacing: -0.24px;
}

.phub-calc__cta {
  width: 100%;
  max-width: none;
  justify-content: center;
}

/* Figma 15076:9356: identical flat backgrounds for all four desktop cards. */
@media (min-width: 900px) {
  .phub-process .phub-step__card {
    border: 1px solid #f98715;
    border-radius: 20px;
    background: linear-gradient(90deg, rgba(249, 135, 21, 0) 0%, rgba(249, 135, 21, 0.4) 100%);
    box-shadow: none;
  }
  .phub-process .phub-step__card::before,
  .phub-process .phub-step__card::after {
    display: none;
  }
}