/* Portfolio Constellation — a 3D star atlas of every public repo.
   Adapted from ~/src/missionmap (constellation.css). Liquid-glass HUD,
   near-black sky, dependency-free. Time-lapse HUD removed; reuse panel added.
   Session: S-2026-07-12-1734-portfolio-constellation */
:root {
  --bg: #04060d;
  --glass-bg: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.015));
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-light: inset 0 1px 0 rgba(255, 255, 255, 0.13);
  --text: #e8edf7;
  --text-dim: #7d8bab;
  --text-faint: #4a5573;
  --accent: #5eead4;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
}

#sky { position: fixed; inset: 0; display: block; cursor: grab; }
#sky.dragging { cursor: grabbing; }
#sky.star-hover { cursor: pointer; }

/* ---------- liquid glass primitives ---------- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-light), 0 12px 44px rgba(0, 0, 0, 0.45);
}

/* ---------- top HUD ---------- */
#hud-top {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; padding: 14px 22px; z-index: 20;
  pointer-events: none; flex-wrap: wrap;
}
#hud-top > * { pointer-events: auto; }

.brand {
  display: flex; align-items: center; gap: 13px;
  padding: 9px 18px 9px 14px; border-radius: 18px;
  background: var(--glass-bg);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-light), 0 12px 44px rgba(0, 0, 0, 0.35);
}
.brand-mark {
  font-size: 20px; color: var(--accent);
  text-shadow: 0 0 10px rgba(94, 234, 212, 0.4);
  animation: pulse 4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
.brand h1 { font-size: 14px; letter-spacing: 0.28em; font-weight: 600; }
.brand .sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px; letter-spacing: 0.2em; color: var(--text-dim); margin-top: 3px;
}

.views {
  display: flex; gap: 2px; font-family: 'JetBrains Mono', monospace;
  font-size: 10px; letter-spacing: 0.16em; padding: 4px; border-radius: 22px;
}
.views a {
  color: var(--text-dim); text-decoration: none;
  padding: 7px 15px; border-radius: 18px; transition: all 0.18s;
}
.views a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.views a.current {
  color: var(--accent); background: rgba(94, 234, 212, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 0 16px rgba(94, 234, 212, 0.12);
}

.controls {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 16px 6px 6px; border-radius: 22px;
  background: var(--glass-bg);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-light), 0 12px 44px rgba(0, 0, 0, 0.35);
}
#search {
  background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px; color: var(--text); font-family: inherit; font-size: 12.5px;
  padding: 7px 15px; width: 190px; outline: none;
  transition: border-color 0.15s, width 0.2s, box-shadow 0.2s;
}
#search:focus {
  border-color: rgba(94, 234, 212, 0.5);
  box-shadow: 0 0 14px rgba(94, 234, 212, 0.12); width: 240px;
}

/* ---------- hint ---------- */
#hint {
  position: fixed; top: 78px; left: 50%; transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: 0.14em;
  color: var(--text-faint); z-index: 15; pointer-events: none; transition: opacity 1s;
  padding: 6px 16px; border-radius: 14px; background: rgba(8, 12, 24, 0.4); backdrop-filter: blur(8px);
}
#hint.faded { opacity: 0; }

/* ---------- zoom controls ---------- */
#zoomctl {
  position: fixed; right: 16px; bottom: 60px;
  display: flex; flex-direction: column; gap: 4px; padding: 5px; border-radius: 14px; z-index: 25;
}
#zoomctl button {
  width: 32px; height: 32px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-dim); font-size: 16px; line-height: 1; cursor: pointer; transition: all 0.15s;
}
#zoomctl button:hover {
  color: var(--text); background: rgba(255, 255, 255, 0.1); border-color: rgba(94, 234, 212, 0.35);
}

/* ---------- tooltip ---------- */
#tooltip {
  position: fixed; z-index: 30; pointer-events: none;
  background: linear-gradient(135deg, rgba(20, 28, 50, 0.85), rgba(10, 15, 30, 0.9));
  border: 1px solid var(--glass-border); border-radius: 14px; padding: 11px 15px; max-width: 280px;
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--glass-light), 0 12px 36px rgba(0, 0, 0, 0.6); transform: translate(14px, -50%);
}
#tooltip.hidden { display: none; }
#tooltip .t-name { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
#tooltip .t-cat {
  font-family: 'JetBrains Mono', monospace; font-size: 8.5px; letter-spacing: 0.16em; margin-bottom: 6px;
}
#tooltip .t-desc { font-size: 11.5px; line-height: 1.5; color: var(--text-dim); }
#tooltip .t-links {
  margin-top: 6px; font-family: 'JetBrains Mono', monospace; font-size: 9px; color: var(--text-faint);
}

