:root {
  --navy-950: #060f22;
  --navy-900: #0a1b35;
  --navy-800: #0d2347;
  --navy-700: #123264;
  --blue-500: #1a8fe3;
  --blue-400: #3fa9f5;
  --blue-300: #7ec8f7;
  --ink-100: #f3f7fc;
  --ink-200: #c9d6e8;
  --ink-300: #93a6c2;
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Manrope', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--navy-950);
  color: var(--ink-100);
  overflow-x: hidden;
}

/* ===== Ambient animated background (site-wide) ===== */
.bg-fx {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.bg-fx .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.32;
  will-change: transform;
  animation: driftBlob 24s ease-in-out infinite;
}
.bg-fx .blob-1 {
  width: 560px; height: 560px;
  top: -160px; left: -120px;
  background: radial-gradient(circle, var(--blue-500), transparent 70%);
  animation-duration: 22s;
}
.bg-fx .blob-2 {
  width: 620px; height: 620px;
  bottom: -200px; right: -160px;
  background: radial-gradient(circle, var(--blue-400), transparent 70%);
  animation-duration: 28s;
  animation-delay: -6s;
}
.bg-fx .blob-3 {
  width: 460px; height: 460px;
  top: 38%; left: 55%;
  background: radial-gradient(circle, #2e5ea8, transparent 70%);
  animation-duration: 32s;
  animation-delay: -12s;
}
.bg-fx .blob-4 {
  width: 380px; height: 380px;
  top: 70%; left: 10%;
  background: radial-gradient(circle, var(--blue-300), transparent 70%);
  animation-duration: 26s;
  animation-delay: -18s;
}
@keyframes driftBlob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(70px, -50px) scale(1.12); }
  50% { transform: translate(-40px, 60px) scale(0.92); }
  75% { transform: translate(50px, 40px) scale(1.06); }
}
.bg-fx .particle {
  position: absolute;
  bottom: -10px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--blue-300);
  box-shadow: 0 0 8px 2px rgba(126,200,247,0.6);
  opacity: 0;
  animation: floatParticle linear infinite;
}
@keyframes floatParticle {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 0.8; }
  90% { opacity: 0.4; }
  100% { transform: translateY(-110vh) translateX(30px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .bg-fx .blob, .bg-fx .particle { animation: none; }
}

main, header, section, footer { position: relative; z-index: 1; }

:lang(zh), [lang="zh"] body, body.lang-zh {
  font-family: 'Noto Sans SC', 'Manrope', sans-serif;
}

a { text-decoration: none; }

::selection { background: var(--blue-500); color: #fff; }

/* ===== Navbar ===== */
#mainNav {
  background: rgba(6, 15, 34, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background .3s ease, box-shadow .3s ease;
  padding: 0.6rem 0;
}
#mainNav.scrolled {
  background: rgba(6, 15, 34, 0.92);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.brand-logo { height: 34px; width: auto; }
.footer-logo { height: 30px; width: auto; }
.navbar-nav .nav-link {
  position: relative;
  color: var(--ink-200);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 0.9rem !important;
  transition: color .2s ease;
}
.navbar-nav .nav-link::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 0;
  width: 0; height: 2px;
  background: linear-gradient(90deg, var(--blue-400), var(--blue-300));
  border-radius: 2px;
  transform: translateX(-50%);
  transition: width .25s ease;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active { color: #fff; }
.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after { width: 60%; }

.btn-lang {
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.16);
  color: var(--ink-100);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all .2s ease;
}
.btn-lang:hover {
  background: var(--blue-500);
  border-color: var(--blue-500);
  color: #fff;
  box-shadow: 0 0 18px rgba(26,143,227,0.5);
}
.btn-lang i { transition: transform .4s ease; }
.btn-lang:hover i { transform: rotate(180deg); }

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: radial-gradient(1200px 600px at 50% -10%, #12345f 0%, var(--navy-900) 55%, var(--navy-950) 100%);
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(600px 400px at 85% 20%, rgba(26,143,227,0.25), transparent 60%),
    radial-gradient(500px 350px at 10% 80%, rgba(63,169,245,0.18), transparent 60%);
  pointer-events: none;
}
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 40%, transparent 85%);
  pointer-events: none;
}
.hero-circuit {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0.35;
  pointer-events: none;
}
.hero-circuit .circuit-path {
  stroke-dasharray: 10 8;
  animation: circuitFlow 5s linear infinite;
}
.hero-circuit g:last-child circle {
  filter: drop-shadow(0 0 4px rgba(63,169,245,0.9));
  animation: nodePulse 2.6s ease-in-out infinite;
}
@keyframes circuitFlow { to { stroke-dashoffset: -180; } }
@keyframes nodePulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
.hero-chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(13,35,71,0.55);
  border: 1px solid rgba(63,169,245,0.35);
  backdrop-filter: blur(6px);
  color: var(--blue-300);
  font-weight: 700;
  font-size: 0.85rem;
  font-family: 'Courier New', monospace;
  padding: 0.5rem 0.9rem;
  border-radius: 10px;
  opacity: 0.8;
  animation: float 7s ease-in-out infinite;
  pointer-events: none;
}
.chip-1 { top: 22%; left: 8%; animation-delay: 0s; }
.chip-2 { top: 68%; left: 12%; animation-delay: 1.5s; }
.chip-3 { top: 18%; right: 9%; animation-delay: 0.8s; }
.chip-4 { top: 62%; right: 10%; animation-delay: 2.2s; }
.chip-5 { top: 42%; right: 4%; animation-delay: 3s; font-size: 0.75rem; letter-spacing: 0.1em; }
@media (max-width: 767.98px) {
  .hero-chip { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-circuit .circuit-path, .hero-circuit g:last-child circle, .hero-chip { animation: none; }
}

.badge-pill {
  display: inline-block;
  background: rgba(26,143,227,0.12);
  border: 1px solid rgba(63,169,245,0.4);
  color: var(--blue-300);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
}
.hero-title {
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
}
.gradient-text {
  background: linear-gradient(90deg, var(--blue-400), var(--blue-300) 60%, #ffffff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--ink-200);
  max-width: 680px;
  line-height: 1.7;
}
.btn-primary-grad {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--blue-500), #0f6fc0);
  border: none;
  color: #fff;
  font-weight: 700;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(26,143,227,0.35);
  transition: transform .2s ease, box-shadow .2s ease;
}
.btn-primary-grad::before {
  content: "";
  position: absolute;
  top: 0; left: -75%;
  width: 50%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-20deg);
  transition: left .6s ease;
}
.btn-primary-grad:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 34px rgba(26,143,227,0.55);
  color: #fff;
}
.btn-primary-grad:hover::before { left: 130%; }
.btn-outline-light {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  font-weight: 700;
  border-width: 1.5px;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
}
.btn-outline-light:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 26px rgba(63,169,245,0.3);
}
.scroll-cue {
  position: absolute;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  color: var(--ink-300);
  font-size: 1.4rem;
  animation: bounce 2.2s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translate(-50%, 0); opacity: .6; }
  50% { transform: translate(-50%, 8px); opacity: 1; }
}

