/* Trust-graph demo — controls + svg styling. Builds on /demos/assets/style.css */

.demo-shell {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: calc(100vh - 65px);
  min-height: 560px;
}

.sidepanel {
  border-right: 1px solid var(--line);
  padding: 1.25rem 1.25rem 1rem;
  overflow-y: auto;
}
.sidepanel h1 {
  font-size: 1.4rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}
.sidepanel h2 {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin: 1.4rem 0 0.5rem;
}
.sidepanel .lede { color: var(--fg-dim); font-size: 0.9rem; margin: 0 0 0.25rem; }

.sidepanel form { display: flex; flex-direction: column; gap: 0.55rem; }
.sidepanel label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--fg-dim);
}
.sidepanel input[type="text"],
.sidepanel input:not([type]),
.sidepanel select {
  background: #11141d;
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.45rem 0.55rem;
  font-size: 0.95rem;
}
.sidepanel input:focus, .sidepanel select:focus {
  outline: none;
  border-color: var(--accent);
}
.sidepanel input[type="range"] { padding: 0; }
.sidepanel button {
  background: var(--accent);
  color: #11141d;
  border: 0;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}
.sidepanel button.ghost {
  background: transparent;
  color: var(--fg-dim);
  border: 1px solid var(--line);
}
.sidepanel button:hover { filter: brightness(1.1); }
.sidepanel .row { display: flex; gap: 0.5rem; }

.legend { list-style: none; padding: 0; margin: 0.5rem 0 0; font-size: 0.9rem; color: var(--fg-dim); }
.legend li { display: flex; align-items: center; gap: 0.5rem; padding: 0.15rem 0; }
.legend .swatch {
  display: inline-block;
  width: 22px;
  height: 3px;
  border-radius: 2px;
}
.legend .swatch.knows    { background: #8a92a8; }
.legend .swatch.trusts   { background: #4ea1ff; }
.legend .swatch.member_of{ background: #c2a04e; }

.sidepanel .hint ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  color: var(--fg-dim);
}
.sidepanel footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}
.sidepanel footer a { color: var(--fg-dim); text-decoration: none; }
.sidepanel footer a:hover { color: var(--accent); }

.canvas-wrap {
  position: relative;
  background:
    radial-gradient(circle at 30% 30%, rgba(78,161,255,0.08), transparent 60%),
    radial-gradient(circle at 80% 70%, rgba(194,160,78,0.06), transparent 60%),
    var(--bg);
}
#graph { width: 100%; height: 100%; display: block; }

.hud {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  background: rgba(22, 27, 39, 0.85);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: var(--fg-dim);
  pointer-events: none;
}

/* graph elements */
.link {
  stroke-opacity: 0.55;
  cursor: pointer;
  transition: stroke-opacity 0.15s;
}
.link:hover { stroke-opacity: 1; }
.link.knows    { stroke: #8a92a8; }
.link.trusts   { stroke: #4ea1ff; }
.link.member_of{ stroke: #c2a04e; }
.link.dim { stroke-opacity: 0.12; }

.node circle {
  fill: #2a3140;
  stroke: #4ea1ff;
  stroke-width: 1.5;
  cursor: grab;
  transition: fill 0.15s, stroke 0.15s;
}
.node.selected circle { fill: #1e3a5f; stroke: #9ccaff; stroke-width: 2.5; }
.node.dim circle { opacity: 0.35; }
.node text {
  fill: var(--fg);
  font-size: 12px;
  pointer-events: none;
  text-anchor: middle;
  dominant-baseline: central;
  font-weight: 500;
  text-shadow: 0 0 4px rgba(13,16,24,0.9);
}
.node.dim text { opacity: 0.35; }

@media (max-width: 760px) {
  .demo-shell { grid-template-columns: 1fr; height: auto; }
  .sidepanel { border-right: 0; border-bottom: 1px solid var(--line); }
  .canvas-wrap { height: 60vh; }
}
