html {
  scroll-behavior: smooth;
}

body {
  animation: page-enter 1.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  animation: grain-shift 8s steps(6) infinite;
}

@keyframes grain-shift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-2%, 1%); }
}

@keyframes page-enter {
  from { opacity: 0; filter: blur(10px); }
  to { opacity: 1; filter: none; }
}

#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 80;
  pointer-events: none;
  background: linear-gradient(90deg, #00677d, #50d9fe, #b3ebff, #50d9fe);
  background-size: 220% 100%;
  box-shadow: 0 0 14px rgba(80, 217, 254, 0.7);
  transition: width 0.28s linear;
  animation: progress-shift 9s linear infinite;
}

@keyframes progress-shift {
  from { background-position: 0 0; }
  to { background-position: 220% 0; }
}

#cursor-glow {
  position: fixed;
  width: 560px;
  height: 560px;
  margin: -280px 0 0 -280px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 70;
  background: radial-gradient(circle, rgba(80, 217, 254, 0.16) 0%, transparent 68%);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.8s ease;
}

#cursor-glow.is-on { opacity: 1; }

.cursor-trail {
  position: fixed;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 71;
  background: #50d9fe;
  box-shadow: 0 0 10px #50d9fe;
  opacity: 0;
}

#back-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 14px;
  z-index: 75;
  cursor: pointer;
  color: #0d1c32;
  background: #50d9fe;
  box-shadow: 0 10px 28px rgba(0, 103, 125, 0.35);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

#back-top.is-show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

#back-top:hover { transform: translateY(-3px); }

header {
  animation: header-in 1.35s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: box-shadow 0.7s ease, background-color 0.7s ease;
}

@keyframes header-in {
  from { transform: translateY(-110%); opacity: 0; }
  to { transform: none; opacity: 1; }
}

header.is-scrolled { box-shadow: 0 12px 40px rgba(13, 28, 50, 0.32); }

header a[href="index.html"] img {
  animation: logo-glow 6s ease-in-out infinite, logo-spin-in 1.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes logo-spin-in {
  from { transform: rotate(-16deg) scale(0.55); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@keyframes logo-glow {
  0%, 100% { box-shadow: 0 0 16px rgba(80, 217, 254, 0.28); }
  50% { box-shadow: 0 0 32px rgba(80, 217, 254, 0.7); }
}

header nav a {
  position: relative;
  animation: nav-item-in 1.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
header nav a:nth-child(1) { animation-delay: 0.18s; }
header nav a:nth-child(2) { animation-delay: 0.32s; }
header nav a:nth-child(3) { animation-delay: 0.46s; }
header nav a:nth-child(4) { animation-delay: 0.6s; }
header nav a:nth-child(5) { animation-delay: 0.74s; }
header nav a:nth-child(6) { animation-delay: 0.88s; }

@keyframes nav-item-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: none; }
}

header nav a::after {
  content: "";
  position: absolute;
  left: 0.6rem;
  right: 0.6rem;
  bottom: 0.15rem;
  height: 2px;
  border-radius: 2px;
  background: #50d9fe;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

header nav a:hover::after,
header nav a[aria-current="page"]::after { transform: scaleX(1); }

header a.group.overflow-hidden::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 -40%;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  transform: translateX(-20%);
  animation: cta-sheen 6.4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes cta-sheen {
  0%, 48% { transform: translateX(-20%); }
  82%, 100% { transform: translateX(380%); }
}

.btn-ripple { position: relative; overflow: hidden; }
.btn-ripple .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  transform: scale(0);
  animation: ripple-out 1.2s ease-out forwards;
  pointer-events: none;
}
@keyframes ripple-out { to { transform: scale(12); opacity: 0; } }

#mobile-nav { transition: opacity 0.55s ease, transform 0.55s ease; }
#mobile-nav.is-open {
  display: block;
  animation: nav-drop 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@media (min-width: 1280px) {
  #mobile-nav.is-open { display: none; animation: none; }
}
@keyframes nav-drop {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: none; }
}

html.js-motion main section {
  opacity: 0;
  will-change: opacity, transform;
}
html.js-motion main section:nth-of-type(odd) { transform: translate3d(-56px, 48px, 0); }
html.js-motion main section:nth-of-type(even) { transform: translate3d(56px, 48px, 0); }
html.js-motion main section:first-of-type { transform: translate3d(0, 32px, 0) scale(0.98); }
html.js-motion main section.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 1.6s cubic-bezier(0.22, 1, 0.36, 1), transform 1.6s cubic-bezier(0.22, 1, 0.36, 1);
}

html.js-motion .reveal-child { opacity: 0; }
html.js-motion .reveal-child:nth-child(odd) { transform: translate3d(-40px, 28px, 0) scale(0.95); }
html.js-motion .reveal-child:nth-child(even) { transform: translate3d(40px, 28px, 0) scale(0.95); }
html.js-motion .is-visible .reveal-child,
html.js-motion .reveal-child.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 1.4s cubic-bezier(0.22, 1, 0.36, 1), transform 1.4s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--d, 0ms);
}

