/* ═══════════════════════════════════════════════════════════
   THINKSIDE UNIVERSE — DESIGN SYSTEM & VISUAL ARCHITECTURE
   Unified with ThinkSide Agency Design Tokens & Cyberpunk Tech
   ═══════════════════════════════════════════════════════════ */

:root {
  --void: #050505;
  --carbon: #121216;
  --carbon-light: #1c1d25;
  --carbon-border: rgba(255, 255, 255, 0.1);
  --neon: #FF0A16;
  --glow: #E50914;
  --edge-red: #FF3B47;
  --cyan: #00F0FF;
  --emerald: #10B981;
  --stark: #F5F5F7;
  --chrome: #A1A1AA;
  --muted: #64748B;
  
  --f-brutal: 'Montserrat', 'Archivo Black', -apple-system, BlinkMacSystemFont, sans-serif;
  --f-mono: 'Outfit', 'JetBrains Mono', 'Courier New', monospace;
}

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

html {
  background-color: var(--void);
  color: var(--stark);
  font-family: var(--f-mono);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--void);
  color: var(--stark);
  user-select: none;
}

::selection {
  background: var(--neon);
  color: #fff;
}

/* ─── TYPOGRAPHY HELPERS ─── */
.font-brutal { font-family: var(--f-brutal); }
.font-mono { font-family: var(--f-mono); }

/* ─── CUSTOM CURSOR (Desktop only) ─── */
@media (pointer: fine) {
  body { cursor: none; }
  a, button, [role="button"] { cursor: none; }

  #custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 8px;
    height: 8px;
    background-color: var(--neon);
    border-radius: 50%;
    pointer-events: none;
    z-index: 100000;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 12px var(--neon), 0 0 24px var(--neon);
    transition: transform 0.08s ease-out;
  }

  #cursor-follower {
    position: fixed;
    top: 0;
    left: 0;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 10, 22, 0.55);
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
    opacity: 0.7;
    transition: width 0.2s, height 0.2s, border-color 0.2s;
  }

  body.cursor-hover #cursor-follower {
    width: 48px;
    height: 48px;
    border-color: var(--cyan);
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.35);
  }
}

@media (pointer: coarse) {
  #custom-cursor, #cursor-follower { display: none !important; }
}

/* ─── ATMOSPHERIC SCANLINES & FILM GRAIN ─── */
.crt-overlay-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.crt-scanlines {
  z-index: 15;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(0, 0, 0, 0.22) 3px, rgba(0, 0, 0, 0.22) 4px);
  opacity: 0.35;
}

.crt-grain {
  z-index: 16;
  mix-blend-mode: overlay;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.7'/%3E%3C/svg%3E");
}

/* ─── LASER PROGRESS / WARP BAR ─── */
#scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--neon), var(--edge-red), var(--cyan));
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0.05);
  z-index: 999999;
  transition: transform 0.15s ease-out;
  box-shadow: 0 0 10px var(--neon);
}

/* ─── CYBERPUNK BOOT SEQUENCE PRELOADER ─── */
#os-boot {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background-color: var(--void);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--f-mono);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.8s;
  pointer-events: auto;
}

#os-boot.boot-finished {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-reticle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--neon);
  box-shadow: 0 0 14px var(--neon);
  animation: ping 1.4s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.boot-title {
  color: var(--neon);
  font-size: clamp(0.75rem, 2vw, 0.95rem);
  letter-spacing: 0.3em;
  font-weight: 800;
  margin-top: 12px;
}

.boot-sub {
  color: var(--chrome);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  margin-top: 6px;
  margin-bottom: 24px;
}

.boot-bar-wrap {
  width: min(320px, 80vw);
  height: 3px;
  background: var(--carbon);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.boot-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--neon), var(--edge-red), var(--cyan));
  transition: width 0.2s ease;
  box-shadow: 0 0 12px var(--neon);
}

/* ─── WEBGL STAGE ─── */
#webgl-stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block;
}

/* ─── TOP NAVIGATION & TELEMETRY HUD ─── */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 50;
  background: linear-gradient(180deg, rgba(5, 5, 5, 0.95) 0%, rgba(5, 5, 5, 0.65) 65%, transparent 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.reticle-core {
  position: relative;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reticle-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 10, 22, 0.45);
  animation: reticleSpin 8s linear infinite;
}

.reticle-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--neon);
  box-shadow: 0 0 10px var(--neon);
  animation: pulse 2s ease-in-out infinite;
}

