/* ─── Global Reset & Theme ───────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: radial-gradient(circle at center, #0a0518 0%, #020308 100%);
  color: #e0ccff;
  font-family: 'Inter', sans-serif;
  height: 100vh;
  overflow: hidden;
}

#bg-canvas {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
}

.name-tag {
  position: fixed; top: 30px; left: 42px;
  font-family: 'Syne', sans-serif; font-weight: 800;
  font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase;
  color: #b38bff;
  z-index: 50; pointer-events: none;
  text-shadow: 0 0 15px rgba(150, 50, 255, 0.5);
}

.hint {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: rgba(180, 100, 255, 0.22);
  letter-spacing: 0.12em; text-transform: uppercase;
  pointer-events: none; z-index: 50;
}

/* ─── Graphs & Lines ────────────────────────────────────────── */
#graph {
  position: fixed; inset: 0; z-index: 10;
  transition: opacity 0.45s ease;
}

#lines, #tech-svg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; overflow: visible;
}

.edge, .tech-edge { 
  stroke: rgba(150, 100, 255, 0.15); 
  stroke-width: 1; fill: none; stroke-dasharray: 4 6;
  animation: dataFlow 130s linear infinite; 
}

.edge-bright, .tech-edge-bright { 
  stroke: rgba(180, 120, 255, 0.35); 
  stroke-width: 1.2; fill: none; stroke-dasharray: 8 12;
  filter: drop-shadow(0 0 5px rgba(180, 100, 255, 0.4)); 
  animation: dataFlow 120s linear infinite reverse; 
}

@keyframes dataFlow { to { stroke-dashoffset: 1000; } }

/* ─── Unified Glass Nodes ───────────────────────────────────── */
.node, .tech-result-node, .tech-center-node {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 20;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.node-circle, .tech-result-circle, .tech-center-circle {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  width: 110px; height: 110px; border-radius: 50%;
  background: rgba(45, 10, 80, 0.15); 
  backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid rgba(180, 100, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 0 15px rgba(180, 100, 255, 0.1);
}

.node:hover, .tech-result-node:hover {
  z-index: 30;
  transform: translate(-50%, -58%) scale(1.08);
}

.node-label, .tech-result-title, .tech-center-label {
  font-family: 'Syne', sans-serif;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: #e0ccff; text-align: center; padding: 0 10px; line-height: 1.3;
}

.node-hint, .tech-result-section {
  font-size: 9px; font-weight: 400; 
  color: rgba(180, 130, 255, 0.5);
  letter-spacing: 0.08em; text-transform: uppercase;
  text-align: center; margin-bottom: 4px;
}

.node.center, .tech-center-node { z-index: 25; }
.node.center .node-circle, .tech-center-circle {
  width: 130px; height: 130px;
  background: rgba(120, 50, 255, 0.1);
  border: 1px solid rgba(200, 150, 255, 0.5);
}

.node.center::before {
  content: ''; position: absolute; inset: -16px; border-radius: 50%;
  border: 1px solid rgba(180, 100, 255, 0.2);
  animation: ringPulse 3.5s ease-out infinite; pointer-events: none;
}
@keyframes ringPulse {
  0%   { opacity: 0.8; transform: scale(0.93); }
  100% { opacity: 0;   transform: scale(1.18); }
}

/* ─── Modern Section Panel ───────────────────────────────────── */
#panel {
  position: fixed; inset: 0; 
  background: linear-gradient(135deg, #020308 0%, #0a0518 100%);
  z-index: 100; display: flex; flex-direction: column;
  opacity: 0; pointer-events: none;
  transform: scale(1.05);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
#panel.active { opacity: 1; pointer-events: all; transform: scale(1); }

.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 40px 60px;
  border-bottom: 1px solid rgba(180, 100, 255, 0.08);
}

.panel-title {
  font-family: 'Syne', sans-serif; font-size: 32px; font-weight: 800;
  background: linear-gradient(to right, #fff, #b38bff);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.back-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(180, 100, 255, 0.2);
  color: #b38bff; font-family: 'Inter', sans-serif;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.15em; padding: 12px 24px; border-radius: 12px;
  cursor: pointer; transition: all 0.3s ease; backdrop-filter: blur(10px);
}

.back-btn:hover {
  background: rgba(180, 100, 255, 0.1); border-color: #b38bff;
  color: #fff; transform: translateX(-5px);
}

.panel-body {
  flex: 1; overflow-y: auto; padding: 60px;
  max-width: 1000px; margin: 0 auto; width: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(179, 139, 255, 0.3) transparent;
}

.panel-body::-webkit-scrollbar {
  width: 4px;
}

.panel-body::-webkit-scrollbar-track {
  background: transparent;
}

.panel-body::-webkit-scrollbar-thumb {
  background: rgba(179, 139, 255, 0.3);
  border-radius: 100px;
}

.panel-body::-webkit-scrollbar-thumb:hover {
  background: rgba(179, 139, 255, 0.7);
}

.card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(180, 100, 255, 0.1);
  padding: 30px; margin-bottom: 20px; border-radius: 20px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(180, 100, 255, 0.3);
  transform: translateY(-5px);
}

.card-meta {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.2em;
  color: #b38bff; margin-bottom: 12px;
}

.card-title {
  font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 700;
  color: #fff; margin-bottom: 10px;
}

.card-body {
  font-size: 14px; color: rgba(224, 204, 255, 0.6);
  line-height: 1.6; margin-bottom: 20px;
}

/* ─── Ultra Modern Modal ─────────────────────────────────────── */
#card-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(2, 1, 6, 0.85); backdrop-filter: blur(25px);
  z-index: 300; display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: all 0.4s ease;
}
#card-modal-overlay.active { opacity: 1; pointer-events: all; }

#card-modal {
  background: linear-gradient(160deg, rgba(30, 15, 60, 0.7) 0%, rgba(10, 5, 20, 0.95) 100%);
  border: 1px solid rgba(180, 100, 255, 0.3);
  border-radius: 32px; padding: 50px; max-width: 600px; width: 90%;
  position: relative; transform: translateY(30px) scale(0.95);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex; flex-direction: column;
}

