/* === BASE STYLES === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: #0a0a0f;
  color: #fff;
  overflow-x: hidden;
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
  width: 4px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.02);
  border-radius: 2px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(6,182,212,0.3);
  border-radius: 2px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(6,182,212,0.5);
}

/* === INTRO OVERLAY === */
.intro-energy {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(6,182,212,0.8) 0%, rgba(168,85,247,0.4) 40%, transparent 70%);
  animation: introPulse 1.5s ease-in-out infinite;
  position: relative;
}

.intro-energy::before {
  content: '';
  position: absolute;
  inset: -15px;
  border-radius: 50%;
  border: 1px solid rgba(6,182,212,0.3);
  animation: introRing 2s linear infinite;
}

.intro-energy::after {
  content: '';
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  border: 1px solid rgba(168,85,247,0.15);
  animation: introRing 3s linear infinite reverse;
}

@keyframes introPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
}

@keyframes introRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* === CURSOR GLOW === */
.cursor-glow {
  position: fixed;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168,85,247,0.08) 0%, rgba(6,182,212,0.04) 30%, transparent 70%);
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
}

/* === OBSIDIAN CRYSTAL 3D === */
.obsidian-crystal-container {
  width: 120px;
  height: 140px;
  perspective: 800px;
  position: relative;
}

.obsidian-crystal {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: crystalRotate 8s ease-in-out infinite;
}

.crystal-face {
  position: absolute;
  background: linear-gradient(135deg, rgba(30,20,50,0.9), rgba(10,10,25,0.95));
  border: 1px solid rgba(168,85,247,0.2);
  backdrop-filter: blur(10px);
}

.crystal-face.front {
  width: 120px; height: 140px;
  transform: translateZ(30px);
  background: linear-gradient(180deg, rgba(168,85,247,0.15), rgba(6,182,212,0.05));
  border-color: rgba(168,85,247,0.3);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.crystal-face.back {
  width: 120px; height: 140px;
  transform: translateZ(-30px);
  background: linear-gradient(0deg, rgba(168,85,247,0.1), rgba(6,182,212,0.05));
  border-color: rgba(168,85,247,0.15);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.crystal-face.left,
.crystal-face.right {
  width: 60px; height: 140px;
}

.crystal-face.left {
  transform: rotateY(-90deg) translateZ(30px);
  background: linear-gradient(180deg, rgba(168,85,247,0.1), rgba(10,10,25,0.9));
}

.crystal-face.right {
  transform: rotateY(90deg) translateZ(30px);
  background: linear-gradient(180deg, rgba(6,182,212,0.1), rgba(10,10,25,0.9));
}

.crystal-face.top {
  width: 120px; height: 60px;
  transform: rotateX(90deg) translateZ(0px);
  background: radial-gradient(circle, rgba(168,85,247,0.2), rgba(10,10,25,0.9));
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.crystal-face.bottom {
  width: 120px; height: 60px;
  transform: rotateX(-90deg) translateZ(70px);
  background: rgba(10,10,25,0.95);
}

.crystal-glow {
  position: absolute;
  inset: -40px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168,85,247,0.2) 0%, rgba(6,182,212,0.1) 30%, transparent 70%);
  animation: crystalGlow 3s ease-in-out infinite;
  filter: blur(20px);
}

@keyframes crystalRotate {
  0%, 100% { transform: rotateX(-15deg) rotateY(0deg); }
  25% { transform: rotateX(-20deg) rotateY(90deg); }
  50% { transform: rotateX(-15deg) rotateY(180deg); }
  75% { transform: rotateX(-20deg) rotateY(270deg); }
}

@keyframes crystalGlow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* === MINI OBSIDIAN FOR NODES === */
.mini-obsidian {
  width: 40px;
  height: 50px;
  position: relative;
  background: linear-gradient(180deg, rgba(168,85,247,0.3), rgba(10,10,25,0.9));
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  animation: miniCrystalPulse 3s ease-in-out infinite;
}

.mini-obsidian::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6,182,212,0.4), transparent);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  opacity: 0.5;
}

@keyframes miniCrystalPulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.05); filter: brightness(1.3); }
}

/* === BLACK HOLE === */
.black-hole-container {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.black-hole-core {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle, #000 0%, #0a0a0f 60%, rgba(168,85,247,0.3) 100%);
  position: absolute;
  z-index: 3;
  box-shadow: 0 0 30px rgba(168,85,247,0.4), 0 0 60px rgba(6,182,212,0.2);
}

.black-hole-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid;
}

.ring-1 {
  width: 120px;
  height: 120px;
  border-color: rgba(168,85,247,0.4);
  animation: bhRotate 6s linear infinite;
  box-shadow: 0 0 20px rgba(168,85,247,0.2);
}

.ring-1::before {
  content: '';
  position: absolute;
  top: -4px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a855f7;
  box-shadow: 0 0 10px #a855f7;
}

.ring-2 {
  width: 180px;
  height: 180px;
  border-color: rgba(6,182,212,0.25);
  animation: bhRotateReverse 10s linear infinite;
  box-shadow: 0 0 15px rgba(6,182,212,0.15);
}

.ring-2::before {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 30%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #06b6d4;
  box-shadow: 0 0 8px #06b6d4;
}

.ring-3 {
  width: 240px;
  height: 240px;
  border-color: rgba(236,72,153,0.15);
  animation: bhRotate 15s linear infinite;
  border-style: dashed;
  box-shadow: 0 0 10px rgba(236,72,153,0.1);
}

@keyframes bhRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes bhRotateReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

