/* HiBOX Site — shared design system */
:root {
  --bg: #050706;
  --bg-elevated: #0c100e;
  --surface: #121714;
  --surface-2: #1a201c;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f7f4;
  --text-2: #a8b3ac;
  --text-3: #6f7a73;
  --green: #3ecf9a;
  --green-deep: #167a58;
  --green-glow: rgba(62, 207, 154, 0.28);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  --radius: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --max: 1120px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; border: 0; cursor: pointer; background: none; color: inherit; }
img { max-width: 100%; display: block; }
code {
  font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 0.9em;
  background: rgba(255,255,255,0.06);
  padding: 2px 6px;
  border-radius: 6px;
}

.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.wrap {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  background: rgba(5, 7, 6, 0.72);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: linear-gradient(145deg, #3ecf9a, #0f6b4c);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #04120c;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 8px 24px var(--green-glow);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  color: var(--text-2);
  font-size: 14px;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); }
.nav-cta {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--text);
  color: #0a0d0b;
  font-size: 13px;
  font-weight: 600;
  transition: transform 0.25s var(--ease), opacity 0.25s;
}
.nav-cta:hover { transform: scale(1.03); }

/* Buttons */
.btn-primary {
  display: inline-block;
  padding: 14px 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, #49d8a4, #1e9a6c);
  color: #03140d;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 10px 30px var(--green-glow), inset 0 1px 0 rgba(255,255,255,0.35);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.btn-primary:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 16px 40px var(--green-glow);
}
.btn-ghost {
  display: inline-block;
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  font-weight: 500;
  font-size: 15px;
  transition: background 0.25s, border-color 0.25s;
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.22);
}

/* Sections */
section { padding: 96px 0; position: relative; z-index: 1; }
.section-label {
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.section-title {
  font-size: clamp(28px, 4.5vw, 44px);
  letter-spacing: -0.035em;
  line-height: 1.12;
  font-weight: 700;
  max-width: 20ch;
  margin-bottom: 16px;
}
.section-desc {
  color: var(--text-2);
  font-size: 17px;
  max-width: 52ch;
  line-height: 1.65;
}
.center-head {
  text-align: center;
  margin-bottom: 48px;
}
.center-head .section-title,
.center-head .section-desc {
  margin-left: auto;
  margin-right: auto;
}
.center-head .section-title { max-width: 24ch; }
.center-head .section-desc { max-width: 52ch; }

/* Cards */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent 40%), var(--surface);
  transition: transform 0.35s var(--ease), border-color 0.35s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(62, 207, 154, 0.28);
}

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.show {
  opacity: 1;
  transform: none;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 40px;
  color: var(--text-3);
  font-size: 13px;
  position: relative;
  z-index: 1;
}
.foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}
.foot-links { display: flex; gap: 18px; }
.foot a:hover { color: var(--text-2); }

/* Lang toggle */
[data-lang="en"] .zh { display: none; }
[data-lang="zh"] .en { display: none; }
.lang-toggle {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12px;
}
.lang-toggle:hover { color: var(--text); border-color: var(--border-strong); }

/* Mobile menu (built by _shared.js) */
.menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  flex: none;
}
.menu-btn span {
  display: block;
  width: 16px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s;
}
body.menu-open .menu-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.menu-open .menu-btn span:nth-child(2) { opacity: 0; }
body.menu-open .menu-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-menu {
  position: fixed;
  inset: 64px 0 auto 0;
  z-index: 49;
  background: rgba(5, 7, 6, 0.97);
  backdrop-filter: saturate(160%) blur(20px);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 8px 20px calc(20px + env(safe-area-inset-bottom));
  display: none;
  flex-direction: column;
  gap: 2px;
  transform: translateY(-10px);
  opacity: 0;
  transition: transform 0.3s var(--ease), opacity 0.3s;
  max-height: calc(100dvh - 64px);
  overflow-y: auto;
}
.mobile-menu a {
  padding: 14px 8px;
  font-size: 16px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
}
.mobile-menu a.active, .mobile-menu a:hover { color: var(--text); }
.mobile-menu .nav-cta {
  margin-top: 14px;
  text-align: center;
  border-bottom: 0;
  padding: 14px;
  font-size: 15px;
}
.mobile-menu .lang-toggle { margin-top: 12px; align-self: flex-start; padding: 10px 16px; }
body.menu-open .mobile-menu { transform: none; opacity: 1; }
body.menu-open { overflow: hidden; }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .menu-btn { display: flex; }
  .mobile-menu { display: flex; }
  section { padding: 64px 0; }
}

