/* LonXang smooth motion — GPU-only, no layout thrash, device-aware */
:root {
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.4, 0, .2, 1);
  --dur: .7s;
  --dur-fast: .28s;
  --rise: 28px;
}

/* ---------- Page load (all pages) ---------- */
body { opacity: 1; }
html.js-ready body {
  opacity: 0;
  transition: opacity .4s var(--ease-io);
}
html.js-ready body.is-loaded { opacity: 1; }

.page-boot {
  position: fixed; inset: 0; z-index: 3000;
  display: grid; place-items: center;
  background: #17110e;
  transition: opacity .5s var(--ease-io), visibility .5s;
  will-change: opacity;
}
.page-boot.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.page-boot-mark {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  transform: translateZ(0);
}
.page-boot-logo {
  color: #fffdf8; font: 700 15px/1 Arial, "PingFang SC", sans-serif;
  letter-spacing: .28em; opacity: 0;
  animation: bootFade .55s var(--ease-out) .05s both;
}
.page-boot-line {
  width: min(200px, 42vw); height: 2px; border-radius: 99px; overflow: hidden;
  background: rgba(255,255,255,.08);
}
.page-boot-line i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #f0582a, #dda94a, #ff7040);
  box-shadow: 0 0 16px rgba(240,88,42,.55);
  animation: bootBar .85s var(--ease-out) .1s both;
}
@keyframes bootFade {
  from { opacity: 0; transform: translate3d(0, 8px, 0); }
  to { opacity: 1; transform: none; }
}
@keyframes bootBar {
  from { width: 0; }
  to { width: 100%; }
}

/* ---------- Scroll / enter reveals (transform+opacity ONLY) ---------- */
.reveal,
.reveal-soft,
.reveal-left,
.reveal-scale {
  opacity: 0;
  transform: translate3d(0, var(--rise), 0);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
  transition-delay: var(--delay, 0ms);
  backface-visibility: hidden;
}
.reveal-soft { --rise: 18px; }
.reveal-left { transform: translate3d(-22px, 0, 0); }
.reveal-scale { transform: translate3d(0, 12px, 0) scale(.98); }
.reveal.visible,
.reveal-soft.visible,
.reveal-left.visible,
.reveal-scale.visible {
  opacity: 1;
  transform: none;
}

/* Stagger helpers */
.stagger > .reveal:nth-child(1), .stagger > .reveal-soft:nth-child(1) { --delay: 0ms; }
.stagger > .reveal:nth-child(2), .stagger > .reveal-soft:nth-child(2) { --delay: 60ms; }
.stagger > .reveal:nth-child(3), .stagger > .reveal-soft:nth-child(3) { --delay: 120ms; }
.stagger > .reveal:nth-child(4), .stagger > .reveal-soft:nth-child(4) { --delay: 180ms; }
.stagger > .reveal:nth-child(5), .stagger > .reveal-soft:nth-child(5) { --delay: 240ms; }
.stagger > .reveal:nth-child(6), .stagger > .reveal-soft:nth-child(6) { --delay: 300ms; }

/* ---------- Hero load sequence ---------- */
.hero-copy h1 span,
.hero-copy h1 em {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, .85em, 0);
}
.hero.is-ready .hero-copy h1 span:nth-child(1) {
  animation: lineIn .8s var(--ease-out) .12s both;
}
.hero.is-ready .hero-copy h1 span:nth-child(2) {
  animation: lineIn .8s var(--ease-out) .26s both;
}
.hero.is-ready .hero-copy h1 em {
  animation: lineIn .8s var(--ease-out) .4s both;
  color: var(--orange-bright, #ff7040);
}
@keyframes lineIn {
  from { opacity: 0; transform: translate3d(0, .85em, 0); }
  to { opacity: 1; transform: none; }
}
.hero-scan {
  position: absolute; left: 0; right: 0; top: -15%;
  height: 16%; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(255,112,64,.22), transparent);
  opacity: 0;
  transform: translateZ(0);
}
.hero.is-ready .hero-scan {
  animation: scanOnce 1.6s var(--ease-io) .2s 1 both;
}
@keyframes scanOnce {
  0% { top: -12%; opacity: 0; }
  12% { opacity: .85; }
  100% { top: 105%; opacity: 0; }
}

