/* ===== CSS Variables ===== */
:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #1a1030;
  --bg-card: rgba(20, 25, 45, 0.6);
  --neon-cyan: #00f0ff;
  --neon-purple: #a855f7;
  --neon-pink: #f472b6;
  --neon-gold: #fbbf24;
  --text-primary: #f0f4ff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-glow: rgba(0, 240, 255, 0.3);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== Background Gradient ===== */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(168, 85, 247, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(0, 240, 255, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(26, 16, 48, 0.5) 0%, var(--bg-primary) 70%);
  z-index: -2;
  pointer-events: none;
}

/* ===== Grid Background ===== */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: -1;
  pointer-events: none;
}

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

/* ===== CRT Scanlines ===== */
.crt-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15) 0px,
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
  animation: crt-flicker 0.15s infinite;
}

@keyframes crt-flicker {
  0% { opacity: 0.4; }
  50% { opacity: 0.35; }
  100% { opacity: 0.4; }
}

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 50px;
  background: rgba(10, 14, 26, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 1000;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
}

.logo-icon {
  color: var(--neon-cyan);
  font-size: 22px;
  text-shadow: 0 0 10px var(--neon-cyan);
  animation: logo-pulse 2s ease-in-out infinite;
}

@keyframes logo-pulse {
  0%, 100% { text-shadow: 0 0 10px var(--neon-cyan); }
  50% { text-shadow: 0 0 20px var(--neon-cyan), 0 0 30px var(--neon-cyan); }
}

.logo-text {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 35px;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s;
  position: relative;
}

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

.nav-links a:hover {
  color: var(--neon-cyan);
}

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

.nav-cta-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-cta {
  padding: 8px 22px;
  border: 1px solid var(--neon-cyan);
  border-radius: 6px;
  color: var(--neon-cyan);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s;
  white-space: nowrap;
}

.nav-cta:hover {
  background: var(--neon-cyan);
  color: var(--bg-primary);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
}

.nav-cta-api {
  border-color: var(--neon-purple);
  color: var(--neon-cyan);
}

.nav-cta-api:hover {
  background: var(--neon-purple);
  color: var(--bg-primary);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.5);
}

/* ===== Hero Section ===== */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 140px 80px 100px;
  min-height: 100vh;
  gap: 60px;
  z-index: 1;
}

.hero-content {
  flex: 1;
  max-width: 600px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 20px;
  font-size: 13px;
  color: var(--neon-cyan);
  margin-bottom: 28px;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: 0 0 8px var(--neon-cyan);
  animation: pulse-dot 1.5s ease-in-out infinite;
}

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

.hero-title {
  font-size: 56px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 24px;
}

.title-line {
  display: block;
}

.title-accent {
  background: linear-gradient(135deg, var(--neon-cyan) 0%, var(--neon-purple) 50%, var(--neon-pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px rgba(0, 240, 255, 0.3));
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 40px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 50px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--neon-cyan), #00b8d4);
  color: var(--bg-primary);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 35px rgba(0, 240, 255, 0.6), 0 0 60px rgba(0, 240, 255, 0.2);
}

.btn-primary .btn-arrow {
  transition: transform 0.3s;
}

.btn-primary:hover .btn-arrow {
  transform: translateX(4px);
}

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

.btn-secondary:hover {
  border-color: var(--neon-purple);
  color: var(--neon-purple);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.2);
}

.btn-large {
  padding: 18px 40px;
  font-size: 17px;
}

/* ===== Hero Stats ===== */
.hero-stats {
  display: flex;
  align-items: center;
  gap: 30px;
}

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

.stat-num {
  font-size: 32px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--glass-border);
}

/* ===== Hero Preview ===== */
.hero-preview {
  flex: 1;
  max-width: 520px;
  position: relative;
}

.preview-frame {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  backdrop-filter: blur(20px);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px rgba(0, 240, 255, 0.08);
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--glass-border);
}

.preview-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.preview-dot.red { background: #ff5f57; }
.preview-dot.yellow { background: #febc2e; }
.preview-dot.green { background: #28c840; }

.preview-title {
  margin-left: 12px;
  font-size: 13px;
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
}

.storyboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 20px;
}

.story-cell {
  aspect-ratio: 5 / 4;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  opacity: 0;
  animation: cell-appear 0.6s ease forwards;
}

@keyframes cell-appear {
  to { opacity: 1; }
}

.sketch-svg {
  width: 70%;
  height: 60%;
}

.sketch-path {
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
  animation: draw-line 2s ease forwards;
}

@keyframes draw-line {
  to { stroke-dashoffset: 0; }
}

.cell-label {
  position: absolute;
  bottom: 6px;
  left: 8px;
  font-size: 10px;
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
}

.preview-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--glass-border);
  font-size: 13px;
  color: var(--neon-cyan);
}

.status-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: 0 0 10px var(--neon-cyan);
  animation: pulse-dot 1s ease-in-out infinite;
}

/* ===== Geometric Decorations ===== */
.geo-deco {
  position: absolute;
  pointer-events: none;
  z-index: -1;
}

.geo-ring {
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  border: 2px solid rgba(168, 85, 247, 0.3);
  border-radius: 50%;
  animation: spin-slow 20s linear infinite;
}

.geo-ring::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  bottom: 10px;
  border: 1px dashed rgba(0, 240, 255, 0.2);
  border-radius: 50%;
}

