/* ============================================================
   VertexStudio — Content layer
   Knowledge Graph, Learn hub (paths/guides/news) & article prose.
   Loaded on learn.html, knowledge.html and article pages.
   ============================================================ */

/* ============================================================
   1. KNOWLEDGE GRAPH
   ============================================================ */
.kg-shell { display: grid; grid-template-columns: 1.55fr 1fr; gap: 22px; margin-top: 40px; align-items: start; }
.kg-stage {
  position: relative; border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden;
  background: radial-gradient(700px circle at 28% -10%, rgba(139, 92, 246, .12), transparent 60%), var(--surface);
  min-height: 580px; box-shadow: var(--shadow-lg);
}
#kg-canvas { display: block; width: 100%; height: 580px; cursor: grab; }
#kg-canvas:active { cursor: grabbing; }
.kg-toolbar { position: absolute; inset: 14px 14px auto 14px; z-index: 3; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.kg-search { flex: 1; min-width: 170px; background: rgba(6, 6, 13, .75); border: 1px solid var(--line-2); border-radius: var(--r-pill); padding: 10px 16px; color: var(--text); font-size: var(--fs-sm); font-family: var(--font-sans); outline: none; backdrop-filter: blur(8px); }
.kg-search:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(139, 92, 246, .18); }
.kg-btn { background: rgba(6, 6, 13, .75); border: 1px solid var(--line-2); color: var(--text-2); border-radius: var(--r-pill); padding: 9px 15px; font-size: var(--fs-xs); font-weight: 600; backdrop-filter: blur(8px); transition: all .2s; }
.kg-btn:hover { color: var(--text); border-color: var(--brand); }
.kg-legend { position: absolute; inset: auto 14px 14px 14px; z-index: 3; display: flex; flex-wrap: wrap; gap: 8px; }
.kg-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; background: rgba(6, 6, 13, .75); border: 1px solid var(--line-2); color: var(--muted); backdrop-filter: blur(8px); transition: all .2s; }
.kg-chip .dot { width: 9px; height: 9px; border-radius: 50%; }
.kg-chip[aria-pressed="true"] { color: var(--text); border-color: var(--line-strong); }
.kg-chip.dim { opacity: .4; }

.kg-panel { position: sticky; top: calc(var(--nav-h) + 20px); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; background: var(--surface); min-height: 580px; }
.kg-panel .kg-empty { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.75; font-weight: 300; }
.kg-panel .kg-empty strong { color: var(--text); font-weight: 600; }
.kg-cat { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .1em; padding: 5px 12px; border-radius: var(--r-pill); border: 1px solid var(--line-2); }
.kg-cat .dot { width: 9px; height: 9px; border-radius: 50%; }
.kg-panel h3 { font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; letter-spacing: -.02em; margin: 16px 0 12px; }
.kg-panel .kg-summary { color: var(--text-2); font-size: .92rem; line-height: 1.75; font-weight: 300; }
.kg-panel h4 { font-family: var(--font-mono); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .12em; color: var(--brand-2); margin: 26px 0 12px; font-weight: 500; }
.kg-neighbors { display: flex; flex-wrap: wrap; gap: 8px; }
.kg-neighbors button { background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text); border-radius: var(--r-pill); padding: 7px 14px; font-size: var(--fs-xs); font-weight: 500; transition: all .2s; }
.kg-neighbors button:hover { background: rgba(139, 92, 246, .16); border-color: var(--brand); transform: translateY(-1px); }
.kg-panel .btn-lg { margin-top: 24px; }
.kg-hint { margin-top: 20px; font-size: var(--fs-sm); color: var(--muted); }

/* ============================================================
   2. LEARN HUB
   ============================================================ */
.learn-section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 40px; }