/* ===== Stats strip ===== */
.stats-strip {
  background: linear-gradient(90deg, rgba(13,35,71,0.72), rgba(18,50,100,0.72));
  backdrop-filter: blur(6px);
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 2.6rem 0;
}
.stat-num {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 800;
  color: #fff;
}
.stat-num span { color: var(--blue-400); }
.stat-label {
  color: var(--ink-300);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 0.3rem;
}

/* ===== Sections ===== */
.section { padding: 6.5rem 0; position: relative; overflow: hidden; }
.section-alt { background: rgba(10, 27, 53, 0.72); backdrop-filter: blur(6px); }
.section::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.section > .container { position: relative; z-index: 1; }

/* About: soft glow top-left + faint diagonal grid */
#about::before {
  background:
    radial-gradient(520px 420px at 8% 10%, rgba(63,169,245,0.14), transparent 65%),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.025) 0 2px, transparent 2px 26px);
  mask-image: radial-gradient(ellipse 90% 80% at 20% 15%, black 30%, transparent 80%);
}

/* Services: dotted grid + glow bottom-right */
#services::before {
  background:
    radial-gradient(560px 460px at 92% 85%, rgba(26,143,227,0.16), transparent 65%),
    radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: auto, 22px 22px;
  mask-image: radial-gradient(ellipse 85% 75% at 80% 85%, black 25%, transparent 80%);
}

