/* ============================================================
   PROJECT NEXUS — Cyberpunk HUD Theme
   ============================================================ */

:root {
  /* Jemira Labs brand system — "Deep Void" / "Solar Eclipse" (Archetype 5: Jewel & Luxury) */
  --bg-void: #050505;
  --bg-panel: #0a0a0a;
  --bg-panel-2: #121212;
  --brand: #f59e0b;        /* brand primary (amber) — reused as the "signal" accent */
  --brand-dim: #d97706;    /* brand primary_hover */
  --gold: #fcd34d;      /* brand accent (light gold) — secondary accent */
  --gold-2: #fcd34d;
  --amber: #f59e0b;
  --green: #39ff8a;
  --red: #ff3b5c;
  --grey: #6b7280;
  --text-hi: #f3f4f6;
  --text-mid: #9ca3af;
  --text-dim: #6b7280;
  --border-glow: rgba(245, 158, 11, 0.4);
  --font-display: 'Outfit', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-void);
  color: var(--text-hi);
  font-family: var(--font-body);
  overflow-x: hidden;
  min-height: 100%;
}

::selection { background: var(--brand); color: #001015; }

html { scrollbar-width: thin; scrollbar-color: rgba(245,158,11,0.45) transparent; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(245,158,11,0.4);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(245,158,11,0.65); }

/* ---------------- Background canvas + overlays ---------------- */

#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(245, 158, 11,0.08), transparent 60%),
    radial-gradient(ellipse 70% 50% at 100% 100%, rgba(252, 211, 77,0.10), transparent 60%),
    var(--bg-void);
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse 120% 100% at 50% 50%, transparent 60%, rgba(0,0,0,0.45) 100%);
}

/* ---------------- Boot screen ---------------- */

#boot-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg-void);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
#boot-screen.boot-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#app {
  position: relative;
  z-index: 3;
  transition: opacity 0.7s ease;
}
#app.app-hidden { opacity: 0; }

/* ---------------- HUD bar ---------------- */

.hud-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 32px;
  border-bottom: 1px solid rgba(245, 158, 11,0.18);
  background: linear-gradient(to bottom, rgba(10,10,10,0.9), rgba(10,10,10,0.4));
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.hud-logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 3px;
}
.logo-bracket { color: var(--gold); }
.logo-text {
  color: var(--text-hi);
  text-shadow: 0 0 12px rgba(245,158,11,0.45);
}
.hud-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-top: 2px;
}
.hud-sub-link {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}
.hud-sub-link:hover {
  color: var(--brand);
  text-shadow: 0 0 8px rgba(245,158,11,0.5);
}
.hud-right {
  display: flex;
  align-items: center;
  gap: 24px;
}
.hud-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--green);
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green), 0 0 16px var(--green);
  animation: pulse-dot 1.8s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}
.hud-clock-block {
  text-align: right;
  line-height: 1.4;
}
.hud-date {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--text-dim);
}
.hud-clock {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--brand);
  letter-spacing: 2px;
  text-shadow: 0 0 8px var(--brand-dim);
}

/* ---------------- Hero ---------------- */

.hero {
  position: relative;
  text-align: center;
  padding: 72px 24px 40px;
  overflow: hidden;
}
.hero-grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(245, 158, 11,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 158, 11,0.06) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 70% 100% at 50% 30%, black 30%, transparent 75%);
  pointer-events: none;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(36px, 6.5vw, 68px);
  letter-spacing: 2px;
  margin: 0;
  position: relative;
  color: var(--text-hi);
  text-shadow: 0 0 28px rgba(245,158,11,0.28);
}
.hero-subtitle {
  font-family: var(--font-body);
  color: var(--text-mid);
  letter-spacing: 0;
  font-size: 16px;
  margin-top: 14px;
}

/* ---------------- Stats row ---------------- */

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto 48px;
  padding: 0 24px;
}
.stat-tile {
  position: relative;
  background: linear-gradient(160deg, rgba(18,18,18,0.85), rgba(10,10,10,0.85));
  border: 1px solid rgba(245, 158, 11,0.15);
  padding: 22px 18px;
  text-align: center;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}
.stat-tile:hover {
  border-color: var(--brand);
  box-shadow: 0 0 26px rgba(245, 158, 11,0.18);
  transform: translateY(-2px);
}
.stat-value {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 700;
  color: var(--brand);
  text-shadow: 0 0 14px rgba(245, 158, 11,0.35);
}
.stat-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-top: 6px;
}
.stat-corner {
  position: absolute;
  width: 10px; height: 10px;
  border-color: var(--gold);
  opacity: 0.8;
}
.stat-corner.tl { top: -1px; left: -1px; border-top: 2px solid; border-left: 2px solid; }
.stat-corner.tr { top: -1px; right: -1px; border-top: 2px solid; border-right: 2px solid; }
.stat-corner.bl { bottom: -1px; left: -1px; border-bottom: 2px solid; border-left: 2px solid; }
.stat-corner.br { bottom: -1px; right: -1px; border-bottom: 2px solid; border-right: 2px solid; }

/* ---------------- Tech Arsenal ---------------- */

.arsenal-section {
  max-width: 1200px;
  margin: 0 auto 48px;
  padding: 0 24px;
}
.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 1.5px;
  color: var(--text-hi);
  margin-bottom: 20px;
}
.section-heading-glyph {
  color: var(--brand);
  text-shadow: 0 0 8px rgba(245,158,11,0.5);
}
.section-heading-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(245,158,11,0.35), transparent);
}