@media (max-width: 640px) {
  .wrap { width: calc(100% - 32px); }
  .cta-row { flex-direction: column; align-items: center; }
  .cta-row .btn-primary, .cta-row .btn-ghost {
    width: 100%;
    max-width: 320px;
    text-align: center;
  }
  .eyebrow { font-size: 12px; }
  .hero-sub { font-size: 16px; }
  .final-card { border-radius: 24px; }
}

/* ============ Dynamic effects ============ */

/* Cursor glow that follows the mouse */
.cursor-glow {
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 520px;
  height: 520px;
  margin: -260px 0 0 -260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(62,207,154,0.09), transparent 60%);
  z-index: 2;
  opacity: 0;
  transition: opacity 0.6s var(--ease);
  will-change: transform;
}
body.mouse-active .cursor-glow { opacity: 1; }
@media (hover: none) { .cursor-glow { display: none; } }

/* Spotlight hover on cards — border glow follows mouse */
.spotlight { position: relative; }
.spotlight::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%),
    rgba(62,207,154,0.12), transparent 65%);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
  z-index: 0;
}
.spotlight:hover::before { opacity: 1; }
.spotlight > * { position: relative; z-index: 1; }

/* Staggered reveal children */
[data-stagger] > .reveal { transition-delay: calc(var(--i, 0) * 90ms); }

/* Floating ambient orbs */
.orbs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.5;
  will-change: transform;
  animation: orb-float 14s ease-in-out infinite;
}
.orb.o1 {
  width: 420px; height: 420px;
  top: -120px; left: -80px;
  background: radial-gradient(circle, rgba(62,207,154,0.20), transparent 70%);
}
.orb.o2 {
  width: 360px; height: 360px;
  top: 10%; right: -100px;
  background: radial-gradient(circle, rgba(120,148,255,0.14), transparent 70%);
  animation-delay: -5s;
  animation-duration: 18s;
}
.orb.o3 {
  width: 280px; height: 280px;
  bottom: -60px; left: 35%;
  background: radial-gradient(circle, rgba(167,139,250,0.12), transparent 70%);
  animation-delay: -9s;
  animation-duration: 16s;
}
@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.08); }
  66% { transform: translate(-30px, 24px) scale(0.95); }
}

/* Animated gradient headline text */
.grad-anim {
  background: linear-gradient(120deg, #f7fff9 0%, #3ecf9a 30%, #8ee7c4 55%, #7894ff 80%, #3ecf9a 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: grad-shift 6s linear infinite;
}
@keyframes grad-shift { to { background-position: 220% center; } }

/* Floating device idle bob */
.float-bob { animation: bob 7s ease-in-out infinite; }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* Typing caret */
.typing::after {
  content: "";
  display: inline-block;
  width: 1px;
  height: 1em;
  margin-left: 2px;
  background: var(--green);
  vertical-align: -0.15em;
  animation: caret 0.9s steps(1) infinite;
}
@keyframes caret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* Sequential pulse for agent chips */
.chip-flow .agent-chip { animation: chip-glow 3.2s ease-in-out infinite; animation-delay: calc(var(--i, 0) * 0.45s); }
@keyframes chip-glow {
  0%, 100% { border-color: var(--border); box-shadow: none; }
  12% { border-color: rgba(62,207,154,0.5); box-shadow: 0 0 14px rgba(62,207,154,0.25); }
  24% { border-color: var(--border); box-shadow: none; }
}

/* Marquee strip */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
  position: relative;
  z-index: 1;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex;
  gap: 40px;
  width: max-content;
  animation: marquee 26s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-3);
  font-size: 14px;
  white-space: nowrap;
}
.marquee-item i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* Progress shimmer on timeline active item */
.tl-item.active-pulse { position: relative; overflow: hidden; }
.tl-item.active-pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(62,207,154,0.08) 50%, transparent 70%);
  animation: shimmer 2.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(100%); }
}

/* Magnetic button base (transform set from JS) */
.magnetic { transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease); will-change: transform; }

/* Parallax tilt base */
.tilt { transform-style: preserve-3d; will-change: transform; transition: transform 0.25s var(--ease); }

/* Scroll progress bar at very top */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--green), #8ee7c4);
  z-index: 100;
  pointer-events: none;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .orb, .float-bob, .marquee-track, .grad-anim, .chip-flow .agent-chip,
  .tl-item.active-pulse::after, .typing::after { animation: none !important; }
  .reveal { transition: none; opacity: 1; transform: none; }
}
