/* ── TOKENS ──────────────────────────────────────────────────────────────── */
:root {
  --void:     #07080F;
  --surface:  #0C1018;
  --edge:     #1C2130;
  --text:     #CDD8E4;
  --body:     #8096A8;
  --muted:    #4A5C6C;
  --signal:   #C49A3C;
  --sig-deep: #1A1508;
  --sig-mid:  #58400E;
  /* Node layer colours */
  --mission:   #C49A3C;
  --manageco:  #D4CEB8;
  --nonprofit: #9A7EC8;
  --science:   #00C49A;
  --platform:  #7EC8A0;
  --brand:     #C87E7E;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { background: var(--void); color: var(--text); min-height: 100vh; font-family: 'IBM Plex Sans', sans-serif; }
::-webkit-scrollbar { width: 2px; }
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb { background: var(--edge); border-radius: 2px; }
::selection { background: var(--sig-deep); color: var(--signal); }

.signal { color: var(--signal); }

/* ── FADE ────────────────────────────────────────────────────────────────── */
.fade { opacity: 0; transform: translateY(16px); transition: opacity 1s ease, transform 1s ease; }
.fade.visible { opacity: 1; transform: none; }

/* ── ANIMATIONS ──────────────────────────────────────────────────────────── */
@keyframes heroIn    { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:none; } }
@keyframes pulseGlow {
  0%, 100% { filter: drop-shadow(0 0 3px currentColor); opacity: 0.75; }
  50%      { filter: drop-shadow(0 0 9px currentColor); opacity: 1; }
}
.pulse-1 { animation: pulseGlow 3.5s ease-in-out infinite; }
.pulse-2 { animation: pulseGlow 3.5s ease-in-out 1.1s infinite; }
.pulse-3 { animation: pulseGlow 3.5s ease-in-out 2.2s infinite; }
@media (prefers-reduced-motion: reduce) { .pulse-1,.pulse-2,.pulse-3 { animation: none; opacity: 1; } }

/* ── NAV ─────────────────────────────────────────────────────────────────── */
#nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: 52px;
  padding: 0 clamp(24px, 5vw, 64px);
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid transparent;
  transition: background 0.4s, border-color 0.4s, backdrop-filter 0.4s;
}
#nav.scrolled { background: rgba(7,8,15,0.93); backdrop-filter: blur(14px); border-color: var(--edge); }
.nav-wordmark {
  background: none; border: none; cursor: pointer;
  font-family: 'IBM Plex Mono', monospace; font-size: 10px;
  letter-spacing: 0.18em; color: var(--text);
}
.nav-link {
  font-family: 'IBM Plex Mono', monospace; font-size: 9px;
  letter-spacing: 0.16em; color: var(--muted);
  text-decoration: none; transition: color 0.25s;
}
.nav-link:hover { color: var(--signal); }

/* ── HERO ────────────────────────────────────────────────────────────────── */
.hero {
  min-height: 50vh; display: flex; align-items: center;
  padding: 80px clamp(24px, 6vw, 72px) 48px;
  max-width: 960px; margin: 0 auto;
}
.hero-content { max-width: 680px; }
.hero-in { animation: heroIn 1s ease 0.3s both; }

.eyebrow {
  display: block; font-family: 'IBM Plex Mono', monospace;
  font-size: 9px; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--signal); margin-bottom: 28px;
}
h1 {
  font-family: 'Spectral', serif; font-weight: 200;
  font-size: clamp(36px, 6vw, 68px); line-height: 1.1;
  letter-spacing: -0.02em; color: var(--text); margin-bottom: 22px;
}
h1 em { font-style: italic; color: var(--muted); font-weight: 200; }
.hero-sub {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: clamp(14px, 1.4vw, 16px); line-height: 1.85;
  color: var(--body); max-width: 520px; margin-bottom: 28px;
}

/* Legend */
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; }
.legend-item {
  display: flex; align-items: center; gap: 6px;
  font-family: 'IBM Plex Mono', monospace; font-size: 9px;
  letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase;
}
.leg-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── MAP ─────────────────────────────────────────────────────────────────── */
.map-section { padding: 0 clamp(12px, 3vw, 48px) 32px; }
.map-container { max-width: 1060px; margin: 0 auto; position: relative; }
#constellation { width: 100%; height: auto; display: block; }

