:root {
  --accent: #6c63ff;
  --accent-2: #a78bfa;
  --accent-3: #22d3ee;
  --accent-soft: rgba(108, 99, 255, 0.16);
  --bg: #0a0c12;
  --bg-elev: rgba(22, 27, 34, 0.62);
  --bg-elev-2: rgba(28, 34, 48, 0.7);
  --text: #eef0f6;
  --text-dim: #97a0b0;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --radius: 18px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --glow: 0 0 24px rgba(108, 99, 255, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }

.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(1000px 700px at 50% -15%, #1b1e35 0%, transparent 60%);
}
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.4; }
.orb-1 { width: 460px; height: 460px; background: #6c63ff; top: -140px; left: -100px; animation: float 20s ease-in-out infinite; }
.orb-2 { width: 380px; height: 380px; background: #ec4899; bottom: -160px; right: -80px; animation: float 24s ease-in-out infinite reverse; }
.orb-3 { width: 320px; height: 320px; background: #22d3ee; top: 45%; right: 22%; animation: float 28s ease-in-out infinite; }
.grid-overlay {
  position: absolute; inset: 0; opacity: 0.4;
  background-image: linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 30%, transparent 75%);
}
@keyframes float { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(34px,-46px) scale(1.05); } }

.container {
  position: relative; z-index: 1;
  max-width: 1000px; margin: 0 auto;
  padding: 56px 22px 48px;
  display: flex; flex-direction: column; gap: 26px;
}

.card {
  background: var(--bg-elev);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.card-head h2, .chart-card h2 { font-size: 1.02rem; font-weight: 600; letter-spacing: -0.01em; }
.muted { color: var(--text-dim); font-size: 0.85rem; }
.dot { color: var(--text-dim); }

.hero { display: flex; gap: 26px; align-items: center; }
.avatar-wrap { position: relative; flex-shrink: 0; width: 120px; height: 120px; }
.avatar {
  width: 120px; height: 120px; border-radius: 50%;
  object-fit: cover; position: relative; z-index: 1;
  border: 3px solid rgba(255,255,255,0.06);
}
.avatar-ring {
  position: absolute; inset: -6px; border-radius: 50%; z-index: 0;
  background: conic-gradient(from 0deg, var(--accent), var(--accent-3), var(--accent-2), var(--accent));
  filter: blur(2px); opacity: 0.9;
  animation: spin 6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hero-meta h1 { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.login {
  color: var(--accent-2); text-decoration: none; font-weight: 600; font-size: 0.95rem;
  font-family: "JetBrains Mono", monospace;
}
.login:hover { text-decoration: underline; }
.bio { color: var(--text-dim); margin: 8px 0 12px; max-width: 62ch; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 13px; font-size: 0.8rem; color: var(--text-dim);
  transition: border-color 0.18s, color 0.18s;
}
.badge:hover { border-color: var(--accent); color: var(--text); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; }
.stat-tile {
  position: relative; overflow: hidden;
  background: var(--bg-elev);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.stat-tile::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120px 80px at 80% 0%, var(--accent-soft), transparent 70%);
  opacity: 0; transition: opacity 0.25s;
}
.stat-tile:hover { transform: translateY(-5px); border-color: var(--border-strong); box-shadow: var(--glow), var(--shadow); }
.stat-tile:hover::after { opacity: 1; }
.stat-top { display: flex; align-items: center; gap: 8px; color: var(--text-dim); }
.stat-top svg { width: 16px; height: 16px; }
.stat-tile .value { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; margin-top: 8px; font-family: "JetBrains Mono", monospace; }
.stat-tile .label { color: var(--text-dim); font-size: 0.8rem; margin-top: 2px; }
.stat-tile.accent .value { background: linear-gradient(120deg, var(--accent), var(--accent-3)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.heatmap-scroll { overflow-x: auto; padding-bottom: 6px; }
.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 12px); gap: 3px; min-width: max-content; }
.hm-cell { width: 12px; height: 12px; border-radius: 3px; background: rgba(255,255,255,0.05); }
.hm-cell.l0 { background: rgba(255,255,255,0.05); }
.hm-cell.l1 { background: rgba(108,99,255,0.35); }
.hm-cell.l2 { background: rgba(108,99,255,0.55); }
.hm-cell.l3 { background: rgba(108,99,255,0.78); }
.hm-cell.l4 { background: #8b7bff; box-shadow: 0 0 6px rgba(139,123,255,0.6); }
.heatmap-legend { display: flex; align-items: center; gap: 5px; margin-top: 12px; justify-content: flex-end; }
.heatmap-legend .hm-cell { width: 11px; height: 11px; }

.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: stretch; }
.chart-card { display: flex; flex-direction: column; }
.chart-wrap { position: relative; height: 260px; flex: 1; }
.chart-wrap canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.lang-layout { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 20px; align-items: center; flex: 1; }
.lang-chart-wrap { height: 250px; }
.lang-list { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.lang-list li { font-size: 0.82rem; }
.lang-row { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; color: var(--text-dim); }
.lang-name { color: var(--text); font-weight: 500; }
.lang-pct { margin-left: auto; font-family: "JetBrains Mono", monospace; font-size: 0.76rem; }
.lang-bar { height: 6px; border-radius: 4px; background: rgba(255,255,255,0.06); overflow: hidden; }
.lang-bar > span { display: block; height: 100%; border-radius: 4px; width: 0; transition: width 0.9s cubic-bezier(.2,.8,.2,1); }

.repo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.repo {
  display: block; background: rgba(255,255,255,0.03);
  border: 1px solid var(--border); border-radius: 14px; padding: 16px;
  text-decoration: none; color: inherit;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s;
}
.repo:hover { transform: translateY(-4px); border-color: var(--accent); background: rgba(108,99,255,0.06); }
.repo .repo-name { color: var(--accent-2); font-weight: 600; margin-bottom: 5px; font-size: 0.98rem; }
.repo .repo-desc { color: var(--text-dim); font-size: 0.82rem; min-height: 2.6em; }
.repo .repo-foot { display: flex; gap: 15px; align-items: center; margin-top: 12px; font-size: 0.78rem; color: var(--text-dim); }
.lang-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }

.copy-btn {
  background: var(--accent-soft); color: var(--accent-2);
  border: 1px solid var(--accent); border-radius: 999px;
  padding: 6px 14px; font-size: 0.78rem; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: background 0.18s, transform 0.12s;
}
.copy-btn:hover { background: rgba(108,99,255,0.28); }
.copy-btn:active { transform: scale(0.96); }
.embeds { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 14px; }
.embed { background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 12px; padding: 12px; width: 100%; height: 300px; object-fit: contain; }

.footer { text-align: center; padding-top: 10px; display: flex; gap: 8px; justify-content: center; }
.footer a:hover { color: var(--accent-2); }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: #161b22; border: 1px solid var(--accent); color: var(--text);
  padding: 11px 20px; border-radius: 12px; box-shadow: var(--shadow);
  z-index: 20; opacity: 0; transition: opacity 0.25s, transform 0.25s; font-size: 0.88rem;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.error {
  position: fixed; inset: auto 0 0 0; background: #3a1418; color: #ffb4bd;
  padding: 14px 20px; text-align: center; border-top: 1px solid #5a1f26; z-index: 10;
}
.hidden { display: none; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

@media (max-width: 760px) {
  .embeds { grid-template-columns: 1fr; }
  .embed { height: auto; }
  .charts { grid-template-columns: 1fr; }
  .lang-layout { grid-template-columns: 1fr; }
  .hero { flex-direction: column; text-align: center; }
  .badges { justify-content: center; }
  .hero-meta h1 { font-size: 1.7rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, .orb, .avatar-ring { animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}
