/*
  Unified expedition scene.

  The mountain is one static plane. The guide, right ridge, and complete river
  are one continuous artwork centered on the viewport and moved only on the Y
  axis. A fixed minimum artwork width keeps the guide the same useful size on
  phones instead of shrinking him with the viewport.
*/

.expedition-story {
  --mountain-focus-x: 50%;
  --journey-width: max(125vw, 1000px);
  --journey-river-anchor: -40%;
  --journey-start-y: -84dvh;
  --journey-end-y: -132dvh;
  position: relative;
  overflow: clip;
  background: #073f37;
}

.hero-depth-background {
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: var(--mountain-focus-x) bottom;
  transform: translate3d(-2%, -13%, 0) scaleX(1.03) scaleY(1.3);
  transform-origin: center bottom;
  animation: none !important;
}

/* A distant forest-and-river plane reconnects the mountain to the near river. */
.hero-depth-midground {
  inset: auto;
  top: 0;
  bottom: auto;
  left: 50%;
  width: auto;
  height: 100%;
  max-width: none;
  object-fit: fill;
  transform: translate3d(-54%, 38dvh, 0);
  transform-origin: center bottom;
  animation: none !important;
  will-change: transform;
}

.landscape-bridge {
  z-index: 7;
  height: 310px;
  margin-bottom: -310px;
  overflow: visible;
  background: transparent;
  pointer-events: none;
}

.landscape-bridge > img {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 50%;
  width: var(--journey-width);
  height: auto;
  max-width: none;
  transform: translate3d(var(--journey-river-anchor), var(--journey-start-y), 0);
  transform-origin: 50% 0;
  animation: none !important;
  will-change: transform;
  image-rendering: auto;
  backface-visibility: hidden;
}

.problems {
  z-index: 9;
  margin-top: 0;
  overflow: hidden;
  transform: none;
  animation: none !important;
  border-radius: 0;
  background: transparent;
}

.river-return {
  position: absolute;
  inset: 0 auto auto 50%;
  z-index: 0;
  width: auto;
  height: 100%;
  max-width: none;
  object-fit: fill;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, transparent 18%, #000 48%, #000 100%);
  mask-image: linear-gradient(180deg, transparent 0, transparent 18%, #000 48%, #000 100%);
}

.river-return-background {
  transform: translate3d(-54%, 0, 0);
}

.river-return-midground {
  transform: translate3d(-60.3%, -3%, 0) scale(1.06);
}

/* The canoe is a separate narrative plane above the continuous river. */
.canoe-layer {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 1%;
  width: clamp(760px, 72vw, 1050px);
  height: auto;
  max-width: none;
  transform: translate3d(-60.3%, 12%, 0) scale(1.03);
  transform-origin: center bottom;
  animation: none !important;
  pointer-events: none;
  aspect-ratio: 1448 / 1086;
}

.canoe-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.dog-head-layer {
  display: none;
}

.stuck-overlay {
  position: relative;
  z-index: 4;
}

@keyframes unified-journey-rise {
  from { transform: translate3d(var(--journey-river-anchor), var(--journey-start-y), 0); }
  to { transform: translate3d(var(--journey-river-anchor), var(--journey-end-y), 0); }
}

@keyframes restored-midground-rise {
  from { transform: translate3d(-54%, 38dvh, 0); }
  to { transform: translate3d(-54%, 15dvh, 0); }
}

@keyframes canoe-drift {
  from { transform: translate3d(-60.3%, 18%, 0) rotate(-1deg) scale(1.03); }
  to { transform: translate3d(-60.3%, 4%, 0) rotate(.8deg) scale(1.03); }
}

@supports (animation-timeline: scroll()) {
  .landscape-bridge > img {
    animation: unified-journey-rise linear both !important;
    animation-timeline: scroll(root) !important;
    animation-range: 0 1250px !important;
  }

  .hero-depth-midground {
    animation: restored-midground-rise linear both !important;
    animation-timeline: scroll(root) !important;
    animation-range: 0 760px !important;
  }

  .canoe-layer {
    animation: canoe-drift linear both !important;
    animation-timeline: view() !important;
    animation-range: entry 0% cover 70% !important;
  }
}

@media (max-width: 1200px) {
  .expedition-story { --mountain-focus-x: 72%; }
}

@media (max-width: 900px) {
  .expedition-story {
    --mountain-focus-x: 82%;
    --journey-start-y: -76dvh;
    --journey-end-y: -125dvh;
  }
}

/* Desktop-only character beat: the guide's dog briefly shakes its head and ears. */
@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  .dog-head-layer {
    display: block;
    position: absolute;
    z-index: 2;
    top: 56.6%;
    left: 59.5%;
    width: 9.8%;
    height: auto;
    transform-origin: 50% 88%;
    will-change: transform;
    animation: dog-head-shake 3.8s cubic-bezier(.36, .07, .19, .97) infinite;
  }
}

