:root {
  --bg: #081421;
  --panel: rgba(15, 23, 42, 0.92);
  --panel-soft: rgba(30, 41, 59, 0.8);
  --text: #ebf2ff;
  --muted: #a6bfdc;
  --accent: #7dd3fc;
  --accent-strong: #38bdf8;
  --border: rgba(148, 163, 184, 0.22);
  --shadow: rgba(2, 6, 23, 0.48);
  --danger-bg: rgba(127, 29, 29, 0.38);
  --danger-text: #fecdd3;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, rgba(56, 189, 248, 0.18), transparent 28%), var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.hidden {
  display: none !important;
}

.page-shell {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 64px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 18px 40px var(--shadow);
  padding: 24px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.3rem, 5vw, 4rem);
}

.subtitle {
  margin: 8px 0 0;
  max-width: 540px;
  color: var(--muted);
}

.search-bar {
  display: flex;
  gap: 12px;
  width: min(100%, 420px);
}

.search-bar input {
  flex: 1;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  padding: 14px 16px;
}

.search-bar button,
.cta-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #02111f;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.search-bar button:hover,
.cta-link:hover {
  transform: translateY(-1px);
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 2px solid rgba(125, 211, 252, 0.65);
}

.profile-header h2 {
  margin: 0 0 4px;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.handle {
  margin: 0 0 10px;
  color: var(--accent);
  font-weight: 600;
}

.bio {
  margin: 0;
  color: var(--muted);
  max-width: 560px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--panel-soft);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px 18px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 10px;
}

.stat-card strong {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.section-header {
  margin-bottom: 16px;
}

.section-header h3 {
  margin: 0;
  font-size: 1.25rem;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  background: rgba(125, 211, 252, 0.12);
  border: 1px solid rgba(125, 211, 252, 0.32);
  border-radius: 999px;
}

.repo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.repo-card {
  display: block;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  text-decoration: none;
  color: inherit;
}

.repo-card h4 {
  margin: 0;
  font-size: 1.1rem;
}

.repo-card p {
  margin: 12px 0;
  color: var(--muted);
  min-height: 48px;
}

.repo-title-row,
.repo-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.repo-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.error-panel {
  margin-bottom: 24px;
  border-color: rgba(251, 113, 133, 0.5);
  background: var(--danger-bg);
}

.error-panel strong {
  display: block;
  margin-bottom: 8px;
  color: var(--danger-text);
}

@media (max-width: 720px) {
  .hero,
  .profile-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats-grid,
  .repo-grid,
  .search-bar {
    display: grid;
    grid-template-columns: 1fr;
  }
}
