/* ═══════════════════════════════════════════════════════════════════
   VELLUNOX NEURAL ECOSYSTEM - Living Breathing AI Design System
   Central Brain | Neural Connections | Vellunox-Style Interface
   ═══════════════════════════════════════════════════════════════════ */

/* ─── CSS Variables ─── */
:root {
  /* Neural Colors */
  --neural-blue: #3b82f6;
  --neural-purple: #3b82f6;
  --neural-pink: #f43f5e;
  --neural-green: #22c55e;
  --synapse-glow: rgba(59, 130, 246, 0.6);
  
  /* Backgrounds */
  --bg-void: #030308;
  --bg-deep: #0a0a1a;
  --bg-surface: #12122a;
  
  /* Text */
  --text-bright: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.7);
  
  /* Gradients */
  --gradient-neural: linear-gradient(135deg, var(--neural-blue), var(--neural-purple));
  --gradient-synapse: linear-gradient(90deg, transparent, var(--neural-blue), transparent);
  --gradient-pulse: radial-gradient(circle, var(--neural-blue) 0%, transparent 70%);
  
  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur: 20px;
  
  /* Fonts */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ─── Base Styles ─── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background: var(--bg-void);
  color: var(--text-bright);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* ─── Neural Background System ─── */
.neural-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.neural-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(59, 130, 246, 0.03) 0%, transparent 70%);
  animation: neural-breathe 8s ease-in-out infinite;
}

@keyframes neural-breathe {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.02); }
}

/* Neural grid overlay */
.neural-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: 
    linear-gradient(rgba(59, 130, 246, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, 0.02) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: grid-pulse 4s ease-in-out infinite;
}

@keyframes grid-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

/* Floating neural nodes */
.neural-node {
  position: fixed;
  width: 4px;
  height: 4px;
  background: var(--neural-blue);
  border-radius: 50%;
  box-shadow: 0 0 20px var(--synapse-glow);
  animation: node-float 20s linear infinite;
  opacity: 0.5;
}

@keyframes node-float {
  0% { transform: translate(0, 100vh) scale(0); opacity: 0; }
  10% { opacity: 0.5; transform: scale(1); }
  90% { opacity: 0.5; }
  100% { transform: translate(100px, -100vh) scale(0); opacity: 0; }
}

/* ─── Typography ─── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.5rem); }

.text-gradient {
  background: var(--gradient-neural);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }

/* Page Headers - Always Centered */
.page-header {
  text-align: center;
  padding: 2rem 1rem;
}

.page-header h1 {
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

p { margin-bottom: 1rem; }

/* ─── Links & Buttons ─── */
a {
  color: var(--neural-blue);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--neural-purple);
  text-shadow: 0 0 10px var(--synapse-glow);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-synapse);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.btn:hover::before {
  transform: translateX(100%);
}

.btn-primary {
  background: var(--gradient-neural);
  color: var(--bg-void);
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 50px rgba(59, 130, 246, 0.5);
}

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

.btn-secondary:hover {
  border-color: var(--neural-blue);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

.btn-sm {
  padding: 10px 20px;
  font-size: 0.85rem;
}

/* ─── Navigation ─── */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  background: rgba(3, 3, 8, 0.9);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--glass-border);
}

.nav .logo {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-bright);
}

.nav .logo img {
  width: 68px;
  height: 68px;
  filter: drop-shadow(0 0 10px var(--synapse-glow));
  animation: logo-pulse 3s ease-in-out infinite;
}

@keyframes logo-pulse {
  0%, 100% { filter: drop-shadow(0 0 10px var(--synapse-glow)); }
  50% { filter: drop-shadow(0 0 20px var(--synapse-glow)); }
}

.nav .logo span {
  background: var(--gradient-neural);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-neural);
  transition: width 0.3s ease;
}

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

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

/* ─── Sections ─── */
.section {
  padding: 80px 20px;
  position: relative;
}

.section-dark {
  background: rgba(0, 0, 0, 0.3);
}

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

.section-header h2 {
  margin-bottom: 10px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-sm { max-width: 800px; }

/* ─── Neural Cards ─── */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 30px;
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-synapse);
  animation: synapse-flow 3s linear infinite;
}

@keyframes synapse-flow {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.card:hover {
  border-color: rgba(59, 130, 246, 0.3);
  transform: translateY(-5px);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.3),
    0 0 30px rgba(59, 130, 246, 0.1);
}

