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

:root {
  --bg: #0a0a0f;
  --surface: #111118;
  --surface2: #1a1a24;
  --border: rgba(255,255,255,0.07);
  --purple: #7c3aed;
  --purple-light: #a855f7;
  --purple-glow: rgba(124,58,237,0.3);
  --text: #f0f0f5;
  --text-muted: #8888a0;
  --text-dim: #555568;
  --green: #22c55e;
  --yellow: #eab308;
  --red: #ef4444;
  --radius: 12px;
  --radius-lg: 18px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── PAGES ── */
.page {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.page.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

/* Home page still needs to scroll on small screens */
#pageHome {
  overflow-y: auto;
}

/* ── HOME ── */
.home-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  position: relative;
}

.home-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.35);
  color: var(--purple-light);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 28px;
}

.home-title {
  font-size: clamp(42px, 8vw, 80px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 16px;
  color: var(--text);
}
.home-title span {
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.home-sub {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 44px;
  max-width: 400px;
}

.search-box {
  width: 100%;
  max-width: 520px;
  margin-bottom: 32px;
}

.search-inner {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 6px 6px 6px 16px;
  gap: 10px;
  transition: border-color 0.2s;
}
.search-inner:focus-within {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-glow);
}

.search-icon {
  width: 18px;
  height: 18px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.search-inner input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}
.search-inner input::placeholder { color: var(--text-dim); }

.search-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  white-space: nowrap;
}
.search-btn:hover { opacity: 0.9; }
.search-btn:active { transform: scale(0.97); }
.search-btn svg { width: 16px; height: 16px; }
.search-btn.loading { opacity: 0.7; pointer-events: none; }

.search-hints {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
  justify-content: center;
  color: var(--text-dim);
  font-size: 12px;
}
.hint {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.hint:hover { border-color: var(--purple); color: var(--purple-light); }

.home-features {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}
.feat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}
.feat-icon {
  width: 44px;
  height: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

/* ── NAV ── */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(10,10,15,0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav-back {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.nav-back:hover { border-color: var(--purple); color: var(--text); }
.nav-back svg { width: 16px; height: 16px; }
.nav-brand {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── PROFILE ── */
#pageProfile {
  display: flex;
  flex-direction: column;
}

.profile-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

.profile-side {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--surface2) transparent;
  height: 100%;
  padding-right: 4px;
}

.profile-main {
  min-width: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--surface2) transparent;
  height: 100%;
  padding-right: 4px;
}

.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.p-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--border);
  margin-bottom: 14px;
  display: block;
}
.p-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 2px;
}
.p-login {
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  margin-bottom: 10px;
}
.p-bio {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 18px;
  line-height: 1.5;
}
.p-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}
.p-stat {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
}
.p-stat strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.p-stat span {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.p-contrib-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

/* ── REPOS ── */
.repos-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}
.repos-title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.repo-count-badge {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
}
.repos-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
}
.search-field svg { width: 14px; height: 14px; color: var(--text-dim); flex-shrink: 0; }
.search-field input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  width: 160px;
}
.search-field input::placeholder { color: var(--text-dim); }

select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

.repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.repo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.repo-card:hover {
  border-color: var(--purple);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124,58,237,0.15);
}
.repo-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--purple-light);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.repo-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.repo-card-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: auto;
}
.repo-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.lang-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--purple-light);
  flex-shrink: 0;
}
.repo-card-analyze {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(124,58,237,0.1);
  border: 1px solid rgba(124,58,237,0.25);
  color: var(--purple-light);
  padding: 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.2s;
}
.repo-card:hover .repo-card-analyze { background: rgba(124,58,237,0.2); }

/* ── ANALYSIS ── */
#pageAnalysis {
  display: flex;
  flex-direction: column;
}

.analysis-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 16px 24px 0;
  max-width: 1300px;
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
}

.analysis-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 16px;
  flex-shrink: 0;
}
.a-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.a-repo-name {
  font-size: 20px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}
