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

:root {
  --bg: #f9f9f8;
  --surface: #ffffff;
  --border: #e5e5e3;
  --text: #1a1a1a;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --radius: 8px;
  --max-w: 720px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

nav {
  position: sticky;
  top: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

nav .inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 52px;
}

nav .brand {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s;
}

nav a:hover, nav a.active {
  color: var(--accent);
}

main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

/* Profile page */
.profile-header {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.6rem;
  font-weight: 700;
  flex-shrink: 0;
}

.profile-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}

.role-badge {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
  margin-bottom: 0.5rem;
}

.profile-header .tagline {
  color: var(--muted);
  font-size: 0.9rem;
}

section {
  margin-bottom: 2.5rem;
}

section h2 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

section p {
  color: #374151;
  font-size: 0.95rem;
  margin-bottom: 0.85rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.tag {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.2rem 0.65rem;
  border-radius: 99px;
}

/* Repos page */
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}

.page-subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.repo-grid {
  display: grid;
  gap: 0.75rem;
}

.repo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.repo-card .repo-name {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.repo-card .repo-name a {
  color: var(--accent);
  text-decoration: none;
}

.repo-card .repo-name a:hover {
  text-decoration: underline;
}

.repo-card .repo-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.repo-card .repo-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.65rem;
}

.repo-meta span {
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

span.repo-topic {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-light);
  border-radius: 99px;
  padding: 0.15rem 0.55rem;
}

a.repo-site {
  font-size: 0.75rem;
  color: var(--accent);
  text-decoration: none;
  margin-left: auto;
}

a.repo-site:hover {
  text-decoration: underline;
}

.loading {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 2rem 0;
  text-align: center;
}

.error-msg {
  color: #dc2626;
  font-size: 0.85rem;
  padding: 1rem;
  background: #fef2f2;
  border-radius: var(--radius);
  border: 1px solid #fecaca;
}

footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 1.25rem 1.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}

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

footer a:hover {
  color: var(--accent);
}

@media (max-width: 600px) {
  .profile-header { flex-direction: column; }
  nav .inner { gap: 1.25rem; }
}
