/* ============ Tokens ============ */
:root {
  --bg: #000000;
  --bg-soft: #0a0a0a;
  --orange: #FF8C0A;
  --orange-soft: #ffae4d;
  --green: #3FA9F5;
  --green-glow: #6FC4FF;
  --ring: #9a9a9a;
  --ring-hi: #d8d8d8;
  --text: #f4f4f4;
  --text-dim: #b9b9b9;
  --text-faint: #7d7d7d;
  --panel-bg: #0e0e0e;
  --panel-border: #262626;
  --script: "Dancing Script", cursive;
  --sans: "Poppins", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ============ Top bar ============ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  background: linear-gradient(180deg, rgba(0,0,0,.92), rgba(0,0,0,0));
  pointer-events: none;
}
.topbar .brand, .topbar .controls { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 30px; height: 30px; }
.brand-text { font-weight: 600; font-size: 14px; letter-spacing: .2px; color: var(--text-dim); }
.controls { display: flex; gap: 8px; }
.ctrl-btn {
  font-family: var(--sans); font-weight: 500; font-size: 13px;
  color: var(--text); background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14); border-radius: 9px;
  padding: 8px 12px; cursor: pointer; transition: all .18s ease;
  min-height: 38px;
}
.ctrl-btn.icon { width: 38px; padding: 0; font-size: 18px; line-height: 1; }
.ctrl-btn:hover { background: rgba(255,140,10,.16); border-color: var(--orange); color: var(--orange-soft); }
.ctrl-btn:active { transform: scale(.95); }

/* ============ Hint ============ */
.hint {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  z-index: 40; font-size: 12.5px; color: var(--text-faint);
  background: rgba(10,10,10,.7); border: 1px solid rgba(255,255,255,.08);
  padding: 7px 14px; border-radius: 999px; backdrop-filter: blur(6px);
  transition: opacity .4s ease; pointer-events: none; text-align: center;
}
.hint kbd {
  font-family: var(--sans); font-size: 11px; background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18); border-radius: 4px; padding: 1px 5px;
}
.hint.hidden { opacity: 0; }

/* ============ Stage / canvas ============ */
.stage {
  position: fixed; inset: 0; z-index: 1;
  cursor: grab; touch-action: none;
}
.stage.grabbing { cursor: grabbing; }
.canvas {
  position: absolute; top: 0; left: 0;
  width: 2400px; height: 1700px;
  transform-origin: 0 0;
  will-change: transform;
}

/* ============ Dome title ============ */
.dome {
  position: absolute; left: 50%; top: 40px;
  transform: translateX(-50%);
  width: 1000px; height: 360px;
  display: flex; align-items: flex-start; justify-content: center;
}
.dome-arc { position: absolute; inset: 0; width: 100%; height: 100%; }
.dome-text { position: relative; text-align: center; padding-top: 40px; width: 70%; }
.dome-school { font-weight: 700; color: var(--orange); font-size: 30px; letter-spacing: .5px; }
.dome-year { font-weight: 700; color: var(--orange); font-size: 28px; margin-bottom: 6px; }
.dome-title { font-family: var(--script); color: var(--orange); font-size: 76px; line-height: 1.05; font-weight: 700; }
.dome-of { font-family: var(--script); color: var(--orange); font-size: 46px; line-height: 1.3; }
.dome-name { font-family: var(--script); color: var(--orange); font-size: 70px; font-weight: 700; line-height: 1.1; }

/* ============ Links (arrows) ============ */
.links { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }

/* ============ Nodes ============ */
.nodes { position: absolute; inset: 0; }
.node {
  position: absolute; transform: translate(-50%, -50%);
  width: var(--size, 190px); height: var(--size, 190px);
  border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 18px;
  border: 5px solid var(--ring);
  background: radial-gradient(circle at 50% 40%, #141414 0%, #000 75%);
  cursor: pointer; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  box-shadow: 0 0 0 rgba(255,140,10,0);
}
.node:hover {
  border-color: var(--orange);
  box-shadow: 0 0 34px rgba(255,140,10,.32);
  transform: translate(-50%, -50%) scale(1.04);
  z-index: 5;
}
.node .node-tag {
  font-size: 11px; font-weight: 600; color: var(--text-faint);
  margin-bottom: 6px; letter-spacing: .3px; line-height: 1.25;
}
.node .node-title {
  font-family: var(--script); color: var(--green-glow);
  font-size: 27px; font-weight: 700; line-height: 1.05;
}
.node .node-badge {
  margin-top: 9px; display: inline-flex; flex-wrap: wrap; gap: 4px; justify-content: center;
}
.node .pill {
  font-size: 10.5px; font-weight: 600; color: #03182e;
  background: var(--green); border-radius: 999px; padding: 2px 8px; letter-spacing: .2px;
}

/* central hub node */
.node.hub {
  --size: 230px;
  border-color: var(--ring-hi);
}
.node.hub .node-title { font-family: var(--sans); color: var(--text); font-size: 22px; font-weight: 700; }

/* ============ Detail panel ============ */
.panel {
  position: fixed; top: 0; right: 0; z-index: 60;
  width: min(440px, 92vw); height: 100%;
  background: var(--panel-bg); border-left: 1px solid var(--panel-border);
  transform: translateX(105%); transition: transform .42s cubic-bezier(.4,0,.1,1);
  display: flex; flex-direction: column;
  box-shadow: -20px 0 60px rgba(0,0,0,.6);
}
.panel.open { transform: translateX(0); }
.panel-close {
  position: absolute; top: 16px; left: 16px;
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
  color: var(--text); font-size: 20px; cursor: pointer; transition: all .18s ease;
}
.panel-close:hover { background: rgba(255,140,10,.16); border-color: var(--orange); color: var(--orange-soft); }
.panel-head { padding: 70px 28px 18px; border-bottom: 1px solid var(--panel-border); }
.panel-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; min-height: 4px; }
.panel-badges .pill {
  font-size: 11px; font-weight: 600; color: #03182e;
  background: var(--green); border-radius: 999px; padding: 3px 10px;
}
.panel-badges .pill .pill-name { display:block; font-weight:500; color:#05223d; font-size:9.5px; }
.panel-title { font-family: var(--script); color: var(--orange); font-size: 40px; font-weight: 700; line-height: 1.05; }
.panel-blurb { color: var(--text-dim); font-size: 14px; line-height: 1.55; margin-top: 8px; }
.panel-body { flex: 1; overflow-y: auto; padding: 18px 28px 60px; }

.subnode {
  border: 1px solid var(--panel-border); border-radius: 14px;
  padding: 16px; margin-bottom: 14px; background: #121212;
  transition: border-color .2s ease;
}
.subnode:hover { border-color: rgba(63,169,245,.5); }
.subnode h3 { font-size: 15px; font-weight: 600; color: var(--green-glow); margin-bottom: 6px; }
.subnode p { font-size: 13px; line-height: 1.55; color: var(--text-dim); }
.subnode .imgslot {
  margin-top: 12px; border: 1.5px dashed #3a3a3a; border-radius: 10px;
  min-height: 96px; display: flex; align-items: center; justify-content: center;
  color: var(--text-faint); font-size: 11.5px; text-align: center; padding: 12px;
  background: repeating-linear-gradient(45deg,#0d0d0d,#0d0d0d 10px,#111 10px,#111 20px);
}
.subnode .imgslot img { max-width: 100%; border-radius: 7px; display: block; }
.subnode-link {
  display: inline-block; margin-top: 10px; font-size: 12.5px; font-weight: 600;
  color: var(--green-glow); text-decoration: none;
  border: 1px solid rgba(63,169,245,.4); border-radius: 8px; padding: 5px 11px;
  transition: all .18s ease;
}
.subnode-link:hover { background: rgba(63,169,245,.14); border-color: var(--green); }

/* rubric reference block in panel */
.rubric-ref {
  margin-top: 18px; padding: 14px 16px; border-radius: 12px;
  background: rgba(255,140,10,.06); border: 1px solid rgba(255,140,10,.25);
}
.rubric-ref h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--orange-soft); margin-bottom: 8px; }
.rubric-ref .rr-item { font-size: 12.5px; color: var(--text-dim); line-height: 1.5; margin-bottom: 6px; }
.rubric-ref .rr-item b { color: var(--text); }
.rubric-ref .rr-last { color: var(--green-glow); font-weight: 600; }

/* ============ Responsive ============ */
@media (max-width: 640px) {
  .brand-text { display: none; }
  .hint { font-size: 11px; bottom: 12px; width: 92%; }
  .dome-title { font-size: 56px; }
  .dome-name { font-size: 52px; }
  .dome-school, .dome-year { font-size: 22px; }
}