html.js-motion .reveal-title {
  opacity: 0;
  filter: blur(8px);
}
html.js-motion .is-visible .reveal-title {
  opacity: 1;
  filter: none;
  transition: opacity 1.5s ease 0.15s, filter 1.5s ease 0.15s;
}

html.js-motion .reveal-copy {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
}
html.js-motion .is-visible .reveal-copy {
  opacity: 1;
  transform: none;
  transition: opacity 1.45s ease 0.4s, transform 1.45s cubic-bezier(0.22, 1, 0.36, 1) 0.4s;
}

html.js-motion .draw-line {
  transform: scaleX(0);
  transform-origin: left center;
}
html.js-motion .is-visible .draw-line {
  transform: scaleX(1);
  transition: transform 1.55s cubic-bezier(0.22, 1, 0.36, 1) 0.18s;
}

.char-span {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.85em) rotate(8deg);
}
.is-visible .char-span {
  opacity: 1;
  transform: none;
  transition: opacity 1.15s ease, transform 1.15s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--cd, 0ms);
}

html.js-motion footer {
  opacity: 0;
  transform: translate3d(0, 42px, 0);
}
html.js-motion footer.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 1.55s cubic-bezier(0.22, 1, 0.36, 1), transform 1.55s cubic-bezier(0.22, 1, 0.36, 1);
}
html.js-motion footer.is-visible a {
  animation: footer-link-in 1.25s ease both;
}
html.js-motion footer.is-visible a:nth-child(1) { animation-delay: 0.12s; }
html.js-motion footer.is-visible a:nth-child(2) { animation-delay: 0.24s; }
html.js-motion footer.is-visible a:nth-child(3) { animation-delay: 0.36s; }
html.js-motion footer.is-visible a:nth-child(4) { animation-delay: 0.48s; }
html.js-motion footer.is-visible a:nth-child(5) { animation-delay: 0.6s; }
html.js-motion footer.is-visible a:nth-child(6) { animation-delay: 0.72s; }
@keyframes footer-link-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

html.motion-fallback main section,
html.motion-fallback footer,
html.motion-fallback .reveal-child,
html.motion-fallback .reveal-title,
html.motion-fallback .reveal-copy,
html.motion-fallback .draw-line,
html.motion-fallback .char-span {
  opacity: 1 !important;
  transform: none !important;
  filter: none !important;
  clip-path: none !important;
  transition: none !important;
}

main section:first-of-type .absolute.inset-0 svg { animation: grid-drift 38s linear infinite; }
@keyframes grid-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(48px, 48px, 0); }
}

main section:first-of-type .blur-3xl,
main section:first-of-type .blur-\[100px\] {
  animation: orb-breathe 12s ease-in-out infinite;
}
@keyframes orb-breathe {
  0%, 100% { transform: scale(1) translate(0, 0); opacity: 0.28; }
  50% { transform: scale(1.24) translate(-18px, 12px); opacity: 0.52; }
}

.hero-particle {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #50d9fe;
  box-shadow: 0 0 10px rgba(80, 217, 254, 0.8);
  pointer-events: none;
  z-index: 2;
  animation: particle-float linear infinite;
  opacity: 0.55;
}
@keyframes particle-float {
  0% { transform: translate3d(0, 18px, 0); opacity: 0; }
  20% { opacity: 0.7; }
  100% { transform: translate3d(var(--tx, 20px), -150px, 0); opacity: 0; }
}

.hero-scan {
  position: absolute;
  left: -8%;
  width: 116%;
  height: 140px;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(180deg, transparent, rgba(80, 217, 254, 0.14), transparent);
  animation: scan-down 10s ease-in-out infinite;
}
@keyframes scan-down {
  0% { top: -22%; opacity: 0; }
  14% { opacity: 1; }
  86% { opacity: 1; }
  100% { top: 92%; opacity: 0; }
}

.hero-ring {
  position: absolute;
  border: 1px solid rgba(80, 217, 254, 0.22);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  animation: ring-expand 9s ease-out infinite;
}
@keyframes ring-expand {
  0% { transform: scale(0.4); opacity: 0.5; }
  100% { transform: scale(1.8); opacity: 0; }
}

