:root {
  --void: #050706;
  --deep: #08110f;
  --panel: rgba(8, 17, 15, 0.76);
  --panel-strong: rgba(12, 25, 22, 0.92);
  --ink: #f5fff9;
  --ink-soft: #d8eee6;
  --muted: #9ab2aa;
  --line: rgba(186, 255, 232, 0.18);
  --aqua: #36f1c7;
  --aqua-deep: #14a68d;
  --leaf: #9ad66d;
  --ember: #ff6e4d;
  --violet: #a88cff;
  --gold: #ffd46a;
  --sky: #64c7ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(125deg, rgba(54, 241, 199, 0.12), transparent 38%),
    linear-gradient(245deg, rgba(255, 110, 77, 0.1), transparent 34%),
    linear-gradient(180deg, #050706 0%, #08110f 46%, #0d1816 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 22%, rgba(54, 241, 199, 0.16), transparent 16%),
    radial-gradient(circle at 78% 14%, rgba(255, 212, 106, 0.12), transparent 12%),
    radial-gradient(circle at 64% 82%, rgba(168, 140, 255, 0.14), transparent 16%);
  mix-blend-mode: screen;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.starfield {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 18px;
}

.topbar {
  min-height: 74px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 460px) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(186, 255, 232, 0.2);
  border-radius: 8px;
  background: rgba(5, 9, 8, 0.74);
  color: var(--ink);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(54, 241, 199, 0.95), rgba(255, 212, 106, 0.9)),
    #36f1c7;
  color: #04100d;
  font-weight: 900;
  box-shadow: 0 0 34px rgba(54, 241, 199, 0.34);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: "Fraunces", serif;
  font-size: 1.3rem;
}

.brand small {
  margin-top: 2px;
  color: rgba(245, 255, 249, 0.64);
  font-size: 0.78rem;
}

.search-box {
  height: 48px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(186, 255, 232, 0.16);
  box-shadow: inset 0 0 24px rgba(54, 241, 199, 0.04);
}

.search-box span {
  color: rgba(245, 255, 249, 0.58);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: #ffffff;
  background: transparent;
}

.search-box input::placeholder {
  color: rgba(245, 255, 249, 0.38);
}

.top-links {
  display: flex;
  gap: 8px;
}

.top-links a,
.mode-tab,
.filter-chip,
.detail-links a {
  text-decoration: none;
  border-radius: 8px;
  font-weight: 800;
}

.top-links a {
  padding: 12px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(186, 255, 232, 0.16);
}

.top-links a:hover,
.filter-chip:hover,
.repo-card:hover,
.detail-links a:hover {
  border-color: rgba(54, 241, 199, 0.58);
  box-shadow: 0 0 24px rgba(54, 241, 199, 0.12);
}

.atlas {
  display: grid;
  grid-template-columns: 292px minmax(430px, 1fr) 364px;
  gap: 18px;
  margin-top: 18px;
  min-height: calc(100vh - 128px);
}

.source-rail,
.graph-stage,
.inspector {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.source-rail,
.inspector {
  border-radius: 8px;
  padding: 16px;
  overflow: auto;
  max-height: calc(100vh - 128px);
}

.graph-stage {
  border-radius: 8px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(7, 15, 13, 0.76), rgba(8, 18, 16, 0.84)),
    #07110e;
}

.rail-heading {
  display: grid;
  gap: 3px;
}

.rail-heading p,
.kicker,
.inspector-topline,
.repo-card small {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 900;
  color: var(--aqua);
}

.rail-heading strong {
  font-family: "Fraunces", serif;
  font-size: 3.6rem;
  line-height: 0.9;
  color: var(--gold);
  text-shadow: 0 0 28px rgba(255, 212, 106, 0.25);
}

.rail-heading span,
.rail-stats span {
  color: var(--muted);
  font-size: 0.86rem;
}

.rail-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 18px;
}

.rail-stats div {
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(186, 255, 232, 0.14);
}

.rail-stats strong,
.rail-stats span {
  display: block;
}

.rail-stats strong {
  font-size: 1.05rem;
  color: var(--ink);
}

.scholar-card {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 212, 106, 0.28);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  background:
    linear-gradient(135deg, rgba(255, 212, 106, 0.16), transparent 46%),
    rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 0 24px rgba(255, 212, 106, 0.06);
}

.scholar-card span,
.scholar-card em {
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 800;
}

.scholar-card strong {
  font-family: "Fraunces", serif;
  color: var(--gold);
  font-size: 2.25rem;
  line-height: 0.95;
}