.geo-hex {
  bottom: -20px;
  left: -20px;
  width: 80px;
  height: 80px;
  border: 2px solid rgba(0, 240, 255, 0.2);
  animation: spin-slow 15s linear infinite reverse;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

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

/* ===== Section Common ===== */
section {
  position: relative;
  z-index: 1;
  padding: 100px 80px;
}

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

.section-tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--neon-cyan);
  margin-bottom: 16px;
  font-family: 'Courier New', monospace;
}

.section-title {
  font-size: 40px;
  font-weight: 800;
  margin-bottom: 14px;
}

.section-desc {
  font-size: 16px;
  color: var(--text-secondary);
}

/* ===== Features Section ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  max-width: 1200px;
  margin: 0 auto;
}

.feature-card {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 40px 32px;
  backdrop-filter: blur(10px);
  transition: all 0.4s;
  overflow: hidden;
}

.feature-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-glow);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3), 0 0 30px rgba(0, 240, 255, 0.1);
}

.feature-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 240, 255, 0.08);
  border-radius: 14px;
  border: 1px solid rgba(0, 240, 255, 0.2);
}

.feature-icon svg {
  width: 36px;
  height: 36px;
}

.feature-card h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}

.feature-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.feature-glow {
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.08) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

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

/* ===== Styles Section ===== */
.styles-scroll {
  overflow-x: auto;
  padding: 20px 0 30px;
  scrollbar-width: thin;
  scrollbar-color: var(--neon-cyan) transparent;
}

.styles-scroll::-webkit-scrollbar {
  height: 6px;
}

.styles-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.styles-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.3);
  border-radius: 3px;
}

.styles-track {
  display: flex;
  gap: 20px;
  padding: 0 80px;
  width: max-content;
}

.style-card {
  flex-shrink: 0;
  width: 220px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.4s;
  cursor: pointer;
}

.style-card:hover {
  transform: translateY(-4px);
  border-color: var(--neon-purple);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3), 0 0 25px rgba(168, 85, 247, 0.15);
}

.style-visual {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.style-visual svg {
  width: 80%;
  height: 80%;
}

.style-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(10, 14, 26, 0.8) 100%);
}

.style-info {
  padding: 16px;
}

.style-name {
  display: block;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.style-tag {
  font-size: 12px;
  color: var(--text-muted);
}

.styles-hint {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 10px;
}

/* ===== Workflow Section ===== */
.workflow-timeline {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
}

.workflow-line {
  position: absolute;
  top: 32px;
  left: 12%;
  right: 12%;
  height: 2px;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple), var(--neon-pink), var(--neon-cyan));
  background-size: 200% 100%;
  animation: flow-line 3s linear infinite;
  opacity: 0.4;
}

@keyframes flow-line {
  to { background-position: 200% 0; }
}

.workflow-step {
  text-align: center;
  position: relative;
}

.step-badge {
  width: 64px;
  height: 64px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--neon-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--neon-cyan);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
  position: relative;
  z-index: 2;
  transition: all 0.3s;
}

.workflow-step:hover .step-badge {
  background: var(--neon-cyan);
  color: var(--bg-primary);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.5);
  transform: scale(1.1);
}

.step-content h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.step-content p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== CTA Section ===== */
.cta-section {
  position: relative;
  text-align: center;
  overflow: hidden;
}

.cta-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.15) 0%, rgba(0, 240, 255, 0.08) 40%, transparent 70%);
  pointer-events: none;
}

.cta-content {
  position: relative;
  z-index: 2;
  max-width: 700px;
  margin: 0 auto;
}

.cta-title {
  font-size: 44px;
  font-weight: 800;
  margin-bottom: 16px;
}

.cta-accent {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cta-desc {
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.cta-demo {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(10px);
}

.demo-input-wrap {
  position: relative;
  margin-bottom: 20px;
}

.demo-input {
  width: 100%;
  min-height: 80px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  resize: none;
  outline: none;
}

.demo-counter {
  position: absolute;
  bottom: 10px;
  right: 14px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--glass-border);
  padding: 40px 80px;
  position: relative;
  z-index: 1;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
}

.footer-links {
  display: flex;
  gap: 30px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--neon-cyan);
}

.footer-copy {
  width: 100%;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 10px;
  padding-top: 20px;
  border-top: 1px solid var(--glass-border);
}

/* ===== Scroll Reveal Animation ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .hero {
    flex-direction: column;
    padding: 120px 40px 80px;
    text-align: center;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-actions,
  .hero-stats {
    justify-content: center;
  }

  .hero-preview {
    max-width: 100%;
    width: 100%;
  }

  .features-grid {
    grid-template-columns: 1fr;
    max-width: 500px;
  }

  .workflow-timeline {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
  }

  .workflow-line {
    display: none;
  }

  section {
    padding: 80px 40px;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 14px 20px;
  }

  .nav-links {
    display: none;
  }

  .hero-title {
    font-size: 36px;
  }

  .hero-subtitle {
    font-size: 15px;
  }

  .section-title {
    font-size: 28px;
  }

  .cta-title {
    font-size: 30px;
  }

  .hero-stats {
    gap: 16px;
  }

  .stat-num {
    font-size: 24px;
  }

  .storyboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .styles-track {
    padding: 0 20px;
  }
}
