:root {
  --bg:           #0a0a0a;
  --surface:      #111111;
  --surface-2:    #161616;
  --surface-3:    #1c1c1c;
  --border:       rgba(255,255,255,0.07);
  --border-mid:   rgba(255,255,255,0.11);
  --border-focus: rgba(255,255,255,0.22);
  --text:         #ededed;
  --text-2:       #888;
  --text-3:       #888;
  font-family: 'Geist', 'DM Sans', system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  padding: 20px clamp(16px, 3vw, 48px) 72px;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--text); }

/* ── Background ── */
.bg-grid {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 72px 72px;
}
.bg-glow { display: none; }

/* ── Nav ── */
.glass-nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  background: rgba(10,10,10,0.88);
  border: 1px solid var(--border-mid);
  border-radius: 10px;
  backdrop-filter: blur(12px);
  margin-bottom: 24px;
}
.brand { display: flex; gap: 10px; align-items: center; }
.brand-title { font-weight: 600; letter-spacing: 0.01em; font-size: 14px; color: var(--text); }
.brand-sub { font-size: 12px; color: var(--text-2); }

/* Small status dot — replaces the glowing orb */
.orb {
  width: 7px; height: 7px; border-radius: 50%;
  background: #3a3a3a;
  border: 1px solid var(--border-mid);
  flex-shrink: 0;
}

.nav-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 7px;
  background: transparent;
  border: 1px solid var(--border-mid);
  color: var(--text-2); font-size: 12px; font-weight: 500;
  letter-spacing: 0.01em;
  transition: color .15s, border-color .15s, background .15s;
  cursor: pointer;
  font-family: inherit;
}
.chip:hover { color: var(--text); border-color: var(--border-focus); background: rgba(255,255,255,0.04); }
.chip[type="button"], button.chip { border: 1px solid var(--border-mid); }
.chip-ghost { border-color: transparent; background: transparent; }
.chip-ghost:hover { border-color: var(--border-mid); }

/* Toggle */
.mode-toggle {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 11px; border-radius: 7px; border: 1px solid var(--border-mid);
  background: transparent; cursor: pointer;
}
.mode-toggle input {
  position: absolute; opacity: 0; width: 34px; height: 18px;
  left: 8px; top: 50%; transform: translateY(-50%); z-index: 2; cursor: pointer;
}
.mode-toggle .slider {
  position: relative; width: 34px; height: 18px; border-radius: 9px;
  background: var(--surface-3); border: 1px solid var(--border-mid);
  transition: background .15s; flex-shrink: 0;
}
.mode-toggle .slider::after {
  content: "";
  position: absolute; top: 2px; left: 2px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--text-3);
  transition: transform .15s ease, background .15s;
}
.mode-toggle input:checked + .slider { background: rgba(255,255,255,0.1); }
.mode-toggle input:checked + .slider::after { transform: translateX(16px); background: var(--text); }
.toggle-label { font-size: 12px; color: var(--text-2); font-weight: 500; }

/* ── Hero ── */
.hero {
  display: grid; grid-template-columns: 1.2fr 0.8fr;
  gap: 40px; align-items: center; position: relative; z-index: 1; margin-bottom: 32px;
}
.hero-text .mega {
  font-size: clamp(30px, 4vw, 50px);
  margin: 8px 0 14px; letter-spacing: -0.03em; font-weight: 700;
}
.hero-text .lead { max-width: 560px; color: var(--text-2); font-size: 15px; line-height: 1.65; }

.eyebrow {
  text-transform: uppercase; letter-spacing: 0.1em;
  font-size: 10px; color: var(--text-3); margin: 0; font-weight: 500;
}

.hero-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.meta-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px;
  border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); font-size: 12px;
}

.hero-portrait { justify-self: end; display: flex; align-items: center; gap: 20px; }
.portrait-shell {
  position: relative; width: 172px; height: 172px; border-radius: 14px;
  overflow: hidden; border: 1px solid var(--border-mid);
}
.portrait-shell img { width: 100%; height: 100%; object-fit: cover; }
.pulse-ring { display: none; }