.a-repo-full {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.a-repo-meta {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.a-meta-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
}
.a-meta-item svg { width: 13px; height: 13px; }

.analysis-body {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 16px;
}

.analysis-left {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.analysis-right {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tabs-content-wrap {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--surface2) transparent;
  padding-right: 2px;
}

/* ── CHAT ── */
.chat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.chat-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.chat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--surface2) transparent;
}
.chat-intro {
  text-align: center;
  padding: 20px 10px;
  color: var(--text-muted);
  font-size: 13px;
}
.chat-intro-icon { font-size: 32px; margin-bottom: 10px; }

.msg {
  max-width: 90%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}
.msg.user {
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.msg.ai {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.msg.typing { opacity: 0.6; }

.chat-form {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}
.chat-form input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.chat-form input:focus { border-color: var(--purple); }
.chat-form input::placeholder { color: var(--text-dim); }
.chat-form button {
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  border: none;
  border-radius: 8px;
  padding: 9px 12px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}
.chat-form button:hover { opacity: 0.85; }
.chat-form button svg { width: 16px; height: 16px; }

/* ── TABS ── */
.tabs-bar {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 16px;
}
.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.tab-btn.active {
  background: var(--surface2);
  color: var(--text);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* tabs-bar stays fixed, content scrolls */
.tabs-bar { flex-shrink: 0; }

/* ── ANALYSIS CARDS ── */
.a-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
}
.a-card-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.a-summary { font-size: 14px; color: var(--text-muted); line-height: 1.7; }

.score-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.score-label { font-size: 13px; color: var(--text-muted); flex: 1; }
.score-bar-wrap {
  flex: 2;
  height: 6px;
  background: var(--surface2);
  border-radius: 100px;
  overflow: hidden;
}
.score-bar {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--purple), var(--purple-light));
  transition: width 0.8s ease;
}
.score-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  width: 28px;
  text-align: right;
}

.rating-big {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
}
.rating-num {
  font-size: 48px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.rating-denom { font-size: 20px; color: var(--text-dim); }
.rating-reason { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  background: rgba(124,58,237,0.12);
  border: 1px solid rgba(124,58,237,0.25);
  color: var(--purple-light);
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
}

.bullet-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.bullet-list li {
  display: flex;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.bullet-list li::before {
  content: '▸';
  color: var(--purple-light);
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── LOADER ── */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.loader.hidden { display: none; }
.loader-box { text-align: center; }
.loader-ring {
  width: 48px;
  height: 48px;
  border: 3px solid var(--surface2);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
#loaderText { color: var(--text-muted); font-size: 14px; }

/* ── UTILS ── */
.hidden { display: none !important; }
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-dim);
  font-size: 14px;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .profile-layout { grid-template-columns: 1fr; overflow-y: auto; }
  .profile-side { height: auto; overflow: visible; }
  .profile-main { height: auto; overflow: visible; }
  .analysis-body { grid-template-columns: 1fr; overflow-y: auto; }
  .analysis-left { min-height: 400px; }
  .chat-card { height: 400px; }
  .tabs-content-wrap { overflow: visible; }
}
@media (max-width: 600px) {
  .topnav { padding: 12px 16px; }
  .analysis-layout, .profile-layout { padding: 12px; }
  .repos-toolbar { flex-direction: column; align-items: flex-start; }
  .repos-controls { width: 100%; }
  .search-field input { width: 100%; }
  .analysis-hero { flex-direction: column; align-items: flex-start; }
}

/* ── INFO GRID ── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.info-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.info-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
}
.info-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.complexity-simple { color: var(--green); }
.complexity-moderate { color: var(--yellow); }
.complexity-complex { color: #f97316; }
.complexity-very-complex { color: var(--red); }

/* ── PURPOSE ── */
.a-purpose {
  margin-top: 10px;
  font-size: 13px;
  color: var(--purple-light);
  font-style: italic;
  line-height: 1.5;
}

/* ── LANGUAGE BARS ── */
.lang-bars { display: flex; flex-direction: column; gap: 10px; }
.lang-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lang-bar-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  width: 110px;
  flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
}
.lang-bar-track {
  flex: 1;
  height: 6px;
  background: var(--surface2);
  border-radius: 100px;
  overflow: hidden;
}
.lang-bar-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 0.8s ease;
}
.lang-bar-pct {
  font-size: 11px;
  color: var(--text-dim);
  width: 38px;
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
}