.reticle-accent {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--cyan);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--f-brutal);
  font-weight: 900;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  color: #fff;
}

.brand-title em {
  font-style: normal;
  color: var(--chrome);
  font-family: var(--f-mono);
  font-weight: 700;
  font-size: 0.75rem;
  margin-left: 4px;
}

.brand-sub {
  font-family: var(--f-mono);
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  color: var(--chrome);
}

/* Center Telemetry Node */
.telemetry-node {
  display: none;
  align-items: center;
  gap: 12px;
  font-family: var(--f-mono);
  font-size: 0.7rem;
  color: var(--chrome);
  letter-spacing: 0.12em;
  background: rgba(18, 18, 22, 0.85);
  padding: 6px 16px;
  border-radius: 9999px;
  border: 1px solid var(--carbon-border);
  backdrop-filter: blur(12px);
}

@media (min-width: 1100px) {
  .telemetry-node { display: flex; }
}

.telemetry-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--emerald);
  font-weight: 600;
}

.status-ping {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}

.telemetry-sep {
  color: rgba(255, 255, 255, 0.18);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-pill-btn {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  background: rgba(18, 18, 22, 0.85);
  border: 1px solid var(--carbon-border);
  color: var(--stark);
  padding: 6px 12px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.hud-pill-btn:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.hud-pill-btn.active {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--cyan);
  color: #fff;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
}

/* Language switch */
.lang-switcher {
  display: flex;
  align-items: center;
  background: rgba(18, 18, 22, 0.9);
  border: 1px solid var(--carbon-border);
  border-radius: 9999px;
  padding: 2px;
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--chrome);
  font-family: var(--f-mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 9999px;
  transition: all 0.2s;
}

.lang-btn.active {
  background: var(--neon);
  color: #fff;
}

/* Sound Wave Equalizer */
.sound-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.sound-bar {
  width: 2px;
  height: 4px;
  background-color: var(--chrome);
  border-radius: 1px;
  transition: height 0.2s, background-color 0.2s;
}

.sound-btn.is-active .sound-bar {
  background-color: var(--neon);
}

.sound-btn.is-active .sound-bar:nth-child(1) { animation: soundWave 0.8s ease-in-out infinite alternate; }
.sound-btn.is-active .sound-bar:nth-child(2) { animation: soundWave 1.1s ease-in-out 0.2s infinite alternate; }
.sound-btn.is-active .sound-bar:nth-child(3) { animation: soundWave 0.9s ease-in-out 0.4s infinite alternate; }

/* ─── FLOATING 3D LABELS CONTAINER ─── */
#labels-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}

.floating-label {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, -100%);
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: opacity 0.2s, transform 0.2s;
}

.label-pill {
  font-family: var(--f-mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 3px 8px;
  border-radius: 9999px;
  background: rgba(18, 18, 22, 0.88);
  border: 1px solid var(--carbon-border);
  backdrop-filter: blur(8px);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.label-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.floating-label:hover .label-pill {
  border-color: var(--unit-color, var(--cyan));
  box-shadow: 0 0 14px var(--unit-color, var(--cyan));
  transform: scale(1.08);
}

.label-sat-count {
  font-size: 0.5rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  margin-left: 2px;
}

/* Multi-Galactic Satellite Floating Mini-Labels */
.floating-sat-label {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, -100%);
  pointer-events: auto;
  cursor: pointer;
  z-index: 18;
  transition: opacity 0.18s ease;
}

.sat-label-pill {
  font-family: var(--f-mono);
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 9999px;
  background: rgba(10, 11, 16, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: rgba(245, 245, 247, 0.82);
  transition: all 0.18s ease;
}

.sat-label-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  flex-shrink: 0;
}

.floating-sat-label.is-excited,
.floating-sat-label:hover {
  z-index: 28;
}

.floating-sat-label.is-excited .sat-label-pill,
.floating-sat-label:hover .sat-label-pill {
  border-color: var(--sat-color, var(--cyan));
  color: #fff;
  background: rgba(14, 16, 24, 0.96);
  box-shadow: 0 0 12px var(--sat-color, var(--cyan));
  transform: scale(1.1);
}

/* Central Core floating label */
.floating-core-label .label-pill {
  border-color: var(--neon);
  color: #fff;
  background: rgba(229, 9, 20, 0.25);
  box-shadow: 0 0 16px rgba(255, 10, 22, 0.45);
}

/* ─── TACTICAL INFO CARD (HOVER DOSSIER) ─── */
#tactical-card {
  position: fixed;
  z-index: 40;
  width: min(350px, 92vw);
  max-width: 92vw;
  box-sizing: border-box;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease-out;
}

