/* Keep custom products pages on the same document-scroll model as index/home. */
body[data-page="products"][data-subpage="custom"] {
  --custom-flow-fill-height: calc(100vh + var(--nav-height, 64px));
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

@supports (height: 100svh) {
  body[data-page="products"][data-subpage="custom"] {
    --custom-flow-fill-height: calc(100svh + var(--nav-height, 64px));
  }
}

@supports (height: 100dvh) {
  body[data-page="products"][data-subpage="custom"] {
    --custom-flow-fill-height: calc(100dvh + var(--nav-height, 64px));
  }
}

body[data-page="products"][data-subpage="custom"] .custom-scroll {
  position: relative;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  scroll-snap-type: none !important;
  scroll-snap-stop: normal !important;
  scroll-padding-top: 0 !important;
  -webkit-overflow-scrolling: auto !important;
}

body[data-page="products"][data-subpage="custom"] .custom-scroll > main,
body[data-page="products"][data-subpage="custom"] .custom-scroll > footer {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
}

body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow,
body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--stack {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow {
  display: flex !important;
  flex-direction: column !important;
  min-height: var(--custom-flow-fill-height) !important;
}

body[data-page="products"][data-subpage="custom"] .custom-scroll > main > section,
body[data-page="products"][data-subpage="custom"] .custom-scroll > main > .custom-stack-section,
body[data-page="products"][data-subpage="custom"] .custom-scroll > main > .custom-snap-section,
body[data-page="products"][data-subpage="custom"] .custom-scroll .custom-section--flow,
body[data-page="products"][data-subpage="custom"] .custom-scroll .custom-section--factors,
body[data-page="products"][data-subpage="custom"] .custom-scroll .custom-section--cases,
body[data-page="products"][data-subpage="custom"] .custom-scroll .custom-section--team {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  scroll-snap-align: none !important;
  scroll-snap-stop: normal !important;
  overscroll-behavior: auto !important;
}

body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 0 auto !important;
  min-height: var(--custom-flow-fill-height) !important;
}

body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .custom-section__inner.custom-section__inner--full {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: var(--custom-flow-fill-height) !important;
}

body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .custom-section__content.custom-section__content--centered {
  flex: 0 0 auto !important;
}

body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .custom-section__media.custom-section__media--full,
body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .process-timeline--horizontal,
body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .custom-flow-steps-container {
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .custom-flow-steps-container {
  display: flex !important;
  flex-direction: column !important;
}

body[data-page="products"][data-subpage="custom"] .custom-scroll .custom-section--factors.is-internal-scrollable,
body[data-page="products"][data-subpage="custom"] .custom-scroll .custom-section--cases.is-internal-scrollable,
body[data-page="products"][data-subpage="custom"] .custom-scroll .custom-section--team.is-internal-scrollable {
  overflow: visible !important;
  overscroll-behavior: auto !important;
  -webkit-overflow-scrolling: auto !important;
}

body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .custom-section__inner,
body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .custom-section__media,
body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .process-timeline--horizontal,
body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .custom-flow-steps-container,
body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .custom-flow-steps-container .process-steps--horizontal {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
}

body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .custom-flow-steps-container .process-steps--horizontal {
  flex: 1 1 auto !important;
  grid-template-rows: none !important;
  touch-action: auto !important;
}

body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .process-step,
body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .step-content {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .process-step {
  position: relative !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .step-content {
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

/* Keep flow/factors subtitles on exactly the same tone across breakpoints. */
body[data-page="products"][data-subpage="custom"] .custom-flow-lede,
body[data-page="products"][data-subpage="custom"] .custom-factors-lede {
  color: rgba(176, 182, 191, 0.96) !important;
}

body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--cases .case-copy > .case-copy__mobile-summary {
  display: none;
}

@media (max-width: 900px) {
  body[data-page="products"][data-subpage="custom"] {
    --custom-flow-fill-height: calc(100vh + var(--nav-height, 64px));
    --custom-factors-fill-height: 100vh;
    --custom-flow-bottom-gap-mobile: var(--nav-height, 64px);
    --custom-flow-subtitle-to-content-gap: 2.08rem;
  }

  @supports (height: 100svh) {
    body[data-page="products"][data-subpage="custom"] {
      --custom-flow-fill-height: calc(100svh + var(--nav-height, 64px));
      --custom-factors-fill-height: 100svh;
    }
  }

  @supports (height: 100dvh) {
    body[data-page="products"][data-subpage="custom"] {
      --custom-flow-fill-height: calc(100dvh + var(--nav-height, 64px));
      --custom-factors-fill-height: 100dvh;
    }
  }

  /* Keep the flow title below the fixed mobile nav bar. */
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow {
    min-height: var(--custom-flow-fill-height) !important;
    height: var(--custom-flow-fill-height) !important;
    padding-top: var(--nav-height, 64px) !important;
    box-sizing: border-box !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow,
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .custom-section__inner.custom-section__inner--full {
    min-height: 100% !important;
    height: 100% !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .custom-section__media.custom-section__media--full,
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .process-timeline--horizontal,
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .custom-flow-steps-container,
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .custom-flow-steps-container .process-steps--horizontal {
    min-height: 0 !important;
    height: 100% !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .custom-flow-steps-container {
    height: calc(100% - var(--custom-flow-bottom-gap-mobile)) !important;
    min-height: 0 !important;
    margin-bottom: var(--custom-flow-bottom-gap-mobile) !important;
    padding-bottom: 0 !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .custom-flow-steps-container .process-steps--horizontal {
    height: 100% !important;
    min-height: 0 !important;
    grid-template-rows: repeat(5, minmax(0, 1fr)) !important;
    align-content: stretch !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .process-step {
    height: 100% !important;
    min-height: 0 !important;
    background: transparent !important;
    background-image: none !important;
  }

  /* Mobile adaptive: fill each row, but follow one-screen layout. */
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .step-content {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  /* Keep mask reveal in lockstep with card/image reveal. */
  body[data-page="products"][data-subpage="custom"] .custom-section--flow .step-content::after {
    opacity: 0;
  }

  body[data-page="products"][data-subpage="custom"] .custom-section--flow.is-visible .process-step .step-content::after {
    animation: customFlowMaskReveal 0.62s cubic-bezier(0.22, 0.61, 0.36, 1) both !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-section--flow.is-visible .process-step[data-step="1"] .step-content::after {
    animation-delay: var(--custom-flow-step-delay-1, 0s) !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-section--flow.is-visible .process-step[data-step="2"] .step-content::after {
    animation-delay: var(--custom-flow-step-delay-2, 0s) !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-section--flow.is-visible .process-step[data-step="3"] .step-content::after {
    animation-delay: var(--custom-flow-step-delay-3, 0s) !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-section--flow.is-visible .process-step[data-step="4"] .step-content::after {
    animation-delay: var(--custom-flow-step-delay-4, 0s) !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-section--flow.is-visible .process-step[data-step="5"] .step-content::after {
    animation-delay: var(--custom-flow-step-delay-5, 0s) !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--stack > .custom-stack-section.custom-section--factors,
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--stack > .custom-section--factors {
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    padding-top: var(--nav-height, 64px) !important;
  }

  /* Factors title block: use centered content container like flow title block. */
  body[data-page="products"][data-subpage="custom"] .custom-section--factors .custom-section__content.custom-section__content--centered {
    margin-top: 0.42rem !important;
    margin-bottom: var(--custom-flow-subtitle-to-content-gap) !important;
    text-align: center !important;
    align-items: center !important;
    gap: 0.16rem !important;
    width: 100%;
    max-width: 700px;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-section--factors .custom-section__content.custom-section__content--centered .section-header {
    margin: 0 !important;
    align-items: center !important;
    text-align: center !important;
  }

  /* Beat the mobile wildcard color override in styles.css and keep parity with .custom-flow-lede. */
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--stack > .custom-stack-section.custom-section--factors .section-lede.custom-factors-lede,
  body[data-page="products"][data-subpage="custom"] .custom-section--factors .custom-factors-lede {
    margin: 0 !important;
    max-width: 40rem;
    font-size: 0.82rem !important;
    line-height: 1.55 !important;
    color: rgba(176, 182, 191, 0.96) !important;
    text-align: center !important;
  }

  /* Cases heading block: keep the same title/subtitle vertical position as factors. */
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--cases .custom-section__content.custom-section__content--centered .section-header {
    margin-top: 0 !important;
    margin-bottom: 0.16rem !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--cases .custom-section__content.custom-section__content--centered .section-lede.custom-cases-lede {
    margin: 0 !important;
  }
}

@media (max-width: 640px) {
  body[data-page="products"][data-subpage="custom"] {
    --custom-flow-bottom-gap-mobile: var(--nav-height, 64px);
    --custom-flow-subtitle-to-content-gap: 1.78rem;
  }

  body[data-page="products"][data-subpage="custom"] .custom-section--factors .custom-section__content.custom-section__content--centered {
    margin-top: 0.36rem !important;
    margin-bottom: var(--custom-flow-subtitle-to-content-gap) !important;
    gap: 0.12rem !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-section--factors .custom-factors-lede {
    font-size: 0.74rem !important;
    line-height: 1.5 !important;
    padding: 0 0.25rem;
  }

  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--cases .custom-section__content.custom-section__content--centered .section-header {
    margin-top: 0 !important;
    margin-bottom: 0.12rem !important;
  }
}

/* Lock mobile intro typography parity between flow/factors title blocks. */
@media (max-width: 900px) {
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .custom-section__content.custom-section__content--centered .section-header h2,
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--stack > .custom-stack-section.custom-section--factors .custom-section__content.custom-section__content--centered .section-header h2 {
    font-size: clamp(1.34rem, 6.9vw, 1.66rem) !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .custom-flow-lede,
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--stack > .custom-stack-section.custom-section--factors .custom-section__content.custom-section__content--centered .section-lede.custom-factors-lede {
    font-size: 0.82rem !important;
    line-height: 1.55 !important;
  }
}

@media (max-width: 640px) {
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .custom-section__content.custom-section__content--centered .section-header h2,
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--stack > .custom-stack-section.custom-section--factors .custom-section__content.custom-section__content--centered .section-header h2 {
    font-size: clamp(1.28rem, 6.6vw, 1.56rem) !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .custom-flow-lede,
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--stack > .custom-stack-section.custom-section--factors .custom-section__content.custom-section__content--centered .section-lede.custom-factors-lede {
    font-size: 0.74rem !important;
    line-height: 1.5 !important;
  }
}

@keyframes customFlowMaskReveal {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Final hard reset: remove the unexpected frame between flow and factors on mobile. */
@media (max-width: 900px) {
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--stack > .custom-stack-section.custom-section--factors,
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--stack > .custom-stack-section.custom-section--factors.is-visible,
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--stack > .custom-section--factors {
    margin-bottom: 0 !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--stack > .custom-snap-section.custom-section--cases,
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--stack > .custom-snap-section.custom-section--cases.is-visible,
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--stack > .custom-section--cases {
    margin-bottom: 0 !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-snap-section.custom-section--flow,
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow,
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--stack > .custom-stack-section.custom-section--factors,
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--stack > .custom-stack-section.custom-section--factors.is-visible,
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--stack > .custom-section--factors {
    background: transparent !important;
    background-image: none !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  /* Cases section on mobile: remove desktop reveal/frame effects at the top area. */
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--cases > .custom-snap-section.custom-section--cases,
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--cases > .custom-snap-section.custom-section--cases.is-visible,
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--cases > .custom-section--cases,
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--cases > .custom-section--cases.is-visible {
    margin-top: 0 !important;
    padding-top: var(--nav-height, 64px) !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    background: transparent !important;
    background-image: none !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    will-change: auto !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--cases > .custom-snap-section.custom-section--cases .custom-section__inner {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    gap: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    padding-top: 0 !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--cases .custom-section__content.custom-section__content--centered {
    display: contents !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--cases .custom-section__content.custom-section__content--centered .section-header,
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--cases .custom-section__content.custom-section__content--centered .section-lede.custom-cases-lede {
    align-self: center !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--cases .custom-section__content.custom-section__content--centered .section-header {
    order: 1 !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--cases .custom-section__content.custom-section__content--centered .section-lede.custom-cases-lede {
    order: 2 !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--cases .custom-section__media {
    order: 3 !important;
    margin-top: 4vh !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--cases .case-copy {
    order: 4 !important;
    margin-top: 4vh !important;
    text-align: center !important;
    justify-items: center !important;
    padding-inline: clamp(0.9rem, 4.8vw, 1.35rem) !important;
    box-sizing: border-box !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--cases .case-copy > p {
    display: none !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--cases .case-copy > .case-copy__mobile-summary {
    display: block !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    margin: 0 !important;
    width: 100% !important;
    text-align: center !important;
    font-size: 0.86rem !important;
    line-height: 1.7 !important;
    letter-spacing: 0.002em !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--cases .case-copy > .case-copy__mobile-summary + .case-copy__mobile-summary {
    margin-top: 0.7rem !important;
  }
}

@media (max-width: 640px) {
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--cases .case-copy > .case-copy__mobile-summary {
    font-size: 0.82rem !important;
  }
}

@media (max-width: 900px) {
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--factors {
    order: 2 !important;
    position: relative !important;
    z-index: 1 !important;
    isolation: isolate !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--cases {
    order: 3 !important;
    position: relative !important;
    z-index: 0 !important;
    isolation: isolate !important;
    margin-top: clamp(1rem, 4vw, 1.5rem) !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow {
    padding-top: var(--nav-height, 64px) !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    padding-top: 0 !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .custom-section__inner.custom-section__inner--full {
    padding-top: 0 !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow .custom-section__content.custom-section__content--centered {
    margin-top: 0 !important;
    padding-top: var(--mobile-section-title-top-space, clamp(2.5rem, 10vw, 4rem)) !important;
  }

  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow.reveal,
  body[data-page="products"][data-subpage="custom"] .custom-scroll > main.custom-main--flow > .custom-section--flow.reveal.is-visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
  }
}