/* ── CONTRIBUTORS ── */
.contrib-list { display: flex; flex-direction: column; gap: 10px; }
.contrib-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.contrib-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--surface2);
}
.contrib-login {
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  width: 110px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contrib-bar-wrap {
  flex: 1;
  height: 5px;
  background: var(--surface2);
  border-radius: 100px;
  overflow: hidden;
}
.contrib-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--purple-light));
  border-radius: 100px;
  transition: width 0.8s ease;
}
.contrib-count {
  font-size: 11px;
  color: var(--text-dim);
  width: 36px;
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
}

/* ── COMMITS ── */
.commit-list { display: flex; flex-direction: column; gap: 0; }
.commit-row {
  display: grid;
  grid-template-columns: 52px 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.commit-row:last-child { border-bottom: none; }
.commit-sha {
  font-family: 'JetBrains Mono', monospace;
  color: var(--purple-light);
  font-size: 11px;
  background: rgba(124,58,237,0.1);
  padding: 2px 6px;
  border-radius: 4px;
}
.commit-msg {
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.commit-author {
  color: var(--text-dim);
  font-size: 11px;
  white-space: nowrap;
}
.commit-date {
  color: var(--text-dim);
  font-size: 11px;
  white-space: nowrap;
}

/* ── RELEASES ── */
.release-list { display: flex; flex-direction: column; gap: 0; }
.release-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.release-row:last-child { border-bottom: none; }
.release-tag {
  font-family: 'JetBrains Mono', monospace;
  color: var(--purple-light);
  font-size: 11px;
  background: rgba(124,58,237,0.1);
  padding: 2px 8px;
  border-radius: 4px;
}
.release-name { color: var(--text-muted); flex: 1; }
.release-date { color: var(--text-dim); font-size: 11px; }
.badge-pre {
  background: rgba(234,179,8,0.15);
  border: 1px solid rgba(234,179,8,0.3);
  color: var(--yellow);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
}

/* ── FILE TREE ── */
.file-tree {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--surface2) transparent;
}
.ft-folder { margin-bottom: 6px; }
.ft-folder-name {
  color: var(--purple-light);
  font-weight: 600;
  padding: 3px 0;
}
.ft-children { padding-left: 16px; border-left: 1px solid var(--border); margin-left: 6px; }
.ft-file {
  color: var(--text-muted);
  padding: 2px 0 2px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ft-more { color: var(--text-dim); padding: 2px 0 2px 8px; font-style: italic; }

/* ── SUGGESTIONS ── */
.suggestion-list { display: flex; flex-direction: column; gap: 12px; }
.suggestion-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.suggestion-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.3);
  color: var(--purple-light);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.suggestion-body { flex: 1; }
.suggestion-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.suggestion-detail {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── HEALTH GRID ── */
.health-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.health-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.health-item.good { border-color: rgba(34,197,94,0.25); }
.health-item.warn { border-color: rgba(239,68,68,0.25); }
.health-icon { font-size: 18px; }
.health-label { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; }
.health-val { font-size: 15px; font-weight: 700; color: var(--text); }
.health-item.good .health-val { color: var(--green); }
.health-item.warn .health-val { color: var(--red); }

/* ── BEST PRACTICES ── */
.bp-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ── WARN BULLET LIST ── */
.bullet-list.warn li::before { color: var(--yellow); }

/* ── TIP CARD ── */
.tip-card {
  border-color: rgba(124,58,237,0.3);
  background: rgba(124,58,237,0.05);
}

/* ── RESPONSIVE ADDITIONS ── */
@media (max-width: 600px) {
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .health-grid { grid-template-columns: repeat(2, 1fr); }
  .commit-row { grid-template-columns: 52px 1fr; }
  .commit-author, .commit-date { display: none; }
}

/* ── HOME TOPBAR ── */
.home-topbar {
  position: absolute;
  top: 20px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.about-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 14px 6px 6px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.about-btn:hover {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-glow);
}
.about-btn-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--purple);
}
.about-btn-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}
.about-btn-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1;
}
.about-btn-role {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1;
}