.arsenal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.arsenal-card {
  position: relative;
  background: linear-gradient(160deg, rgba(18,18,18,0.85), rgba(8,8,8,0.9));
  border: 1px solid rgba(245,158,11,0.14);
  padding: 18px 18px 16px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
.arsenal-card:hover {
  border-color: var(--brand);
  box-shadow: 0 0 22px rgba(245,158,11,0.12);
  transform: translateY(-2px);
}
.arsenal-corner {
  position: absolute;
  width: 10px; height: 10px;
  border-color: var(--gold);
  opacity: 0.7;
}
.arsenal-corner.tl { top: -1px; left: -1px; border-top: 2px solid; border-left: 2px solid; }
.arsenal-corner.br { bottom: -1px; right: -1px; border-bottom: 2px solid; border-right: 2px solid; }

.arsenal-category {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}
.arsenal-items {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.arsenal-pill {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-mid);
  background: rgba(245,158,11,0.06);
  border: 1px solid rgba(245,158,11,0.22);
  padding: 4px 10px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.arsenal-pill:hover {
  color: var(--brand);
  border-color: var(--brand);
}

/* ---------------- Controls ---------------- */

.controls {
  max-width: 1200px;
  margin: 0 auto 36px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.search-wrap {
  position: relative;
  max-width: 420px;
}
.search-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: var(--brand-dim);
}
#search-input {
  width: 100%;
  background: rgba(10,10,10,0.8);
  border: 1px solid rgba(245, 158, 11,0.25);
  color: var(--text-hi);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.3px;
  padding: 12px 14px 12px 40px;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}
#search-input::placeholder { color: var(--text-dim); }
#search-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 16px rgba(245, 158, 11,0.25);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chip {
  font-family: var(--font-body);
  font-size: 13px;
  letter-spacing: 0;
  color: var(--text-mid);
  background: rgba(18,18,18,0.6);
  border: 1px solid rgba(92,112,128,0.3);
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.chip.active {
  background: rgba(245, 158, 11,0.12);
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: 0 0 12px rgba(245, 158, 11,0.2);
}
.status-chip .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.dot-live { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot-dev { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.dot-offline { background: var(--grey); }
.dot-archived { background: var(--gold); box-shadow: 0 0 6px var(--gold); }

/* ---------------- Project grid ---------------- */

.project-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 40px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.project-card {
  position: relative;
  background: linear-gradient(155deg, rgba(18,18,18,0.9), rgba(10,10,10,0.92));
  border: 1px solid rgba(245, 158, 11,0.14);
  padding: 22px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  animation: card-in 0.5s ease both;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 40%, rgba(245, 158, 11,0.08) 50%, transparent 60%);
  transform: translateX(-120%);
  transition: transform 0.6s ease;
  pointer-events: none;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand);
  box-shadow: 0 8px 32px rgba(245, 158, 11,0.12), 0 0 0 1px rgba(245, 158, 11,0.1);
}
.project-card:hover::before { transform: translateX(120%); }

.card-corner {
  position: absolute;
  width: 14px; height: 14px;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-color: var(--gold-2);
}
.project-card:hover .card-corner { opacity: 1; }
.card-corner.tl { top: 6px; left: 6px; border-top: 2px solid; border-left: 2px solid; }
.card-corner.br { bottom: 6px; right: 6px; border-bottom: 2px solid; border-right: 2px solid; }

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}
.card-category {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.5px;
  color: var(--gold);
  border: 1px solid rgba(252, 211, 77,0.4);
  padding: 3px 8px;
}
.card-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3px;
}
.card-status .dot { width: 7px; height: 7px; border-radius: 50%; }
.status-live { color: var(--green); }
.status-dev { color: var(--amber); }
.status-offline { color: var(--grey); }
.status-archived { color: var(--gold); }

.card-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--text-hi);
  margin: 4px 0 4px;
  letter-spacing: 0.5px;
}
.card-tagline {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--brand);
  opacity: 0.85;
  margin-bottom: 12px;
  font-weight: 500;
}
.card-desc {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-mid);
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tech-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.5px;
  color: var(--text-mid);
  background: rgba(245, 158, 11,0.06);
  border: 1px solid rgba(245, 158, 11,0.2);
  padding: 3px 9px;
}

/* ---------------- No results ---------------- */

.no-results {
  text-align: center;
  padding: 80px 24px;
  font-family: var(--font-mono);
}
.no-results.hidden { display: none; }
.no-results-glyph {
  color: var(--gold-2);
  letter-spacing: 0.5px;
  font-size: 17px;
}
.no-results-sub {
  color: var(--text-dim);
  margin-top: 8px;
  font-size: 13px;
  letter-spacing: 0;
}

/* ---------------- Footer ---------------- */

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 40px;
  border-top: 1px solid rgba(245, 158, 11,0.1);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}

/* ---------------- Modal ---------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(2,4,8,0.82);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.modal-backdrop.visible { opacity: 1; }
.modal-backdrop.hidden { display: none; }

.modal-panel {
  position: relative;
  width: min(560px, 100%);
  max-height: 84vh;
  background: linear-gradient(160deg, rgba(15,15,15,0.98), rgba(8,8,8,0.98));
  border: 1px solid rgba(245, 158, 11,0.3);
  box-shadow: 0 0 60px rgba(245, 158, 11,0.15);
  transform: scale(0.96);
  transition: transform 0.25s ease;
}
.modal-backdrop.visible .modal-panel { transform: scale(1); }

.modal-scroll {
  max-height: 84vh;
  overflow-y: auto;
  scrollbar-width: none; /* Firefox: keep scroll capability, hide the bar */
  -ms-overflow-style: none;
  padding: 36px;
}
.modal-scroll::-webkit-scrollbar { display: none; }

