/* XALEN Animated Graphics — Welch Labs-inspired */
/* Neural networks, data flow, ecosystem constellations */
/* Pure CSS + SVG animations, no libraries */

/* ═══════════════════════════════════════════════════
   1. NEURAL NETWORK GRAPH
   ═══════════════════════════════════════════════════ */

.nn-graph {
  width: 100%;
  max-width: 900px;
  height: auto;
  margin: 0 auto;
  display: block;
  overflow: visible;
}

.nn-connection {
  fill: none;
  stroke: #E5E7EB;
  stroke-width: 1.5;
  opacity: 0.6;
}

.nn-connection.active {
  stroke: var(--primary, #FF6600);
  stroke-width: 2;
  opacity: 0.3;
}

.nn-node {
  transition: all 0.3s ease;
}

.nn-node-ring {
  fill: none;
  stroke-width: 2;
  opacity: 0.4;
}

.nn-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  fill: #6B7280;
  text-anchor: middle;
}

.nn-layer-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 10px;
  font-weight: 700;
  fill: #9CA3AF;
  text-anchor: middle;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.nn-particle {
  opacity: 0.9;
  filter: drop-shadow(0 0 3px rgba(255, 102, 0, 0.6));
}

/* Node pulsing */
@keyframes nn-pulse {
  0%, 100% { r: 18; opacity: 0.9; }
  50% { r: 20; opacity: 1; }
}

@keyframes nn-pulse-sm {
  0%, 100% { r: 14; opacity: 0.8; }
  50% { r: 16; opacity: 1; }
}

@keyframes nn-glow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(255, 102, 0, 0.2)); }
  50% { filter: drop-shadow(0 0 12px rgba(255, 102, 0, 0.4)); }
}

.nn-node-output {
  animation: nn-pulse 4s ease-in-out infinite;
}

.nn-node-hidden {
  animation: nn-pulse-sm 5s ease-in-out infinite;
}

.nn-graph-wrapper {
  animation: nn-glow 6s ease-in-out infinite;
}

/* Connection shimmer */
@keyframes conn-shimmer {
  0% { stroke-dashoffset: 200; }
  100% { stroke-dashoffset: 0; }
}

.nn-connection.shimmer {
  stroke-dasharray: 8 12;
  animation: conn-shimmer 4s linear infinite;
}


/* ═══════════════════════════════════════════════════
   2. DATA FLOW PIPELINE
   ═══════════════════════════════════════════════════ */

.pipeline-graph {
  width: 100%;
  max-width: 800px;
  height: auto;
  margin: 0 auto;
  display: block;
}

.pipeline-stage {
  transition: all 0.3s ease;
}

.pipeline-stage:hover {
  filter: drop-shadow(0 0 8px rgba(255, 102, 0, 0.2));
}

.pipeline-arrow {
  fill: none;
  stroke: #D1D5DB;
  stroke-width: 2;
  stroke-dasharray: 6 4;
}

.pipeline-arrow.active {
  stroke: var(--primary, #FF6600);
  stroke-dasharray: none;
}

@keyframes flow-right {
  0% { stroke-dashoffset: 40; }
  100% { stroke-dashoffset: 0; }
}

.pipeline-arrow.animated {
  stroke-dasharray: 8 8;
  animation: flow-right 1.5s linear infinite;
}

.pipeline-dot {
  fill: var(--primary, #FF6600);
  opacity: 0;
}

@keyframes pipeline-dot-flow {
  0% { opacity: 0; transform: translateX(0); }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { opacity: 0; transform: translateX(160px); }
}

.pipeline-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-anchor: middle;
}

.pipeline-sublabel {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 9px;
  fill: #9CA3AF;
  text-anchor: middle;
}


/* ═══════════════════════════════════════════════════
   3. ECOSYSTEM CONSTELLATION
   ═══════════════════════════════════════════════════ */

.constellation {
  width: 100%;
  max-width: 600px;
  height: auto;
  margin: 0 auto;
  display: block;
}

.constellation-line {
  stroke: #E5E7EB;
  stroke-width: 1;
  stroke-dasharray: 4 4;
  opacity: 0.6;
}

@keyframes constellation-pulse-line {
  0%, 100% { opacity: 0.3; stroke-dashoffset: 0; }
  50% { opacity: 0.7; stroke-dashoffset: 8; }
}

.constellation-line.animated {
  animation: constellation-pulse-line 4s ease-in-out infinite;
}

.constellation-node {
  transition: all 0.3s ease;
  cursor: default;
}

@keyframes orbit-slow {
  from { transform: rotate(0deg) translateX(3px) rotate(0deg); }
  to { transform: rotate(360deg) translateX(3px) rotate(-360deg); }
}

.constellation-orbit {
  animation: orbit-slow 30s linear infinite;
  transform-origin: center;
}

.constellation-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 600;
  fill: #374151;
  text-anchor: middle;
}