/* ─── Neural Hero Section ─── */
.neural-hero {
  position: relative;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.neural-hero-bg {
  position: absolute;
  inset: 0;
}

.neural-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
  animation: hero-breathe 10s ease-in-out infinite;
}

@keyframes hero-breathe {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.05); opacity: 0.6; }
}

.neural-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    linear-gradient(180deg, var(--bg-void) 0%, transparent 30%, transparent 70%, var(--bg-void) 100%),
    radial-gradient(ellipse at center, transparent 40%, var(--bg-void) 100%);
}

.neural-hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 900px;
  padding: 40px;
}

.neural-hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin-bottom: 20px;
  animation: text-glow 4s ease-in-out infinite;
}

@keyframes text-glow {
  0%, 100% { text-shadow: 0 0 20px rgba(59, 130, 246, 0.3); }
  50% { text-shadow: 0 0 40px rgba(59, 130, 246, 0.5); }
}

.neural-hero p {
  font-size: 1.3rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

/* ─── AI Team Avatars ─── */
.ai-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid transparent;
  background: 
    linear-gradient(var(--bg-void), var(--bg-void)) padding-box,
    var(--gradient-neural) border-box;
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
  animation: avatar-pulse 4s ease-in-out infinite;
}

@keyframes avatar-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.3); }
  50% { box-shadow: 0 0 40px rgba(59, 130, 246, 0.5); }
}

.ai-avatar:hover {
  transform: scale(1.1);
  box-shadow: 0 0 50px rgba(59, 130, 246, 0.6);
}

/* ─── Neural Connection Lines ─── */
.neural-connection {
  position: absolute;
  height: 2px;
  background: var(--gradient-synapse);
  animation: connection-pulse 2s ease-in-out infinite;
}

@keyframes connection-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* ─── Brain Indicator ─── */
.brain-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 30px;
  font-size: 0.85rem;
}

.brain-status::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--neural-green);
  box-shadow: 0 0 10px var(--neural-green);
  animation: status-blink 2s ease-in-out infinite;
}

@keyframes status-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ─── Grids ─── */
.grid { display: grid; gap: 25px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .nav { padding: 15px 20px; }
  .nav-links, .nav-actions { 
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-void, #030308);
    backdrop-filter: blur(30px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 30px;
    z-index: 9999;
    padding: 60px 30px;
    overflow-y: auto;
  }
  .nav-links.active, .nav-actions.active { 
    display: flex; 
  }
  .nav-links a, .nav-actions a { 
    font-size: 1.4rem; 
    padding: 15px 30px;
    width: 100%;
    text-align: center;
    border-radius: 12px;
    transition: background 0.2s;
  }
  .nav-links a:hover, .nav-actions a:hover {
    background: rgba(59, 130, 246, 0.1);
  }
  .mobile-menu-toggle { display: flex !important; }
}

@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 50px 15px; }
  h1 { font-size: 1.8rem !important; }
  h2 { font-size: 1.5rem !important; }
  .btn { padding: 12px 24px; font-size: 0.9rem; }
  .hero-content { padding: 30px 15px !important; }
  .hero-chat { padding: 20px; }
  .hero-avatar { width: 80px; height: 80px; }
  .chat-input-row { flex-direction: column; }
  .chat-input-row button { width: 100%; }
}

/* ─── Mobile Menu Toggle Button ─── */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 10px;
  z-index: 10001;
  position: relative;
}

.mobile-menu-toggle span {
  width: 28px;
  height: 3px;
  background: var(--neural-blue);
  border-radius: 3px;
  transition: all 0.3s ease;
}

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

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

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

/* ─── Mobile Close Button ─── */
.mobile-menu-close {
  display: none;
  position: fixed;
  top: 25px;
  right: 25px;
  font-size: 2.5rem;
  color: var(--neural-blue);
  cursor: pointer;
  z-index: 10002;
  width: 50px;
  height: 50px;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
}
.nav-links.active .mobile-menu-close,
.nav-actions.active .mobile-menu-close { 
  display: flex; 
}

.nav-links.active .mobile-menu-close { display: block; }

/* ─── Footer ─── */
.footer {
  text-align: center;
  padding: 50px 20px;
  border-top: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.5);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.footer p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ─── Utilities ─── */
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }
.mt-3 { margin-top: 30px; }

/* ─── Animations ─── */
.fade-in {
  animation: fadeIn 0.6s ease-out;
}

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

.scale-in {
  animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
