/* 
   Deep Mind Dive - Design System & Custom Animations
   Author: Hossain Mahfuj (Neuro-Digital Architect)
*/

@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=IBM+Plex+Mono:wght@400;500;700&family=Space+Grotesk:wght@400;500;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap');

:root {
  /* Color System */
  --bg-abyssal: #000000;
  --color-primary: #C6FF33;
  --glow-color: 198, 255, 51;
  --panel-surface: #d9d9d9;
  --color-secondary: #c6ff33;
  --color-tertiary: #000000;
  --color-accent: #000000;
  
  --surface-low: rgba(255, 255, 255, 0.04);
  --surface-medium: rgba(var(--glow-color), 0.12);
  --surface-high: rgba(198, 255, 51, 0.12);
  --on-surface: #000000;
  --on-surface-variant: rgba(0, 0, 0, 0.7);
  --outline: rgba(255, 255, 255, 0.22);
  --outline-active: rgba(var(--glow-color), 0.75);

  /* Spacing */
  --margin-desktop: 64px;
  --margin-mobile: 20px;
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

html {
  background-color: var(--bg-abyssal);
}

body {
  background-color: var(--panel-surface);
  color: var(--on-surface);
  font-family: 'Space Grotesk', sans-serif;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  margin: 28px;
  border: 28px solid var(--bg-abyssal);
  border-radius: 6px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.9);
}
::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 9999px;
  box-shadow: 0 0 10px var(--color-primary);
}

/* Typography Utility */
.font-display {
  font-family: 'Archivo Black', sans-serif;
}
.font-technical {
  font-family: 'IBM Plex Mono', monospace;
}

/* Bioluminescent Effects & Glows */
.text-glow-primary {
  text-shadow: 0 0 12px rgba(var(--glow-color), 0.8), 0 0 28px rgba(var(--glow-color), 0.35);
}

.text-glow-secondary {
  text-shadow: 0 0 12px rgba(198, 255, 51, 0.75), 0 0 24px rgba(198, 255, 51, 0.32);
}

.text-glow-tertiary {
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 20px rgba(255, 255, 255, 0.24);
}

@media (max-width: 767px) {
  .text-glow-primary,
  .text-glow-secondary,
  .text-glow-tertiary {
    text-shadow: 0 0 8px rgba(var(--glow-color), 0.45), 0 0 14px rgba(var(--glow-color), 0.18);
  }

  .font-display.text-4xl,
  .font-display.text-5xl,
  .font-display.text-6xl,
  .font-display.text-7xl,
  .font-display.text-8xl {
    letter-spacing: -0.02em;
  }
}

.glow-border-primary {
  border: 1px solid rgba(var(--glow-color), 0.28);
  box-shadow: 0 0 15px rgba(var(--glow-color), 0.12);
  transition: all 0.5s ease;
}
.glow-border-primary:hover {
  border-color: rgba(var(--glow-color), 1);
  box-shadow: 0 0 25px rgba(var(--glow-color), 0.4);
}

.glow-border-secondary {
  border: 1px solid rgba(198, 255, 51, 0.24);
  box-shadow: 0 0 15px rgba(198, 255, 51, 0.12);
  transition: all 0.5s ease;
}
.glow-border-secondary:hover {
  border-color: rgba(198, 255, 51, 1);
  box-shadow: 0 0 25px rgba(198, 255, 51, 0.35);
}

/* Glassmorphism Classes */
.glass-panel {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: var(--surface-low);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.glass-orb {
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.02);
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-node {
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  background: rgba(0, 0, 0, 0.85);
  border: 1.5px solid rgba(var(--glow-color, 198, 255, 51), 0.38);
  box-shadow: 0 0 20px rgba(var(--glow-color, 198, 255, 51), 0.14);
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.glass-node:hover {
  background: rgba(var(--glow-color, 198, 255, 51), 0.14);
  border-color: rgba(var(--glow-color, 198, 255, 51), 1);
  box-shadow: 0 0 45px rgba(var(--glow-color, 198, 255, 51), 0.45);
  transform: scale(1.12) translateY(-4px);
}

.glass-node .dimension-label {
  opacity: 0;
  transform: translateY(12px);
  transition: all 0.4s ease;
}

.glass-node:hover .dimension-label {
  opacity: 1;
  transform: translateY(0);
}

/* Animations */
@keyframes spin-clockwise {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spin-counter {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(var(--glow-color), 0.35), inset 0 0 10px rgba(var(--glow-color), 0.16);
    border-color: rgba(var(--glow-color), 0.5);
  }
  50% {
    box-shadow: 0 0 35px rgba(var(--glow-color), 0.8), inset 0 0 20px rgba(var(--glow-color), 0.48);
    border-color: rgba(var(--glow-color), 1);
  }
}

.pulse-glow {
  animation: pulse-glow 3s infinite ease-in-out;
}

/* DNA Animation */
@keyframes helix-spin {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(360deg); }
}
.helix-container {
  perspective: 1000px;
}
.helix-svg {
  animation: helix-spin 12s linear infinite;
  transform-style: preserve-3d;
}

/* AI Neural Pulse */
@keyframes neural-fire {
  0%, 100% {
    background-color: rgba(198, 255, 51, 0.08);
    box-shadow: 0 0 0px rgba(198, 255, 51, 0);
    transform: scale(1);
  }
  15% {
    background-color: var(--color-tertiary);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.7);
    transform: scale(1.35);
  }
}
.node-pulse {
  animation: neural-fire 1.2s infinite ease-in-out;
}

