/* ============================================
   XuanRealm Technology - Main Stylesheet
   ============================================ */

/* ---- CSS Variables ---- */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #0f0f18;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 212, 255, 0.3);
  --text-primary: #f0f0f5;
  --text-secondary: rgba(240, 240, 245, 0.6);
  --text-muted: rgba(240, 240, 245, 0.35);
  --accent-cyan: #00d4ff;
  --accent-purple: #7b2ff7;
  --accent-gradient: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  --font-cn: 'Noto Sans SC', sans-serif;
  --font-en: 'Inter', system-ui, -apple-system, sans-serif;
  --max-width: 1200px;
  --nav-height: 64px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-cn);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

/* ---- Selection ---- */
::selection {
  background: rgba(0, 212, 255, 0.3);
  color: #fff;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  transition: background var(--transition-smooth), backdrop-filter var(--transition-smooth), box-shadow var(--transition-smooth);
}

.navbar.scrolled {
  background: rgba(10, 10, 15, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--border-subtle);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-cn);
  font-size: 1.25rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  letter-spacing: 0.01em;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent-gradient);
  border-radius: 1px;
  transition: width var(--transition-smooth);
}

.nav-links a:hover {
  color: var(--text-primary);
}

.nav-links a:hover::after {
  width: 100%;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  padding: 4px 12px;
  cursor: pointer;
  font-family: var(--font-en);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.lang-switch:hover {
  border-color: var(--border-glow);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.1);
}

.lang-option {
  padding: 2px 6px;
  border-radius: 12px;
  transition: all var(--transition-fast);
}

.lang-option.active {
  background: var(--accent-gradient);
  color: #fff;
  font-weight: 600;
}

.lang-divider {
  color: var(--text-muted);
  font-weight: 300;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#particleCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(0, 212, 255, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 70%, rgba(123, 47, 247, 0.06) 0%, transparent 60%);
  z-index: 1;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, var(--bg-primary) 100%);
  z-index: 2;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 3;
  text-align: center;
  max-width: 800px;
  padding: 0 24px;
  animation: heroFadeIn 1s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-title {
  font-family: var(--font-cn);
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.2;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #fff 0%, #e0e0f0 40%, var(--accent-cyan) 70%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 300;
  color: var(--text-secondary);
  margin-bottom: 40px;
  letter-spacing: 0.06em;
}

.hero-cta-wrap {
  display: flex;
  justify-content: center;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  font-family: var(--font-cn);
  font-size: 0.95rem;
  font-weight: 500;
  color: #fff;
  background: var(--accent-gradient);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.cta-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
  opacity: 0;
  transition: opacity var(--transition-smooth);
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 212, 255, 0.25);
}

.cta-btn:hover::before {
  opacity: 1;
}

.cta-btn svg,
.cta-btn span {
  position: relative;
  z-index: 1;
}

.cta-btn:hover svg {
  animation: arrowBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}

@keyframes arrowBounce {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  animation: scrollPulse 2s ease-in-out infinite;
}

.scroll-dot {
  display: block;
  width: 6px;
  height: 6px;
  background: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.5);
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(8px); }
}

/* ============================================
   Sections
   ============================================ */
.section {
  padding: 120px 24px;
  position: relative;
}

.section-alt {
  background: var(--bg-secondary);
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 64px;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-en);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 16px;
  padding: 4px 14px;
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 20px;
  background: rgba(0, 212, 255, 0.05);
}

.section-title {
  font-family: var(--font-cn);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 16px;
}

.section-line {
  width: 48px;
  height: 2px;
  background: var(--accent-gradient);
  margin: 0 auto;
  border-radius: 1px;
}

/* ---- Reveal Animation ---- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Staggered reveal for cards ---- */
.cap-card:nth-child(1) { transition-delay: 0s; }
.cap-card:nth-child(2) { transition-delay: 0.1s; }
.cap-card:nth-child(3) { transition-delay: 0.2s; }
.cap-card:nth-child(4) { transition-delay: 0.3s; }

/* ============================================
   About Section
   ============================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.about-text p {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.8;
}

.about-text p:last-child {
  margin-bottom: 0;
}

.about-stats {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-left: 48px;
  border-left: 1px solid var(--border-subtle);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-number {
  font-family: var(--font-en);
  font-size: 2.25rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ============================================
   Product Card
   ============================================ */