/* Why Us: diagonal hatch + glow top-center */
#why::before {
  background:
    radial-gradient(600px 360px at 50% 0%, rgba(126,200,247,0.12), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.025) 0 2px, transparent 2px 28px);
}

/* Contact: glow bottom-left + dotted grid */
#contact::before {
  background:
    radial-gradient(540px 420px at 6% 90%, rgba(63,169,245,0.15), transparent 65%),
    radial-gradient(rgba(255,255,255,0.055) 1px, transparent 1px);
  background-size: auto, 26px 26px;
  mask-image: radial-gradient(ellipse 85% 75% at 15% 90%, black 25%, transparent 80%);
}
.section-tag {
  display: inline-block;
  color: var(--blue-400);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
  margin-bottom: 0.8rem;
}
.section-title {
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
}
.section-text {
  color: var(--ink-200);
  line-height: 1.8;
  font-size: 1.02rem;
}

/* ===== About ===== */
.about-visual {
  position: relative;
  height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.about-illustration {
  position: absolute;
  width: 100%;
  max-width: 460px;
  height: auto;
  animation: spinSlow 60s linear infinite;
}
.about-illustration .about-line {
  stroke-dasharray: 6 8;
  animation: lineFlow 3.2s linear infinite;
}
@keyframes lineFlow { to { stroke-dashoffset: -140; } }
@keyframes spinSlow { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .about-illustration, .about-illustration .about-line { animation: none; }
}
.glow-orb {
  position: absolute;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(26,143,227,0.55), rgba(26,143,227,0) 70%);
  filter: blur(10px);
  animation: pulse 4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: .8; }
  50% { transform: scale(1.12); opacity: 1; }
}
.orbit-card {
  position: absolute;
  background: rgba(13,35,71,0.75);
  border: 1px solid rgba(63,169,245,0.3);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
  padding: 1.1rem 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 20px 40px rgba(0,0,0,0.35);
  animation: float 6s ease-in-out infinite;
}
.orbit-card i { color: var(--blue-400); font-size: 1.4rem; }
.card-1 { top: 10%; left: 4%; animation-delay: 0s; }
.card-2 { top: 42%; right: 2%; animation-delay: 1.2s; }
.card-3 { bottom: 8%; left: 18%; animation-delay: 2.4s; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

/* ===== Services ===== */
.service-flat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
  align-items: stretch;
}
@media (max-width: 991.98px) {
  .service-flat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575.98px) {
  .service-flat-grid { grid-template-columns: 1fr; }
}
.service-tag-item {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.9rem;
  height: 100%;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 1.8rem 1.3rem;
  color: var(--ink-100);
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.45;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.service-tag-item:hover {
  border-color: rgba(63,169,245,0.45);
  background: rgba(63,169,245,0.08);
  transform: translateY(-5px);
}
.service-tag-item i {
  flex-shrink: 0;
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px;
  background: rgba(26,143,227,0.15);
  color: var(--blue-400);
  font-size: 1.35rem;
  transition: transform .35s ease, box-shadow .35s ease, color .35s ease;
}
.service-tag-item:hover i {
  transform: scale(1.15) rotate(-8deg);
  box-shadow: 0 0 22px rgba(63,169,245,0.55);
  color: #fff;
}

/* ===== Why us ===== */
.why-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius);
  padding: 2rem 1.6rem;
  height: 100%;
  text-align: center;
  transition: transform .25s ease, background .25s ease, border-color .25s ease;
}
.why-card:hover {
  transform: translateY(-6px);
  background: rgba(255,255,255,0.055);
  border-color: rgba(63,169,245,0.4);
}
.why-icon {
  width: 56px; height: 56px;
  margin: 0 auto 1.1rem;
  border-radius: 50%;
  background: rgba(26,143,227,0.15);
  border: 1px solid rgba(63,169,245,0.35);
  display: flex; align-items: center; justify-content: center;
  color: var(--blue-400);
  font-size: 1.4rem;
  transition: transform .35s ease, box-shadow .35s ease, color .35s ease;
}
.why-card:hover .why-icon {
  transform: scale(1.15) rotate(-8deg);
  box-shadow: 0 0 22px rgba(63,169,245,0.55);
  color: #fff;
}
.why-card h4 { color: #fff; font-weight: 700; font-size: 1.05rem; margin-bottom: 0.6rem; }
.why-card p { color: var(--ink-300); font-size: 0.92rem; line-height: 1.6; margin: 0; }

/* Diagonal shine sweep on hover (cards) */
.service-tag-item::before,
.why-card::before {
  content: "";
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.16), transparent);
  transform: skewX(-20deg);
  transition: left .75s ease;
  z-index: 1;
  pointer-events: none;
}
.service-tag-item:hover::before,
.why-card:hover::before { left: 130%; }

