:root { --journey-shift: 0px; --journey-darwin: 0; --journey-image-opacity: 1; }
.wave-story .wave-story-sticky { isolation:isolate; }
.wave-story .scenic-layers { position:absolute; inset:0; overflow:hidden; pointer-events:none; z-index:1; opacity:var(--journey-image-opacity); transform:translateZ(0); }
.wave-story .scenic-shot { position:absolute; inset:-7% -3%; background-position:center; background-size:cover; background-repeat:no-repeat; will-change:transform,opacity; transition:opacity .24s linear; transform:translate3d(0,var(--journey-shift),0) scale(1.08); }
.wave-story .scenic-nepal { background-image:url('./assets/images/scenery/nepal-himalayas.webp'); opacity:calc(1 - var(--journey-darwin)); }
.wave-story .scenic-darwin { background-color:#502c36; background-image:url('./assets/images/scenery/darwin-artwork-fallback.webp'); opacity:var(--journey-darwin); }
.wave-story .scenic-overlay { position:absolute; inset:0; z-index:2; pointer-events:none; background:linear-gradient(90deg,rgba(3,8,18,.25),rgba(4,9,15,.18) 50%,rgba(0,0,0,.25)),linear-gradient(0deg,rgba(3,8,16,.18),transparent 32%,rgba(3,7,15,.10)); }
.wave-story .story-copy-wrap { z-index:30 !important; }
.wave-story .story-copy h1,.wave-story .story-copy h2 { text-shadow:0 3px 28px rgba(0,0,0,.6) !important; }
html[data-theme='dark'] .wave-story .story-copy h1,html[data-theme='dark'] .wave-story .story-copy h2 {color:#fffdf7!important;text-shadow:0 2px 12px rgba(0,0,0,.8),0 0 25px rgba(0,0,0,.55)!important;}
html[data-theme='light'] .wave-story .scenic-overlay { background:linear-gradient(90deg,rgba(255,250,238,.13) 0%,rgba(255,249,237,.09) 52%,rgba(255,249,237,.11) 100%),linear-gradient(0deg,rgba(255,249,237,.14),transparent 34%); }
html[data-theme='light'] .wave-story .story-copy h1,html[data-theme='light'] .wave-story .story-copy h2 {color:#101722!important;text-shadow:0 1px 3px rgba(255,255,255,.98),0 0 18px rgba(255,255,255,.9),0 0 34px rgba(255,255,255,.65)!important;}
html[data-theme='dark'] .wave-story .eyebrow,html[data-theme='dark'] .wave-story .chapter-number,html[data-theme='dark'] .wave-story .chapter-total,html[data-theme='dark'] .wave-story .scroll-label {color:rgba(255,255,255,.92) !important;}
.wave-story .journey-caption {position:absolute;bottom:76px;left:clamp(20px,5vw,72px);right:clamp(20px,5vw,72px);z-index:34;display:flex;align-items:center;gap:15px;font:700 10px/1.4 'Space Mono',monospace;letter-spacing:.12em;opacity:.86;pointer-events:none;}
.wave-story .journey-thread {flex:0 1 95px;height:1px;background:linear-gradient(90deg,var(--blue,#82b1ff),var(--amber,#f0b85c));}
.wave-story .journey-flag {white-space:nowrap;}
.wave-story .journey-flag-secondary {opacity:calc(.45 + .55 * var(--journey-darwin));}
html[data-theme='dark'] .wave-story .journey-caption {color:#fff;}
html[data-theme='light'] .wave-story .journey-caption {color:#182231;}
@media (max-width:760px) {
 .wave-story .scenic-layers {opacity:1;}
 .wave-story .scenic-shot {inset:-4% -24%;background-position:center;transform:translate3d(0,calc(var(--journey-shift) * .45),0) scale(1.06);}
 .wave-story .journey-caption {bottom:88px;left:22px;right:22px;gap:9px;font-size:8px;letter-spacing:.055em;}
 .wave-story .journey-thread {flex:1 1 28px;}
 .wave-story .journey-flag-secondary {max-width:38%;}
}
@media (prefers-reduced-motion:reduce) {
 .wave-story .scenic-shot {transition:none!important;transform:none!important;will-change:auto;}
 .wave-story .journey-caption {transition:none!important;}
}

.journey-origin{margin:0 0 22px;max-width:55ch;font:600 12px/1.6 'Space Mono',monospace;letter-spacing:.03em;color:var(--muted);}
@media(max-width:760px){.journey-origin{font-size:11px;margin-top:-8px;margin-bottom:20px;}}

.scenery-credits-link{font:600 10px/1.5 'Space Mono',monospace;text-decoration:underline;text-underline-offset:3px;color:var(--muted);}
.scenery-credits-link:hover,.scenery-credits-link:focus-visible{color:var(--text);}

.wave-story .scenic-depth { position:absolute; inset:-9% -5%; z-index:1; pointer-events:none; background-position:center 63%; background-size:cover; background-repeat:no-repeat; opacity:0; will-change:transform,opacity; mask-image:linear-gradient(to bottom,transparent 31%,rgba(0,0,0,.35) 54%,black 100%); -webkit-mask-image:linear-gradient(to bottom,transparent 31%,rgba(0,0,0,.35) 54%,black 100%); transform:translate3d(0,var(--journey-foreground,0px),0) scale(1.18);}
.wave-story .scenic-nepal-depth { background-image:url('./assets/images/scenery/nepal-himalayas.webp'); opacity:calc((1 - var(--journey-darwin)) * .58);}
.wave-story .scenic-darwin-depth { background-image:url('./assets/images/scenery/darwin-artwork-fallback.webp'); opacity:calc(var(--journey-darwin) * .52);}
.wave-story .scenic-nepal,.wave-story .scenic-darwin {transform:translate3d(0,var(--journey-distance,0px),0) scale(1.12);}
.wave-story .journey-caption {left:auto;right:clamp(28px,5vw,76px);bottom:88px;max-width:min(85vw,500px);justify-content:flex-end;}
html[data-theme='light'] .wave-story .scenic-depth,html[data-theme='dark'] .wave-story .scenic-depth {background-blend-mode:normal;}
@media(max-width:760px){.wave-story .scenic-depth {transform:translate3d(0,calc(var(--journey-foreground,0px) * .4),0) scale(1.10);background-position:50% center;}.wave-story .journey-caption {right:18px;left:18px;bottom:96px;justify-content:flex-end;}}
@media(prefers-reduced-motion:reduce){.wave-story .scenic-depth,.wave-story .scenic-shot {transform:none!important;will-change:auto!important;}}

/* The same scenic imagery and full pixel detail are preserved across both themes. */
.wave-story .scenic-layers { opacity:var(--journey-image-opacity, 1)!important; filter:none!important; -webkit-filter:none!important; }
.wave-story .scenic-shot, .wave-story .scenic-depth { filter:none!important; -webkit-filter:none!important; image-rendering:auto; }
html[data-theme="light"] .wave-story .scenic-depth { opacity:calc((1 - var(--journey-darwin)) * .26); }
html[data-theme="light"] .wave-story .scenic-darwin-depth { opacity:calc(var(--journey-darwin) * .26); }
@media (max-width:760px) { .wave-story .scenic-layers { opacity:var(--journey-image-opacity, 1)!important; } }

/* Keep the location caption legible without hiding the scenery. */
.wave-story .journey-caption { padding:8px 12px; border-radius:12px; width:max-content; }
html[data-theme="light"] .wave-story .journey-caption { background:rgba(252,250,241,.70); color:#152034; }
html[data-theme="dark"] .wave-story .journey-caption { background:rgba(8,13,23,.58); color:#fafafa; }
html[data-theme="light"] .wave-story .scroll-label, html[data-theme="light"] .wave-story .chapter-total { color:#182231!important; text-shadow:0 1px 5px rgba(255,255,255,.92); }
@media(max-width:760px){
 .wave-story .journey-caption { bottom:155px; left:18px; right:auto; width:calc(100% - 36px); max-width:calc(100% - 36px); justify-content:space-between; gap:7px; }
 .wave-story .journey-thread { flex:1 1 14px; }
}

.linkedin-connect {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  max-width: 100%;
  margin-top: 18px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #0a66c2;
  border: 1px solid rgba(255,255,255,.24);
  color: #fff !important;
  text-decoration: none;
  font: 700 14px/1.4 'Inter', system-ui, sans-serif;
  box-shadow: 0 10px 24px rgba(4,65,130,.2);
  transition: transform .25s ease, background-color .25s ease, box-shadow .25s ease;
}
.linkedin-connect:hover {
  background: #004182;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(4,65,130,.3);
}
.linkedin-connect:focus-visible { outline: 3px solid #f0b85c; outline-offset: 3px; }
.linkedin-connect-mark {
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  height: 24px;
  border-radius: 4px;
  background: #fff;
  color: #0a66c2;
  font: 900 16px Arial, sans-serif;
  letter-spacing: -.08em;
}
.linkedin-connect-arrow { margin-left: auto; font-size: 19px; }
@media (max-width: 480px) {
  .linkedin-connect { width: 100%; justify-content: center; font-size: 13px; padding: 13px 10px; }
  .linkedin-connect-arrow { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .linkedin-connect { transition: none; } }

/* Performance: avoid permanent GPU layer allocations outside the active story. */
body:not(.wave-story-active) .wave-story .scenic-shot,
body:not(.wave-story-active) .wave-story .scenic-depth { will-change: auto; }
@media (max-width:760px) {
  .wave-story .scenic-shot,
  .wave-story .scenic-depth { transition: none; }
}

/* v61: a single bundled image per scene prevents mid-scroll remote-image swapping. */
.wave-story .scenic-nepal,
.wave-story .scenic-nepal-depth {background-image:url('./assets/images/scenery/nepal-himalayas.webp')}
.wave-story .scenic-darwin,
.wave-story .scenic-darwin-depth {background-image:url('./assets/images/scenery/darwin-artwork-fallback.webp')}

/* Transition the last scenic frame into the following hero without a hard seam. */
.wave-story .scenic-exit-shade {
  position:absolute;
  inset:0;
  z-index:3;
  pointer-events:none;
  opacity:var(--journey-exit,0);
  background:linear-gradient(to bottom,
    rgba(7,8,12,.10) 0%,
    rgba(7,8,12,.16) 28%,
    rgba(7,8,12,.65) 65%,
    #0a0b0e 100%);
}
html[data-theme='light'] .wave-story .scenic-exit-shade {
  background:linear-gradient(to bottom,
    rgba(247,244,236,.08) 0%,
    rgba(247,244,236,.14) 28%,
    rgba(247,244,236,.73) 65%,
    #f4f0e8 100%);
}
.wave-story .story-copy-wrap { opacity:calc(1 - var(--journey-copy-exit,0)); }

/* The last word must remain legible against the pale theme. */
html[data-theme='light'] #hero-main .wave-line:nth-child(3) {color:#17161b!important}
html[data-theme='light'] #hero-main .wave-line:nth-child(3) .wave-letter {
  background-image:linear-gradient(135deg,#17161b 5%,#805b12 100%)!important;
  -webkit-background-clip:text;
  background-clip:text;
  -webkit-text-fill-color:transparent;
}
.wave-story .journey-flag:not(.journey-flag-secondary) {
  opacity:calc(1 - .55 * var(--journey-darwin));
}

/* Lightweight wireframe globe: fine cool-toned geometry, not concentric golden rings. */
.wave-story .story-wire-orb {
  position:absolute;
  top:8%;
  left:47%;
  width:min(75vw,920px);
  aspect-ratio:1;
  z-index:9;
  pointer-events:none;
  overflow:visible;
  color:#c7e1e8;
  opacity:calc(.46 * var(--journey-image-opacity, 1));
  transform:translate3d(var(--wire-scroll-x,0px),0,0);
}
.wave-story .wire-orb-drift {
  width:100%;height:100%;
  animation:wireOrbHorizontal 22s ease-in-out infinite alternate;
}
.wave-story .wire-orb-art {width:100%;height:100%;display:block;overflow:visible;}
.wave-story .wire-orb-rotate {
  transform-origin:50% 50%;
  transform-box:view-box;
  animation:wireOrbTurn 58s linear infinite;
}
.wave-story .wire-orb-art path {
  stroke:currentColor;
  stroke-linecap:round;
  stroke-width:1.05;
  fill:none;
  vector-effect:non-scaling-stroke;
}
.wave-story .wire-orb-back {opacity:.36;}
.wave-story .wire-orb-front {opacity:.78;}
html[data-theme="light"] .wave-story .story-wire-orb {
  color:#536f80;
  opacity:calc(.37 * var(--journey-image-opacity, 1));
}
html[data-theme="dark"] .wave-story .story-wire-orb {
  color:#d0e5e7;
  opacity:calc(.51 * var(--journey-image-opacity, 1));
}
@keyframes wireOrbHorizontal {
  from {transform:translate3d(-10vw,0,0);}
  to {transform:translate3d(7vw,0,0);}
}
@keyframes wireOrbTurn {
  from {transform:rotate(-7deg);}
  to {transform:rotate(16deg);}
}
.wave-story:not(.spiral-in-view) .wire-orb-drift,
.wave-story:not(.spiral-in-view) .wire-orb-rotate {animation-play-state:paused;}
@media(max-width:760px) {
  .wave-story .story-wire-orb {top:21%;left:35%;width:108vw;opacity:calc(.32 * var(--journey-image-opacity, 1));}
  html[data-theme="light"] .wave-story .story-wire-orb {opacity:calc(.28 * var(--journey-image-opacity, 1));}
  html[data-theme="dark"] .wave-story .story-wire-orb {opacity:calc(.35 * var(--journey-image-opacity, 1));}
  .wave-story .wire-orb-art path {stroke-width:.8;}
}
@media(prefers-reduced-motion:reduce) {
  .wave-story .wire-orb-drift,.wave-story .wire-orb-rotate {animation:none!important;}
  .wave-story .story-wire-orb {transform:none!important;}
}

/* Scene handoff: the photographs fully disappear before the next section enters. */
.wave-story .journey-caption,
.wave-story .chapter-number,
.wave-story .chapter-total,
.wave-story .scroll-label,
.wave-story .story-progress,
.wave-story .story-theme-dock {
  opacity:calc(1 - var(--journey-ui-exit, 0));
}
@media (prefers-reduced-motion:reduce) {
  .wave-story .scenic-layers,
  .wave-story .story-wire-orb { transition:none!important; }
}


.wave-story .story-copy[data-chapter="3"] { z-index: 105 !important; }
.wave-story .story-copy-wrap { position: relative; z-index: 104 !important; }

html[data-theme] #hero-main .hero-title .wave-line:nth-child(3) .wave-letter {
  background: none !important;
  background-image: none !important;
  background-clip: border-box !important;
  -webkit-background-clip: border-box !important;
  -webkit-text-fill-color: var(--text) !important;
  color: var(--text) !important;
  text-shadow: none !important;
  animation: none !important;
  filter: none !important;
  opacity: 1 !important;
}
#hero-main .hero-title .wave-line:nth-child(3) {
  background: none !important;
  isolation: isolate;
  animation: heroLastLineDrift 7s ease-in-out infinite alternate;
}
@keyframes heroLastLineDrift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(0, -3px, 0); }
}
@media (prefers-reduced-motion: reduce) {
  #hero-main .hero-title .wave-line:nth-child(3) { animation: none !important; }
}

/* Consistent mobile viewport: keep the scenic painting larger than Chrome's
   collapsible browser chrome, without changing the story travel on every swipe. */
@media (max-width: 760px) {
  .wave-story.story {
    height: 390lvh !important;
    min-height: 0 !important;
  }
  .wave-story .wave-story-sticky,
  .wave-story .story-sticky {
    top: 0 !important;
    height: 100lvh !important;
    min-height: 100lvh !important;
    max-height: none !important;
    overflow: hidden !important;
    background-color: #141720 !important;
  }
  html[data-theme="light"] .wave-story .wave-story-sticky,
  html[data-theme="light"] .wave-story .story-sticky {
    background-color: #f4f0e8 !important;
  }
  .wave-story .scenic-layers { inset: -1px !important; }
  .wave-story .journey-caption { bottom: calc(155px + var(--story-bottom-lift, 0px)); }
  .wave-story .story-theme-dock { bottom: calc(72px + var(--story-bottom-lift, 0px)); }
  .wave-story .scroll-label,
  .wave-story .chapter-total { bottom: calc(28px + var(--story-bottom-lift, 0px)) !important; }
  .wave-story .story-progress { bottom: calc(33px + var(--story-bottom-lift, 0px)) !important; }
}
@supports not (height: 100lvh) {
  @media (max-width: 760px) {
    .wave-story.story { height: 390vh !important; }
    .wave-story .wave-story-sticky,
    .wave-story .story-sticky { height: 100vh !important; min-height: 100vh !important; }
  }
}

/* Keep the first chapter fully composed before the intro releases the shared
   background-and-type reveal. Following chapters retain staggered motion. */
body.home-scene-pending .wave-story .story-copy[data-chapter="0"].is-active .cinematic-line > span,
body.home-scene-pending .wave-story .story-copy[data-chapter="0"].is-active .eyebrow {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
}

/* A small local contrast plate preserves the mountain's sharpness. */
.wave-story .story-copy .eyebrow {
  display: inline-block !important;
  justify-self: center;
  padding: 5px 9px !important;
  border-radius: 6px;
  letter-spacing: .13em !important;
  text-shadow: none !important;
}
html[data-theme="light"] .wave-story .story-copy .eyebrow {
  color: #583c00 !important;
  background: rgba(255,249,233,.84);
  box-shadow: 0 1px 8px rgba(255,249,233,.2);
}
html[data-theme="dark"] .wave-story .story-copy .eyebrow {
  color: #ffe5a0 !important;
  background: rgba(5,13,23,.62);
  box-shadow: 0 1px 8px rgba(5,13,23,.2);
}
@media (max-width:760px) {
  .wave-story .story-copy .eyebrow {
    font-size: 11px !important;
    line-height: 1.3 !important;
    max-width: calc(100vw - 40px);
  }
  /* Light silver-blue wire geometry, not thick golden rings. */
  .wave-story .story-wire-orb { top: 25%; left: 46%; width: 105vw; }
  html[data-theme="light"] .wave-story .story-wire-orb {
    color: #476073;
    opacity: calc(.52 * var(--journey-image-opacity, 1));
  }
  html[data-theme="dark"] .wave-story .story-wire-orb {
    color: #d4eaf0;
    opacity: calc(.63 * var(--journey-image-opacity, 1));
  }
  .wave-story .wire-orb-art path { stroke-width: 1.02; }
  .wave-story .wire-orb-back { opacity: .48; }
  .wave-story .wire-orb-front { opacity: .88; }
}

/* A fast fling may skip chapters; prevent distant headings from overlapping. */
.wave-story.chapter-jump .story-copy:not(.is-active) {
  opacity: 0 !important;
  visibility: hidden !important;
  transition: none !important;
}