.site-marquee {
  position: relative;
  overflow: hidden;
  margin-top: 2rem;
  padding: 0.75rem 0;
  border-top: 1px solid rgba(80, 217, 254, 0.18);
  border-bottom: 1px solid rgba(80, 217, 254, 0.18);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.site-marquee-track {
  display: flex;
  width: max-content;
  gap: 2.5rem;
  font-family: jetbrainsMono, ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(80, 217, 254, 0.88);
  animation: marquee-move 44s linear infinite;
  white-space: nowrap;
}
@keyframes marquee-move {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.55;
}

.lift-card {
  position: relative;
  transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.75s ease;
  transform-style: preserve-3d;
}
.lift-card:hover { box-shadow: 0 18px 44px rgba(13, 28, 50, 0.14); }
.is-visible .lift-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  animation: card-edge 6s ease-in-out infinite;
}
@keyframes card-edge {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(80, 217, 254, 0); }
  50% { box-shadow: inset 0 0 0 1px rgba(80, 217, 254, 0.38); }
}

.lift-card:hover .material-symbols-outlined {
  animation: icon-pop 0.95s cubic-bezier(0.22, 1, 0.36, 1);
  color: #00677d;
}
@keyframes icon-pop {
  0% { transform: scale(1) rotate(0deg); }
  40% { transform: scale(1.18) rotate(-8deg); }
  100% { transform: scale(1) rotate(0deg); }
}

main .material-symbols-outlined { animation: icon-idle 6.8s ease-in-out infinite; }
@keyframes icon-idle {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -3px; }
}

html.js-motion .is-visible .font-metric-display {
  animation: metric-pop 1.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes metric-pop {
  0% { transform: scale(0.72); opacity: 0.15; }
  70% { transform: scale(1.06); }
  100% { transform: scale(1); opacity: 1; }
}

html.js-motion main h1 .text-secondary-container,
html.js-motion main h2 .text-secondary,
html.js-motion main h2 .text-secondary-container {
  background: linear-gradient(90deg, #50d9fe, #ffffff, #50d9fe);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  animation: text-shine 8s ease-in-out infinite;
}
@keyframes text-shine {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

html.js-motion main section img:not([src*="logo"]):not([src*="wechat-qr"]) {
  clip-path: inset(12% 12% 12% 12%);
  filter: saturate(0.8) brightness(0.95);
  transform: scale(1.08);
}
html.js-motion main section.is-visible img:not([src*="logo"]):not([src*="wechat-qr"]) {
  clip-path: inset(0);
  filter: none;
  transform: none;
  transition: clip-path 2s cubic-bezier(0.22, 1, 0.36, 1), filter 1.8s ease, transform 2.1s ease;
}
main section .group:hover img {
  transform: scale(1.06);
  transition: transform 1.6s ease;
}

img[src*="wechat-qr"] { animation: qr-float 7.2s ease-in-out infinite; }
@keyframes qr-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.03); }
}

.pulse-dot { animation: live-dot 2.8s ease-in-out infinite; }
@keyframes live-dot {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.35); }
}

.tag-btn,
button.transition-colors {
  transition: transform 0.55s ease, background-color 0.55s ease, box-shadow 0.55s ease !important;
}
.tag-btn:hover,
button.transition-colors:hover { transform: translateY(-2px); }

a.bg-secondary,
a.bg-on-tertiary-container,
button[type="submit"] {
  transition: transform 0.55s ease, box-shadow 0.55s ease, background-color 0.55s ease;
}
a.bg-secondary:hover,
a.bg-on-tertiary-container:hover,
button[type="submit"]:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 28px rgba(0, 103, 125, 0.35);
}

.img-shine {
  position: relative;
  overflow: hidden;
}
.img-shine::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.28) 50%, transparent 60%);
  transform: translateX(-120%);
  animation: img-sheen 7s ease-in-out infinite;
  pointer-events: none;
}
@keyframes img-sheen {
  0%, 55% { transform: translateX(-120%); }
  85%, 100% { transform: translateX(120%); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body, body::after, header, header a[href="index.html"] img, header nav a,
  header a.group.overflow-hidden::after,
  main section:first-of-type .absolute.inset-0 svg,
  main section:first-of-type .blur-3xl,
  main section:first-of-type .blur-\[100px\],
  img[src*="wechat-qr"], .hero-particle, .hero-scan, .hero-ring,
  .site-marquee-track, #scroll-progress,
  html.js-motion .is-visible .font-metric-display,
  html.js-motion main h1 .text-secondary-container,
  html.js-motion main h2 .text-secondary,
  html.js-motion main h2 .text-secondary-container,
  main .material-symbols-outlined, .is-visible .lift-card::after,
  .pulse-dot, .img-shine::after {
    animation: none !important;
  }
  html.js-motion main section, html.js-motion .reveal-child, html.js-motion .reveal-title,
  html.js-motion .reveal-copy, html.js-motion .draw-line, html.js-motion footer,
  html.js-motion main section img, .char-span {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    clip-path: none !important;
    transition: none !important;
  }
  #cursor-glow, #scroll-progress, .hero-particle, .hero-scan, .hero-ring,
  .site-marquee, .cursor-trail, .hero-canvas, #back-top, body::after { display: none !important; }
  .lift-card:hover { transform: none; }
}