/* ---------- bottom counter pill ---------- */
#counter {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: 0.1em;
  color: var(--text-dim); white-space: nowrap; z-index: 20;
  padding: 8px 16px; border-radius: 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid var(--glass-border); box-shadow: var(--glass-light), 0 12px 36px rgba(0, 0, 0, 0.4);
}
#counter b { color: var(--accent); font-weight: 500; }

/* ---------- detail panel ---------- */
#panel {
  position: fixed; top: 14px; right: 14px; bottom: 14px; width: 400px;
  max-width: calc(100vw - 28px); border-radius: 20px;
  background: linear-gradient(160deg, rgba(22, 30, 54, 0.82), rgba(10, 15, 30, 0.88));
  backdrop-filter: blur(26px) saturate(150%); -webkit-backdrop-filter: blur(26px) saturate(150%);
  border: 1px solid var(--glass-border); box-shadow: var(--glass-light), -18px 0 60px rgba(0, 0, 0, 0.5);
  z-index: 40; overflow-y: auto;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s;
}
#panel.hidden { transform: translateX(110%); opacity: 0; }
#panel-close {
  position: absolute; top: 14px; right: 14px;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%; width: 28px; height: 28px; color: var(--text-dim); font-size: 13px;
  cursor: pointer; z-index: 2; transition: all 0.15s;
}
#panel-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.1); }
#panel-body { padding: 26px 24px 40px; }

.panel-cat {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: 0.18em;
  color: var(--text-dim); margin-bottom: 10px;
}
.legend-dot { width: 9px; height: 9px; border-radius: 3px; }
#panel h2 { font-size: 22px; font-weight: 700; margin-bottom: 10px; word-break: break-word; }

.panel-badges { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.badge {
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px; padding: 4px 10px; border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.09); background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.badge.b-lang { color: var(--accent); border-color: rgba(94, 234, 212, 0.3); }

.gh-link {
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: 20px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.06em;
  color: var(--accent); text-decoration: none;
  padding: 8px 14px; border-radius: 14px;
  border: 1px solid rgba(94, 234, 212, 0.3); background: rgba(94, 234, 212, 0.06);
  transition: all 0.15s;
}
.gh-link:hover { background: rgba(94, 234, 212, 0.14); box-shadow: 0 0 18px rgba(94, 234, 212, 0.2); }

#panel .desc { font-size: 13.5px; line-height: 1.65; margin-bottom: 22px; }

#panel h3 {
  font-family: 'JetBrains Mono', monospace; font-size: 9.5px; font-weight: 500; letter-spacing: 0.2em;
  color: var(--text-faint); margin: 22px 0 10px; text-transform: uppercase;
}

.reuse-apply { font-size: 12.5px; line-height: 1.6; color: var(--text-dim); margin-bottom: 4px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; padding: 4px 9px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.07); color: var(--text-dim);
}
.chip.tag { color: var(--accent); border-color: rgba(94, 234, 212, 0.22); background: rgba(94, 234, 212, 0.05); }

.conn-list { list-style: none; }
.conn-list li {
  display: flex; align-items: baseline; gap: 8px; padding: 8px 11px; margin-bottom: 5px;
  background: rgba(255, 255, 255, 0.035); border-radius: 10px; font-size: 12.5px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.15s;
}
.conn-list li:hover { border-color: rgba(94, 234, 212, 0.45); background: rgba(94, 234, 212, 0.05); }
.conn-list .arrow { color: var(--text-faint); font-size: 11px; flex-shrink: 0; }
.conn-list .arrow.strong { color: var(--accent); }
.conn-list .cname { font-weight: 600; flex: 1; }
.conn-list .cscore { color: var(--text-faint); font-family: 'JetBrains Mono', monospace; font-size: 10px; }
.none-note { font-size: 12px; color: var(--text-faint); font-style: italic; }

@media (max-width: 760px) {
  #hint { display: none; }
  .brand .sub { display: none; }
}
