/* =============================================
   缘合Lab - Digital Nexus Theme
   ============================================= */

:root {
  --bg-deep: #06060e;
  --bg-surface: #0c0c1a;
  --bg-card: #10102a;
  --cyan: #00e8ff;
  --cyan-dim: #00e8ff33;
  --cyan-glow: #00e8ff18;
  --amber: #ff6b2b;
  --amber-dim: #ff6b2b33;
  --text-primary: #e8eaf0;
  --text-secondary: #7a7f9a;
  --text-muted: #3d4060;
  --border: #1a1a3a;
  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Noto Sans SC', sans-serif;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.7;
}

::selection {
  background: var(--cyan);
  color: var(--bg-deep);
}

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

/* Canvas */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* =============================================
   Navigation
   ============================================= */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.25rem 0;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav.scrolled {
  padding: 0.75rem 0;
  background: rgba(6, 6, 14, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.logo-icon {
  color: var(--cyan);
  font-size: 1.5rem;
  filter: drop-shadow(0 0 8px var(--cyan-dim));
}

.logo-accent {
  color: var(--cyan);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2.5rem;
}

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

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--cyan);
  transition: width 0.3s;
  box-shadow: 0 0 6px var(--cyan-dim);
}

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

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

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  transition: all 0.3s;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

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

.hero-grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.15;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 70%);
}

.hero-glow {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--cyan-glow) 0%, transparent 70%);
  pointer-events: none;
  animation: glow-pulse 6s ease-in-out infinite;
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  border: 1px solid var(--cyan-dim);
  border-radius: 100px;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 2rem;
  background: var(--cyan-glow);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  animation: dot-blink 2s ease-in-out infinite;
}

@keyframes dot-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 10vw, 8rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

.title-line {
  display: block;
}

.title-accent {
  background: linear-gradient(135deg, var(--cyan) 0%, #00ff88 50%, var(--cyan) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 4s linear infinite;
}

@keyframes gradient-shift {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 300;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  letter-spacing: 0.2em;
}

.hero-desc {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 500px;
  margin: 0 auto 2.5rem;
  font-weight: 300;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.8rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), #00c8dd);
  color: var(--bg-deep);
  box-shadow: 0 0 20px var(--cyan-dim), 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 35px var(--cyan-dim), 0 8px 25px rgba(0, 0, 0, 0.4);
}

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--cyan-dim);
  color: var(--text-primary);
  background: var(--cyan-glow);
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--cyan), transparent);
  animation: scroll-flow 2s ease-in-out infinite;
}

@keyframes scroll-flow {
  0% { transform: scaleY(0); transform-origin: top; opacity: 1; }
  50% { transform: scaleY(1); transform-origin: top; opacity: 1; }
  51% { transform: scaleY(1); transform-origin: bottom; opacity: 1; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 1; }
}

/* =============================================
   Sections Common
   ============================================= */
.section {
  position: relative;
  z-index: 1;
  padding: 7rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  color: var(--cyan);
  margin-bottom: 1rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--cyan-dim);
  border-radius: 4px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 300;
}

/* =============================================
   Services
   ============================================= */
.services {
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, var(--cyan-glow) 0%, transparent 60%),
    var(--bg-deep);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.service-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-card:hover {
  border-color: var(--cyan-dim);
  transform: translateY(-4px);
}

.card-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 30%, var(--cyan-glow) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.5s;
}

.service-card:hover .card-glow {
  opacity: 1;
}

.card-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 1.5rem;
  color: var(--cyan);
  filter: drop-shadow(0 0 10px var(--cyan-dim));
}

.card-icon svg {
  width: 100%;
  height: 100%;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

.card-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 1.25rem;
  font-weight: 300;
}

.card-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.card-tags span {
  font-size: 0.7rem;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  transition: all 0.3s;
}

.service-card:hover .card-tags span {
  border-color: var(--cyan-dim);
  color: var(--text-secondary);
}

/* =============================================
   About
   ============================================= */
.about {
  background: var(--bg-deep);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.9;
  margin-bottom: 1.25rem;
  font-weight: 300;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.stat {
  text-align: center;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--cyan);
  line-height: 1;
}

.stat-suffix {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--cyan);
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  letter-spacing: 0.1em;
}

/* Orb visual */
.about-visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

.visual-orb {
  position: relative;
  width: 300px;
  height: 300px;
}

.orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--cyan-dim);
}

.orb-ring-1 {
  animation: orb-spin 12s linear infinite;
  border-style: dashed;
}

.orb-ring-2 {
  inset: 30px;
  animation: orb-spin 8s linear infinite reverse;
  border-color: var(--amber-dim);
}

.orb-ring-3 {
  inset: 60px;
  animation: orb-spin 20s linear infinite;
  border-style: dotted;
}

.orb-core {
  position: absolute;
  inset: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--cyan) 0%, var(--cyan-dim) 40%, transparent 70%);
  animation: core-pulse 3s ease-in-out infinite;
}

@keyframes orb-spin {
  to { transform: rotate(360deg); }
}

@keyframes core-pulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; }
}

/* =============================================
   Contact
   ============================================= */
.contact {
  background:
    radial-gradient(ellipse 60% 40% at 50% 100%, var(--cyan-glow) 0%, transparent 60%),
    var(--bg-deep);
}

.contact-grid {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
}

.contact-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem 3rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: all 0.3s;
}

.contact-item:hover {
  border-color: var(--cyan-dim);
}

.contact-icon {
  width: 40px;
  height: 40px;
  color: var(--cyan);
  margin-bottom: 0.5rem;
}

.contact-icon svg {
  width: 100%;
  height: 100%;
}

.contact-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.contact-value {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* =============================================
   Footer
   ============================================= */
.footer {
  position: relative;
  z-index: 1;
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.3s;
}

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

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.icp a {
  color: var(--text-muted);
  transition: color 0.3s;
}

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

/* =============================================
   Reveal Animation
   ============================================= */
[data-reveal] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

[data-delay="1"] { transition-delay: 0.1s; }
[data-delay="2"] { transition-delay: 0.2s; }
[data-delay="3"] { transition-delay: 0.3s; }

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 300px;
    height: 100vh;
    background: var(--bg-surface);
    flex-direction: column;
    padding: 5rem 2rem 2rem;
    gap: 1.5rem;
    border-left: 1px solid var(--border);
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .nav-links.open {
    right: 0;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .about-visual {
    order: -1;
  }

  .visual-orb {
    width: 200px;
    height: 200px;
  }

  .orb-ring-2 { inset: 20px; }
  .orb-ring-3 { inset: 40px; }
  .orb-core { inset: 60px; }

  .about-stats {
    gap: 1rem;
  }

  .stat-number {
    font-size: 1.6rem;
  }

  .footer-inner {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .hero-title {
    font-size: clamp(2.8rem, 12vw, 5rem);
  }

  .contact-grid {
    flex-direction: column;
    align-items: center;
  }

  .contact-item {
    width: 100%;
    max-width: 360px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1.25rem;
  }

  .section {
    padding: 5rem 0;
  }

  .service-card {
    padding: 1.75rem 1.5rem;
  }

  .about-stats {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}
