/* XUNBEE motion layer: movement explains routing, state and hierarchy. */

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: clip; }
.lenis.lenis-smooth iframe { pointer-events: none; }

.global-scroll-progress {
  position: fixed;
  z-index: 10000;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, #f5b82e, #20c7a6);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}

.site-header,
.topbar {
  transition: height 260ms cubic-bezier(.25,1,.5,1), background 260ms ease, backdrop-filter 260ms ease;
}

.site-header.is-scrolled,
.topbar.is-scrolled {
  position: fixed;
  height: 72px;
  background: rgba(8,10,13,.86);
  backdrop-filter: blur(18px) saturate(1.25);
}

.topbar .menu-toggle { display: none; }

@media (max-width: 900px) {
  .topbar .menu-toggle {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 6px;
    color: #fff;
    background: #10141a;
  }
  .topbar .nav {
    display: none;
    position: fixed;
    z-index: 110;
    inset: 92px 0 0;
    padding: 24px max(28px, calc((100vw - 720px) / 2));
    align-items: stretch;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    background-color: #080a0d;
    background-image:
      radial-gradient(circle at 30px 31px, rgba(245,184,46,.95) 0 2px, transparent 3px),
      linear-gradient(90deg, transparent 29px, rgba(245,184,46,.16) 30px, transparent 31px);
    box-shadow: inset 0 1px rgba(247,248,250,.08);
  }
  .topbar.is-scrolled .nav { top: 72px; }
  .topbar .nav.is-open { display: flex; }
  .topbar .nav.is-open a,
  .topbar .nav.is-open a:not(.nav-cta) {
    display: flex;
    min-height: 64px;
    align-items: center;
    padding: 0 14px 0 30px;
    border-bottom: 1px solid rgba(247,248,250,.09);
    font-size: 18px;
  }
  .topbar .nav.is-open .nav-cta { justify-content: center; margin: 18px 0 0 30px; padding: 0 18px; border: 1px solid rgba(245,184,46,.68); }
  body.menu-open .topbar { position: fixed; z-index: 100; height: 92px; background: #080a0d; }
  body.menu-open .topbar .nav { top: 92px; }
}

@media (max-width: 980px) {
  body.menu-open::before {
    content: "";
    position: fixed;
    z-index: 90;
    inset: 0;
    background: rgba(3,4,6,.72);
    backdrop-filter: blur(10px);
  }

  .site-header .site-shell,
  .topbar .shell { position: relative; z-index: 120; }

  body.menu-open .site-header { z-index: 100; height: 92px; }
  body.menu-open .site-header .site-nav { top: 92px; }

  .menu-toggle {
    position: relative;
    z-index: 121;
    overflow: hidden;
    font-size: 0;
    cursor: pointer;
    transition: border-color 220ms cubic-bezier(.25,1,.5,1), background 220ms ease;
  }

  .menu-toggle::before,
  .menu-toggle::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 16px;
    height: 1px;
    background: #f7f8fa;
    transform: translate(-50%, -50%);
    transition: transform 240ms cubic-bezier(.25,1,.5,1), box-shadow 180ms ease, opacity 180ms ease;
  }

  .menu-toggle::before { box-shadow: 0 -5px #f7f8fa, 0 5px #f7f8fa; }
  .menu-toggle::after { opacity: 0; }
  .menu-toggle[aria-expanded="true"] { border-color: rgba(245,184,46,.92); background: rgba(245,184,46,.08); }
  .menu-toggle[aria-expanded="true"]::before { box-shadow: none; transform: translate(-50%, -50%) rotate(45deg); }
  .menu-toggle[aria-expanded="true"]::after { opacity: 1; transform: translate(-50%, -50%) rotate(-45deg); }

  .site-nav.is-open,
  .topbar .nav.is-open { animation: mobile-menu-enter 280ms cubic-bezier(.25,1,.5,1) both; }

  .site-nav.is-open a,
  .topbar .nav.is-open a { animation: mobile-link-enter 360ms cubic-bezier(.25,1,.5,1) both; }

  .site-nav.is-open a:nth-child(2), .topbar .nav.is-open a:nth-child(2) { animation-delay: 25ms; }
  .site-nav.is-open a:nth-child(3), .topbar .nav.is-open a:nth-child(3) { animation-delay: 50ms; }
  .site-nav.is-open a:nth-child(4), .topbar .nav.is-open a:nth-child(4) { animation-delay: 75ms; }
  .site-nav.is-open a:nth-child(5), .topbar .nav.is-open a:nth-child(5) { animation-delay: 100ms; }
  .site-nav.is-open a:nth-child(6), .topbar .nav.is-open a:nth-child(6) { animation-delay: 125ms; }
}

@media (max-width: 640px) {
  .topbar { height: 76px; }
  .topbar .brand-lockup { width: 134px; }
  .topbar .nav { top: 76px; }
  body.menu-open .site-header,
  body.menu-open .topbar { height: 76px; }
  body.menu-open .site-header .site-nav,
  body.menu-open .topbar .nav { top: 76px; }
}

@keyframes mobile-menu-enter {
  from { opacity: 0; clip-path: inset(0 0 100% 0); }
  to { opacity: 1; clip-path: inset(0); }
}

@keyframes mobile-link-enter {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-transition {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
  background: #0a0c0f;
  transform: translateY(0);
  transition: transform 640ms cubic-bezier(.76, 0, .24, 1);
}

.page-transition.is-entered { transform: translateY(-101%); }
body.is-leaving .page-transition { transform: translateY(0); }

.transition-mark {
  position: relative;
  z-index: 2;
  width: 92px;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 220ms ease, transform 540ms cubic-bezier(.25, 1, .5, 1);
}

.page-transition.is-entered .transition-mark {
  opacity: 0;
  transform: translateY(-12px) scale(.94);
}

.transition-route {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #f5b82e 18%, #f5b82e 48%, #20c7a6 52%, #20c7a6 82%, transparent);
  transform: scaleX(0);
  transform-origin: center;
  animation: transition-route 820ms cubic-bezier(.25, 1, .5, 1) both;
}

.transition-route::before,
.transition-route::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #f5b82e;
  box-shadow: 0 0 20px rgba(245, 184, 46, .7);
}

.transition-route::before { left: 16%; }
.transition-route::after { right: 16%; background: #20c7a6; box-shadow: 0 0 20px rgba(32, 199, 166, .7); }

@keyframes transition-route {
  0% { transform: scaleX(0); opacity: 0; }
  35% { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1); opacity: .2; }
}

.motion-reveal {
  opacity: 0;
  transform: translateY(34px);
  transition:
    opacity 720ms cubic-bezier(.25, 1, .5, 1),
    transform 820ms cubic-bezier(.25, 1, .5, 1);
  transition-delay: var(--reveal-delay, 0ms);
}

.motion-reveal[data-reveal="left"] { transform: translateX(-38px); }
.motion-reveal[data-reveal="right"] { transform: translateX(38px); }
.motion-reveal[data-reveal="scale"] { transform: scale(.965); }

.motion-reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.motion-enabled .hero-copy > *,
.motion-enabled .inner-hero-copy > * {
  opacity: 0;
  transform: translateY(22px);
  animation: hero-arrive 760ms cubic-bezier(.25, 1, .5, 1) forwards;
}

.motion-enabled .hero-copy > *:nth-child(1),
.motion-enabled .inner-hero-copy > *:nth-child(1) { animation-delay: 520ms; }
.motion-enabled .hero-copy > *:nth-child(2),
.motion-enabled .inner-hero-copy > *:nth-child(2) { animation-delay: 610ms; }
.motion-enabled .hero-copy > *:nth-child(3),
.motion-enabled .inner-hero-copy > *:nth-child(3) { animation-delay: 710ms; }
.motion-enabled .hero-copy > *:nth-child(4),
.motion-enabled .inner-hero-copy > *:nth-child(4) { animation-delay: 800ms; }
.motion-enabled .hero-copy > *:nth-child(5),
.motion-enabled .inner-hero-copy > *:nth-child(5) { animation-delay: 890ms; }

@keyframes hero-arrive {
  to { opacity: 1; transform: translateY(0); }
}

.motion-enabled .hero-image,
.motion-enabled .inner-hero-media {
  animation: image-settle 1600ms cubic-bezier(.25, 1, .5, 1) 260ms both;
}

@keyframes image-settle {
  from { opacity: .35; transform: scale(1.055); filter: saturate(.7) contrast(1.08); }
  to { opacity: .94; transform: scale(1); filter: saturate(.92) contrast(1.02); }
}

.motion-enabled .route-board.is-visible::before { animation: route-board-arrive 1350ms cubic-bezier(.25, 1, .5, 1) 240ms both; }
.motion-enabled .route-board.is-visible .hive-core { animation: core-confirm 520ms cubic-bezier(.25, 1, .5, 1) 940ms both; }
.motion-enabled .route-board.is-visible .route-node { animation: node-confirm 560ms cubic-bezier(.25, 1, .5, 1) both; }
.motion-enabled .route-board.is-visible .route-node:nth-of-type(1) { animation-delay: 120ms; }
.motion-enabled .route-board.is-visible .route-node:nth-of-type(2) { animation-delay: 210ms; }
.motion-enabled .route-board.is-visible .route-node.out { animation-delay: 1020ms; }

@keyframes route-board-arrive {
  from { opacity: 0; clip-path: inset(0 50%); }
  to { opacity: .72; clip-path: inset(0 0); }
}

@keyframes core-confirm {
  0% { filter: drop-shadow(0 18px 30px rgba(23,26,31,.15)); }
  50% { filter: drop-shadow(0 0 28px rgba(32,199,166,.48)); }
  100% { filter: drop-shadow(0 18px 30px rgba(23,26,31,.15)); }
}

@keyframes node-confirm {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.motion-enabled .channel-map.is-visible .orbit-line {
  animation: orbit-draw 880ms cubic-bezier(.25, 1, .5, 1) both;
  animation-delay: calc(240ms + var(--line-order, 0) * 90ms);
}

@keyframes orbit-draw {
  from { opacity: 0; scale: 0 1; }
  to { opacity: 1; scale: 1 1; }
}

/* Message signals: a restrained, directional trace instead of decorative noise. */
.motion-enabled .route-board.is-visible .route-flow::before,
.motion-enabled .channel-map.is-visible .orbit-line::before {
  animation: signal-line-breathe 3.8s ease-in-out var(--flow-delay, 0s) infinite;
}

.motion-enabled .route-board.is-visible .route-flow::after,
.motion-enabled .channel-map.is-visible .orbit-line::after {
  animation: signal-particle-travel 3.6s cubic-bezier(.42, 0, .58, 1) var(--flow-delay, 0s) infinite;
}

.motion-enabled .channel-map.is-visible .orbit-line::before,
.motion-enabled .channel-map.is-visible .orbit-line::after {
  animation-delay: calc(1.1s + var(--flow-delay, 0s));
}

@keyframes signal-line-breathe {
  0%, 100% { opacity: .12; transform: scaleY(.72); }
  50% { opacity: .72; transform: scaleY(1.35); }
}

@keyframes signal-particle-travel {
  0% { left: 0; opacity: 0; }
  10% { opacity: .92; }
  82% { opacity: .92; }
  100% { left: calc(100% - 5px); opacity: 0; }
}

.button,
.nav-cta,
.primary-link,
.secondary-link {
  position: relative;
  overflow: hidden;
}

.button::before,
.nav-cta::before,
.primary-link::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,.28) 48%, transparent 75%);
  transform: translateX(-140%);
  transition: transform 620ms cubic-bezier(.25, 1, .5, 1);
}