.scholar-card small {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.fork-card {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid rgba(54, 241, 199, 0.28);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  background:
    linear-gradient(135deg, rgba(54, 241, 199, 0.14), transparent 46%),
    rgba(255, 255, 255, 0.05);
}

.fork-card span,
.fork-card em {
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 800;
}

.fork-card strong {
  line-height: 1.2;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.filter-chip {
  appearance: none;
  border: 1px solid rgba(186, 255, 232, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink-soft);
  padding: 8px 10px;
  font-size: 0.78rem;
  cursor: pointer;
}

.filter-chip.active {
  background: rgba(54, 241, 199, 0.18);
  border-color: rgba(54, 241, 199, 0.72);
  color: #ffffff;
  box-shadow: 0 0 28px rgba(54, 241, 199, 0.18);
}

.repo-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.repo-card {
  display: grid;
  gap: 6px;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(186, 255, 232, 0.14);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--ink);
  cursor: pointer;
}

.repo-card.active {
  outline: 1px solid var(--aqua);
  background: rgba(54, 241, 199, 0.12);
}

.repo-card strong {
  color: var(--ink);
  line-height: 1.25;
}

.repo-card span {
  color: var(--muted);
  font-size: 0.82rem;
}

.stage-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  padding: 22px 22px 0;
}

.stage-toolbar h1 {
  max-width: 780px;
  margin: 4px 0 0;
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.96;
  text-shadow: 0 0 36px rgba(54, 241, 199, 0.14);
}

.mode-tabs {
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.mode-tab {
  appearance: none;
  border: 0;
  padding: 10px 12px;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
}

.mode-tab.active {
  background: rgba(54, 241, 199, 0.16);
  color: #ffffff;
  box-shadow: 0 0 28px rgba(54, 241, 199, 0.16);
}

.graph-wrap {
  position: relative;
  min-height: 650px;
}

.graph-wrap::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(186, 255, 232, 0.07);
  background-image:
    linear-gradient(rgba(186, 255, 232, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(186, 255, 232, 0.06) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at center, black, transparent 72%);
  pointer-events: none;
}

#graph-svg {
  position: relative;
  display: block;
  width: 100%;
  height: 650px;
}

.graph-link {
  fill: none;
  stroke: rgba(186, 255, 232, 0.26);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 2 10;
  filter: drop-shadow(0 0 5px rgba(54, 241, 199, 0.16));
  animation: route-drift 9s linear infinite;
}

.graph-link.hot {
  stroke: var(--aqua);
  stroke-width: 3;
  stroke-dasharray: 12 12;
  filter: drop-shadow(0 0 10px rgba(54, 241, 199, 0.5));
  animation-duration: 2.8s;
}

.graph-link.muted,
.graph-node.is-muted {
  opacity: 0.2;
}

.node-halo {
  fill: transparent;
  stroke: rgba(54, 241, 199, 0.32);
  stroke-width: 14;
  filter: drop-shadow(0 0 18px rgba(54, 241, 199, 0.42));
  animation: halo-breathe 2.8s ease-in-out infinite;
}

.orbit-ring {
  fill: none;
  stroke: rgba(255, 212, 106, 0.34);
  stroke-width: 1.5;
  stroke-dasharray: 4 10;
  transform-origin: center;
  animation: orbit-spin 11s linear infinite;
}

.orbit-two {
  stroke: rgba(54, 241, 199, 0.28);
  stroke-dasharray: 2 12;
  animation-duration: 16s;
  animation-direction: reverse;
}

.graph-node {
  cursor: pointer;
}

.node-hit {
  fill: rgba(255, 255, 255, 0.001);
  stroke: transparent;
}

.node-visual {
  pointer-events: none;
}

.graph-node circle.core {
  stroke: rgba(245, 255, 249, 0.52);
  stroke-width: 2;
  filter: drop-shadow(0 0 12px rgba(54, 241, 199, 0.32));
  transition: stroke-width 0.2s ease;
}

.graph-node.is-selected circle.core {
  stroke: #ffffff;
  stroke-width: 4;
  filter: drop-shadow(0 0 24px rgba(255, 212, 106, 0.58));
}

.node-aura {
  opacity: 0.2;
  filter: blur(2px);
}

.node-spark {
  fill: rgba(255, 255, 255, 0.72);
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.55));
  pointer-events: none;
}

.energy-particle {
  fill: rgba(186, 255, 232, 0.72);
  filter: drop-shadow(0 0 8px rgba(54, 241, 199, 0.7));
  pointer-events: none;
}

.energy-particle.hot {
  fill: #fff8c8;
  filter: drop-shadow(0 0 12px rgba(255, 212, 106, 0.9));
}

.spark-burst {
  pointer-events: none;
  animation: burst-fade 0.82s ease-out forwards;
}

.burst-ring {
  fill: none;
  stroke-width: 2;
  animation: burst-ring 0.82s ease-out forwards;
}

.burst-ray {
  stroke-width: 2;
  stroke-linecap: round;
  animation: burst-ray 0.82s ease-out forwards;
}