#tactical-card.visible {
  opacity: 1;
  pointer-events: auto;
}

.card-glass-shell {
  background: rgba(10, 10, 14, 0.94);
  border: 1px solid var(--card-accent, var(--cyan));
  border-left-width: 2px;
  padding: 18px 20px 24px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8), 0 0 24px rgba(255, 10, 22, 0.15);
}

.card-glass-shell::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 240, 255, 0.015) 2px, rgba(0, 240, 255, 0.015) 4px);
}

.card-corner-tl {
  position: absolute;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--card-accent, var(--cyan));
  border-left: 2px solid var(--card-accent, var(--cyan));
}

.card-corner-br {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 8px;
  height: 8px;
  border-bottom: 2px solid var(--card-accent, var(--cyan));
  border-right: 2px solid var(--card-accent, var(--cyan));
}

.card-node-code {
  font-size: 0.55rem;
  letter-spacing: 0.22em;
  color: var(--chrome);
  margin-bottom: 6px;
}

.card-title {
  font-family: var(--f-brutal);
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: #fff;
  line-height: 1.2;
}

.card-category {
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  color: var(--card-accent, var(--cyan));
  margin-top: 4px;
  margin-bottom: 10px;
}

.card-divider {
  height: 1px;
  background: linear-gradient(90deg, var(--card-accent, var(--cyan)), transparent);
  margin-bottom: 12px;
  opacity: 0.4;
}

.card-desc {
  font-size: 0.68rem;
  line-height: 1.65;
  color: rgba(245, 245, 247, 0.85);
  margin-bottom: 14px;
}

.card-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
  width: 100%;
}

.modal-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
  width: 100%;
}

.metric-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 8px;
  border-radius: 4px;
  min-width: 0;
  overflow: hidden;
  word-break: break-word;
}

.metric-label {
  font-size: 0.5rem;
  letter-spacing: 0.14em;
  color: var(--chrome);
}

.metric-val {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--stark);
  margin-top: 2px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.card-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  text-align: center;
  font-family: var(--f-mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  line-height: 1.35;
  padding: 9px 12px;
  background: transparent;
  color: var(--card-accent, var(--cyan));
  border: 1px solid var(--card-accent, var(--cyan));
  border-radius: 4px;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  transition: all 0.2s;
}

.card-action-btn:hover {
  background: var(--card-accent, var(--cyan));
  color: #000;
  box-shadow: 0 0 18px var(--card-accent, var(--cyan));
}

/* ─── BOTTOM TELEMETRY HUD ─── */
#bottom-hud {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 30;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  color: var(--chrome);
}

.hud-group {
  display: flex;
  align-items: center;
  gap: 16px;
  pointer-events: auto;
}

.hud-badge {
  background: rgba(18, 18, 22, 0.75);
  border: 1px solid var(--carbon-border);
  padding: 4px 10px;
  border-radius: 9999px;
  backdrop-filter: blur(8px);
}

.hud-accent { color: var(--cyan); }
.hud-neon { color: var(--neon); }

/* ─── MODAL CONTAINER & BACKDROP ─── */
#modal-container {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 8, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 20px;
}

#modal-container.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-box {
  width: min(640px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
  background: rgba(14, 14, 18, 0.98);
  border: 1px solid var(--modal-border, var(--neon));
  border-radius: 8px;
  padding: 32px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(255, 10, 22, 0.25);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#modal-container.open .modal-box {
  transform: scale(1);
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--chrome);
  font-family: var(--f-mono);
  font-size: 0.75rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  border-color: var(--neon);
  color: var(--neon);
  transform: rotate(90deg);
}

.modal-header {
  margin-bottom: 20px;
}

.modal-eyebrow {
  font-size: 0.62rem;
  letter-spacing: 0.24em;
  color: var(--neon);
  margin-bottom: 6px;
}

.modal-title {
  font-family: var(--f-brutal);
  font-weight: 900;
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  letter-spacing: 0.05em;
  color: #fff;
}

.modal-tagline {
  font-size: 0.75rem;
  color: var(--chrome);
  margin-top: 4px;
}

