/* YuanFeng V52.1 — sequential full page hand-off.
   V51.3's outgoing motion is preserved. The incoming page now waits until the outgoing page
   has completed, then performs one complete matching entrance instead of flashing in. */
:root{--yf-pk-ease:cubic-bezier(.65,0,.15,1);--yf-v520-out:.80s;--yf-v520-white:.08s;--yf-v520-in:.80s;}

::view-transition-old(root),::view-transition-new(root){transform-origin:center bottom;}
/* V52.1 — the hand-off midpoint is a clean white canvas, never a frozen tilted frame. */
html[data-yf-vt-mode="full"],html[data-yf-vt-mode="full"] body{background:#fff!important;}
::view-transition-group(root),::view-transition-image-pair(root){background:#fff!important;}


/* Main-navigation transitions are intentionally sequential:
   1) complete exit all the way to a clean white canvas; 2) keep only 80ms of blank white; 3) begin the complete incoming motion. */
html[data-yf-vt-mode="full"][data-yf-vt-dir="forward"]::view-transition-old(root){
  animation:yf-v520-pk-old-forward var(--yf-v520-out) var(--yf-pk-ease) both!important;
}
html[data-yf-vt-mode="full"][data-yf-vt-dir="forward"]::view-transition-new(root){
  animation:yf-v520-pk-new-forward var(--yf-v520-in) var(--yf-pk-ease) calc(var(--yf-v520-out) + var(--yf-v520-white)) both!important;
}
html[data-yf-vt-mode="full"][data-yf-vt-dir="back"]::view-transition-old(root){
  animation:yf-v520-pk-old-back var(--yf-v520-out) var(--yf-pk-ease) both!important;
}
html[data-yf-vt-mode="full"][data-yf-vt-dir="back"]::view-transition-new(root){
  animation:yf-v520-pk-new-back var(--yf-v520-in) var(--yf-pk-ease) calc(var(--yf-v520-out) + var(--yf-v520-white)) both!important;
}

/* Keep the exact V51.3 outgoing shape the user approved. */
@keyframes yf-v520-pk-old-forward{
  0%{transform:translateX(0) rotate(0) scale(1);opacity:1}
  36%{transform:translateX(-5%) rotate(-1deg) scale(.86);opacity:.85}
  86%{transform:translateX(-46%) rotate(-4.5deg) scale(.82);opacity:.28}
  100%{transform:translateX(-54%) rotate(-5deg) scale(.79);opacity:0}
}
@keyframes yf-v520-pk-old-back{
  0%{transform:translateX(0) rotate(0) scale(1);opacity:1}
  36%{transform:translateX(5%) rotate(1deg) scale(.86);opacity:.85}
  86%{transform:translateX(46%) rotate(4.5deg) scale(.82);opacity:.28}
  100%{transform:translateX(54%) rotate(5deg) scale(.79);opacity:0}
}
/* Full incoming counterpart. During the delay, animation-fill-mode:both keeps the new page
   fixed at its first off-screen frame, eliminating the V51.3 instantaneous flash. */
@keyframes yf-v520-pk-new-forward{
  0%{transform:translateX(100vw) rotate(5deg) scale(.85);opacity:0}
  8%{transform:translateX(92vw) rotate(4.6deg) scale(.86);opacity:1}
  100%{transform:translateX(0) rotate(0) scale(1);opacity:1}
}
@keyframes yf-v520-pk-new-back{
  0%{transform:translateX(-100vw) rotate(-5deg) scale(.85);opacity:0}
  8%{transform:translateX(-92vw) rotate(-4.6deg) scale(.86);opacity:1}
  100%{transform:translateX(0) rotate(0) scale(1);opacity:1}
}

/* file:// and browsers without cross-document View Transitions.
   The preflight script installs this state before first paint, so the destination cannot flash. */
html.yf-v520-fallback-arrival,html.yf-v520-fallback-running,
html.yf-v520-fallback-arrival body,html.yf-v520-fallback-running body{overflow-x:hidden!important;}
html.yf-v520-fallback-arrival[data-yf-vt-mode="full"] .main > :not(.menuList):not(.menuBg):not(.topMenu):not(#topShow){
  visibility:hidden;
  transform-origin:center bottom;
  will-change:transform,opacity;
  backface-visibility:hidden;
}
html.yf-v520-fallback-arrival[data-yf-vt-mode="full"][data-yf-vt-dir="forward"] .main > :not(.menuList):not(.menuBg):not(.topMenu):not(#topShow){
  transform:translateX(100vw) rotate(5deg) scale(.85);
}
html.yf-v520-fallback-arrival[data-yf-vt-mode="full"][data-yf-vt-dir="back"] .main > :not(.menuList):not(.menuBg):not(.topMenu):not(#topShow){
  transform:translateX(-100vw) rotate(-5deg) scale(.85);
}
.yf-v520-fallback-node{transform-origin:center bottom!important;will-change:transform,opacity!important;backface-visibility:hidden;}



/* V52.1 — transition viewport lock.
   During every page hand-off the document is non-scrollable and the browser scrollbar is
   suppressed on both the outgoing and incoming document. This prevents a grey scrollbar
   from becoming part of a tilted View Transition snapshot. */
html.yf-vt-lock,
html.yf-vt-lock body{
  scroll-behavior:auto!important;
  overflow:hidden!important;
  overscroll-behavior:none!important;
  scrollbar-width:none!important;
  -ms-overflow-style:none!important;
}
html.yf-vt-lock::-webkit-scrollbar,
html.yf-vt-lock body::-webkit-scrollbar{
  width:0!important;
  height:0!important;
  display:none!important;
}

/* Right-side drawers/search overlays are interface chrome, never transition artwork.
   display:none is intentional here (stronger than visibility:hidden) so no one-pixel red/grey
   edge can be captured when the root plane rotates. */
html.yf-vt-lock .menuBg,
html.yf-vt-lock .menuList,
html.yf-vt-lock .searchWin,
html.yf-vt-lock .winbg{
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
  view-transition-name:none!important;
}

/* Never let the root snapshots paint outside the visual viewport. */
::view-transition-group(root),
::view-transition-image-pair(root),
::view-transition-old(root),
::view-transition-new(root){
  overflow:clip!important;
  clip-path:inset(0)!important;
}

/* Accessibility controls are never transition artwork. */
.yf-skip-link{view-transition-name:none!important;}

@media(prefers-reduced-motion:reduce){
  html[data-yf-vt-mode="full"]::view-transition-old(root),
  html[data-yf-vt-mode="full"]::view-transition-new(root){animation-duration:.01ms!important;animation-delay:0ms!important;}
  html.yf-v520-fallback-arrival[data-yf-vt-mode="full"] .main > :not(.menuList):not(.menuBg):not(.topMenu):not(#topShow){visibility:visible;transform:none;}
}


/* V52.1 — transition polish requested after V51.4 acceptance. */
/* The legacy right-side menu overlay (.menuBg / .menuList) lives fixed at the viewport edge.
   When the root snapshot tilts, that fixed edge can become a visible red/grey blade in the
   middle of the transition. It is UI chrome, not page artwork, so remove it only while a
   navigation hand-off is being captured/played. */
html.yf-vt-lock .menuBg,
html.yf-vt-lock .menuList{
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
}

/* V50 gave the active 1px main/sub-nav markers their own shared View Transition snapshots.
   During the larger V51.4 tilt those tiny vertical markers can be stretched/interpolated into
   a long red/grey line. For full transitions let each marker stay inside its own nav snapshot
   instead of becoming an independent transition layer. */
html[data-yf-vt-mode="full"] .topMenu .mLinks .mLinksDiv div>a.hover p span,
html[data-yf-vt-mode="full"] .subMenu .tabs a.hover p span{
  view-transition-name:none!important;
}

/* Secondary navigation now participates in the same full hand-off when its links are clicked.
   No separate visual treatment is needed: .subMenu remains part of the page canvas and follows
   the same exit / white-clear / entrance motion as the content below it. */

/* Bring project listings and the news landing content closer to the large heading.
   On desktop the visual gap from the glyph bottom to the first content is ~92–96px:
   heading bottom padding (~58px) + project shell top padding (34px), or 58px + 36px for news. */
.yf-section-heading + .projectsData{
  margin-top:0!important;
}
.yf-section-heading + .newsData{
  margin-top:36px!important;
}
@media(max-width:900px){
  .yf-section-heading + .projectsData{margin-top:0!important;}
  .yf-section-heading + .newsData{margin-top:24px!important;}
}


/* V52.1 — desktop navigation refinement.
   The red right-side drawer belongs to the compact/mobile UI only. Desktop keeps the full
   top navigation and uses a restrained language popover instead of opening the red drawer. */
@media (min-width:751px){
  .menuOpen{display:none!important;}
  .menuList,.menuBg{display:none!important;visibility:hidden!important;pointer-events:none!important;}
  .topMenu .topMenuDiv .mBtn{width:auto!important;min-width:112px;}
  .topMenu .topMenuDiv .mBtn>div>ul{gap:0;align-items:center;}
}
.yf-desktop-lang-menu{
  position:fixed;
  z-index:2147483200;
  min-width:138px;
  padding:8px;
  border:1px solid rgba(0,0,0,.10);
  border-radius:10px;
  background:rgba(255,255,255,.97);
  box-shadow:0 12px 34px rgba(0,0,0,.12);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  opacity:0;
  visibility:hidden;
  transform:translate3d(0,-6px,0);
  transition:opacity .18s ease,transform .18s ease,visibility 0s linear .18s;
  pointer-events:none;
}
.yf-desktop-lang-menu.is-open{
  opacity:1;
  visibility:visible;
  transform:translate3d(0,0,0);
  transition-delay:0s;
  pointer-events:auto;
}
.yf-desktop-lang-option{
  display:block;
  width:100%;
  border:0;
  border-radius:7px;
  background:transparent;
  padding:9px 12px;
  text-align:left;
  font:inherit;
  font-size:13px;
  line-height:1.25;
  color:#222;
  cursor:pointer;
}
.yf-desktop-lang-option:hover,.yf-desktop-lang-option[aria-current="true"]{background:#f3f3f3;}
@media (max-width:750px){.yf-desktop-lang-menu{display:none!important;}}

/* Keep the scrollbar visually absent during the post-transition home return sequence too,
   without setting overflow:hidden: the scripted linear scroll must remain possible. */
html.yf-home-return-lock,html.yf-home-return-lock body{
  scroll-behavior:auto!important;
  overscroll-behavior:none!important;
  scrollbar-width:none!important;
  -ms-overflow-style:none!important;
}
html.yf-home-return-lock::-webkit-scrollbar,
html.yf-home-return-lock body::-webkit-scrollbar{width:0!important;height:0!important;display:none!important;}

/* V52.1 — isolate the post-transition linear home glide from legacy scroll-header motion.
   main.js watches every scroll event and otherwise adds 0.6/0.8s header margin transitions.
   During the controlled 500ms return-to-top timeline those extra transitions visually compete
   with the viewport motion, so keep the header/subheader geometrically stable until the glide ends. */
html.yf-home-return-lock .scrollA,
html.yf-home-return-lock .scrollB{
  margin-top:0!important;
  transition:none!important;
  -webkit-transition:none!important;
  -moz-transition:none!important;
  -o-transition:none!important;
}


/* V52.1 — home-return anti-flash primer.
   The target home document is not paintable until the parser reaches the exact home boundary
   and synchronously sets scrollTop there. This prevents even a single hero-frame flash. */
html.yf-home-preprime body{visibility:hidden!important;}
html.yf-home-preprime,html.yf-home-preprime body{
  scroll-behavior:auto!important;
  overflow:hidden!important;
  scrollbar-width:none!important;
  background:#fff!important;
}
html.yf-home-preprime::-webkit-scrollbar,
html.yf-home-preprime body::-webkit-scrollbar{width:0!important;height:0!important;display:none!important;}

/* The product queue already owns the physics; this class is only a lightweight marker while
   the V52 arrival impulse is decaying naturally through its existing friction model. */
[data-depth-queue].yf-arrival-spin{will-change:contents;}