/* ── ABOUT OVERLAY ── */
.about-overlay {
  position: fixed;
  inset: 0;
  z-index: 199;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  transition: opacity 0.2s;
}
.about-overlay.hidden { display: none; }

/* ── ABOUT CARD ── */
.about-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 200;
  width: min(520px, 92vw);
  background: var(--surface);
  border: 1px solid rgba(124,58,237,0.35);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(124,58,237,0.1);
  animation: floatIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.about-card.hidden { display: none; }

@keyframes floatIn {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.95); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.about-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: border-color 0.2s, color 0.2s;
}
.about-close:hover { border-color: var(--red); color: var(--red); }
.about-close svg { width: 14px; height: 14px; }

.about-inner {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.about-photo {
  width: 100px;
  height: 100px;
  border-radius: 16px;
  object-fit: cover;
  border: 2px solid rgba(124,58,237,0.4);
  flex-shrink: 0;
}

.about-info { flex: 1; min-width: 0; }

.about-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}

.about-role {
  font-size: 13px;
  font-weight: 500;
  color: var(--purple-light);
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.about-bio {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 16px;
}

.about-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.about-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  transition: border-color 0.2s, color 0.2s;
}
.about-link svg { width: 14px; height: 14px; flex-shrink: 0; }
.about-link:hover { border-color: var(--purple); color: var(--text); }
.about-link-li:hover { border-color: #0077b5; color: #0077b5; }

.about-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.about-tag {
  background: rgba(124,58,237,0.1);
  border: 1px solid rgba(124,58,237,0.2);
  color: var(--purple-light);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 100px;
  font-family: 'JetBrains Mono', monospace;
}

@media (max-width: 480px) {
  .about-inner { flex-direction: column; align-items: center; text-align: center; }
  .about-links { justify-content: center; }
  .about-stack { justify-content: center; }
  .home-topbar { top: 12px; right: 12px; }
}

/* ── PROFILE TABS ── */
.profile-tabs-bar {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 18px;
}
.profile-tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 9px 14px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.profile-tab-btn.active { background: var(--surface2); color: var(--text); }
.profile-tab-panel { display: none; }
.profile-tab-panel.active { display: block; }

/* ── PROFILE INTELLIGENCE ── */
.pi-placeholder {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
}
.pi-idle-icon { font-size: 48px; margin-bottom: 16px; }

.pi-analyze-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--purple), var(--purple-light));
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-top: 20px;
  transition: opacity 0.2s;
}
.pi-analyze-btn:hover { opacity: 0.88; }
.pi-analyze-btn:disabled { opacity: 0.6; pointer-events: none; }
.pi-analyze-btn svg { width: 16px; height: 16px; }

.pi-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

.pi-score-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.pi-score-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 10px;
  text-align: center;
}
.pi-score-num {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 6px;
}
.pi-score-label {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pi-tag-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.pi-profile-tag {
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.35);
  color: var(--purple-light);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 100px;
}
.pi-impress {
  font-size: 12px;
  color: var(--yellow);
  background: rgba(234,179,8,0.1);
  border: 1px solid rgba(234,179,8,0.25);
  padding: 5px 12px;
  border-radius: 100px;
}

.pi-verdict {
  font-size: 18px;
  font-weight: 700;
}

@media (max-width: 600px) {
  .pi-score-row { grid-template-columns: repeat(2, 1fr); }
}

/* ── ACTIVITY CHART ── */
.activity-chart {
  display: block;
  margin: 0 auto;
  border-radius: 8px;
}

.activity-legend {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.act-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}
.act-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 4px #22c55e;
  flex-shrink: 0;
}
.act-label {
  flex: 1;
  color: var(--text-muted);
}
.act-val {
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  min-width: 24px;
  text-align: right;
}
.act-pct {
  color: #22c55e;
  font-family: 'JetBrains Mono', monospace;
  min-width: 32px;
  text-align: right;
}