.modal-line {
  height: 1px;
  background: linear-gradient(90deg, var(--neon), var(--cyan), transparent);
  margin: 16px 0 20px;
  opacity: 0.5;
}

.modal-body {
  font-size: 0.78rem;
  line-height: 1.85;
  color: rgba(245, 245, 247, 0.88);
}

.modal-pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.pillar-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px;
  border-radius: 6px;
}

.pillar-title {
  font-family: var(--f-brutal);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--cyan);
  margin-bottom: 6px;
}

.pillar-desc {
  font-size: 0.68rem;
  line-height: 1.6;
  color: var(--chrome);
}

.modal-footer {
  margin-top: 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ─── CLASSIFIED EASTER EGG TERMINAL ─── */
#classified-terminal {
  display: none;
  font-family: 'JetBrains Mono', monospace;
  background: #000;
  border: 1px solid #00FF88;
  color: #00FF88;
  padding: 24px;
  border-radius: 6px;
  box-shadow: 0 0 35px rgba(0, 255, 136, 0.35);
  max-height: 80vh;
  overflow-y: auto;
}

.term-line {
  font-size: 0.75rem;
  line-height: 1.8;
  opacity: 0;
  animation: termReveal 0.04s forwards;
}

.term-cursor::after {
  content: '█';
  animation: blink 1s step-end infinite;
}

/* ─── TACTICAL REGISTRY VIEW (ORBITAL DESCENT / MOBILE) ─── */
#tactical-registry {
  position: fixed;
  inset: 0;
  top: 64px;
  bottom: 0;
  z-index: 25;
  overflow-y: auto;
  padding: 32px 20px 80px;
  background: rgba(5, 5, 8, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: none;
}

#tactical-registry.visible {
  display: block;
}

.registry-inner {
  max-width: 680px;
  margin: 0 auto;
}

.registry-header {
  text-align: center;
  margin-bottom: 36px;
}

.registry-title {
  font-family: var(--f-brutal);
  font-weight: 900;
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  letter-spacing: 0.08em;
  color: #fff;
}

.registry-sub {
  font-size: 0.75rem;
  color: var(--chrome);
  letter-spacing: 0.2em;
  margin-top: 6px;
}

/* The Spine Connecting All Orbits */
.registry-list {
  position: relative;
  padding-left: 28px;
}

.registry-list::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 10px;
  bottom: 30px;
  width: 1px;
  background: linear-gradient(180deg, var(--neon), var(--cyan) 50%, var(--muted));
}

.registry-node-card {
  position: relative;
  background: rgba(18, 18, 24, 0.88);
  border: 1px solid var(--node-color, var(--cyan));
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 24px;
  backdrop-filter: blur(12px);
  transition: transform 0.2s, box-shadow 0.2s;
}

.registry-node-card::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 24px;
  width: 16px;
  height: 1px;
  background: var(--node-color, var(--cyan));
}

.registry-node-card::after {
  content: '';
  position: absolute;
  left: -26px;
  top: 21px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--node-color, var(--cyan));
  box-shadow: 0 0 10px var(--node-color, var(--cyan));
}

.registry-node-card:hover {
  transform: translateX(4px);
  box-shadow: 0 0 24px rgba(255, 10, 22, 0.2);
}

.node-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  color: var(--chrome);
  margin-bottom: 10px;
}

.node-name {
  font-family: var(--f-brutal);
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
}

.node-tagline {
  font-size: 0.72rem;
  color: var(--chrome);
  margin-top: 4px;
  margin-bottom: 12px;
}

.node-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.58rem;
  padding: 3px 8px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
}

.node-desc {
  font-size: 0.74rem;
  line-height: 1.7;
  color: rgba(245, 245, 247, 0.85);
  margin-bottom: 14px;
}

/* ─── ANIMATION KEYFRAMES ─── */
@keyframes ping {
  75%, 100% { transform: scale(2); opacity: 0; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.7; }
}

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

@keyframes soundWave {
  0% { height: 3px; }
  100% { height: 12px; }
}

@keyframes termReveal {
  to { opacity: 1; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ─── ECOSYSTEM MULTI-NODE LINKS & DOSSIER CARDS ─── */
.card-ecosystem-links {
  display: none;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 12px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.eco-mini-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 5px 9px;
  font-family: var(--f-mono);
  font-size: 0.56rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--stark);
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.32);
  border-radius: 4px;
  text-decoration: none;
  overflow: hidden;
  transition: all 0.18s;
}