.button:hover::before,
.nav-cta:hover::before,
.primary-link:hover::before { transform: translateX(140%); }

.nav a,
.site-nav a { position: relative; }
.nav a:not(.nav-cta)::after,
.site-nav a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -11px;
  height: 1px;
  background: #f5b82e;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms cubic-bezier(.25, 1, .5, 1);
}

.nav a:hover::after,
.nav a[aria-current="page"]::after,
.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after { transform: scaleX(1); }

.route-pulse {
  offset-path: path("M 0 0 C 160 0, 280 0, 440 0");
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f5b82e;
  box-shadow: 0 0 18px rgba(245,184,46,.8);
  opacity: 0;
}

.is-visible .route-pulse { animation: route-pulse 1250ms cubic-bezier(.4,0,.2,1) 420ms 1 both; }

@keyframes route-pulse {
  0% { offset-distance: 0%; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}

[data-parallax] { will-change: transform; }

/* Product storytelling inspired by premium device sites, mapped to XUNBEE's route narrative. */
.cinematic-scroll {
  position: relative;
  height: 280vh;
  background: #080a0d;
  color: #f7f8fa;
}

.cinematic-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 720px;
  overflow: hidden;
}

.cinematic-sticky::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(8,10,13,.92), rgba(8,10,13,.14) 50%, rgba(8,10,13,.52)),
    linear-gradient(0deg, rgba(8,10,13,.95), transparent 30%, rgba(8,10,13,.48));
}