.stat-stack { display: grid; gap: 7px; }
.stat {
  padding: 10px 13px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface); width: 162px;
}
.stat-label { font-size: 17px; font-weight: 700; color: var(--text); }
.stat-desc { color: var(--text-2); font-size: 11px; margin-top: 2px; line-height: 1.4; }

/* ── Graph section ── */
.graph-stage { position: relative; z-index: 1; margin-top: 8px; }
.graph-topbar {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: 10px; align-items: center; margin-bottom: 10px;
}
.graph-title { display: flex; gap: 8px; align-items: center; }
.tiny-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--text-3); flex-shrink: 0; }

/* Legend — Linear-style segmented control */
.legend {
  display: flex; flex-wrap: wrap; gap: 2px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 3px;
  font-size: 12px;
}
.legend-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 9px; border-radius: 5px; color: var(--text-2);
  transition: background .12s, color .12s; cursor: default; user-select: none;
}
.legend-item:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-core    { background: #7af2c5; }
.dot-project { background: #6fa8ff; }
.dot-focus   { background: #ffc861; }
.dot-exp     { background: #ff9e7d; }
.dot-skill   { background: #a08bff; }
.dot-contact { background: #ff7dd1; }

.graph-shell {
  position: relative; border: 1px solid var(--border-mid);
  border-radius: 10px; overflow: hidden;
  background: var(--surface);
  min-height: 600px; height: clamp(560px, 75vh, 960px);
}

/* SVG / D3 */
#graph-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; z-index: 1; }
.link { stroke: rgba(255,255,255,0.09); stroke-width: 1px; opacity: 1; transition: opacity .2s, stroke .2s; }
.link.active { stroke: rgba(255,255,255,0.28); opacity: 1; }
.node circle { stroke: rgba(255,255,255,0.18); stroke-width: 1.5px; cursor: pointer; transition: transform .2s ease, stroke-opacity .2s; }
.node text { pointer-events: none; font-size: 12px; fill: var(--text-2); font-family: inherit; }
.node.hovered circle,
.node.selected circle { transform: scale(1.1); stroke: rgba(255,255,255,0.5); stroke-width: 2px; }
.node.selected circle { stroke: rgba(255,255,255,0.7); }

/* ── Drawer ── */
.drawer {
  position: absolute; right: 14px; top: 14px; width: 216px; max-height: 80vh;
  background: var(--surface-2); border: 1px solid var(--border-mid); border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  padding: 12px; display: none; flex-direction: column; gap: 8px; z-index: 2;
}
.drawer.open { display: flex; animation: pop .15s ease; }
.drawer-header { display: flex; justify-content: space-between; align-items: center; }
.drawer-list { display: grid; gap: 3px; overflow: auto; }
.drawer button { width: 100%; }
.drawer .chip { justify-content: flex-start; width: 100%; }
@keyframes pop { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Detail panel ── */
.detail-panel {
  position: absolute; left: 14px; top: 14px;
  width: min(700px, 50vw); max-width: 97vw; max-height: 83vh;
  background: var(--surface-2); border: 1px solid var(--border-mid); border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  padding: 18px; display: flex; flex-direction: column; gap: 12px; z-index: 2;
}
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
#panel-title { margin: 4px 0 0; font-size: 19px; font-weight: 600; letter-spacing: -0.015em; color: var(--text); }
.panel-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.panel-body { color: var(--text-2); font-size: 14px; line-height: 1.65; overflow: auto; max-height: 58vh; }
.panel-img-wrap { position: relative; margin-bottom: 2px; }
.panel-body img {
  width: 100%; height: 240px; max-height: 240px; object-fit: contain;
  background: var(--surface-3); border-radius: 8px; border: 1px solid var(--border);
}
.panel-body ul { padding-left: 16px; margin: 8px 0; color: var(--text); }
.panel-body li { margin-bottom: 3px; }
.panel-body .tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.panel-body p { margin: 0 0 8px; }

/* GitHub-style topic chips */
.tag {
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-3);
  font-size: 11px; color: var(--text-2); font-weight: 500;
}

.link-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px;
  border-radius: 7px; border: 1px solid var(--border-mid);
  background: transparent; color: var(--text); font-size: 12px; font-weight: 500;
  transition: border-color .15s, background .15s;
}
.link-btn:hover { border-color: var(--border-focus); background: rgba(255,255,255,0.04); opacity: 1; }
.link-btn i { color: var(--text-2); }
.img-link {
  position: absolute; right: 8px; bottom: 8px; padding: 5px 9px;
  border-radius: 6px; background: rgba(10,10,10,0.9); border: 1px solid var(--border-mid);
  color: var(--text); font-size: 12px; font-weight: 500; text-decoration: none;
}
.panel-mini {
  margin-top: 6px; padding: 9px 12px; border-radius: 7px;
  background: var(--surface-3); border: 1px solid var(--border);
  font-size: 13px; color: var(--text-2);
}
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* Focus pills */
.focus-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.focus-pill {
  padding: 4px 10px; border-radius: 999px;
  background: var(--surface-3); border: 1px solid var(--border);
  color: var(--text-2); font-size: 11px; font-weight: 500;
}

/* ── Text view ── */
.text-view { display: none; padding: 30px 0 60px; }
body.text-mode .graph-stage { display: none; }
body.text-mode .legend,
body.text-mode .node-prompt { display: none; }
body.text-mode .hero-meta,
body.text-mode #drawer-toggle { display: none; }
body.text-mode #text-view { display: block; }
.text-view-inner { display: grid; gap: 20px; }
.text-view .text-section h3,
.text-view h2 { margin-bottom: 10px; font-size: 16px; }
.text-cards { display: grid; gap: 8px; }
.text-card {
  padding: 14px 16px; border: 1px solid var(--border);
  border-radius: 9px; background: var(--surface);
}
.text-card h4 { margin: 0 0 5px; font-size: 14px; color: var(--text); }
.text-card .tags { margin-top: 8px; }
.text-card .tag { display: inline-flex; }
.text-card .links { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.text-about h2 { margin-bottom: 8px; }
.text-about #text-about { color: var(--text-2); line-height: 1.65; font-size: 14px; }
.text-img { margin-bottom: 8px; }
.text-img img {
  width: 100%; max-height: 180px; object-fit: contain;
  border-radius: 8px; border: 1px solid var(--border); background: var(--surface-3);
}
.pill-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.pill {
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-3); color: var(--text-2); font-weight: 500; font-size: 11px;
}
.text-skills-grid { display: grid; gap: 8px; }
.highlight { color: var(--text); font-weight: 600; }

/* ── Footer ── */
.footer { margin-top: 48px; }
.footer-inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px;
  color: var(--text-3); font-size: 12px;
  border-top: 1px solid var(--border); padding-top: 14px;
}
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.footer a { color: var(--text-2); transition: color .15s; }
.footer a:hover { color: var(--text); opacity: 1; }

/* ── Responsive ── */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .hero-portrait { justify-self: start; }
  .graph-shell { min-height: 520px; }
  .detail-panel { position: relative; width: 100%; left: 0; top: 0; max-height: none; margin-bottom: 10px; }
  .drawer { position: relative; width: 100%; right: 0; top: 0; display: none; }
}
@media (max-width: 640px) {
  body { padding: 12px 12px 60px; }
  .glass-nav { flex-direction: column; align-items: flex-start; gap: 10px; }
  .nav-actions { width: 100%; }
  .hero-text .mega { font-size: 30px; }
  .graph-topbar { flex-direction: column; align-items: flex-start; }
  .legend { width: 100%; }
  .panel-actions { width: 100%; justify-content: flex-start; }
  #graph-canvas { height: 65vh; }
  .node text { font-size: 11px; }
}


/* Back to the main version of the portfolio. */
.chip.chip-home{border-color:rgba(255,255,255,.28);font-weight:600}
.chip.chip-home:hover{border-color:rgba(255,255,255,.6)}