.modal-corner {
  position: absolute;
  width: 18px; height: 18px;
  border-color: var(--brand);
}
.modal-corner.tl { top: -1px; left: -1px; border-top: 2px solid; border-left: 2px solid; }
.modal-corner.tr { top: -1px; right: -1px; border-top: 2px solid; border-right: 2px solid; }
.modal-corner.bl { bottom: -1px; left: -1px; border-bottom: 2px solid; border-left: 2px solid; }
.modal-corner.br { bottom: -1px; right: -1px; border-bottom: 2px solid; border-right: 2px solid; }

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-mid);
  width: 30px; height: 30px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}
.modal-close:hover { border-color: var(--gold-2); color: var(--gold-2); }

.modal-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--gold);
}
.modal-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-hi);
  margin: 8px 0 4px;
}
.modal-tagline {
  color: var(--brand);
  font-size: 15px;
  margin-bottom: 18px;
}
.modal-desc {
  color: var(--text-mid);
  line-height: 1.65;
  font-size: 15px;
  margin-bottom: 22px;
}
.modal-section-label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.modal-tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}
.modal-status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.3px;
  padding-top: 18px;
  margin-bottom: 4px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.modal-access-note {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

/* ---------------- Responsive ---------------- */

@media (max-width: 720px) {
  .hud-bar { padding: 14px 18px; }
  .hud-sub { display: none; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .site-footer { flex-direction: column; gap: 6px; text-align: center; }
}



/* ============================================================
   Refinements
   ============================================================ */

.section-heading-count {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0;
  color: var(--text-dim);
}

/* Status filter chips */
.status-chip .dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.chip-count { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }
.chip.active .chip-count { color: inherit; opacity: 0.8; }
.controls .filter-group + .filter-group { margin-top: -4px; }
.chip:focus-visible, .arsenal-pill:focus-visible, .card-visit:focus-visible, .modal-link:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px;
}

/* Card footer: host + visit */
.card-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 16px; padding-top: 12px;
  border-top: 1px solid rgba(245,158,11,0.1);
  font-size: 12px;
}
.card-host { font-family: var(--font-mono); color: var(--text-dim); }
.card-visit {
  color: var(--brand); text-decoration: none; font-weight: 500;
  padding: 2px 0; border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.card-visit:hover { border-bottom-color: var(--brand); }

/* Modal link as a button */
.modal-link {
  display: inline-block; margin-top: 14px; padding: 10px 18px;
  font-size: 14px; font-weight: 500; text-decoration: none;
  color: #1a1204; background: var(--brand);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.modal-link:hover { background: var(--gold); box-shadow: 0 0 18px rgba(245,158,11,0.35); }

/* ---------------- Animated tech arsenal ---------------- */

.arsenal-card {
  overflow: hidden;
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s cubic-bezier(.2,.7,.2,1) calc(var(--i) * 70ms),
              transform 0.6s cubic-bezier(.2,.7,.2,1) calc(var(--i) * 70ms),
              border-color 0.3s ease, box-shadow 0.3s ease;
}
.arsenal-card.in { opacity: 1; transform: none; }
.arsenal-card.in:hover { transform: translateY(-3px); transition-delay: 0s; }

/* a light sweep passes over each card once as it appears */
.arsenal-scan {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(245,158,11,0.16) 50%, transparent 62%);
  transform: translateX(-130%);
}
.arsenal-card.in .arsenal-scan {
  animation: arsenal-sweep 1.1s ease calc(var(--i) * 70ms + 250ms) 1 both;
}
@keyframes arsenal-sweep { to { transform: translateX(130%); } }

.arsenal-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 12px;
}
.arsenal-head .arsenal-category { margin-bottom: 0; letter-spacing: 0.5px; text-transform: none; font-size: 12px; }
.arsenal-total { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); }

.arsenal-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); cursor: default;
  opacity: 0; transform: translateY(8px) scale(0.96);
  transition: opacity 0.4s ease, transform 0.4s ease, color 0.2s ease,
              border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.arsenal-card.in .arsenal-pill {
  opacity: 1; transform: none;
  transition-delay: calc(var(--i) * 70ms + var(--d) * 45ms + 150ms), calc(var(--i) * 70ms + var(--d) * 45ms + 150ms), 0s, 0s, 0s, 0s;
}
.arsenal-pill:disabled { color: var(--text-dim); border-color: rgba(245,158,11,0.12); background: transparent; }
.arsenal-pill.used { cursor: pointer; color: var(--text-hi); }
.arsenal-pill.used:hover {
  color: var(--brand); border-color: var(--brand); background: rgba(245,158,11,0.12);
  box-shadow: 0 0 14px rgba(245,158,11,0.22);
  transform: translateY(-2px);
  transition-delay: 0s;
}
.pill-count {
  font-size: 10px; line-height: 1; padding: 2px 5px; border-radius: 8px;
  color: #1a1204; background: var(--brand);
}

/* ---------------- Motion preferences + small screens ---------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; animation-delay: 0s !important; }
  .arsenal-card, .arsenal-pill { opacity: 1; transform: none; }
  .project-card { animation: none; }
}

@media (max-width: 720px) {
  .stats-row { grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 16px; }
  .stat-tile { padding: 16px 8px; }
  .stat-label { font-size: 11px; }
  .hud-status { display: none; }
}

/* ============================================================
   Galaxy hero — floating 3D constellation
   ============================================================ */

.galaxy {
  position: relative;
  width: 100%;
  height: clamp(560px, 88vh, 860px);
  overflow: hidden;
  margin-bottom: 40px;
  border-bottom: 1px solid rgba(245,158,11,0.14);
  background:
    radial-gradient(ellipse 60% 55% at 20% 25%, rgba(110,80,255,0.20), transparent 62%),
    radial-gradient(ellipse 55% 50% at 85% 75%, rgba(30,200,170,0.14), transparent 62%),
    radial-gradient(ellipse 45% 40% at 55% 50%, rgba(255,150,40,0.10), transparent 65%),
    #04060f;
}
/* slow drifting aurora behind the orbs */
.galaxy::before, .galaxy::after {
  content: ""; position: absolute; inset: -20%; pointer-events: none;
  background: conic-gradient(from 0deg at 50% 50%, rgba(120,90,255,0.10), transparent 25%, rgba(40,210,180,0.08) 50%, transparent 75%, rgba(255,160,60,0.09));
  filter: blur(60px);
  animation: aurora 38s linear infinite;
}
.galaxy::after { animation-duration: 55s; animation-direction: reverse; opacity: 0.7; }
@keyframes aurora { to { transform: rotate(360deg); } }