/* Connection lines */
.conn         { fill: none; stroke-width: 0.8; }
.conn-gold    { stroke: #C49A3C; opacity: 0.35; }
.conn-silver  { stroke: #D4CEB8; opacity: 0.3; stroke-dasharray: 5 4; }
.conn-green   { stroke: #7EC8A0; opacity: 0.4; }
.conn-violet  { stroke: #9A7EC8; opacity: 0.35; stroke-dasharray: 5 4; }

/* Nodes */
.node { cursor: pointer; }
.node-mission  { fill: var(--mission);   color: var(--mission); }
.node-manageco { fill: var(--manageco);  color: var(--manageco); }
.node-nonprofit{ fill: var(--nonprofit); color: var(--nonprofit); }
.node-science  { fill: var(--science);   color: var(--science); }
.node-platform { fill: var(--platform);  color: var(--platform); }
.node-brand    { fill: var(--brand);     color: var(--brand); }

.node-group { cursor: pointer; }
.node-group:hover .node { opacity: 1; filter: drop-shadow(0 0 12px currentColor) !important; }

.node-label {
  font-family: 'IBM Plex Mono', monospace; font-size: 8.5px;
  fill: var(--body); text-anchor: middle; pointer-events: none; letter-spacing: 0.05em;
}
.layer-label {
  font-family: 'IBM Plex Mono', monospace; font-size: 7px;
  fill: var(--muted); text-anchor: middle; pointer-events: none;
  letter-spacing: 0.2em; text-transform: uppercase;
}
.legend-svg {
  font-family: 'IBM Plex Mono', monospace; font-size: 7px;
  fill: var(--muted); letter-spacing: 0.08em;
}

/* ── TOOLTIP ─────────────────────────────────────────────────────────────── */
.tooltip {
  position: absolute; z-index: 50;
  background: var(--surface); border: 1px solid var(--edge);
  padding: 16px 18px; max-width: 230px;
  transform: translate(-50%, -100%) translateY(-14px);
  opacity: 0; transition: opacity 0.2s ease; pointer-events: auto;
}
.tooltip.visible { opacity: 1; }
.tt-layer { font-family: 'IBM Plex Mono', monospace; font-size: 8px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--signal); margin-bottom: 6px; }
.tt-label { font-family: 'IBM Plex Mono', monospace; font-size: 11px; color: var(--text); margin-bottom: 8px; }
.tt-desc  { font-family: 'IBM Plex Sans', sans-serif; font-size: 11px; color: var(--body); line-height: 1.6; margin-bottom: 10px; }
.tt-link  { font-family: 'IBM Plex Mono', monospace; font-size: 9px; color: var(--signal); text-decoration: none; letter-spacing: 0.1em; }
.tt-link:hover { opacity: 0.75; }

/* ── LIST SECTION ────────────────────────────────────────────────────────── */
.list-section {
  padding: clamp(32px, 5vw, 56px) clamp(24px, 6vw, 72px);
  border-top: 1px solid var(--edge);
}
.wrap-wide { max-width: 960px; margin: 0 auto; }
.entity-group { margin-bottom: clamp(28px, 4vw, 44px); }
.group-label {
  font-family: 'IBM Plex Mono', monospace; font-size: 8px;
  letter-spacing: 0.24em; text-transform: uppercase;
  margin-bottom: 12px; padding-bottom: 10px;
  border-bottom: 1px solid;
}
.entity-row {
  display: grid; grid-template-columns: 200px 1fr;
  grid-template-rows: auto auto; gap: 0 28px;
  padding: 14px 0; border-bottom: 1px solid var(--edge);
  text-decoration: none; transition: padding 0.2s, background 0.2s;
}
.entity-row:hover { background: var(--surface); padding-left: 12px; padding-right: 12px; margin: 0 -12px; }
.entity-name { font-family: 'Spectral', serif; font-size: 15px; font-weight: 400; color: var(--text); grid-column: 1; grid-row: 1; align-self: center; }
.entity-url  { font-family: 'IBM Plex Mono', monospace; font-size: 8px; color: var(--signal); letter-spacing: 0.1em; grid-column: 1; grid-row: 2; align-self: center; }
.entity-desc { font-family: 'IBM Plex Sans', sans-serif; font-size: 13px; color: var(--body); line-height: 1.65; grid-column: 2; grid-row: 1 / 3; align-self: center; }

@media (max-width: 600px) {
  .entity-row { grid-template-columns: 1fr; gap: 4px; }
  .entity-desc { grid-column: 1; grid-row: 3; margin-top: 4px; }
}

/* ── FOOTER ──────────────────────────────────────────────────────────────── */
footer { border-top: 1px solid var(--edge); }
.footer-inner {
  max-width: 960px; margin: 0 auto;
  padding: clamp(32px, 5vw, 48px) clamp(24px, 6vw, 72px);
  display: flex; flex-wrap: wrap;
  justify-content: space-between; align-items: flex-end; gap: 20px;
}
.footer-wordmark { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 0.18em; color: var(--text); margin-bottom: 6px; }
.footer-desc     { font-family: 'IBM Plex Sans', sans-serif; font-size: 11px; color: var(--muted); }
.footer-link     { color: var(--signal); text-decoration: none; border-bottom: 1px solid var(--sig-mid); transition: border-color 0.2s; }
.footer-link:hover { border-color: var(--signal); }
.footer-tagline  { font-family: 'Spectral', serif; font-size: 13px; font-style: italic; color: var(--muted); text-align: right; line-height: 1.9; }