#card-modal-overlay.active #card-modal { transform: translateY(0) scale(1); }

.modal-close {
  position: absolute; top: 25px; right: 25px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff; width: 36px; height: 36px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}

.modal-meta { color: #b38bff; font-size: 11px; font-weight: 700; letter-spacing: 0.3em; margin-bottom: 15px; }
.modal-title { font-family: 'Syne', sans-serif; font-size: 32px; font-weight: 800; color: #fff; margin-bottom: 20px; }
.modal-body { font-size: 15px; color: rgba(224, 204, 255, 0.7); line-height: 1.7; margin-bottom: 30px; }

.modal-tags { 
  display: flex; flex-wrap: wrap; gap: 8px; 
  margin-bottom: 40px; border-top: 1px solid rgba(180, 100, 255, 0.1); padding-top: 20px;
}

.tags {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
}

.tag, .modal-tag {
  font-size: 9px; font-weight: 700; padding: 6px 14px;
  background: rgba(179, 139, 255, 0.05); border: 1px solid rgba(179, 139, 255, 0.2);
  color: rgba(179, 139, 255, 0.8); border-radius: 100px; cursor: pointer; text-transform: uppercase;
  transition: all 0.25s ease;
}

.tag:hover, .modal-tag:hover {
  background: rgba(179, 139, 255, 0.18);
  border-color: #b38bff;
  color: #fff;
  box-shadow: 0 0 12px rgba(179, 139, 255, 0.4), 0 0 24px rgba(179, 139, 255, 0.15);
  transform: translateY(-1px);
}

.modal-link-btn {
  align-self: flex-start; display: inline-flex; align-items: center;
  padding: 16px 32px; background: #b38bff; color: #0a0518;
  text-decoration: none; font-size: 12px; font-weight: 800;
  border-radius: 16px; text-transform: uppercase; transition: all 0.3s;
}

.modal-link-btn:hover { transform: scale(1.05) translateY(-2px); background: #fff; }

/* ─── Tech Overlay Fixes (CRITICAL) ─────────────────────────── */
#tech-canvas-wrap {
  position: relative;
  flex: 1;
  width: 100%;
  overflow: hidden;
}

#tech-overlay {
  position: fixed; inset: 0; 
  background: radial-gradient(circle at center, #0a0518 0%, #020308 100%);
  z-index: 400; display: none; flex-direction: column;
}

#tech-overlay.active { display: flex; }

#tech-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 40px 60px; z-index: 10;
}

#tech-tag-badge {
  font-size: 14px; font-weight: 800; color: #fff;
  background: rgba(179, 139, 255, 0.2); padding: 8px 20px;
  border-radius: 100px; border: 1px solid #b38bff; font-family: 'Syne', sans-serif;
}

#tech-subtitle { margin-left: 15px; font-size: 12px; color: rgba(180,100,255,0.5); text-transform: uppercase; letter-spacing: 2px;}

/* Hide nodes if overlay is not active */
#tech-overlay:not(.active) .tech-result-node,
#tech-overlay:not(.active) .tech-center-node {
  display: none;
}

.tooltip {
  position: fixed; background: rgba(15, 10, 25, 0.95);
  border: 1px solid rgba(180, 100, 255, 0.3);
  padding: 8px 15px; font-size: 11px; color: #dccaff;
  pointer-events: none; opacity: 0; border-radius: 6px;
  backdrop-filter: blur(8px); z-index: 999;
}