.constellation-sublabel {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 9px;
  fill: #9CA3AF;
  text-anchor: middle;
}


/* ═══════════════════════════════════════════════════
   4. ANIMATED METRIC COUNTERS
   ═══════════════════════════════════════════════════ */

@keyframes count-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.metric-animated {
  animation: count-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}


/* ═══════════════════════════════════════════════════
   5. FLOWING GRADIENT BORDERS
   ═══════════════════════════════════════════════════ */

@keyframes gradient-border-rotate {
  0% { --angle: 0deg; }
  100% { --angle: 360deg; }
}

.gradient-border {
  position: relative;
  background: white;
  border-radius: 16px;
  overflow: hidden;
}

.gradient-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: conic-gradient(
    from var(--angle, 0deg),
    #FF6600, #FFB380, #FF6600, #FFB380, #FF6600
  );
  border-radius: inherit;
  animation: gradient-border-rotate 6s linear infinite;
  z-index: -1;
}

@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}


/* ═══════════════════════════════════════════════════
   6. TYPING ANIMATION
   ═══════════════════════════════════════════════════ */

@keyframes typing-cursor {
  0%, 100% { border-right-color: transparent; }
  50% { border-right-color: var(--primary, #FF6600); }
}

.typing-effect {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid transparent;
  animation: typing-cursor 1s step-end infinite;
  width: 0;
}

.typing-effect.animate {
  animation: typing-expand 2s steps(40) forwards, typing-cursor 1s step-end infinite;
}

@keyframes typing-expand {
  from { width: 0; }
  to { width: 100%; }
}


/* ═══════════════════════════════════════════════════
   7. WAVE / CURVE ANIMATION
   ═══════════════════════════════════════════════════ */

.wave-line {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

@keyframes wave-draw {
  0% { stroke-dashoffset: 1000; }
  100% { stroke-dashoffset: 0; }
}

.wave-line.animate {
  stroke-dasharray: 1000;
  animation: wave-draw 3s ease-out forwards;
}

@keyframes wave-shift {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50px); }
}

.wave-continuous {
  animation: wave-shift 4s linear infinite;
}


/* ═══════════════════════════════════════════════════
   8. DEVICE MOCKUPS
   ═══════════════════════════════════════════════════ */

/* MacBook frame */
.macbook {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
}

.macbook-screen {
  background: #1a1a2e;
  border-radius: 12px 12px 0 0;
  padding: 8px;
  border: 2px solid #d1d5db;
  border-bottom: none;
  position: relative;
}

.macbook-screen::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  background: #4b5563;
  border-radius: 50%;
  margin: 0 auto 8px;
}

.macbook-screen-inner {
  border-radius: 6px;
  overflow: hidden;
}