.cinematic-media {
  position: absolute;
  inset: -6%;
  width: 112%;
  height: 112%;
  object-fit: cover;
  object-position: center;
  transform: translate3d(0,38px,0) scale(.88);
  will-change: transform, filter;
}

.cinematic-copy {
  position: absolute;
  z-index: 4;
  inset: 0;
  width: min(1240px, calc(100% - 80px));
  margin: 0 auto;
  pointer-events: none;
}

.cinematic-stage {
  position: absolute;
  left: 0;
  top: 50%;
  width: 540px;
  opacity: 0;
  transform: translateY(30px);
  will-change: opacity, transform;
}

.cinematic-stage:first-child { opacity: 1; }
.cinematic-stage .scene-index { color: #f5b82e; font: 600 11px/1 "Bahnschrift", sans-serif; letter-spacing: .2em; }
.cinematic-stage h2 { margin: 20px 0 0; font-family: "DengXian", "Microsoft YaHei UI", sans-serif; font-size: clamp(48px,5.4vw,76px); line-height: 1.05; letter-spacing: -.055em; }
.cinematic-stage p { max-width: 480px; margin: 24px 0 0; color: #9ca3ac; font-size: 16px; line-height: 1.9; }

.cinematic-progress {
  position: absolute;
  z-index: 5;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg,#f5b82e,#20c7a6);
  transform: scaleX(0);
  transform-origin: left;
}

.cinematic-meta {
  position: absolute;
  z-index: 5;
  right: max(40px, calc((100vw - 1240px)/2));
  bottom: 44px;
  color: #737b84;
  font: 600 10px/1 "Bahnschrift", sans-serif;
  letter-spacing: .18em;
}

@media (max-width: 720px) {
  .cinematic-scroll { height: 230vh; }
  .cinematic-sticky { min-height: 680px; }
  .cinematic-copy { width: calc(100% - 36px); }
  .cinematic-stage { width: 100%; top: auto; bottom: 110px; }
  .cinematic-stage h2 { font-size: 46px; }
  .cinematic-sticky::before { background: linear-gradient(0deg,rgba(8,10,13,.98),rgba(8,10,13,.16) 65%,rgba(8,10,13,.45)); }
  .cinematic-media { object-position: 82% center; }
  .cinematic-meta { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .page-transition { display: none; }
  .site-nav.is-open,
  .site-nav.is-open a,
  .topbar .nav.is-open,
  .topbar .nav.is-open a { animation: none !important; }
  .motion-reveal,
  .motion-reveal[data-reveal],
  .motion-enabled .hero-copy > *,
  .motion-enabled .inner-hero-copy > *,
  .motion-enabled .hero-image,
  .motion-enabled .inner-hero-media,
  .motion-enabled .route-board.is-visible::before,
  .motion-enabled .route-board.is-visible .hive-core,
  .motion-enabled .route-board.is-visible .route-node,
  .motion-enabled .channel-map.is-visible .orbit-line {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
  .route-flow::before,
  .orbit-line::before {
    animation: none !important;
    opacity: .22 !important;
    transform: none !important;
  }
  .route-flow::after,
  .orbit-line::after {
    display: none !important;
  }
}