/* Section accent line */
.section-heading { position: relative; }
.section-heading::after {
  content: "";
  position: absolute; left: 0; bottom: -16px;
  width: 0; height: 2px;
  background: linear-gradient(90deg, #f0582a, #dda94a, transparent);
  transition: width .9s var(--ease-out);
  will-change: width;
}
.section-heading.visible::after { width: min(160px, 36%); }

/* ---------- Interactive (cheap) ---------- */
.button,
.nav-consult,
.product-tab,
.language-switch,
.showcase-link,
.back-top,
.main-nav a {
  transition:
    transform var(--dur-fast) var(--ease-out),
    opacity var(--dur-fast) var(--ease-out),
    color var(--dur-fast) ease,
    background var(--dur-fast) ease,
    border-color var(--dur-fast) ease,
    box-shadow var(--dur-fast) ease !important;
}
.button:hover,
.nav-consult:hover { transform: translate3d(0, -2px, 0); }
.button:active,
.nav-consult:active { transform: translate3d(0, 0, 0) scale(.98); }
.button {
  position: relative; overflow: hidden;
}
.button > * { position: relative; z-index: 1; }
.button::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.22) 50%, transparent 65%);
  transform: translate3d(-120%, 0, 0);
  transition: transform .65s var(--ease-out);
}
.button:hover::after { transform: translate3d(120%, 0, 0); }

.product-tab.active {
  box-shadow: 0 8px 22px rgba(221,169,74,.2);
}
.product-panel {
  transform: translateZ(0);
}
.product-panel.panel-animating {
  animation: panelIn .5s var(--ease-out) both;
}
@keyframes panelIn {
  from { opacity: 0; transform: translate3d(0, 14px, 0); }
  to { opacity: 1; transform: none; }
}

[data-count].is-count-done,
[data-count-decimal].is-count-done {
  text-shadow: 0 0 16px rgba(240,88,42,.4);
  transition: text-shadow .4s ease;
}

.culture-card,
.solution-card,
.challenge-card,
.showcase-card {
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease !important;
  will-change: auto;
}
.culture-card:hover,
.solution-card:hover,
.challenge-card:hover,
.showcase-card:hover {
  transform: translate3d(0, -4px, 0);
}

.scroll-progress span {
  transform: translateZ(0);
  will-change: width;
}

.cursor-aura {
  transform: translate3d(-50%, -50%, 0);
  will-change: transform, opacity;
  contain: strict;
}

/* Product subpages page-enter */
.product-page .wrap > * {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
}
.product-page.is-loaded .wrap > * {
  animation: pageIn .65s var(--ease-out) both;
}
.product-page.is-loaded .wrap > *:nth-child(1) { animation-delay: .05s; }
.product-page.is-loaded .wrap > *:nth-child(2) { animation-delay: .12s; }
.product-page.is-loaded .wrap > *:nth-child(3) { animation-delay: .2s; }
.product-page.is-loaded .wrap > *:nth-child(4) { animation-delay: .28s; }
.product-page.is-loaded .wrap > *:nth-child(5) { animation-delay: .36s; }
@keyframes pageIn {
  from { opacity: 0; transform: translate3d(0, 16px, 0); }
  to { opacity: 1; transform: none; }
}

/* ---------- Mobile: lighter, still smooth ---------- */
html.is-mobile-narrow {
  --rise: 16px;
  --dur: .5s;
}
html.is-mobile-narrow .reveal,
html.is-mobile-narrow .reveal-soft,
html.is-mobile-narrow .reveal-left,
html.is-mobile-narrow .reveal-scale {
  --delay: 0ms !important;
}
html.is-mobile-narrow .page-boot,
html.is-mobile-narrow .hero-scan,
html.is-mobile-narrow .button::after {
  display: none !important;
}
html.is-mobile-narrow .culture-card:hover,
html.is-mobile-narrow .solution-card:hover,
html.is-mobile-narrow .challenge-card:hover,
html.is-mobile-narrow .showcase-card:hover {
  transform: none;
}
html.is-mobile-narrow .product-panel.panel-animating {
  animation-duration: .35s;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body { opacity: 1 !important; transition: none !important; }
  .page-boot { display: none !important; }
  .hero-scan { display: none !important; }
  .reveal, .reveal-soft, .reveal-left, .reveal-scale,
  .hero-copy h1 span, .hero-copy h1 em,
  .product-page .wrap > * {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
  .product-panel.panel-animating { animation: none !important; }
  .section-heading::after { width: min(160px, 36%) !important; transition: none !important; }
}