.graph-node text {
  pointer-events: none;
  fill: #f8fff9;
  font-weight: 900;
  font-size: 13px;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.85);
}

.graph-node .node-meta {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

@keyframes route-drift {
  to {
    stroke-dashoffset: -120;
  }
}

@keyframes halo-breathe {
  0%,
  100% {
    opacity: 0.48;
    stroke-width: 10;
  }
  50% {
    opacity: 0.92;
    stroke-width: 18;
  }
}

@keyframes orbit-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes burst-fade {
  0% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
  }
}

@keyframes burst-ring {
  0% {
    transform: scale(0.7);
    stroke-width: 5;
  }
  100% {
    transform: scale(1.65);
    stroke-width: 0;
  }
}

@keyframes burst-ray {
  0% {
    opacity: 0.9;
    stroke-width: 3;
  }
  100% {
    opacity: 0;
    stroke-width: 0;
  }
}

.inspector-topline {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.inspector h2 {
  margin: 12px 0 8px;
  font-family: "Fraunces", serif;
  font-size: 1.65rem;
  line-height: 1.05;
}

.detail-meta,
.detail-section p,
.connection-list {
  color: var(--muted);
  line-height: 1.65;
}

.repo-preview {
  margin: 16px 0;
}

.repo-art {
  display: grid;
  gap: 8px;
  min-height: 178px;
  align-content: end;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid rgba(186, 255, 232, 0.22);
  text-decoration: none;
  color: #f8fff9;
  background:
    linear-gradient(135deg, rgba(54, 241, 199, 0.22), transparent 42%),
    linear-gradient(225deg, rgba(255, 110, 77, 0.2), transparent 38%),
    linear-gradient(180deg, rgba(9, 21, 18, 0.95), rgba(18, 39, 34, 0.95));
  overflow: hidden;
  box-shadow: inset 0 0 36px rgba(54, 241, 199, 0.08);
}

.repo-art span {
  width: max-content;
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(248, 255, 249, 0.78);
  font-size: 0.75rem;
  font-weight: 900;
}

.repo-art strong {
  font-family: "Fraunces", serif;
  font-size: 1.6rem;
  line-height: 1;
}

.repo-art em {
  color: rgba(248, 255, 249, 0.68);
  font-style: normal;
  font-weight: 800;
}

.repo-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.repo-metrics div {
  border-radius: 8px;
  padding: 9px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(186, 255, 232, 0.14);
}

.repo-metrics strong,
.repo-metrics span {
  display: block;
}

.repo-metrics span {
  color: var(--muted);
  font-size: 0.75rem;
}

.detail-section {
  border-top: 1px solid rgba(186, 255, 232, 0.12);
  padding-top: 14px;
  margin-top: 14px;
}

.detail-section h3 {
  margin: 0 0 8px;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.token-group,
.detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.token,
.detail-links a {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(186, 255, 232, 0.16);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.06);
}

.detail-links a {
  color: var(--ink);
}

.connection-list {
  margin: 0;
  padding-left: 18px;
}

.guide-shell {
  max-width: 1180px;
  margin: 0 auto;
}

.guide-links {
  justify-content: end;
}

.guide-page {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.guide-hero,
.guide-panel,
.guide-command {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.guide-hero {
  padding: 30px;
}

.guide-hero h1 {
  max-width: 860px;
  margin: 4px 0 16px;
  font-family: "Fraunces", serif;
  font-size: clamp(2.4rem, 6vw, 5.4rem);
  line-height: 0.94;
}

.guide-hero p {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.7;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.guide-panel {
  padding: 18px;
}

.guide-panel span {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #06110e;
  background: var(--gold);
  font-weight: 900;
}

.guide-panel h2 {
  margin: 14px 0 8px;
  font-size: 1.15rem;
}

.guide-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.guide-command {
  padding: 22px;
}

.guide-command h2 {
  margin: 0 0 12px;
}

.guide-command pre {
  margin: 0;
  overflow: auto;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid rgba(186, 255, 232, 0.16);
  color: var(--ink);
  background: rgba(0, 0, 0, 0.3);
}

@media (max-width: 1180px) {
  .atlas {
    grid-template-columns: 280px minmax(420px, 1fr);
  }

  .inspector {
    grid-column: 1 / -1;
    max-height: none;
  }
}

@media (max-width: 860px) {
  .app-shell {
    padding: 10px;
  }

  .topbar,
  .atlas,
  .stage-toolbar {
    grid-template-columns: 1fr;
  }

  .source-rail,
  .inspector {
    max-height: none;
  }

  .graph-wrap,
  #graph-svg {
    min-height: 560px;
    height: 560px;
  }

  .top-links {
    justify-content: stretch;
  }

  .top-links a {
    flex: 1;
    text-align: center;
  }

  .guide-grid {
    grid-template-columns: 1fr;
  }
}