@keyframes dog-head-shake {
  0%, 58%, 100% { transform: rotate(0deg); }
  64% { transform: rotate(-7deg); }
  70% { transform: rotate(6deg); }
  76% { transform: rotate(-5deg); }
  82% { transform: rotate(4deg); }
  88% { transform: rotate(-2deg); }
  94% { transform: rotate(1deg); }
}

@media (max-width: 900px), (prefers-reduced-motion: reduce) {
  .dog-head-layer {
    display: none !important;
    animation: none !important;
  }
}

@media (min-width: 761px) and (max-width: 900px) {
  .waterfall-story {
    /* Match the 100%-wide canoe painting at the shared tablet seam. */
    background-size: 100% 100%;
  }
}

/* A single responsive painting spans both chapters on narrow screens. This is
   the canonical seam solution and must remain the final scene rule. */
.waterfall-story {
  display: contents;
}

@media (max-width: 900px) {
  .waterfall-story {
    display: block;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: #003f3c url("assets/waterfall-to-pool-mobile.png") center top / auto 100% no-repeat;
  }

  .waterfall-story .help,
  .waterfall-story .process {
    background: transparent !important;
  }

  .waterfall-story .help::before,
  .waterfall-story .help::after,
  .waterfall-story .process::before,
  .waterfall-story .process::after {
    content: none !important;
    display: none !important;
    background: none !important;
  }
}

/* FINAL narrow-screen canoe chapter: canoe and river are one fixed scene. */
@media (max-width: 900px) {
  .problems {
    min-height: max(1250px, calc(200vw - 270px));
    background-color: #073f37 !important;
    background-image: url("assets/canoe-river-mobile-integrated.png") !important;
    background-position: center top !important;
    background-size: 100% auto !important;
    background-repeat: no-repeat !important;
  }

  .problems .river-return,
  .problems .canoe-layer {
    display: none !important;
  }

  .waterfall-story {
    margin-top: -2px;
  }
}

@media (max-width: 760px) {
  .problems {
    min-height: 1250px;
    background-position: center top !important;
    background-size: auto 1520px !important;
  }
}

@media (max-width: 340px) {
  .hero-depth-foreground {
    --guide-x: -70%;
    --guide-rise: 0px;
    bottom: 82px;
    transform: translateX(-69%);
  }
}

/* Desktop flock: a quiet left-to-right loop across the open mountain sky. */
.hero-flight {
  display: none;
  pointer-events: none;
}

