:root {
  --bg: #07110d;
  --bg2: #0b1712;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-strong: rgba(255, 255, 255, 0.055);
  --line: rgba(191, 233, 200, 0.14);
  --line-strong: rgba(191, 233, 200, 0.22);
  --text: rgba(207, 232, 214, 0.88);
  --muted: rgba(207, 232, 214, 0.6);
  --ink: #bfe9c8;
  --gold: #e6d7b7;
  --shadow: rgba(0, 0, 0, 0.6);

  --core: #e6d7b7;
  --cognition: #93d6ae;
  --governance: #96c5c0;
  --science: #d8ca97;
  --essays: #c2bfce;

  --radius: 18px;
  --radius2: 14px;

  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --serif: ui-serif, Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(1200px 900px at 25% 8%, rgba(191, 233, 200, 0.09), transparent 52%),
    radial-gradient(900px 640px at 80% 30%, rgba(230, 215, 183, 0.06), transparent 56%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.55;
}

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 18px 64px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(7, 17, 13, 0.74);
  border-bottom: 1px solid rgba(191, 233, 200, 0.08);
}

.topbar__inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
}

.brand img {
  opacity: 0.96;
  filter: drop-shadow(0 10px 24px rgba(191, 233, 200, 0.08));
}

.topbar__meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--gold);
  background: rgba(230, 215, 183, 0.06);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 0 0 10px rgba(191, 233, 200, 0.65);
}

.topbar__nav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.navlink {
  color: var(--muted);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
}

.navlink:hover,
.navlink:focus-visible,
.navlink.is-active {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.hero,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
  box-shadow: 0 30px 90px var(--shadow);
}

.hero {
  margin-top: 14px;
  padding: 24px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.hero__copy {
  max-width: 74ch;
}

.hero__kicker,
.inspector__kicker {
  margin: 0 0 6px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font: 12px/1.4 var(--mono);
}

.hero h1 {
  margin: 0;
  font: 600 40px/1.08 var(--serif);
  color: rgba(255, 255, 255, 0.95);
}

.hero__lede {
  margin: 14px 0 0;
  max-width: 66ch;
  color: var(--text);
  font-size: 16px;
}

.hero__note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.btn:hover,
.btn:focus-visible {
  border-color: var(--line-strong);
}

.btn--primary {
  border-color: rgba(230, 215, 183, 0.22);
  background: rgba(230, 215, 183, 0.08);
}

.panel {
  margin-top: 18px;
  padding: 18px;
}

.panel__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel__head h2 {
  margin: 0;
  font: 600 18px/1.2 var(--serif);
  color: rgba(255, 255, 255, 0.92);
}

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

.legend__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0;
  margin: 0;
}

.legend__list li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
}

.swatch {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  display: inline-block;
  box-shadow: 0 0 14px currentColor;
}

.swatch--core { color: var(--core); background: var(--core); }
.swatch--cognition { color: var(--cognition); background: var(--cognition); }
.swatch--governance { color: var(--governance); background: var(--governance); }
.swatch--science { color: var(--science); background: var(--science); }
.swatch--essays { color: var(--essays); background: var(--essays); }

.graph-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(280px, 0.7fr);
  gap: 16px;
}

.graph-shell {
  margin: 0;
}

.graph-stage {
  position: relative;
  min-height: 720px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background:
    radial-gradient(700px 420px at 50% 48%, rgba(191, 233, 200, 0.05), transparent 68%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.015));
}

.graph-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(191, 233, 200, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(191, 233, 200, 0.04) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 1), transparent 92%);
  pointer-events: none;
}

.graph-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.cluster-rings ellipse {
  fill: rgba(255, 255, 255, 0.012);
  stroke: rgba(191, 233, 200, 0.08);
  stroke-width: 1.5;
  stroke-dasharray: 5 8;
}

.connectors line {
  stroke: rgba(191, 233, 200, 0.16);
  stroke-width: 1.6;
}

.connectors--primary line {
  stroke: rgba(230, 215, 183, 0.22);
  stroke-width: 2.1;
}

.cluster-label {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(7, 17, 13, 0.82);
  font: 11px/1.2 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.cluster-label--cognition { color: var(--cognition); }
.cluster-label--governance { color: var(--governance); }
.cluster-label--science { color: var(--science); }
.cluster-label--essays { color: var(--essays); }

.graph-node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  min-width: 116px;
  max-width: 170px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(7, 17, 13, 0.9);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  text-align: center;
  font: 700 12px/1.3 var(--mono);
  letter-spacing: 0.02em;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  z-index: 2;
}

.graph-node span {
  display: block;
}

.graph-node:hover,
.graph-node:focus-visible,
.graph-node.is-active {
  transform: translate(-50%, -50%) translateY(-2px);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.46);
  outline: none;
  z-index: 3;
}

.graph-node--core {
  border-color: rgba(230, 215, 183, 0.4);
  background: rgba(30, 25, 15, 0.96);
  color: var(--core);
}

.graph-node--core:hover,
.graph-node--core:focus-visible,
.graph-node--core.is-active {
  box-shadow: 0 0 0 1px rgba(230, 215, 183, 0.28), 0 0 36px rgba(230, 215, 183, 0.14);
}

.graph-node--cognition {
  color: var(--cognition);
  border-color: rgba(147, 214, 174, 0.26);
}

.graph-node--governance {
  color: var(--governance);
  border-color: rgba(150, 197, 192, 0.26);
}

.graph-node--science {
  color: var(--science);
  border-color: rgba(216, 202, 151, 0.24);
}

.graph-node--essays {
  color: var(--essays);
  border-color: rgba(194, 191, 206, 0.24);
}

.inspector {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 320px;
}

.inspector h3 {
  margin: 0;
  font: 600 28px/1.1 var(--serif);
  color: rgba(255, 255, 255, 0.96);
}

.inspector p {
  margin: 0;
  color: var(--text);
}

.tooltip {
  position: fixed;
  max-width: 260px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(7, 17, 13, 0.96);
  color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.46);
  font-size: 12px;
  line-height: 1.45;
  z-index: 40;
  pointer-events: none;
}

.footer {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: rgba(207, 232, 214, 0.55);
  font-size: 12px;
  text-align: center;
  font-family: var(--mono);
}

::selection {
  background: rgba(191, 233, 200, 0.25);
  color: #fff;
}

@media (max-width: 1080px) {
  .graph-layout {
    grid-template-columns: 1fr;
  }

  .inspector {
    min-height: 0;
  }
}

@media (max-width: 900px) {
  .topbar__inner,
  .hero,
  .panel__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .topbar__meta {
    flex-wrap: wrap;
  }

  .hero h1 {
    font-size: 34px;
  }

  .hero__actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .graph-stage {
    min-height: auto;
    padding: 14px;
    display: grid;
    gap: 10px;
  }

  .graph-stage::before,
  .graph-lines,
  .cluster-label {
    display: none;
  }

  .graph-node {
    position: static;
    transform: none;
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  .graph-node:hover,
  .graph-node:focus-visible,
  .graph-node.is-active {
    transform: translateY(-2px);
  }
}