.path-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.path-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; transition: border-color .3s, transform .3s, box-shadow .3s; }
.path-card:hover { border-color: var(--line-2); transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.path-head { padding: 28px 28px 0; }
.path-badge { display: inline-block; font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500; text-transform: uppercase; letter-spacing: .1em; padding: 4px 11px; border-radius: var(--r-pill); margin-bottom: 16px; }
.path-badge.beginner { background: rgba(52, 211, 153, .12); color: #6ee7b7; border: 1px solid rgba(52, 211, 153, .25); }
.path-badge.intermediate { background: rgba(34, 211, 238, .12); color: #67e8f9; border: 1px solid rgba(34, 211, 238, .25); }
.path-badge.advanced { background: rgba(139, 92, 246, .14); color: #c4b5fd; border: 1px solid rgba(139, 92, 246, .28); }
.path-card h3 { font-family: var(--font-display); font-size: 1.18rem; font-weight: 600; margin-bottom: 8px; }
.path-card .path-desc { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.6; font-weight: 300; }
.path-meta { display: flex; gap: 16px; padding: 16px 28px; color: var(--muted); font-size: var(--fs-xs); font-family: var(--font-mono); }
.path-steps { list-style: none; max-height: 0; overflow: hidden; transition: max-height .4s var(--ease); padding: 0 28px; }
.path-card.open .path-steps { max-height: 480px; padding-bottom: 12px; }
.path-steps li { display: flex; gap: 12px; align-items: flex-start; padding: 11px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.path-steps li .step-n { width: 22px; height: 22px; min-width: 22px; border-radius: 50%; background: rgba(139, 92, 246, .16); color: #c4b5fd; font-size: var(--fs-xs); font-weight: 700; display: flex; align-items: center; justify-content: center; }
.path-steps li a { color: var(--text-2); } .path-steps li a:hover { color: var(--brand-2); }
.path-toggle { width: 100%; text-align: left; background: none; border: none; color: var(--brand-2); font-size: var(--fs-sm); font-weight: 600; padding: 12px 28px 22px; }

.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.guide-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; color: inherit; transition: border-color .3s, transform .3s, box-shadow .3s; }
.guide-card:hover { border-color: var(--line-2); transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.guide-thumb { height: 140px; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #fff; }
.guide-thumb .vx-ic { width: 46px; height: 46px; position: relative; z-index: 1; opacity: .92; }
.guide-thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent, rgba(6, 6, 13, .55)); }
.gt1 { background: radial-gradient(circle at 32% 30%, rgba(139, 92, 246, .5), rgba(34, 211, 238, .15)); }
.gt2 { background: radial-gradient(circle at 32% 30%, rgba(34, 211, 238, .45), rgba(99, 102, 241, .15)); }
.gt3 { background: radial-gradient(circle at 32% 30%, rgba(52, 211, 153, .42), rgba(34, 211, 238, .15)); }
.gt4 { background: radial-gradient(circle at 32% 30%, rgba(232, 121, 249, .42), rgba(139, 92, 246, .18)); }
.guide-body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.guide-tag { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500; text-transform: uppercase; letter-spacing: .1em; color: var(--brand-2); margin-bottom: 10px; }
.guide-card h3 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; line-height: 1.35; margin-bottom: 10px; }
.guide-card p { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.6; flex: 1; font-weight: 300; }
.guide-foot { display: flex; align-items: center; gap: 10px; margin-top: 18px; color: var(--muted); font-size: var(--fs-xs); font-family: var(--font-mono); }
.guide-foot .arrow { margin-left: auto; color: var(--brand-2); font-weight: 700; transition: transform .2s; }
.guide-card:hover .guide-foot .arrow { transform: translateX(4px); }

.news-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.news-filter { background: var(--surface); border: 1px solid var(--line); color: var(--muted); border-radius: var(--r-pill); padding: 8px 16px; font-size: var(--fs-xs); font-weight: 600; transition: all .2s; }
.news-filter:hover { color: var(--text); border-color: var(--line-2); }
.news-filter.active { background: rgba(139, 92, 246, .14); border-color: rgba(139, 92, 246, .4); color: var(--text); }
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.news-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; color: inherit; transition: all .3s; }
.news-card:hover { border-color: var(--line-2); transform: translateY(-4px); box-shadow: var(--shadow); }
.news-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.news-cat { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; padding: 3px 10px; border-radius: var(--r-pill); background: rgba(139, 92, 246, .14); color: #c4b5fd; }
.news-date { font-size: var(--fs-xs); color: var(--muted); margin-left: auto; font-family: var(--font-mono); }
.news-card h3 { font-family: var(--font-display); font-size: .98rem; font-weight: 600; line-height: 1.4; margin-bottom: 8px; }
.news-card p { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.6; font-weight: 300; }
.news-src { margin-top: 14px; font-size: var(--fs-xs); color: var(--brand-2); font-weight: 600; }

/* ============================================================
   3. ARTICLE / PROSE
   ============================================================ */
.article-wrap { max-width: var(--maxw-prose); margin: 0 auto; padding: calc(var(--nav-h) + 60px) var(--gutter) 48px; }
.article-meta { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: var(--fs-xs); margin-bottom: 18px; flex-wrap: wrap; font-family: var(--font-mono); }
.article-meta .news-cat { color: #c4b5fd; }
.article-meta a { color: var(--brand-2); }
.article-wrap h1 { font-family: var(--font-display); font-size: var(--fs-h1); font-weight: 600; letter-spacing: -.03em; line-height: 1.08; margin-bottom: 18px; }
.article-lede { font-size: var(--fs-lead); color: var(--text-2); line-height: 1.7; }

.prose { color: var(--text-2); font-size: 1.04rem; line-height: 1.85; font-weight: 300; }
.prose > * + * { margin-top: 22px; }
.prose h2 { color: var(--text); font-family: var(--font-display); font-size: 1.65rem; font-weight: 600; letter-spacing: -.02em; margin-top: 54px; line-height: 1.2; }
.prose h3 { color: var(--text); font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; margin-top: 36px; }
.prose a { color: var(--brand-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(34, 211, 238, .4); }
.prose a:hover { text-decoration-color: var(--brand-2); }
.prose ul, .prose ol { padding-left: 24px; }
.prose li { margin-top: 10px; }
.prose li::marker { color: var(--brand); }
.prose strong { color: var(--text); font-weight: 600; }
.prose blockquote { border-left: 2px solid var(--brand); padding: 6px 22px; margin-left: 0; color: var(--text-2); font-style: italic; background: rgba(139, 92, 246, .06); border-radius: 0 12px 12px 0; }
.prose code { font-family: var(--font-mono); font-size: .85em; background: var(--surface-3); padding: 2px 7px; border-radius: 6px; color: #f0abfc; }
.prose pre { background: rgba(4, 4, 10, .8); border: 1px solid var(--line-2); border-radius: var(--r); padding: 20px 22px; overflow-x: auto; font-family: var(--font-mono); font-size: .84rem; line-height: 1.7; }
.prose pre code { background: none; padding: 0; color: #cbd5e1; }
.prose hr { border: none; height: 1px; background: var(--grad-line); margin: 44px 0; }

.callout { display: flex; gap: 14px; border: 1px solid rgba(34, 211, 238, .25); background: rgba(34, 211, 238, .05); border-radius: var(--r); padding: 18px 20px; font-size: .95rem; line-height: 1.65; }
.callout .c-ic { color: var(--brand-2); flex: none; } .callout .c-ic .vx-ic { width: 22px; height: 22px; }
.callout strong { display: block; margin-bottom: 4px; color: var(--text); }

.key-takeaways { border: 1px solid var(--line); background: rgba(139, 92, 246, .05); border-radius: var(--r-lg); padding: 26px; margin-top: 40px; }
.key-takeaways h4 { font-family: var(--font-mono); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .12em; color: var(--brand-2); font-weight: 500; margin-bottom: 14px; }
.key-takeaways ul { list-style: none; }
.key-takeaways li { display: flex; gap: 10px; padding: 8px 0; font-size: .95rem; color: var(--text-2); }
.key-takeaways li .vx-ic { width: 18px; height: 18px; color: var(--emerald); flex: none; margin-top: 3px; }

.article-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; flex-wrap: wrap; }
.article-related { margin-top: 64px; }
.article-related h4 { font-family: var(--font-mono); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .12em; color: var(--brand-2); font-weight: 500; margin-bottom: 20px; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .kg-shell { grid-template-columns: 1fr; }
  .kg-panel { position: static; min-height: 0; }
  .path-grid, .guide-grid, .news-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .path-grid, .guide-grid, .news-grid { grid-template-columns: 1fr; }
  #kg-canvas, .kg-stage { height: 460px; min-height: 460px; }
}
