/* ── Inline wiki-links inside lesson prose ──────────────────── */
.concept-link {
  color: var(--gold-bright);
  border-bottom: 1px dashed rgba(201, 169, 106, 0.45);
  text-decoration: none;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  padding: 0 1px;
  border-radius: 3px;
}
.concept-link[data-kind="theme"] { color: #b9a7ff; border-bottom-color: rgba(138, 123, 255, 0.45); }
.concept-link:hover { background: rgba(201, 169, 106, 0.14); border-bottom-style: solid; }
.concept-link[data-kind="theme"]:hover { background: rgba(138, 123, 255, 0.16); }

/* ── Concept cards (index) ──────────────────────────────────── */
.concept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 44px;
}
.concept-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 20px 22px;
  border-radius: var(--r);
  border: 1px solid var(--line-soft);
  background: linear-gradient(150deg, var(--panel), rgba(17, 19, 36, 0.3));
  position: relative;
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
}
.concept-card::before {
  content: ""; position: absolute; inset: 0; left: 0;
  width: 3px; background: var(--c);
  box-shadow: 0 0 16px var(--c);
}
.concept-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--c) 50%, transparent); box-shadow: var(--shadow); }
.concept-card__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 12px var(--c); }
.concept-card__name { font-family: var(--serif); font-size: 1.18rem; color: var(--ink); }
.concept-card__meta { font-size: var(--fs-xs); color: var(--faint); letter-spacing: 0.04em; }

/* ── Chips ──────────────────────────────────────────────────── */
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--c) 35%, var(--line-soft));
  background: color-mix(in srgb, var(--c) 8%, transparent);
  font-size: var(--fs-sm); color: var(--text);
  transition: background 0.25s, transform 0.25s, border-color 0.25s;
}
.chip:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--c) 18%, transparent); border-color: var(--c); }
.chip__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }

.concept-orb {
  display: inline-block; width: 16px; height: 16px; border-radius: 50%;
  background: var(--c); box-shadow: 0 0 18px var(--c); vertical-align: middle; margin-right: 6px;
}
.lesson-concepts { margin: 40px 0 8px; padding-top: 24px; border-top: 1px solid var(--line-soft); }

/* ── Graph page ─────────────────────────────────────────────── */
.page--graph { max-width: none; padding: 32px clamp(20px, 3vw, 48px) 32px; height: 100vh; display: flex; }
.graph { display: flex; flex-direction: column; width: 100%; }
.graph__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.graph__title { font-size: var(--fs-h1); margin-top: 6px; }
.graph__legend { display: flex; flex-wrap: wrap; gap: 16px; padding-top: 6px; }
.legend { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--muted); }
.legend__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }

.graph__stage {
  position: relative;
  flex: 1;
  border-radius: var(--r-lg);
  border: 1px solid var(--line-soft);
  background:
    radial-gradient(700px 500px at 30% 20%, rgba(124, 108, 240, 0.10), transparent 70%),
    radial-gradient(600px 400px at 80% 80%, rgba(201, 169, 106, 0.07), transparent 70%),
    rgba(8, 9, 16, 0.4);
  overflow: hidden;
}
.graph__stage canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.graph__stage canvas:active { cursor: grabbing; }
.graph__hint {
  position: absolute; left: 18px; bottom: 16px;
  font-size: var(--fs-xs); color: var(--faint); letter-spacing: 0.06em;
  pointer-events: none;
}
.graph__tooltip {
  position: absolute; z-index: 5; pointer-events: none;
  padding: 7px 12px; border-radius: 8px;
  background: rgba(8, 9, 16, 0.92); border: 1px solid var(--line);
  color: var(--ink); font-size: var(--fs-sm); white-space: nowrap;
  opacity: 0; transform: translateY(4px); transition: opacity 0.15s;
  box-shadow: var(--shadow);
}
.graph__tooltip.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 920px) {
  .page--graph { height: auto; min-height: 80vh; }
  .graph__stage { min-height: 60vh; }
}