@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  .hero-flight {
    position: absolute;
    z-index: 3;
    top: 18%;
    left: 0;
    display: block;
    width: 220px;
    height: 96px;
    opacity: .94;
    transform: translate3d(-22vw, 0, 0);
    animation: hero-flock-crossing 24s linear -6s infinite;
    filter: drop-shadow(0 1px 1px rgba(0, 30, 32, .72));
    will-change: transform;
  }

  .hero-flight i {
    position: absolute;
    width: 30px;
    height: 12px;
    transform: scale(var(--bird-scale, 1));
  }

  .hero-flight i::before,
  .hero-flight i::after {
    content: "";
    position: absolute;
    top: 2px;
    width: 18px;
    height: 10px;
    border-top: 3px solid rgba(255, 247, 221, .96);
    border-radius: 55% 55% 0 0;
    animation: hero-bird-wing .72s ease-in-out infinite alternate;
    transform-origin: center top;
  }

  .hero-flight i::before { left: 0; transform: rotate(15deg); }
  .hero-flight i::after { right: 0; transform: rotate(-15deg); animation-delay: -.36s; }
  .hero-flight i:nth-child(1) { left: 0; top: 48px; --bird-scale: .78; }
  .hero-flight i:nth-child(2) { left: 40px; top: 24px; --bird-scale: 1; }
  .hero-flight i:nth-child(3) { left: 83px; top: 43px; --bird-scale: 1.18; }
  .hero-flight i:nth-child(4) { left: 126px; top: 10px; --bird-scale: .88; }
  .hero-flight i:nth-child(5) { left: 165px; top: 34px; --bird-scale: .7; }
  .hero-flight i:nth-child(6) { left: 201px; top: 17px; --bird-scale: .56; }

  @keyframes hero-flock-crossing {
    from { transform: translate3d(-22vw, 0, 0); }
    to { transform: translate3d(122vw, -4vh, 0); }
  }

  @keyframes hero-bird-wing {
    from { scale: 1 1; }
    to { scale: 1 .45; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-flight { display: none !important; }
}

@media (max-width: 760px) {
  .hero-profiles::before {
    content: "";
    display: block;
    position: absolute;
    z-index: 0;
    top: -34px;
    right: 0;
    left: 0;
    height: 72px;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 0%, rgba(5,57,48,.78) 48%, rgba(5,57,48,.22) 78%, transparent 100%);
  }

  .hero-profiles > * {
    position: relative;
    z-index: 1;
  }
}

/* FINAL river-to-waterfall handoff. The replacement chapter art inherits the
   canoe scene's centered channel and bank geometry at its first painted row. */
@media (max-width: 900px) {
  .waterfall-story {
    margin-top: -30px;
    background-image: url("assets/waterfall-to-pool-mobile-v2.png?v=68");
    background-position: center top;
    background-size: auto 100%;
    background-repeat: no-repeat;
  }

  .problems {
    margin-bottom: 0;
    background-position: center top !important;
  }
}

/* Canoe composition polish: reserve centered water below the copy and keep
   the character layer fully visible instead of letting scroll motion hide it. */
@media (max-width: 900px) {
  .problems {
    background-position: 50% 0 !important;
  }

  .problems .canoe-layer {
    animation: none !important;
    left: 58%;
    bottom: 5%;
    width: min(68vw, 650px);
    transform: translate3d(-50%, 0, 0) !important;
  }
}

@media (max-width: 760px) {
  .problems {
    min-height: max(1450px, 200vw);
    background-position: 50% 0 !important;
    background-size: auto 100% !important;
  }

  .problems .canoe-layer {
    left: 50%;
    bottom: 22%;
    width: min(72vw, 470px);
    transform: translate3d(-50%, 0, 0) !important;
  }
}

/* FINAL narrow-screen canoe chapter: one full-height 1:2 river painting keeps
   the centerline fixed and exposes its complete top and bottom edges. */
@media (max-width: 900px) {
  .problems {
    min-height: max(1200px, 200vw);
    background-color: #073f37 !important;
    background-image: url("assets/canoe-river-mobile-tall.png") !important;
    background-position: center top !important;
    background-size: 100% auto !important;
    background-repeat: no-repeat !important;
  }

  .problems .river-return {
    display: none !important;
  }

  .waterfall-story {
    margin-top: -2px;
  }
}

@media (max-width: 760px) {
  .expedition-story {
    --mountain-focus-x: 87%;
    --journey-width: 1000px;
    --journey-river-anchor: -40%;
    --journey-start-y: -72dvh;
    --journey-end-y: -118dvh;
  }

  .landscape-bridge {
    height: 260px;
    margin-bottom: -260px;
  }

  .problems {
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 150px, #000 92%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0, #000 150px, #000 92%, transparent 100%);
  }

  .canoe-layer {
    width: 620px;
    left: 50%;
    bottom: 5%;
  }
}