.macbook-base {
  background: linear-gradient(180deg, #e5e7eb 0%, #d1d5db 100%);
  height: 18px;
  border-radius: 0 0 8px 8px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.macbook-base::before {
  content: '';
  width: 80px;
  height: 4px;
  background: #c4c8cd;
  border-radius: 2px;
}

.macbook-bottom {
  background: linear-gradient(180deg, #c4c8cd 0%, #b8bcc2 100%);
  height: 6px;
  border-radius: 0 0 12px 12px;
  margin: 0 40px;
}

/* Phone frame */
.phone {
  position: relative;
  width: 320px;
  margin: 0 auto;
}

.phone-frame {
  background: #f3f4f6;
  border-radius: 40px;
  padding: 12px;
  border: 3px solid #d1d5db;
  box-shadow: 0 20px 40px rgba(0,0,0,0.08), inset 0 0 0 1px rgba(255,255,255,0.5);
}

.phone-notch {
  width: 120px;
  height: 28px;
  background: #e5e7eb;
  border-radius: 0 0 16px 16px;
  margin: 0 auto 8px;
  position: relative;
}

.phone-notch::before {
  content: '';
  width: 10px;
  height: 10px;
  background: #374151;
  border-radius: 50%;
  position: absolute;
  right: 24px;
  top: 8px;
}

.phone-screen {
  background: #ffffff;
  border-radius: 28px;
  overflow: hidden;
  min-height: 540px;
}

.phone-home {
  width: 100px;
  height: 4px;
  background: #1f2937;
  border-radius: 2px;
  margin: 12px auto 4px;
}

/* Chat demo inside phone */
.chat-demo {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f3f4f6;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF6600, #FF8533);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
  font-weight: 700;
}

.chat-name {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

.chat-status {
  font-size: 11px;
  color: #10B981;
}

.chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
  animation: chat-appear 0.4s ease-out both;
}

.chat-bubble-user {
  background: #FF6600;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-bubble-ai {
  background: #f3f4f6;
  color: #374151;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

@keyframes chat-appear {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-bubble:nth-child(2) { animation-delay: 0.3s; }
.chat-bubble:nth-child(3) { animation-delay: 0.8s; }
.chat-bubble:nth-child(4) { animation-delay: 1.5s; }
.chat-bubble:nth-child(5) { animation-delay: 2.2s; }
.chat-bubble:nth-child(6) { animation-delay: 3s; }

.chat-typing {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  background: #f3f4f6;
  border-radius: 16px;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  width: fit-content;
}

.chat-typing span {
  width: 6px;
  height: 6px;
  background: #9ca3af;
  border-radius: 50%;
  animation: typing-dot 1.4s ease-in-out infinite;
}

.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Voice waveform */
.voice-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 30px;
  padding: 0 8px;
}

.voice-wave span {
  width: 3px;
  background: #FF6600;
  border-radius: 3px;
  animation: wave-bar 1.2s ease-in-out infinite;
}

.voice-wave span:nth-child(1) { height: 8px; animation-delay: 0s; }
.voice-wave span:nth-child(2) { height: 16px; animation-delay: 0.1s; }
.voice-wave span:nth-child(3) { height: 24px; animation-delay: 0.2s; }
.voice-wave span:nth-child(4) { height: 12px; animation-delay: 0.3s; }
.voice-wave span:nth-child(5) { height: 20px; animation-delay: 0.4s; }
.voice-wave span:nth-child(6) { height: 28px; animation-delay: 0.15s; }
.voice-wave span:nth-child(7) { height: 14px; animation-delay: 0.25s; }
.voice-wave span:nth-child(8) { height: 22px; animation-delay: 0.35s; }
.voice-wave span:nth-child(9) { height: 10px; animation-delay: 0.05s; }

@keyframes wave-bar {
  0%, 100% { transform: scaleY(0.4); opacity: 0.5; }
  50% { transform: scaleY(1); opacity: 1; }
}


/* ═══════════════════════════════════════════════════
   9. RESPONSIVE
   ═══════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .nn-graph { max-width: 100%; }
  .nn-label { font-size: 9px; }
  .nn-layer-label { font-size: 8px; }
  .pipeline-graph { max-width: 100%; }
  .constellation { max-width: 100%; }
}

@media (max-width: 480px) {
  .nn-graph-wrapper { display: none; }
  .pipeline-graph { display: none; }
}
