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

:root {
  --bg: #0a0a0f;
  --surface: #111118;
  --border: #1e1e2e;
  --accent: #00ff88;
  --accent2: #7c3aed;
  --text: #e2e2f0;
  --muted: #5a5a7a;
  --card-bg: #13131f;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Space Mono', monospace;
  min-height: 100vh;
  overflow-x: hidden;
}

/* GRID TEXTURE */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,255,136,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,136,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* NOISE TEXTURE */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

/* ── HEADER ── */
header {
  padding: 4rem 0 3rem;
  position: relative;
}

.header-inner {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
}

.avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  display: block;
  box-shadow: 0 0 30px rgba(0,255,136,0.2);
}

.avatar-glow {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(0,255,136,0.15);
  animation: pulse-ring 3s ease-in-out infinite;
}

@keyframes pulse-ring {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.08); opacity: 1; }
}

.header-text { flex: 1; }

.username {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text);
}

.username span {
  color: var(--accent);
}

.tagline {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bio {
  margin-top: 0.9rem;
  font-size: 0.88rem;
  color: var(--text);
  opacity: 0.75;
  line-height: 1.7;
  font-family: 'Syne', sans-serif;
  font-weight: 400;
}

.header-stats {
  display: flex;
  gap: 2rem;
  margin-top: 1.4rem;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-val {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.gh-link {
  margin-top: 1.4rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.08em;
  border: 1px solid rgba(0,255,136,0.3);
  padding: 0.45rem 1rem;
  border-radius: 2px;
  transition: all 0.2s;
}

.gh-link:hover {
  background: rgba(0,255,136,0.08);
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(0,255,136,0.15);
}

/* ── DIVIDER ── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border) 20%, var(--accent) 50%, var(--border) 80%, transparent);
  margin: 0.5rem 0 2.5rem;
}

/* ── FILTER BAR ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
}

.filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.3rem 0.8rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.2s;
}

.filter-btn:hover, .filter-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0,255,136,0.06);
}

.sort-wrap {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sort-select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  padding: 0.3rem 0.6rem;
  border-radius: 2px;
  cursor: pointer;
  outline: none;
}

/* ── GRID ── */
.repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
}

/* ── CARD ── */
.repo-card {
  background: var(--card-bg);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transition: background 0.2s;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px);
  animation: fade-in 0.4s ease forwards;
}

.repo-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent2), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.repo-card:hover {
  background: #161624;
}

.repo-card:hover::before {
  opacity: 1;
}

@keyframes fade-in {
  to { opacity: 1; transform: translateY(0); }
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.repo-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  line-height: 1.3;
  transition: color 0.2s;
}

.repo-name:hover { color: var(--accent); }

.fork-badge {
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent2);
  border: 1px solid var(--accent2);
  padding: 0.15rem 0.4rem;
  border-radius: 2px;
  flex-shrink: 0;
  opacity: 0.7;
}

.repo-desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.6;
  font-family: 'Syne', sans-serif;
  flex: 1;
}

.repo-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.topic {
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(124,58,237,0.12);
  color: #a78bfa;
  border: 1px solid rgba(124,58,237,0.25);
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
}

.card-footer {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.meta svg { width: 13px; height: 13px; flex-shrink: 0; }

.lang-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.updated {
  margin-left: auto;
  font-size: 0.62rem;
  color: var(--muted);
  opacity: 0.6;
}

/* ── LOADING ── */
.loading {
  grid-column: 1 / -1;
  padding: 5rem 2rem;
  text-align: center;
}

.spinner {
  width: 36px; height: 36px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.2rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading p {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.1em;
}

/* ── ERROR / EMPTY ── */
.state-msg {
  grid-column: 1 / -1;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.state-msg .icon { font-size: 2.5rem; display: block; margin-bottom: 1rem; }

/* ── FOOTER ── */
footer {
  margin-top: 5rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

footer p {
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.1em;
}

footer a { color: var(--accent); text-decoration: none; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .header-inner { flex-direction: column; }
  .sort-wrap { margin-left: 0; }
  .filter-bar { flex-direction: column; align-items: flex-start; }
}
