/* ============================================
   PROJECT NEBULA — Constellation Portfolio
   ============================================ */

/* --- Section Layout --- */
#projects {
  position: relative;
  overflow: hidden;
}

.nebula-section-header {
  padding: 60px 40px 30px;
}

.nebula-section-header .section-label {
  font-family: "Space Mono", monospace;
  font-size: 0.85rem;
  letter-spacing: -0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: block;
}

.nebula-section-header h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  letter-spacing: -0.03em;
}

.nebula-section-header h2 span {
  background: linear-gradient(135deg, #818cf8, #c084fc, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- Filter Buttons --- */
.nebula-filters {
  display: flex;
  gap: 8px;
  padding: 0 40px 20px;
  flex-wrap: wrap;
}

.nebula-filter-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 20px;
  font-family: "Space Mono", monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.nebula-filter-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(129, 140, 248, 0.15),
    rgba(192, 132, 252, 0.15)
  );
  opacity: 0;
  transition: opacity 0.35s ease;
}

.nebula-filter-btn:hover {
  border-color: rgba(129, 140, 248, 0.4);
  color: var(--text-main);
}

.nebula-filter-btn:hover::before {
  opacity: 1;
}

.nebula-filter-btn.active {
  border-color: #818cf8;
  color: #fff;
  background: rgba(129, 140, 248, 0.12);
  box-shadow:
    0 0 20px rgba(129, 140, 248, 0.15),
    inset 0 0 20px rgba(129, 140, 248, 0.05);
}

.nebula-filter-btn.active::before {
  opacity: 1;
}

/* --- Canvas Container --- */
#nebula-container {
  position: relative;
  width: 100%;
  height: 65vh;
  min-height: 450px;
  max-height: 700px;
  overflow: hidden;
  background: radial-gradient(
    ellipse at center,
    rgba(79, 70, 229, 0.04) 0%,
    rgba(5, 5, 5, 0) 70%
  );
}

#nebula-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* --- Hover Card --- */
#nebula-hover-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 280px;
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid rgba(129, 140, 248, 0.3);
  padding: 20px;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.01s linear,
    border-color 0.3s ease;
  z-index: 50;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(129, 140, 248, 0.08);
}

#nebula-hover-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(129, 140, 248, 0.6),
    transparent
  );
}

#nebula-card-category {
  font-family: "Space Mono", monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #818cf8;
  margin-bottom: 8px;
  padding: 3px 8px;
  border: 1px solid rgba(129, 140, 248, 0.3);
  display: inline-block;
}

#nebula-card-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

#nebula-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

#nebula-card-techs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.nebula-tech-chip {
  font-family: "Space Mono", monospace;
  font-size: 0.65rem;
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: rgba(255, 255, 255, 0.03);
}

/* --- Floating Node Labels --- */
#nebula-labels {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.nebula-label {
  position: absolute;
  font-family: "Space Mono", monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transform: translateX(-50%);
  transition: opacity 0.4s ease;
  white-space: nowrap;
  text-shadow: 0 0 15px rgba(0, 0, 0, 0.8);
}

/* --- Click hint --- */
.nebula-hint {
  text-align: center;
  padding: 12px 40px 40px;
  font-family: "Space Mono", monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  opacity: 0.5;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nebula-hint i {
  margin-right: 6px;
  animation: hint-pulse 2s ease-in-out infinite;
}

@keyframes hint-pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* --- Project data (hidden) --- */
.nebula-project-data {
  display: none;
}

/* --- Ambient nebula background effect --- */
.nebula-ambient {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 600px;
  height: 600px;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    circle,
    rgba(79, 70, 229, 0.06) 0%,
    rgba(139, 92, 246, 0.03) 30%,
    rgba(236, 72, 153, 0.02) 50%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
  animation: nebula-rotate 60s linear infinite;
}

@keyframes nebula-rotate {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .nebula-section-header {
    padding: 40px 20px 20px;
  }

  .nebula-filters {
    padding: 0 20px 16px;
    gap: 6px;
  }

  .nebula-filter-btn {
    padding: 6px 14px;
    font-size: 0.65rem;
  }

  #nebula-container {
    height: 55vh;
    min-height: 380px;
  }

  #nebula-hover-card {
    width: 220px;
    padding: 14px;
  }

  #nebula-card-title {
    font-size: 1rem;
  }

  #nebula-card-desc {
    font-size: 0.75rem;
  }

  .nebula-hint {
    padding: 8px 20px 30px;
    font-size: 0.6rem;
  }

  .nebula-ambient {
    width: 350px;
    height: 350px;
  }

  .nebula-label {
    font-size: 0.6rem;
  }
}

@media (max-width: 480px) {
  #nebula-container {
    height: 50vh;
    min-height: 320px;
  }
}