/* ── LOGOUT BUTTON ── */
.nav-logout {
  display: flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: 1px solid rgba(239,68,68,0.25);
  color: var(--text-dim);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.nav-logout:hover {
  border-color: var(--red);
  color: var(--red);
  background: rgba(239,68,68,0.06);
}
.nav-logout svg { width: 15px; height: 15px; }

/* ── README CHAT ── */
.readme-chat-wrap {
  margin-top: 20px;
}
.readme-chat-card {
  background: var(--surface);
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: 380px;
}
.readme-chat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.readme-chat-header span:last-of-type { flex: 1; }
.readme-chat-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}
.readme-chat-close:hover { color: var(--red); }
.readme-chat-close svg { width: 14px; height: 14px; }
.readme-chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--surface2) transparent;
}

/* ── README CHAT GREETING ── */
.readme-greeting {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  background: rgba(124,58,237,0.06);
  border: 1px solid rgba(124,58,237,0.15);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}
.readme-greeting-avatar {
  font-size: 22px;
  flex-shrink: 0;
  margin-top: 2px;
}
.readme-greeting-body { flex: 1; }
.readme-greeting-body strong { color: var(--text); }

.chat-limit-badge {
  display: inline-block;
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.3);
  color: var(--purple-light);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 100px;
  vertical-align: middle;
}

.chat-limit-warn {
  margin-top: 6px;
  font-size: 11px;
  color: var(--yellow);
  opacity: 0.8;
}

/* ── README CHAT INPUT WRAP ── */
.readme-chat-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}
.readme-chat-input-wrap input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 44px 9px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.readme-chat-input-wrap input:focus { border-color: var(--purple); }
.readme-chat-input-wrap input::placeholder { color: var(--text-dim); }

.chat-counter {
  position: absolute;
  right: 10px;
  font-size: 10px;
  color: var(--text-dim);
  pointer-events: none;
  font-family: 'JetBrains Mono', monospace;
}

/* ── THREE.JS CANVAS ── */
#bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--bg);
}

/* ── HOME LOGO ── */
.home-logo {
  text-align: center;
  margin-bottom: 28px;
  line-height: 1;
}
.home-logo-main {
  font-size: clamp(52px, 10vw, 96px);
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #fff 30%, var(--purple-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 32px rgba(168,85,247,0.35));
}
.home-logo-sub {
  font-size: clamp(14px, 2.5vw, 22px);
  font-weight: 500;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--purple-light);
  opacity: 0.85;
  margin-top: 4px;
}

/* ── REVEAL ANIMATIONS ── */
.reveal-logo {
  opacity: 0;
  transform: translateY(-24px) scale(0.94);
  animation: revealLogo 0.9s cubic-bezier(0.22,1,0.36,1) 0.1s forwards;
}
@keyframes revealLogo {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.reveal-item {
  opacity: 0;
  transform: translateY(20px);
  animation: revealUp 0.6s cubic-bezier(0.22,1,0.36,1) var(--d, 0.5s) forwards;
}
@keyframes revealUp {
  to { opacity: 1; transform: translateY(0); }
}

/* ── NAV BRAND SUB ── */
.nav-brand-sub {
  font-weight: 400;
  opacity: 0.7;
  font-size: 12px;
  letter-spacing: 0.12em;
}

/* ── TURNSTILE ── */
.turnstile-wrap {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}
.cf-turnstile {
  width: 100%;
  max-width: 520px;
}
.turnstile-error {
  color: var(--red);
  font-size: 12px;
  text-align: center;
  margin-top: 8px;
  animation: revealUp 0.3s ease forwards;
}

/* ── LOGO IMAGE ── */
.home-logo-img {
  height: clamp(64px, 12vw, 110px);
  width: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 0 28px rgba(168,85,247,0.5));
  object-fit: contain;
}

.nav-logo-img {
  height: 24px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(168,85,247,0.4));
  flex-shrink: 0;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 7px;
}

.chat-logo-img {
  height: 18px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(168,85,247,0.4));
  flex-shrink: 0;
}