.eco-mini-pill:hover {
  background: var(--cyan);
  color: #050505;
  border-color: var(--cyan);
}

.eco-mini-pill.eco-mini-admin {
  background: rgba(255, 10, 22, 0.1);
  border-color: rgba(255, 10, 22, 0.45);
  color: var(--neon);
}

.eco-mini-pill.eco-mini-admin:hover {
  background: var(--neon);
  color: #050505;
}

.eco-mini-badge {
  flex-shrink: 0;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.eco-mini-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ecosystem-dossier-block {
  background: rgba(8, 10, 16, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 6px;
  padding: 14px;
  margin: 16px 0 20px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.ecosystem-dossier-title {
  font-family: var(--f-mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.45;
  color: var(--cyan);
  margin-bottom: 10px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ecosystem-links-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 100%;
}

.ecosystem-link-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  padding: 10px 12px;
  background: rgba(18, 20, 28, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  text-decoration: none;
  color: var(--stark);
  font-family: var(--f-mono);
  font-size: 0.66rem;
  transition: border-color 0.2s, background 0.2s, color 0.2s, box-shadow 0.2s;
}

.ecosystem-link-card:hover {
  border-color: var(--cyan);
  background: rgba(0, 240, 255, 0.09);
  color: #fff;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.15);
}

.ecosystem-link-card.is-admin-link {
  border-color: rgba(255, 10, 22, 0.4);
  background: rgba(255, 10, 22, 0.07);
}

.ecosystem-link-card.is-admin-link:hover {
  border-color: var(--neon);
  background: rgba(255, 10, 22, 0.18);
  box-shadow: 0 0 14px rgba(255, 10, 22, 0.2);
}

.eco-link-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
}

.eco-link-badge {
  flex-shrink: 0;
  font-size: 0.54rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: var(--cyan);
  white-space: nowrap;
}

.is-admin-link .eco-link-badge {
  background: var(--neon);
  border-color: var(--neon);
  color: #050505;
}

.eco-link-label {
  flex: 1 1 0%;
  min-width: 0;
  font-weight: 600;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.eco-link-arrow {
  flex-shrink: 0;
  color: var(--cyan);
  font-weight: 700;
  margin-left: 4px;
}

/* ─── FOUNDER IDENTITY VERIFICATION MODAL ─── */
.founder-auth-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 4, 8, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  padding: 16px;
}

.founder-auth-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.founder-auth-box {
  width: min(440px, 94vw);
  background: rgba(12, 14, 22, 0.98);
  border: 1px solid rgba(255, 10, 22, 0.5);
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.95), 0 0 40px rgba(255, 10, 22, 0.25);
  overflow: hidden;
  font-family: var(--f-mono);
}

.founder-auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 18px;
  background: #0d0f17;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #fff;
}

.founder-auth-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 10px var(--neon);
}

.founder-auth-esc {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--chrome);
  font-family: var(--f-mono);
  font-size: 0.6rem;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
}

.founder-auth-body {
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.founder-auth-desc {
  font-size: 0.68rem;
  line-height: 1.6;
  color: var(--chrome);
}

.founder-auth-label {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--cyan);
}

.founder-auth-input {
  width: 100%;
  background: #05060a;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  padding: 10px 12px;
  color: #fff;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  outline: none;
}

.founder-auth-input:focus {
  border-color: var(--cyan);
}

.founder-auth-err {
  display: none;
  padding: 10px;
  border-radius: 6px;
  background: rgba(255, 10, 22, 0.15);
  border: 1px solid rgba(255, 10, 22, 0.5);
  color: var(--neon);
  font-size: 0.65rem;
  font-weight: 700;
}

.founder-auth-err.visible {
  display: block;
}

.founder-auth-submit {
  margin-top: 4px;
  width: 100%;
  padding: 12px;
  background: var(--neon);
  color: #050505;
  border: none;
  border-radius: 6px;
  font-family: var(--f-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  cursor: pointer;
  transition: all 0.2s;
}

.founder-auth-submit:hover {
  background: #fff;
}

/* ─── CYBERPUNK HUD TOAST NOTIFICATIONS ─── */
#hud-toast-container {
  position: fixed;
  bottom: 48px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.hud-toast {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(10, 12, 18, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--cyan);
  color: #fff;
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  transform: translateY(14px);
  opacity: 0;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.hud-toast.hud-toast-neon {
  border-color: var(--neon);
}

.hud-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.hud-toast-icon {
  font-weight: 700;
  color: var(--cyan);
}

.hud-toast-neon .hud-toast-icon {
  color: var(--neon);
}

/* ─── LIVE TELEMETRY & GLOW TUNER PANEL ─── */
#telemetry-tuner-panel {
  position: fixed;
  top: 66px;
  right: 20px;
  z-index: 60;
  width: min(325px, 92vw);
  max-height: calc(100vh - 115px);
  overflow-y: auto;
  background: rgba(10, 11, 16, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.4);
  border-radius: 8px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 28px rgba(0, 240, 255, 0.14);
  font-family: var(--f-mono);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-10px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.22s;
}

#telemetry-tuner-panel.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.tuner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(18, 20, 28, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #fff;
}

