:root {
  --bg: #080b12;
  --surface: #101620;
  --surface-2: #161e2a;
  --border: #263142;
  --text: #f4f7fb;
  --muted: #9aa7b8;
  --accent: #7bf1a8;
  --accent-dark: #061d10;
  --blue: #8bc7ff;
  --danger: #ff9a9a;
  --radius: 18px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 80% 0%, rgba(77, 139, 255, .12), transparent 30rem),
    linear-gradient(180deg, #090d15 0%, var(--bg) 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

button, input, select { font: inherit; }
a { color: inherit; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 20;
  padding: .7rem 1rem;
  color: #07110b;
  background: var(--accent);
  border-radius: 8px;
}

.skip-link:focus { top: 1rem; }

.site-header,
.site-footer,
main {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 750;
  letter-spacing: -.02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  aspect-ratio: 1;
  color: #08100b;
  background: var(--accent);
  border-radius: 10px;
  font: 800 .72rem ui-monospace, monospace;
}

.header-note { margin: 0; color: var(--muted); font-size: .9rem; }

main { padding-block: clamp(2.5rem, 7vw, 6rem); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: end;
  margin-bottom: 3rem;
}

.eyebrow {
  margin: 0 0 .7rem;
  color: var(--accent);
  font: 700 .72rem ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1, h2, h3, p { overflow-wrap: anywhere; }
h1, h2, h3 { margin-top: 0; line-height: 1.12; }

h1 {
  max-width: 760px;
  margin-bottom: 1rem;
  font-size: clamp(2.35rem, 5vw, 4.8rem);
  letter-spacing: -.055em;
}

.hero-text { max-width: 660px; margin: 0; color: var(--muted); font-size: 1.08rem; }

.search-panel,
.status-card,
.profile-card,
.repo-panel {
  background: rgba(16, 22, 32, .88);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.search-panel { padding: 1.25rem; }
.search-panel > label, .field label { display: block; margin-bottom: .5rem; font-size: .82rem; font-weight: 700; }

.search-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  overflow: hidden;
  background: #090d14;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.search-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(123, 241, 168, .12); }
.input-prefix { padding-left: .9rem; color: #68768a; font: .82rem ui-monospace, monospace; }

input, select {
  width: 100%;
  min-height: 46px;
  padding: .72rem .85rem;
  color: var(--text);
  background: #090d14;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: 0;
}

.search-row input { border: 0; border-radius: 0; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(123, 241, 168, .12); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .68rem 1rem;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 750;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.button:hover { transform: translateY(-1px); }
.button:focus-visible, .text-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.button:disabled { cursor: wait; opacity: .65; transform: none; }
.button-primary { margin: 4px; color: #07110b; background: var(--accent); }
.button-primary:hover { background: #a4fac4; }
.button-secondary { color: var(--text); background: transparent; border-color: var(--border); }
.button-secondary:hover { border-color: #536175; background: var(--surface-2); }

.search-meta { margin-top: .75rem; font-size: .78rem; }
.search-meta p { margin: 0; color: var(--muted); }
.text-button { padding: 0; color: var(--blue); background: none; border: 0; cursor: pointer; text-decoration: underline; }
.validation-message:not(:empty) { margin-top: .35rem; color: var(--danger); }

.status-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 1.4rem;
  margin-bottom: 2rem;
}

.status-card[hidden] { display: none; }
.status-card h2 { margin-bottom: .2rem; font-size: 1rem; }
.status-card p { margin: 0; color: var(--muted); font-size: .9rem; }
.status-card.is-error { border-color: rgba(255, 154, 154, .5); }
.status-card.is-error .status-symbol { color: var(--danger); }
.status-symbol { color: var(--accent); font: 1.6rem ui-monospace, monospace; }

.dashboard {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.dashboard[hidden] { display: none; }
.profile-card { position: sticky; top: 1rem; padding: 1.25rem; }
.profile-top { text-align: center; }
.avatar { width: 116px; height: 116px; margin-bottom: .8rem; object-fit: cover; border: 1px solid var(--border); border-radius: 28px; }
.profile-name { margin-bottom: .2rem; font-size: 1.45rem; }
.profile-login { margin: 0 0 .85rem; color: var(--accent); font: .85rem ui-monospace, monospace; }
.profile-bio { margin: 0; color: var(--muted); font-size: .9rem; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; margin: 1.25rem 0; }
.stat { padding: .7rem .3rem; text-align: center; background: #0a0f17; border: 1px solid var(--border); border-radius: 10px; }
.stat strong, .stat span { display: block; }
.stat strong { font-size: 1.05rem; }
.stat span { color: var(--muted); font-size: .68rem; }
.profile-list { display: grid; gap: .55rem; padding: 1rem 0 0; margin: 0; border-top: 1px solid var(--border); list-style: none; color: var(--muted); font-size: .84rem; }
.profile-list a { color: var(--blue); }

.repo-panel { min-width: 0; padding: clamp(1rem, 3vw, 1.6rem); }
.panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; }
.panel-heading h2 { margin: 0; font-size: clamp(1.45rem, 3vw, 2rem); }
.count-badge { display: inline-block; padding: .18rem .55rem; color: var(--muted); background: #090d14; border: 1px solid var(--border); border-radius: 999px; font-size: .75rem; vertical-align: middle; }
.language-summary { display: flex; flex-wrap: wrap; gap: .5rem; padding: 1rem 0 1.2rem; }
.language-chip { padding: .28rem .6rem; color: var(--muted); background: #0b111a; border: 1px solid var(--border); border-radius: 999px; font-size: .75rem; }
.language-chip strong { color: var(--text); }

.repo-controls { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: .8rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.repo-status { min-height: 1.3rem; margin: .75rem 0; color: var(--muted); font-size: .82rem; }
.repo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.repo-card { display: flex; flex-direction: column; min-width: 0; min-height: 190px; padding: 1rem; background: #0b1018; border: 1px solid var(--border); border-radius: 13px; transition: transform .18s ease, border-color .18s ease; }
.repo-card:hover { transform: translateY(-2px); border-color: #4a5a70; }
.repo-name { margin-bottom: .45rem; font-size: 1rem; }
.repo-name a { color: var(--blue); text-decoration: none; }
.repo-name a:hover { text-decoration: underline; }
.repo-description { flex: 1; margin: 0; color: var(--muted); font-size: .84rem; }
.repo-meta { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1rem; color: #aeb8c7; font: .72rem ui-monospace, monospace; }
.repo-language::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: .35rem; background: var(--accent); border-radius: 50%; }
.empty-repos { grid-column: 1 / -1; padding: 2rem; color: var(--muted); text-align: center; border: 1px dashed var(--border); border-radius: 12px; }

.site-footer { padding-block: 2rem; color: var(--muted); border-top: 1px solid var(--border); font-size: .82rem; }
.site-footer p { margin: 0; }

@media (max-width: 900px) {
  .hero, .dashboard { grid-template-columns: 1fr; }
  .profile-card { position: static; }
  .profile-card { display: grid; grid-template-columns: minmax(180px, .8fr) minmax(240px, 1.2fr); gap: 1rem; }
  .profile-list { border-top: 0; border-left: 1px solid var(--border); padding: .5rem 0 .5rem 1.2rem; }
}

@media (max-width: 640px) {
  .header-note, .input-prefix { display: none; }
  .site-header, .site-footer, main { width: min(100% - 1.25rem, 1180px); }
  main { padding-top: 2rem; }
  h1 { font-size: clamp(2.2rem, 13vw, 3.2rem); }
  .search-row { grid-template-columns: 1fr; background: transparent; border: 0; overflow: visible; gap: .6rem; }
  .search-row:focus-within { box-shadow: none; }
  .search-row input { border: 1px solid var(--border); border-radius: 10px; }
  .button-primary { width: 100%; margin: 0; }
  .profile-card { display: block; }
  .profile-list { border-top: 1px solid var(--border); border-left: 0; padding: 1rem 0 0; }
  .panel-heading { align-items: start; flex-direction: column; }
  .repo-controls, .repo-grid { grid-template-columns: 1fr; }
  .button-secondary { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