#galaxy-canvas { position: absolute; inset: 0; display: block; cursor: grab; touch-action: pan-y; }
.galaxy.grabbing #galaxy-canvas { cursor: grabbing; }

/* floating title block */
.galaxy-title {
  position: absolute; top: 40px; left: 40px; z-index: 3; max-width: min(520px, 52%);
  pointer-events: none;
  animation: float-y 7s ease-in-out infinite;
}
.galaxy-title .hero-title { text-align: left; font-size: clamp(34px, 5.2vw, 64px); }
.galaxy-title .hero-subtitle { text-align: left; margin-top: 12px; max-width: 34ch; }
@keyframes float-y { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

.galaxy-stats { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; pointer-events: auto; }
.g-stat {
  padding: 10px 16px; min-width: 96px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  animation: float-y 6s ease-in-out infinite;
}
.g-stat:nth-child(2) { animation-delay: -2s; animation-duration: 7.5s; }
.g-stat:nth-child(3) { animation-delay: -4s; animation-duration: 6.5s; }
.g-stat b { display: block; font-family: var(--font-display); font-size: 26px; font-weight: 600; color: var(--gold); line-height: 1.1; }
.g-stat span { font-size: 12px; color: var(--text-mid); }

/* hover tooltip */
.galaxy-tip {
  position: absolute; left: 0; top: 0; z-index: 4; pointer-events: none;
  display: flex; flex-direction: column; gap: 2px; min-width: 150px; max-width: 240px;
  padding: 10px 12px;
  background: rgba(10,12,28,0.78); border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px; backdrop-filter: blur(10px);
  opacity: 0; transition: opacity 0.15s ease;
}
.galaxy-tip.on { opacity: 1; }
.galaxy-tip b { font-family: var(--font-display); font-weight: 600; font-size: 14px; }
.galaxy-tip span { font-size: 12px; color: var(--text-mid); }
.galaxy-tip em { font-style: normal; font-size: 11px; color: var(--gold); margin-top: 3px; }
.galaxy-tip em.s-live { color: #5cf2c2; }
.galaxy-tip em.s-dev { color: #ffb454; }

/* floating glass detail card */
.galaxy-panel {
  position: absolute; z-index: 5; top: 50%; right: 36px; width: min(380px, calc(100% - 48px));
  max-height: calc(100% - 64px); overflow-y: auto; padding: 26px;
  background: rgba(12,14,32,0.62);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 20px;
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 30px 80px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.12);
  opacity: 0; transform: translateY(-46%) scale(0.96);
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(.2,.8,.2,1);
  scrollbar-width: none;
}
.galaxy-panel::-webkit-scrollbar { display: none; }
.galaxy-panel[hidden] { display: none; }
.galaxy-panel.open { opacity: 1; transform: translateY(-50%) scale(1); animation: panel-float 6s ease-in-out 0.5s infinite; }
@keyframes panel-float { 0%, 100% { margin-top: 0; } 50% { margin-top: -7px; } }
.gp-close {
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px;
  color: var(--text-mid); background: transparent; border: 1px solid rgba(255,255,255,0.14);
  border-radius: 50%; cursor: pointer; font-size: 12px;
}
.gp-close:hover { color: #fff; border-color: rgba(255,255,255,0.4); }
.gp-eyebrow { font-size: 12px; color: var(--gold); margin-bottom: 6px; }
.galaxy-panel h2 { margin: 0 0 8px; font-family: var(--font-display); font-size: 28px; font-weight: 600; }
.gp-status { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 14px; }
.gp-status i { width: 8px; height: 8px; border-radius: 50%; background: #8c96aa; }
.gp-status.s-live i { background: #5cf2c2; box-shadow: 0 0 10px #5cf2c2; }
.gp-status.s-dev i { background: #ffb454; box-shadow: 0 0 10px #ffb454; }
.gp-status span { color: var(--text-dim); font-family: var(--font-mono); font-size: 12px; margin-left: 4px; }
.gp-tag { color: var(--brand); font-size: 15px; margin-bottom: 10px; }
.galaxy-panel p { color: var(--text-mid); line-height: 1.6; font-size: 14px; margin: 0 0 16px; }
.gp-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.gp-pills span { font-family: var(--font-mono); font-size: 11px; padding: 3px 9px; border-radius: 999px; color: var(--text-mid); border: 1px solid rgba(255,255,255,0.16); }
.gp-visit {
  display: inline-block; padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 500;
  color: #1a1204; background: linear-gradient(120deg, #ffd27a, #ffa53a); text-decoration: none;
  box-shadow: 0 0 22px rgba(255,170,60,0.3); transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.gp-visit:hover { transform: translateY(-2px); box-shadow: 0 0 30px rgba(255,170,60,0.5); }
.gp-nolink { font-size: 13px; color: var(--text-dim); }

/* legend / hint / zoom */
.galaxy-legend {
  position: absolute; left: 40px; bottom: 28px; z-index: 3; display: flex; gap: 16px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-mid);
}
.galaxy-legend span { display: inline-flex; align-items: center; gap: 7px; }
.lg { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.lg.live { background: #5cf2c2; box-shadow: 0 0 8px #5cf2c2; }
.lg.dev { background: #ffb454; box-shadow: 0 0 8px #ffb454; }
.lg.off { background: #8c96aa; }
.lg.tech { background: #cfc6ff; width: 6px; height: 6px; box-shadow: 0 0 8px #b9aaff; }
.galaxy-hint {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 3;
  font-size: 12px; color: var(--text-dim); white-space: nowrap; pointer-events: none;
}
.galaxy-zoom { position: absolute; right: 36px; bottom: 24px; z-index: 6; display: flex; gap: 8px; }
.galaxy-zoom button {
  width: 34px; height: 34px; font-size: 18px; line-height: 1; cursor: pointer;
  color: var(--text-hi); background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.16); border-radius: 50%; backdrop-filter: blur(8px);
}
.galaxy-zoom button:hover { background: rgba(255,255,255,0.14); }

@media (max-width: 900px) {
  .galaxy { height: clamp(520px, 80vh, 700px); }
  .galaxy-title { top: 24px; left: 20px; max-width: calc(100% - 40px); }
  .galaxy-stats { gap: 8px; }
  .g-stat { min-width: 0; padding: 8px 12px; }
  .galaxy-panel { top: auto; bottom: 16px; right: 16px; left: 16px; width: auto; max-height: 62%; transform: translateY(20px) scale(0.98); }
  .galaxy-panel.open { transform: none; animation: none; }
  .galaxy-legend { left: 20px; bottom: 14px; gap: 10px; }
  .galaxy-hint { display: none; }
  .galaxy-zoom { right: 16px; bottom: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  .galaxy::before, .galaxy::after, .galaxy-title, .g-stat, .galaxy-panel.open { animation: none !important; }
}

/* ---- single-screen layout ---- */
.galaxy { height: calc(100vh - 78px); min-height: 560px; max-height: none; margin-bottom: 0; border-bottom: 0; }
.site-footer { margin-top: 0; }

.galaxy-legend { align-items: center; }
.lg-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; font: inherit; font-size: 12px; cursor: pointer;
  color: var(--text-mid); background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12); border-radius: 999px;
  backdrop-filter: blur(8px);
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.lg-btn:hover { color: #fff; border-color: rgba(255,255,255,0.3); }
.lg-btn.on { color: #fff; background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.4); }
.lg-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.lg-note { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-dim); margin-left: 6px; }

@media (max-width: 900px) {
  .galaxy { height: calc(100vh - 66px); min-height: 520px; }
}

/* ============================================================
   Header + footer — glass, matching the galaxy
   ============================================================ */

.nx-header {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 30; width: min(1180px, calc(100% - 32px)); height: 54px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 10px 0 18px;
  background: rgba(10,12,28,0.5);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 10px 40px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
}
.nx-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text-hi); }
.nx-orb {
  width: 18px; height: 18px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #fff7e0, #ffc46b 45%, #e8821a 100%);
  box-shadow: 0 0 14px rgba(255,170,60,0.7), 0 0 30px rgba(255,150,40,0.3);
  animation: orb-breathe 4s ease-in-out infinite;
}
@keyframes orb-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.nx-brand-name { font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: 0.4px; }
.nx-brand-sub { font-size: 12px; color: var(--text-dim); }

.nx-nav { display: flex; gap: 4px; }
.nx-nav a, .nx-foot-links a {
  font-size: 13px; color: var(--text-mid); text-decoration: none;
  padding: 7px 14px; border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
}
.nx-nav a:hover, .nx-foot-links a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nx-nav a:focus-visible, .nx-foot-links a:focus-visible, .nx-brand:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px;
}

.nx-status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; font-size: 12.5px; color: #5cf2c2;
  background: rgba(92,242,194,0.08); border: 1px solid rgba(92,242,194,0.22);
  border-radius: 999px;
}
.nx-pulse { width: 7px; height: 7px; border-radius: 50%; background: #5cf2c2; box-shadow: 0 0 10px #5cf2c2; animation: pulse-dot 1.8s ease-in-out infinite; }

/* galaxy now runs under the floating header */
.galaxy { height: calc(100vh - 64px); min-height: 600px; }
.galaxy-title { top: 100px; }

.nx-footer {
  position: relative; z-index: 3; height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 28px;
  font-size: 13px; color: var(--text-dim);
  background: linear-gradient(to bottom, rgba(4,6,15,0.2), rgba(4,6,15,0.95));
  border-top: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
}
.nx-foot-links { display: flex; gap: 2px; }
.nx-foot-right { font-family: var(--font-mono); font-size: 12px; }

@media (max-width: 900px) {
  .nx-header { top: 10px; height: 48px; width: calc(100% - 20px); padding: 0 8px 0 14px; }
  .nx-brand-sub, .nx-nav { display: none; }
  .nx-status { font-size: 12px; padding: 6px 12px; }
  .galaxy { height: calc(100vh - 56px); min-height: 540px; }
  .galaxy-title { top: 78px; }
  .nx-footer { height: auto; min-height: 56px; flex-wrap: wrap; justify-content: center; padding: 10px 16px; row-gap: 2px; }
  .nx-foot-right { display: none; }
}
@media (max-width: 480px) { .nx-status #hud-status-text { max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }
@media (prefers-reduced-motion: reduce) { .nx-orb, .nx-pulse { animation: none !important; } }

/* ---- stack-colour legend (replaces status filters) ---- */
.galaxy-legend { gap: 14px; row-gap: 6px; }
.galaxy-legend .lg { background: var(--c); box-shadow: 0 0 9px var(--c); }
.gp-host { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); margin-bottom: 14px; }
.galaxy-tip em { color: var(--text-dim); }

.gp-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.gp-store {
  display: inline-block; padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 500;
  color: var(--text-hi); text-decoration: none;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.22);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.gp-store:hover { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.45); transform: translateY(-2px); }

/* ============================================================
   Project card — redesigned
   ============================================================ */

.galaxy-panel {
  --ac: 255, 180, 84;
  width: min(420px, calc(100% - 48px));
  padding: 0;
  overflow-y: auto;
  background:
    radial-gradient(120% 70% at 0% 0%, rgba(var(--ac), 0.20), transparent 60%),
    rgba(10, 12, 28, 0.72);
  border: 1px solid rgba(var(--ac), 0.30);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.55),
    0 0 60px rgba(var(--ac), 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.galaxy-panel::before {          /* accent hairline across the top */
  content: ""; position: absolute; left: 22px; right: 22px; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--ac), 0.95), transparent);
}
.gp-scroll > * { margin-left: 26px; margin-right: 26px; }
.gp-scroll > .gp-head { margin-top: 26px; }
.gp-scroll > :last-child { margin-bottom: 26px; }

.gp-close { top: 16px; right: 16px; margin: 0 !important; }

.gp-head { display: flex; align-items: center; gap: 14px; padding-right: 36px; }
.gp-gem {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #fff 0, rgba(255,255,255,0.0) 32%),
    radial-gradient(circle at 50% 50%, rgb(var(--ac)) 0, rgba(var(--ac), 0.55) 55%, rgba(var(--ac), 0.25) 100%);
  box-shadow: 0 0 0 1px rgba(var(--ac), 0.6), 0 0 26px rgba(var(--ac), 0.55), inset 0 -6px 12px rgba(0,0,0,0.35);
  animation: gem-float 5s ease-in-out infinite;
}
@keyframes gem-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

.galaxy-panel .gp-eyebrow { margin: 0 0 3px; font-size: 12px; color: rgba(var(--ac), 1); letter-spacing: 0.3px; }
.galaxy-panel h2 { margin: 0; font-size: 30px; line-height: 1.1; letter-spacing: -0.01em; }

.galaxy-panel .gp-tag { margin-top: 16px; margin-bottom: 8px; font-size: 16px; color: #fff; font-weight: 500; }
.galaxy-panel .gp-desc { margin-top: 0; margin-bottom: 20px; font-size: 14px; line-height: 1.65; color: var(--text-mid); }

.gp-label {
  margin-top: 0; margin-bottom: 8px;
  font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-dim);
}

.gp-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.galaxy-panel .gp-pills span.gp-pill, .gp-pill {
  --tc: 170, 178, 200;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 11px 5px 9px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 12px; color: #e8eaf4;
  background: rgba(var(--tc), 0.10); border: 1px solid rgba(var(--tc), 0.38);
}
.gp-pill i { width: 7px; height: 7px; border-radius: 50%; background: rgb(var(--tc)); box-shadow: 0 0 8px rgba(var(--tc), 0.9); }

.gp-meta {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-bottom: 20px; margin-top: 0;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px; overflow: hidden;
}
.gp-meta > div { padding: 11px 14px; background: rgba(10,12,28,0.55); }
.gp-meta dt { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 3px; }
.gp-meta dd { margin: 0; font-size: 14px; color: #fff; font-weight: 500; }

.gp-rel { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.gp-chip {
  padding: 6px 12px; font: inherit; font-size: 12.5px; cursor: pointer;
  color: var(--text-mid); background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.14); border-radius: 999px;
  transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.2s;
}
.gp-chip:hover { color: #fff; background: rgba(255,255,255,0.12); border-color: rgba(var(--ac), 0.7); transform: translateY(-1px); }
.gp-chip:focus-visible { outline: 2px solid rgb(var(--ac)); outline-offset: 2px; }

.gp-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.galaxy-panel .gp-visit {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-size: 14px; font-weight: 600;
  color: #0b0d1a; text-decoration: none;
  background: linear-gradient(120deg, rgb(var(--ac)), rgba(var(--ac), 0.7));
  box-shadow: 0 8px 26px rgba(var(--ac), 0.35);
}
.galaxy-panel .gp-visit:hover { box-shadow: 0 10px 34px rgba(var(--ac), 0.55); transform: translateY(-2px); }
.galaxy-panel .gp-store { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; }

/* staggered entrance whenever the card opens or swaps project */
.galaxy-panel.swap .gp-scroll > * { animation: gp-rise 0.5s cubic-bezier(.2,.8,.2,1) both; }
.galaxy-panel.swap .gp-scroll > :nth-child(2) { animation-delay: 0.03s; }
.galaxy-panel.swap .gp-scroll > :nth-child(3) { animation-delay: 0.07s; }
.galaxy-panel.swap .gp-scroll > :nth-child(4) { animation-delay: 0.11s; }
.galaxy-panel.swap .gp-scroll > :nth-child(5) { animation-delay: 0.15s; }
.galaxy-panel.swap .gp-scroll > :nth-child(6) { animation-delay: 0.19s; }
.galaxy-panel.swap .gp-scroll > :nth-child(7) { animation-delay: 0.23s; }
.galaxy-panel.swap .gp-scroll > :nth-child(8) { animation-delay: 0.27s; }
.galaxy-panel.swap .gp-scroll > :nth-child(9) { animation-delay: 0.31s; }
@keyframes gp-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .galaxy-panel { width: auto; }
  .gp-scroll > * { margin-left: 20px; margin-right: 20px; }
  .gp-scroll > .gp-head { margin-top: 20px; }
  .galaxy-panel h2 { font-size: 24px; }
  .gp-gem { width: 38px; height: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  .gp-gem, .galaxy-panel.swap .gp-scroll > * { animation: none !important; }
}

/* description inherits the card gutter (older `.galaxy-panel p` rule zeroed it) */
.galaxy-panel .gp-desc { margin-left: 26px; margin-right: 26px; }
@media (max-width: 900px) { .galaxy-panel .gp-desc { margin-left: 20px; margin-right: 20px; } }

/* ---- card typography + vertical rhythm ---- */
.galaxy-panel { --gap: 22px; }
.galaxy-panel .gp-tag { margin-top: 20px; margin-bottom: 10px; font-size: 16px; line-height: 1.35; text-wrap: balance; }
.galaxy-panel .gp-desc {
  margin-bottom: var(--gap);
  font-size: 14.5px; line-height: 1.72; color: #b4bacb;
  text-wrap: pretty; hyphens: manual; overflow-wrap: break-word;
}
.galaxy-panel .gp-label { margin-bottom: 10px; }
.galaxy-panel .gp-pills { margin-bottom: var(--gap); }
.galaxy-panel .gp-meta { margin-bottom: var(--gap); }
.galaxy-panel .gp-rel { margin-bottom: 26px; }
.galaxy-panel .gp-nolink { margin-top: 4px; padding-top: 2px; }
.galaxy-panel .gp-actions { padding-top: 2px; }

/* ---- page navigation + technologies page ---- */
.nx-nav a.active { color: #fff; background: rgba(255,255,255,0.1); }
a.gp-chip { text-decoration: none; display: inline-block; }
.lg.lg-hub { background: #fff; box-shadow: 0 0 10px rgba(255,255,255,0.8); width: 11px; height: 11px; }
.lg.lg-ring { background: transparent; border: 1px solid rgba(255,255,255,0.8); box-shadow: none; width: 11px; height: 11px; }

/* brand: "Nexus" goes home, "by Jemish" opens jemish.in */
.nx-brand-link { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text-hi); }
a.nx-brand-sub { color: var(--text-dim); text-decoration: none; padding: 4px 0; border-bottom: 1px solid transparent; transition: color 0.2s ease, border-color 0.2s ease; }
a.nx-brand-sub:hover { color: #fff; border-bottom-color: rgba(255,255,255,0.5); }
a.nx-brand-sub:focus-visible, .nx-brand-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }

/* small screens: keep page switching + the Jemish link reachable */
@media (max-width: 900px) {
  .nx-nav { display: flex; gap: 2px; }
  .nx-nav a { padding: 6px 11px; font-size: 12.5px; }
  .nx-brand-sub { display: inline; font-size: 11.5px; }
}
@media (max-width: 560px) { .nx-brand-sub { display: none; } }

/* tall cards stay clear of the floating header and the legend row */
@media (min-width: 901px) {
  .galaxy-panel { top: calc(50% + 28px); max-height: calc(100% - 190px); }
}

/* action buttons stay pinned to the bottom of long cards */
.galaxy-panel .gp-actions {
  position: sticky; bottom: 0; z-index: 2;
  margin-bottom: 0 !important; padding: 18px 0 24px;
  background: linear-gradient(to top, rgba(12,14,32,0.97) 62%, rgba(12,14,32,0));
}

/* three-link nav fits on phones */
@media (max-width: 480px) {
  .nx-nav a { padding: 6px 8px; font-size: 12px; }
  .nx-header { gap: 6px; }
}
body[data-galaxy="data"] .galaxy-title .hero-title { font-size: clamp(30px, 4.4vw, 54px); }

/* ============================================================
   Mobile pass
   ============================================================ */

/* real viewport height on mobile browsers (address bar), and notch-safe footer */
@supports (height: 100dvh) {
  .galaxy { height: calc(100dvh - 64px); }
}
.nx-footer { padding-bottom: env(safe-area-inset-bottom); }

.nx-short { display: none; }

@media (max-width: 900px) {
  @supports (height: 100dvh) { .galaxy { height: calc(100dvh - 56px); } }

  /* drags that start on the stat tiles must still rotate the scene */
  .galaxy-stats { pointer-events: none; }

  /* comfortable tap targets */
  .nx-nav a { padding: 9px 11px; }
  .galaxy-zoom button { width: 40px; height: 40px; font-size: 20px; }
  .gp-close { width: 36px; height: 36px; }
  .gp-chip { padding: 8px 13px; }

  /* the zoom buttons would float on top of the open bottom sheet */
  .galaxy.has-panel .galaxy-zoom { display: none; }

  /* legend never touches the screen edge */
  .galaxy-legend { right: 20px; }
}

@media (max-width: 480px) {
  .nx-full { display: none; }
  .nx-short { display: inline; }
  .nx-header { padding: 0 6px 0 12px; }
  .nx-brand-name { font-size: 17px; }
  .nx-nav { gap: 0; }
  .nx-nav a { padding: 9px 9px; font-size: 12.5px; }

  .galaxy-title { top: 76px; left: 18px; }
  .galaxy-title .hero-title { font-size: 34px; }
  .galaxy-title .hero-subtitle { font-size: 14px; margin-top: 8px; }
  .g-stat b { font-size: 22px; }
  .galaxy-legend { font-size: 11px; gap: 10px; row-gap: 4px; }
  .galaxy-panel { left: 10px; right: 10px; bottom: 10px; max-height: 66%; }
  .nx-footer { font-size: 12px; }
}

@media (max-width: 360px) {
  .nx-brand-name { display: none; }
  .galaxy-title .hero-title { font-size: 30px; }
}

/* The card itself never scrolls: only .gp-scroll does, so the close button always stays put. */
.galaxy-panel { overflow: hidden; display: flex; flex-direction: column; }
.gp-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.gp-scroll::-webkit-scrollbar { display: none; }
.galaxy-panel .gp-close {
  z-index: 8; background: rgba(12,14,32,0.7); backdrop-filter: blur(6px);
  -webkit-tap-highlight-color: transparent;
}

/* One background colour everywhere, and a solid footer that matches the scene (no tint bleeding through) */
html, body { background: #04060f; }
.nx-footer {
  background: #04060f;
  backdrop-filter: none;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text-dim);
}
.nx-foot-links a { color: var(--text-mid); }
.nx-foot-links a:hover { color: #fff; }

/* ============================================================
   Footer = same glass as the header; the page background continues behind it
   ============================================================ */

/* the aurora now belongs to the whole page, so the footer glass picks it up */
html, body {
  background:
    radial-gradient(ellipse 60% 55% at 20% 25%, rgba(110, 80, 255, 0.20), transparent 62%),
    radial-gradient(ellipse 55% 50% at 85% 75%, rgba(30, 200, 170, 0.14), transparent 62%),
    radial-gradient(ellipse 45% 40% at 55% 50%, rgba(255, 150, 40, 0.10), transparent 65%),
    #04060f;
  background-attachment: fixed;
}
.galaxy { background: transparent; }

.nx-footer {
  width: min(1180px, calc(100% - 32px));
  height: 54px;
  margin: 8px auto 16px;
  padding: 0 22px;
  background: rgba(10, 12, 28, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
/* 8 + 54 + 16 = 78px of footer, so the galaxy takes the rest of the screen */
.galaxy { height: calc(100vh - 78px); }
@supports (height: 100dvh) { .galaxy { height: calc(100dvh - 78px); } }

@media (max-width: 900px) {
  .nx-footer {
    width: calc(100% - 20px);
    height: auto; min-height: 46px;
    margin: 6px auto calc(10px + env(safe-area-inset-bottom));
    padding: 10px 16px;
    border-radius: 24px;
    flex-wrap: wrap; justify-content: center; row-gap: 2px;
  }
  .galaxy { height: calc(100vh - 66px); }
  @supports (height: 100dvh) { .galaxy { height: calc(100dvh - 66px); } }
}

/* aurora runs behind the whole page (not clipped at the galaxy edge), so the footer glass has no seam */
.galaxy::before, .galaxy::after { content: none; display: none; }
body::before, body::after {
  content: ""; position: fixed; inset: -20%; pointer-events: none; z-index: 0;
  background: conic-gradient(from 0deg at 50% 50%, rgba(120,90,255,0.10), transparent 25%, rgba(40,210,180,0.08) 50%, transparent 75%, rgba(255,160,60,0.09));
  filter: blur(60px);
  animation: aurora 38s linear infinite;
}
body::after { animation-duration: 55s; animation-direction: reverse; opacity: 0.7; }
@media (prefers-reduced-motion: reduce) { body::before, body::after { animation: none !important; } }

/* galaxy fills exactly the space the header/footer leave, whatever the footer's height */
#app { display: flex; flex-direction: column; min-height: 100vh; }
@supports (height: 100dvh) { #app { min-height: 100dvh; } }
#app .galaxy { height: auto !important; flex: 1 1 auto; min-height: 520px; }
#app .nx-footer { flex: 0 0 auto; }

/* ============================================================
   Loader: a core with tilted orbits, same story as the galaxy
   ============================================================ */

#boot-screen {
  flex-direction: column;
  gap: 0;
  background:
    radial-gradient(ellipse 60% 55% at 20% 25%, rgba(110, 80, 255, 0.20), transparent 62%),
    radial-gradient(ellipse 55% 50% at 85% 75%, rgba(30, 200, 170, 0.14), transparent 62%),
    #04060f;
}

.loader {
  position: relative;
  width: min(220px, 56vw); height: min(220px, 56vw);
  display: grid; place-items: center;
  perspective: 700px;
}

.loader-core {
  width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #fff7e0, #ffc46b 45%, #e8821a 100%);
  box-shadow: 0 0 26px rgba(255, 170, 60, 0.85), 0 0 70px rgba(255, 150, 40, 0.38);
  animation: loader-pulse 1.8s ease-in-out infinite;
}
@keyframes loader-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.16); } }

.orbit {
  position: absolute; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.13);
  transform: rotateX(68deg) rotateZ(0deg);
  animation: loader-orbit var(--d, 3s) linear infinite;
}
.orbit i {
  position: absolute; top: -5px; left: calc(50% - 5px);
  width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #fff, var(--c) 55%);
  box-shadow: 0 0 14px var(--c), 0 0 28px var(--c);
}
.o1 { width: 100%;  height: 100%;  --d: 3.4s; }
.o2 { width: 74%;   height: 74%;   --d: 2.5s; animation-direction: reverse; }
.o3 { width: 50%;   height: 50%;   --d: 1.8s; }
@keyframes loader-orbit { to { transform: rotateX(68deg) rotateZ(360deg); } }

.loader-name {
  margin-top: 26px;
  font-family: var(--font-display); font-weight: 600; font-size: 26px; letter-spacing: 0.5px;
  color: #fff;
  animation: loader-rise 0.8s cubic-bezier(.2,.8,.2,1) 0.15s both;
}
.loader-sub {
  margin-top: 6px; font-size: 13px; color: var(--text-dim);
  animation: loader-rise 0.8s cubic-bezier(.2,.8,.2,1) 0.3s both;
}
.loader-bar {
  margin-top: 22px; width: 120px; height: 2px; border-radius: 2px;
  background: rgba(255, 255, 255, 0.1); overflow: hidden;
  animation: loader-rise 0.8s ease 0.4s both;
}
.loader-bar span {
  display: block; height: 100%; width: 40%; border-radius: 2px;
  background: linear-gradient(90deg, transparent, #ffc46b, transparent);
  animation: loader-sweep 1.3s ease-in-out infinite;
}
@keyframes loader-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes loader-sweep { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

@media (prefers-reduced-motion: reduce) {
  .orbit, .loader-core, .loader-bar span { animation: none !important; }
  .orbit { transform: rotateX(68deg); }
}