/* Spinning gradient ring on hover (cards) */
.service-tag-item::after,
.why-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from 0deg, transparent 0 65%, var(--blue-300), var(--blue-400), transparent 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  z-index: 2;
  pointer-events: none;
  animation: spinRing 2.6s linear infinite;
  animation-play-state: paused;
  transition: opacity .3s ease;
}
.service-tag-item:hover::after,
.why-card:hover::after {
  opacity: 1;
  animation-play-state: running;
}
@keyframes spinRing { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .service-tag-item::after, .why-card::after { animation: none; }
}

/* ===== Contact ===== */
.contact-item { display: flex; gap: 1rem; margin-bottom: 1.5rem; }
.contact-item i {
  width: 46px; height: 46px; flex-shrink: 0;
  border-radius: 12px;
  background: rgba(26,143,227,0.15);
  border: 1px solid rgba(63,169,245,0.3);
  display: flex; align-items: center; justify-content: center;
  color: var(--blue-400); font-size: 1.15rem;
}
.contact-label { font-size: 0.78rem; color: var(--ink-300); text-transform: uppercase; font-weight: 700; letter-spacing: 0.04em; }
.contact-value { color: #fff; font-weight: 600; }

.contact-form {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 2rem;
}
.contact-form .form-label { color: var(--ink-200); font-weight: 600; font-size: 0.9rem; margin-bottom: 0.4rem; }
.contact-form .form-control {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
}
.contact-form .form-control:focus {
  background: rgba(255,255,255,0.06);
  border-color: var(--blue-400);
  box-shadow: 0 0 0 0.2rem rgba(26,143,227,0.25);
  color: #fff;
}
.contact-form .form-control::placeholder { color: var(--ink-300); }

/* ===== Footer ===== */
.footer {
  background: var(--navy-950);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 2.6rem 0;
}
.footer-text { color: var(--ink-300); font-size: 0.88rem; }

/* ===== Back to top ===== */
.back-to-top {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--blue-500);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 10px 24px rgba(26,143,227,0.4);
  opacity: 0; visibility: hidden;
  transform: translateY(10px);
  transition: all .3s ease;
  z-index: 999;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover {
  background: #0f6fc0;
  color: #fff;
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 14px 30px rgba(26,143,227,0.6);
}

/* ===== Reveal animation ===== */
[data-aos] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s ease var(--aos-delay, 0s), transform .7s ease var(--aos-delay, 0s);
}
[data-aos].in-view { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  [data-aos] { opacity: 1; transform: none; transition: none; }
}

@media (max-width: 991.98px) {
  .about-visual { height: 320px; margin-top: 2rem; }
  .orbit-card { padding: 0.85rem 1.1rem; font-size: 0.9rem; }
  #navMenu { background: rgba(6,15,34,0.96); border-radius: 14px; margin-top: 1rem; padding: 1rem; }
}