.product-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  padding: 56px;
  overflow: hidden;
  transition: all var(--transition-smooth);
}

.product-glow {
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  transition: all var(--transition-smooth);
  pointer-events: none;
}

.product-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(0, 212, 255, 0.05);
}

.product-card:hover .product-glow {
  top: -30%;
  right: -10%;
  width: 500px;
  height: 500px;
}

.product-content {
  position: relative;
  z-index: 1;
}

.product-icon {
  margin-bottom: 24px;
}

.product-name {
  font-family: var(--font-en);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.product-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin-bottom: 24px;
  line-height: 1.7;
}

.product-features {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.pf-tag {
  font-size: 0.8rem;
  color: var(--accent-cyan);
  padding: 4px 14px;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 20px;
  letter-spacing: 0.03em;
}

.product-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-cn);
  font-size: 0.9rem;
  font-weight: 500;
  color: #fff;
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  transition: all var(--transition-fast);
}

.product-link:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-glow);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.1);
}

/* ============================================
   Capabilities Grid
   ============================================ */
.cap-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.cap-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 32px 24px;
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.cap-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity var(--transition-smooth);
}

.cap-card:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.cap-card:hover::before {
  opacity: 1;
}

.cap-icon {
  margin-bottom: 20px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 212, 255, 0.06);
  border-radius: 12px;
  border: 1px solid rgba(0, 212, 255, 0.1);
  transition: all var(--transition-smooth);
}

.cap-card:hover .cap-icon {
  background: rgba(0, 212, 255, 0.1);
  border-color: rgba(0, 212, 255, 0.25);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.1);
}

.cap-title {
  font-family: var(--font-cn);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.cap-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ============================================
   Contact Section
   ============================================ */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.contact-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 40px 28px;
  text-align: center;
  transition: all var(--transition-smooth);
  cursor: default;
}

.contact-card[data-action="copy"] {
  cursor: pointer;
}

.contact-card:hover {
  border-color: var(--border-glow);
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.contact-icon {
  margin: 0 auto 20px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 212, 255, 0.06);
  border-radius: 50%;
  border: 1px solid rgba(0, 212, 255, 0.1);
  transition: all var(--transition-smooth);
}

.contact-card:hover .contact-icon {
  background: rgba(0, 212, 255, 0.1);
  border-color: rgba(0, 212, 255, 0.25);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.1);
}

.contact-title {
  font-family: var(--font-cn);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.contact-value {
  font-family: var(--font-en);
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  word-break: break-all;
}

.contact-link {
  font-family: var(--font-en);
  font-size: 0.9rem;
  color: var(--accent-cyan);
  margin-bottom: 12px;
  display: inline-block;
  transition: color var(--transition-fast);
}

.contact-link:hover {
  color: #fff;
}

.contact-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.copy-toast {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 0.75rem;
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.1);
  padding: 4px 12px;
  border-radius: 12px;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: all var(--transition-bounce);
}

.copy-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   Footer
   ============================================ */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 48px 24px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-logo {
  font-family: var(--font-cn);
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-slogan {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.footer-info {
  text-align: right;
}

.footer-copyright {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.footer-icp {
  font-size: 0.75rem;
}

.footer-icp a {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer-icp a:hover {
  color: var(--text-secondary);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1023px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .about-stats {
    flex-direction: row;
    justify-content: space-around;
    padding-left: 0;
    border-left: none;
    padding-top: 32px;
    border-top: 1px solid var(--border-subtle);
  }
  .cap-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .contact-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }
}

@media (max-width: 767px) {
  .nav-links {
    display: none;
  }
  .section {
    padding: 80px 20px;
  }
  .section-header {
    margin-bottom: 40px;
  }
  .hero-title {
    font-size: 1.8rem;
  }
  .hero-subtitle {
    font-size: 0.9rem;
  }
  .about-stats {
    flex-direction: column;
    gap: 20px;
    align-items: center;
  }
  .stat-item {
    align-items: center;
  }
  .cap-grid {
    grid-template-columns: 1fr;
  }
  .product-card {
    padding: 32px 24px;
  }
  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
  }
  .footer-info {
    text-align: center;
  }
  .cta-btn {
    padding: 12px 28px;
    font-size: 0.85rem;
  }
}