/* === HERO ANIMATIONS === */
.hero-title-line {
  opacity: 0;
  animation: heroFadeUp 1s ease-out forwards;
}

.hero-fade {
  opacity: 0;
  animation: heroFadeUp 1s ease-out forwards;
}

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

/* === SCROLL BOUNCE === */
@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

.animate-scroll-bounce {
  animation: scrollBounce 2s ease-in-out infinite;
}

/* === PULSE SLOW === */
@keyframes pulseSlow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-pulse-slow {
  animation: pulseSlow 3s ease-in-out infinite;
}

/* === SECTION REVEAL === */
.section-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* === ECOSYSTEM CARD === */
.ecosystem-card {
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.ecosystem-card:hover {
  transform: translateY(-4px);
}

/* === NODE CARD === */
.node-card {
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.node-card:hover {
  transform: translateY(-8px);
}

/* === FEED ITEM === */
.feed-item {
  opacity: 0;
  animation: feedSlideIn 0.5s ease-out forwards;
}

@keyframes feedSlideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* === CYBER BTN MAIN === */
.cyber-btn-main {
  position: relative;
  transition: all 0.3s;
}

.cyber-btn-main::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, rgba(168,85,247,0.5), rgba(6,182,212,0.5));
  opacity: 0;
  filter: blur(15px);
  transition: opacity 0.3s;
}

.cyber-btn-main:hover::before {
  opacity: 1;
}

/* === PARALLAX LAYER === */
.parallax-layer {
  position: absolute;
  inset: 0;
}

#layer1 {
  background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.15), transparent),
    radial-gradient(1px 1px at 40% 70%, rgba(255,255,255,0.1), transparent),
    radial-gradient(1px 1px at 60% 20%, rgba(255,255,255,0.12), transparent),
    radial-gradient(1px 1px at 80% 60%, rgba(255,255,255,0.08), transparent);
}

#layer2 {
  background-image:
    radial-gradient(1px 1px at 10% 80%, rgba(168,85,247,0.2), transparent),
    radial-gradient(1px 1px at 50% 40%, rgba(6,182,212,0.15), transparent),
    radial-gradient(1.5px 1.5px at 90% 10%, rgba(255,255,255,0.2), transparent),
    radial-gradient(1px 1px at 30% 50%, rgba(236,72,153,0.1), transparent);
}

#layer3 {
  background-image:
    radial-gradient(1.5px 1.5px at 70% 80%, rgba(255,255,255,0.25), transparent),
    radial-gradient(1px 1px at 20% 10%, rgba(255,255,255,0.15), transparent);
}

/* === GALAXY MAP === */
.galaxy-map-container {
  position: relative;
}

.galaxy-tooltip {
  position: absolute;
  transition: all 0.2s ease-out;
}

.galaxy-tooltip.visible {
  display: block;
}

/* === PING SLOW === */
@keyframes pingSlow {
  0% { transform: scale(1); opacity: 1; }
  75%, 100% { transform: scale(2); opacity: 0; }
}

.animate-ping-slow {
  animation: pingSlow 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* === NODE CARD NEURAL === */
.neural-node-card {
  position: relative;
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.neural-node-card:hover {
  transform: translateY(-6px);
}

.neural-node-card .neural-pulse-ring {
  position: absolute;
  inset: -3px;
  border-radius: 1rem;
  border: 1px solid transparent;
  transition: all 0.5s;
  opacity: 0;
}

.neural-node-card:hover .neural-pulse-ring {
  opacity: 1;
}

.neural-node-card .node-crystal {
  width: 36px;
  height: 44px;
  position: relative;
  background: linear-gradient(180deg, var(--node-color-40, rgba(168,85,247,0.4)), var(--node-color-10, rgba(168,85,247,0.1)));
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  animation: miniCrystalPulse 3s ease-in-out infinite;
}

.neural-node-card .connection-dots {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.neural-node-card .connection-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  opacity: 0.4;
  transition: all 0.3s;
}

.neural-node-card:hover .connection-dot {
  opacity: 1;
  animation: connectionPulse 1.5s ease-in-out infinite;
}

@keyframes connectionPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.5); }
}

/* === WORMHOLE === */
#wormholeOverlay {
  background: #0a0a0f;
}

#wormholeOverlay.active {
  pointer-events: all;
  opacity: 1;
}

#wormholeLabel {
  text-shadow: 0 0 20px rgba(6,182,212,0.5), 0 0 40px rgba(168,85,247,0.3);
}

/* === NODE MODAL === */
#nodeModal.active {
  display: block;
}

#nodeModal.active #nodeModalContent {
  transform: scale(1);
  opacity: 1;
}

.modal-connection-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 9999px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  transition: all 0.3s;
  cursor: pointer;
}

.modal-connection-tag:hover {
  transform: scale(1.05);
}

.modal-activity-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
}

/* === NEURAL LINK LINE === */
.neural-link-indicator {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--link-color, rgba(168,85,247,0.3)) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.5s;
}

.neural-node-card:hover ~ .neural-link-indicator,
.neural-node-card:hover + .neural-link-indicator {
  opacity: 1;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .obsidian-crystal-container {
    width: 80px;
    height: 100px;
  }

  .crystal-face.front,
  .crystal-face.back {
    width: 80px;
    height: 100px;
  }

  .crystal-face.left,
  .crystal-face.right {
    width: 40px;
    height: 100px;
  }

  .crystal-face.top {
    width: 80px;
    height: 40px;
  }

  .crystal-face.bottom {
    width: 80px;
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}