/* Final waterfall-to-pool polish: the paintings now meet directly, so the
   former blend veil and the last grid divider are intentionally absent. */
.help::after {
  display: none;
}

.help .outcome:nth-child(n + 3) {
  border-bottom: 0;
}

/* Canonical narrow-screen scene handoffs. The outgoing artwork remains
   uncropped until the incoming layer is already opaque. */
@media (max-width: 900px) {
  .landscape-bridge > img {
    clip-path: none;
  }

  .river-return-background {
    -webkit-mask-image: linear-gradient(180deg, transparent 0, rgba(0, 0, 0, .72) 72px, #000 132px, #000 100%);
    mask-image: linear-gradient(180deg, transparent 0, rgba(0, 0, 0, .72) 72px, #000 132px, #000 100%);
  }

  .river-return-midground {
    clip-path: none;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, rgba(0, 0, 0, .64) 86px, #000 150px, #000 100%);
    mask-image: linear-gradient(180deg, transparent 0, rgba(0, 0, 0, .64) 86px, #000 150px, #000 100%);
  }
}

@media (max-width: 760px) {
  /* Layer the opaque waterfall over a bottom-anchored pool. Their natural
     painted edges meet without a fixed breakpoint or synthetic blend veil. */
  .help::before {
    z-index: -1;
    background-image: url("assets/built-around-you-waterfall.png");
    background-position: center top;
    background-size: var(--waterfall-chapter-width) auto;
    background-repeat: no-repeat;
  }

  .help::after {
    display: block;
    inset: 0;
    height: auto;
    z-index: -2;
    background: #003f3c url("assets/how-it-works-pool.png") center bottom / var(--waterfall-chapter-width) auto no-repeat;
  }
}


/* Edge-to-edge scene coverage and a tint-free section handoff. */
.hero-depth-background {
  left: -2%;
  width: 104%;
  transform: translate3d(0, -13%, 0) scaleX(1.03) scaleY(1.3);
}

.hero-depth-midground {
  left: 50%;
  width: max(112vw, 1200px);
  height: 100%;
  transform: translate3d(-50%, 20dvh, 0);
}

.problems {
  -webkit-mask-image: none !important;
  mask-image: none !important;
}

.problems::after {
  content: none !important;
  background: none !important;
}

.river-return {
  width: max(118vw, 1450px);
  height: 100%;
}

.river-return-background {
  transform: translate3d(-50%, 0, 0);
}

@keyframes restored-midground-edge-to-edge {
  from { transform: translate3d(-50%, 20dvh, 0); }
  to { transform: translate3d(-50%, 3dvh, 0); }
}

@supports (animation-timeline: scroll()) {
  .hero-depth-midground {
    animation-name: restored-midground-edge-to-edge !important;
  }
}

@media (max-width: 760px) {
  .expedition-story {
    --journey-width: 1000px;
  }

  .hero-depth-midground {
    width: 1120px;
    transform: translate3d(-50%, 23dvh, 0);
  }

  .river-return {
    width: 1120px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landscape-bridge > img {
    animation: none !important;
    transform: translate3d(var(--journey-river-anchor), -92dvh, 0);
  }

  .hero-depth-midground,
  .canoe-layer { animation: none !important; }
}

/* Final hero hierarchy and depth calibration. */
.hero-depth-midground {
  transform: translate3d(-54%, 20dvh, 0);
}

.hero-action {
  justify-self: end;
  margin-right: 0;
}

.hero-action .button {
  min-width: 187px;
  padding: 18px 24px;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 999px;
  background: rgba(5, 30, 43, .36);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .055em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px rgba(0, 15, 29, .16);
}

.hero-action .button:hover {
  border-color: rgba(255, 255, 255, .72);
  background: rgba(7, 50, 60, .7);
}

.hero-book-button img {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: block;
}

.hero-profiles {
  z-index: 14 !important;
  isolation: isolate;
}

.problems {
  padding-top: 150px;
}

.stuck-overlay {
  z-index: 5;
  transform: translate3d(0, 110px, 0);
}

.canoe-layer {
  z-index: 4;
  bottom: 28%;
}

@keyframes restored-midground-rise-final {
  from { transform: translate3d(-54%, 20dvh, 0); }
  to { transform: translate3d(-54%, 3dvh, 0); }
}

@supports (animation-timeline: scroll()) {
  .hero-depth-midground {
    animation-name: restored-midground-rise-final !important;
  }
}

@media (max-width: 760px) {
  .hero-depth-midground {
    transform: translate3d(-54%, 23dvh, 0);
  }

  .hero-action {
    justify-self: start;
    margin-right: 0;
  }

  .hero-action .button {
    min-width: 179px;
    padding: 16px 22px;
    font-size: 15px;
  }

  .problems {
    padding-top: 115px;
  }

  .stuck-overlay {
    transform: translate3d(0, 78px, 0);
  }

  .canoe-layer {
    bottom: 31%;
  }
}

/* Crop the tapered river remnant, then stretch only the usable water in place. */
.landscape-bridge > img {
  clip-path: inset(0 0 8% 0);
}

.river-return-midground {
  clip-path: inset(0 0 20% 0);
  transform: translate3d(-60.3%, -3%, 0) scaleX(1.06) scaleY(1.25);
  transform-origin: center top;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, transparent 18%, #000 42%, #000 100%);
  mask-image: linear-gradient(180deg, transparent 0, transparent 18%, #000 42%, #000 100%);
}

.problems .thought-grid {
  width: min(44%, 510px);
}

.problems .thought,
.problems .thought.wide {
  min-height: 108px;
  padding: 18px 22px;
}

.problems .thought p {
  font-size: clamp(21px, 1.9vw, 27px);
  line-height: 1.08;
}

@media (max-width: 760px) {
  .landscape-bridge > img {
    clip-path: inset(0 0 6% 0);
  }

  .problems .thought-grid {
    width: 100%;
  }

  .problems .thought,
  .problems .thought.wide {
    min-height: 104px;
    padding: 17px 18px;
  }

  .problems .thought p {
    font-size: 21px;
  }
}

/* Reserve the river's right side for the canoe and remove the duplicate tail. */
.river-return-midground {
  display: block;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, transparent 18%, #000 42%, #000 72%, transparent 82%);
  mask-image: linear-gradient(180deg, transparent 0, transparent 18%, #000 42%, #000 72%, transparent 82%);
}

.problems .thought-grid {
  width: min(37%, 430px);
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 44px;
}

.problems .thought,
.problems .thought.wide {
  grid-column: auto;
  min-height: 132px;
  padding: 24px 26px;
}

.problems .thought p {
  font-size: clamp(22px, 2.25vw, 31px);
}

@media (max-width: 760px) {
  .problems .thought-grid {
    width: min(88%, 390px);
    gap: 12px;
    margin-top: 34px;
  }

  .problems .thought,
  .problems .thought.wide {
    min-height: 132px;
    padding: 22px 20px;
  }

  .problems .thought p {
    font-size: 23px;
  }
}

/* The river continues over the lip into the next chapter. */
.help {
  position: relative;
  isolation: isolate;
  z-index: 10;
  min-height: 1180px;
  margin-top: -230px;
  padding-top: 284px;
  overflow: hidden;
  color: #f9fbfa;
  background: transparent;
}

.help::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(1, 35, 38, .42) 0%, rgba(1, 35, 38, .12) 47%, rgba(1, 35, 38, .02) 100%),
    url("assets/built-around-you-waterfall.png") center top / cover no-repeat;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, rgba(0, 0, 0, .35) 74px, #000 220px);
  mask-image: linear-gradient(180deg, transparent 0, rgba(0, 0, 0, .35) 74px, #000 220px);
}

.help::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 24%;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(1, 35, 38, .48));
}

.help > .container {
  position: relative;
  z-index: 1;
}

.help .section-heading .kicker,
.help .section-heading h2 span,
.help .outcome > span,
.help .outcome-icon {
  color: #55d8d0;
}

.help .section-heading > p:last-child:not(.kicker) {
  color: rgba(249, 251, 250, .88);
}

.help .outcome-grid {
  width: min(92%, 940px);
  border-color: rgba(255, 255, 255, .22);
}

.help .outcome {
  min-height: 300px;
  border-color: rgba(255, 255, 255, .22);
  text-shadow: 0 2px 18px rgba(0, 25, 27, .58);
}

.help .outcome:nth-child(even) {
  border-left-color: rgba(255, 255, 255, .22);
}

.help .outcome-icon {
  border-color: rgba(255, 255, 255, .3);
  background: rgba(1, 35, 38, .24);
  backdrop-filter: blur(8px);
}

@media (max-width: 760px) {
  .help {
    min-height: 1120px;
    margin-top: -164px;
    padding-top: 198px;
  }

  .help::before {
    background-position: center, 56% top;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, rgba(0, 0, 0, .42) 48px, #000 150px);
    mask-image: linear-gradient(180deg, transparent 0, rgba(0, 0, 0, .42) 48px, #000 150px);
  }

  .help .outcome-grid {
    width: 100%;
  }
}

/* Canonical final edge geometry. Keep this last so earlier scene experiments cannot reopen seams. */
.hero-depth-midground {
  left: 50%;
  width: max(112vw, 1200px);
  height: 100%;
  transform: translate3d(-50%, 20dvh, 0);
}

@keyframes restored-midground-final-edge {
  from { transform: translate3d(-50%, 20dvh, 0); }
  to { transform: translate3d(-50%, 3dvh, 0); }
}

@supports (animation-timeline: scroll()) {
  .hero-depth-midground {
    animation-name: restored-midground-final-edge !important;
  }
}

@media (max-width: 760px) {
  .hero-depth-midground {
    width: 1120px;
    transform: translate3d(-50%, 23dvh, 0);
  }
}

/* Tablet river handoff: keep the continuous foreground visible longer and
   compress the duplicate return layers into a short, low-opacity blend. */
@media (min-width: 761px) and (max-width: 1100px) {
  .landscape-bridge > img {
    clip-path: inset(0 0 2% 0);
  }

  .river-return-background {
    -webkit-mask-image: linear-gradient(180deg, transparent 0, transparent 36%, rgba(0, 0, 0, .25) 43%, #000 51%, #000 100%);
    mask-image: linear-gradient(180deg, transparent 0, transparent 36%, rgba(0, 0, 0, .25) 43%, #000 51%, #000 100%);
  }

  .river-return-midground {
    -webkit-mask-image: linear-gradient(180deg, transparent 0, transparent 38%, rgba(0, 0, 0, .3) 44%, #000 51%, #000 76%, transparent 85%);
    mask-image: linear-gradient(180deg, transparent 0, transparent 38%, rgba(0, 0, 0, .3) 44%, #000 51%, #000 76%, transparent 85%);
  }
}

/* Waterfall-to-pool chapter. Both 4:3 paintings share one rendered width so
   the water centerline and banks meet at the section boundary on every size. */
:root {
  --waterfall-chapter-width: max(100vw, 1574px);
}

.help::before {
  background-image:
    linear-gradient(90deg, rgba(1, 35, 38, .42) 0%, rgba(1, 35, 38, .12) 47%, rgba(1, 35, 38, .02) 100%),
    url("assets/built-around-you-waterfall.png");
  background-position: center top, center top;
  background-size: auto 100%, var(--waterfall-chapter-width) auto;
  background-repeat: no-repeat;
}

.process {
  position: relative;
  isolation: isolate;
  min-height: 1180px;
  margin-top: -264px;
  padding-top: 394px;
  scroll-margin-top: -264px;
  overflow: hidden;
  background: #003f3c;
}

.process::before,
.process::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.process::before {
  z-index: -2;
  background: url("assets/how-it-works-pool.png") center top / var(--waterfall-chapter-width) auto no-repeat;
}

.process::after {
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(1, 35, 38, .48) 0%, rgba(1, 35, 38, .16) 18%, rgba(1, 35, 38, .30) 72%, rgba(1, 35, 38, .64) 100%),
    linear-gradient(90deg, rgba(1, 35, 38, .52) 0%, rgba(1, 35, 38, .20) 48%, rgba(1, 35, 38, .12) 100%);
}

.process > .container {
  position: relative;
  z-index: 1;
}

.process .section-heading {
  text-shadow: 0 3px 24px rgba(0, 24, 25, .64);
}

.process-line {
  background: rgba(255, 255, 255, .28);
  box-shadow: 0 2px 20px rgba(0, 28, 29, .3);
}

.step p {
  color: rgba(249, 251, 250, .82);
  text-shadow: 0 2px 16px rgba(0, 24, 25, .62);
}

@media (max-width: 760px) {
  :root {
    --waterfall-chapter-width: 1494px;
  }

  .help::before {
    background-position: center top, center top;
  }

  .process {
    min-height: 1120px;
    margin-top: -220px;
    padding-top: 308px;
    scroll-margin-top: -220px;
  }

  .process::after {
    background:
      linear-gradient(180deg, rgba(1, 35, 38, .48) 0%, rgba(1, 35, 38, .24) 18%, rgba(1, 35, 38, .46) 100%),
      linear-gradient(90deg, rgba(1, 35, 38, .5), rgba(1, 35, 38, .18));
  }
}

/* Canonical narrow-screen waterfall handoff. Keep last: older experimental
   pseudo-element rules above must never replace this art with a tint panel. */
@media (max-width: 900px) {
  .help::before {
    z-index: -1;
    background-image: url("assets/built-around-you-waterfall.png");
    background-position: center top;
    background-size: var(--waterfall-chapter-width) auto;
    background-repeat: no-repeat;
  }

  .help::after {
    content: "";
    display: block;
    position: absolute;
    inset: 0;
    height: auto;
    z-index: -2;
    pointer-events: none;
    background: #003f3c url("assets/how-it-works-pool.png") center bottom / var(--waterfall-chapter-width) auto no-repeat;
  }
}

/* FINAL narrow-screen chapter geometry: one image, one scale, no seam. */
@media (max-width: 900px) {
  .waterfall-story {
    display: block;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: #003f3c url("assets/waterfall-to-pool-mobile.png") center top / auto 100% no-repeat;
  }

  .waterfall-story .help,
  .waterfall-story .process {
    background: transparent !important;
  }

  .waterfall-story .help::before,
  .waterfall-story .help::after,
  .waterfall-story .process::before,
  .waterfall-story .process::after {
    content: none !important;
    display: none !important;
    background: none !important;
  }
}

/* FINAL narrow-screen canoe chapter: canoe and river are one fixed scene. */
@media (max-width: 900px) {
  .problems {
    min-height: max(1200px, 200vw);
    background-color: #073f37 !important;
    background-image: url("assets/canoe-river-mobile-integrated.png") !important;
    background-position: center top !important;
    background-size: 100% auto !important;
    background-repeat: no-repeat !important;
  }

  .problems .river-return,
  .problems .canoe-layer {
    display: none !important;
  }

  .waterfall-story {
    margin-top: -2px;
  }
}

@media (max-width: 760px) {
  .problems {
    min-height: max(1450px, 200vw);
    background-position: center top !important;
    background-size: auto 100% !important;
  }
}

/* CANONICAL EOF: responsive river-to-waterfall handoff. */
@media (max-width: 900px) {
  .waterfall-story {
    margin-top: -30px;
    background-image: url("assets/waterfall-to-pool-mobile-v2.png");
    background-position: center top;
    background-size: auto 100%;
    background-repeat: no-repeat;
  }

  .problems {
    margin-bottom: 0;
    background-position: center top !important;
  }
}

@media (min-width: 761px) and (max-width: 900px) {
  .waterfall-story {
    background-size: 100% 100%;
  }
}

@media (max-width: 760px) {
  .waterfall-story {
    /* One painting only: match the canoe chapter's width at the top, then
       extend that single waterfall-to-pool scene through the full chapter. */
    background-image: url("assets/waterfall-to-pool-mobile-v2.png?v=78");
    background-position: center top;
    background-size: calc(1450px * .5) 100%;
    background-repeat: no-repeat;
  }
}

/* Mobile hero-to-river handoff: start the river beneath the creator rail so
   the mountain plane can never show through between chapters. */
@media (max-width: 760px) {
  .landscape-bridge { display: none !important; }
  .problems { margin-top: -170px !important; }
}

/* Restore the guide as an independent foreground on phones. The old bridge
   remains hidden, so this cannot reopen the mountain gap below the rail. */
.hero-depth-foreground { display: none; }

@media (max-width: 760px) {
  .hero-depth-foreground {
    --guide-x: -70%;
    --guide-rise: 0px;
    display: block;
    position: absolute;
    z-index: 15;
    top: auto;
    right: auto;
    bottom: 70px;
    left: 50%;
    width: 1100px;
    height: auto;
    max-width: none;
    object-fit: contain;
    transform: translate3d(var(--guide-x), var(--guide-rise), 0);
    will-change: transform;
    pointer-events: none;
  }
}

/* Desktop-only pool detail: a quiet figure-eight flight above the water. */
.dragonfly-flight {
  display: none;
}

@media (min-width: 901px) and (prefers-reduced-motion: no-preference) {
  .dragonfly-flight {
    display: block;
    position: absolute;
    z-index: 4;
    top: 29%;
    left: 58%;
    width: clamp(54px, 4.8vw, 76px);
    pointer-events: none;
    will-change: transform;
    animation: dragonfly-figure-eight 9s ease-in-out infinite;
    filter: drop-shadow(0 7px 7px rgba(0, 30, 34, .28));
  }

  .dragonfly-sprite {
    display: block;
    width: 100%;
    height: auto;
    transform-origin: 48% 54%;
    will-change: transform;
    animation: dragonfly-wing-hum 110ms ease-in-out infinite alternate;
  }
}

@keyframes dragonfly-figure-eight {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-7deg); }
  12.5% { transform: translate3d(88px, -42px, 0) rotate(4deg); }
  25% { transform: translate3d(142px, 0, 0) rotate(12deg); }
  37.5% { transform: translate3d(88px, 42px, 0) rotate(2deg); }
  50% { transform: translate3d(0, 0, 0) rotate(-7deg); }
  62.5% { transform: translate3d(-88px, -42px, 0) rotate(-15deg); }
  75% { transform: translate3d(-142px, 0, 0) rotate(-21deg); }
  87.5% { transform: translate3d(-88px, 42px, 0) rotate(-13deg); }
}

@keyframes dragonfly-wing-hum {
  from { transform: scaleY(.94) rotate(-.7deg); }
  to { transform: scaleY(1.02) rotate(.7deg); }
}

@media (max-width: 900px), (prefers-reduced-motion: reduce) {
  .dragonfly-flight {
    display: none !important;
    animation: none !important;
  }
}

/* Proportional waterfall art on tablets and phones. `cover` preserves the
   source aspect ratio while the centered top anchor keeps the incoming river
   locked to the preceding canoe scene. */
@media (max-width: 900px) {
  .waterfall-story {
    background-image: url("assets/waterfall-to-pool-mobile-v2.png?v=95");
    background-position: center top !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
  }
}

@media (max-width: 340px) {
  .hero-depth-foreground {
    --guide-x: -69%;
    bottom: 82px;
  }
}

/* Phone-only seam polish: dissolve the final painted rows of the guide plane
   into the centered river beneath it, without moving either chapter. */
@media (max-width: 760px) {
  .hero-depth-foreground {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .hero-profiles::before {
    display: none;
  }
}