/* Cyber Matrix Column */
.matrix-column {
  position: absolute;
  top: -120px;
  color: var(--color-primary);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  line-height: 1.1;
  writing-mode: vertical-rl;
  text-orientation: upright;
  animation: matrix-fall linear infinite;
  pointer-events: none;
  opacity: 0.85;
}
@keyframes matrix-fall {
  0% { transform: translateY(-100px); opacity: 0; }
  10% { opacity: 0.8; }
  90% { opacity: 0.8; }
  100% { transform: translateY(115vh); opacity: 0; }
}

@keyframes scan-horizontal {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100vw); }
}
.scan-line-horizontal {
  height: 100%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--color-secondary), transparent);
  position: absolute;
  left: 0;
  top: 0;
  animation: scan-horizontal 5s infinite linear;
  z-index: 5;
  pointer-events: none;
}

/* Web Particle Streams */
@keyframes bezier-flow {
  0% { stroke-dashoffset: 1000; opacity: 0; }
  10% { opacity: 0.7; }
  90% { opacity: 0.7; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
.stream-line {
  stroke-dasharray: 1000;
  animation: bezier-flow 8s infinite linear;
}

/* Prompts Floating Orbs */
@keyframes token-float {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.3; }
  50% { transform: translate(15px, -25px) scale(1.15); opacity: 0.7; }
}
.token-orb {
  animation: token-float 5s infinite alternate ease-in-out;
}

/* Shard Rising (Work section) */
@keyframes shard-rise {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  15% { opacity: 0.5; }
  85% { opacity: 0.5; }
  100% { transform: translateY(-20vh) rotate(360deg); opacity: 0; }
}
.shard {
  position: absolute;
  background: linear-gradient(to top, var(--color-primary), transparent);
  width: 2px;
  height: 70px;
  animation: shard-rise linear infinite;
  pointer-events: none;
}

/* Contact Routing Packets */
@keyframes packet-move {
  0% { transform: translate(0, 0); opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translate(var(--tw-translate-x), var(--tw-translate-y)); opacity: 0; }
}
.data-packet {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-primary);
  position: absolute;
  animation: packet-move 3.5s infinite linear;
  filter: blur(0.5px) drop-shadow(0 0 3px var(--color-primary));
}

/* Tendril drawing on Hub */
.tendril {
  stroke-dasharray: 1000;
  stroke-dashoffset: 1000;
  animation: flow-path 16s linear infinite;
  opacity: 0.22;
  transition: opacity 0.5s ease;
}
@keyframes flow-path {
  to { stroke-dashoffset: 0; }
}

.axon-pulse {
  offset-path: path(var(--path));
  animation: pulse-travel var(--travel-duration, 5s) linear infinite;
}
@keyframes pulse-travel {
  0% { offset-distance: 0%; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}

canvas#neural-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Input elements styling */
input, textarea {
  border-bottom: 1px solid var(--outline) !important;
}
input:focus, textarea:focus {
  border-bottom: 1px solid var(--color-primary) !important;
  box-shadow: 0 4px 12px -4px rgba(var(--glow-color), 0.2);
}

/* Floating overlay grain */
.overlay-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.02;
  z-index: 100;
  background-image: url('https://www.transparenttextures.com/patterns/stardust.png');
}

/* Organic drifting motion for background pathways */
@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(6px, -6px); }
}
#axon-paths {
  animation: drift 12s ease-in-out infinite;
}