.tuner-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tuner-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.tuner-close-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--chrome);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.tuner-close-btn:hover {
  border-color: var(--neon);
  color: var(--neon);
}

.tuner-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tuner-presets {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.tuner-preset-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--chrome);
  font-family: var(--f-mono);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 5px 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.18s;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tuner-preset-btn:hover,
.tuner-preset-btn.active {
  background: rgba(0, 240, 255, 0.14);
  border-color: var(--cyan);
  color: #fff;
}

.tuner-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tuner-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--chrome);
}

.tuner-val {
  color: var(--cyan);
  font-weight: 800;
}

.tuner-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 10, 22, 0.55), rgba(0, 240, 255, 0.7));
  outline: none;
}

.tuner-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  cursor: pointer;
  transition: transform 0.15s;
}

.tuner-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.tuner-mode-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.tuner-mode-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--chrome);
  font-family: var(--f-mono);
  font-size: 0.55rem;
  font-weight: 700;
  padding: 5px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.18s;
}

.tuner-mode-btn.active {
  background: rgba(255, 10, 22, 0.18);
  border-color: var(--neon);
  color: #fff;
}

.tuner-footer {
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tuner-reset-btn {
  width: 100%;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 5px;
  color: var(--chrome);
  font-family: var(--f-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: all 0.2s;
}

.tuner-reset-btn:hover {
  border-color: var(--neon);
  color: #fff;
  background: rgba(255, 10, 22, 0.14);
}

/* ─── SATELLITE CONSTELLATION GRID & SYNAPSE CONNECTIONS IN MODAL ─── */
.satellite-constellation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  width: 100%;
}

.sat-chip-card {
  background: rgba(16, 18, 26, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 2px solid var(--sat-accent, var(--cyan));
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.sat-chip-card:hover {
  border-color: var(--sat-accent, var(--cyan));
  background: rgba(24, 28, 40, 0.98);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.16);
  transform: translateY(-2px);
}

.sat-chip-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.sat-chip-badge {
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(0, 240, 255, 0.35);
  background: rgba(255, 255, 255, 0.04);
}

.sat-chip-orbit {
  font-size: 0.5rem;
  color: var(--chrome);
  letter-spacing: 0.1em;
}

.sat-chip-name {
  font-family: var(--f-brutal);
  font-weight: 800;
  font-size: 0.76rem;
  color: #fff;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.sat-chip-desc {
  font-size: 0.62rem;
  line-height: 1.5;
  color: var(--chrome);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.synapse-connections-bar {
  background: rgba(255, 10, 22, 0.05);
  border: 1px solid rgba(255, 10, 22, 0.25);
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 18px;
}

.synapse-bar-label {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--stark);
  margin-bottom: 8px;
}

.synapse-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.synapse-peer-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: rgba(14, 16, 22, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  color: #fff;
  font-family: var(--f-mono);
  font-size: 0.58rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s;
}

.synapse-peer-pill:hover {
  border-color: var(--peer-color, var(--cyan));
  box-shadow: 0 0 12px var(--peer-color, var(--cyan));
}

.synapse-peer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

/* ─── RESPONSIVE TUNING ─── */
@media (max-width: 900px) {
  #btn-agency-portal { display: none; }
  #synapses-btn-label, #telemetry-btn-label { display: none; }
}

@media (max-width: 768px) {
  #site-header { padding: 12px 14px; }
  .brand-sub { display: none; }
  #bottom-hud { display: none; }
  #tactical-card { width: 90vw; left: 5vw !important; bottom: 12px !important; top: auto !important; }
  #telemetry-tuner-panel { right: 4vw; left: 4vw; width: 92vw; top: 62px; }
  #hud-toast-container { right: 12px; left: 12px; bottom: 16px; }
}

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