:root {
  --bg: #08090c;
  --bg-soft: #0c0e13;
  --panel: rgba(16, 18, 24, 0.72);
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f3f5f9;
  --muted: #9aa2b4;
  --dim: #687085;
  --accent: #ff7a2f;
  --accent-2: #ff4d6d;
  --accent-soft: rgba(255, 122, 47, 0.12);
  --green: #46d39a;
  --radius: 18px;
  --wrap: 1080px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: min(var(--wrap), 100% - 40px);
  margin-inline: auto;
}

/* ---------------------------------------------------------------- backdrop */

.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(680px 380px at 18% -6%, rgba(255, 122, 47, 0.16), transparent 70%),
    radial-gradient(720px 420px at 88% -12%, rgba(122, 108, 255, 0.14), transparent 70%),
    radial-gradient(900px 600px at 50% 120%, rgba(70, 211, 154, 0.05), transparent 70%);
}

.aurora::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 55%);
}

/* ----------------------------------------------------------------- topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 12, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: #140800;
  background: linear-gradient(140deg, #ffc27a, #ff7a2f 45%, #ff3d5e);
  box-shadow: 0 4px 16px rgba(255, 92, 40, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.brand-mark svg {
  width: 17px;
  height: 17px;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-lite {
  margin-left: 6px;
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 2px;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid rgba(70, 211, 154, 0.25);
  border-radius: 999px;
  background: rgba(70, 211, 154, 0.08);
  color: #8ff0c4;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(70, 211, 154, 0.5);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(70, 211, 154, 0.45); }
  70% { box-shadow: 0 0 0 7px rgba(70, 211, 154, 0); }
  100% { box-shadow: 0 0 0 0 rgba(70, 211, 154, 0); }
}

.gh-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  transition: 0.18s ease;
}

.gh-link:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
}

/* ------------------------------------------------------------------- hero */

.hero {
  padding: 58px 0 30px;
  max-width: 720px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow-line {
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.hero h1 {
  margin: 0;
  font-size: clamp(32px, 6.4vw, 48px);
  font-weight: 680;
  line-height: 1.06;
  letter-spacing: -0.035em;
}

.grad {
  background: linear-gradient(96deg, #ffc27a, #ff7a2f 42%, #ff4d6d);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  margin: 18px 0 0;
  max-width: 560px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.snapshot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 20px 0 0;
  color: var(--dim);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.snapshot b {
  color: var(--text);
  font-weight: 600;
}

.dot-sep {
  color: rgba(255, 255, 255, 0.2);
}

/* ------------------------------------------------------------------ board */

.board {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.board.is-loading::after {
  content: "";
  position: absolute;
  top: 0;
  left: -35%;
  width: 35%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: sweep 1.1s ease-in-out infinite;
  z-index: 2;
}

@keyframes sweep {
  to { left: 100%; }
}

.repo-list {
  transition: opacity 0.18s ease;
}

.repo-list.is-loading {
  opacity: 0.4;
  pointer-events: none;
}

.banner {
  padding: 9px 22px;
  border-bottom: 1px solid rgba(255, 122, 47, 0.22);
  background: rgba(255, 122, 47, 0.08);
  color: #ffc59b;
  font-size: 12px;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.012);
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.35);
  gap: 2px;
}

.segmented button {
  padding: 7px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  transition: 0.16s ease;
  white-space: nowrap;
}

.segmented button:hover {
  color: var(--text);
}

.segmented button[aria-selected="true"] {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.control-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
  min-width: 0;
}

.select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  height: 36px;
  padding: 0 30px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: 0.16s ease;
}

.select-wrap select:hover,
.select-wrap select:focus-visible {
  color: var(--text);
  border-color: var(--line-strong);
  outline: none;
}

.select-wrap select option {
  background: #12141a;
  color: var(--text);
}

.select-chevron {
  position: absolute;
  right: 10px;
  width: 13px;
  height: 13px;
  color: var(--dim);
  pointer-events: none;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: min(240px, 100%);
}

.search-wrap > svg {
  position: absolute;
  left: 11px;
  width: 15px;
  height: 15px;
  color: var(--dim);
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  height: 36px;
  padding: 0 34px 0 33px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-size: 13px;
  transition: 0.16s ease;
}

.search-wrap input::placeholder {
  color: var(--dim);
}

.search-wrap input:focus {
  outline: none;
  border-color: rgba(255, 122, 47, 0.45);
  background: rgba(0, 0, 0, 0.45);
  box-shadow: 0 0 0 3px rgba(255, 122, 47, 0.1);
}

.search-wrap input::-webkit-search-cancel-button {
  appearance: none;
}

.search-wrap kbd {
  position: absolute;
  right: 8px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--muted);
  cursor: pointer;
  transition: 0.16s ease;
}

.icon-btn svg {
  width: 15px;
  height: 15px;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.icon-btn.spinning svg {
  animation: spin 0.9s linear infinite;
}

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

/* ------------------------------------------------------------------- list */

.list-head {
  display: grid;
  grid-template-columns: 48px 1fr 150px;
  gap: 14px;
  padding: 10px 22px;
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.head-gained {
  text-align: right;
}

.repo-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.repo {
  display: grid;
  grid-template-columns: 48px 1fr 150px;
  gap: 14px;
  align-items: start;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: background 0.18s ease;
  animation: rise 0.42s cubic-bezier(0.2, 0.7, 0.3, 1) both;
  animation-delay: calc(var(--i, 0) * 26ms);
}

.repo:last-child {
  border-bottom: 0;
}

.repo:hover {
  background: rgba(255, 255, 255, 0.022);
}

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

.repo::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  opacity: 0;
  transition: opacity 0.18s ease;
}

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

@keyframes rise {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

.rank {
  padding-top: 2px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.repo:nth-child(1) .rank,
.repo:nth-child(2) .rank,
.repo:nth-child(3) .rank {
  color: var(--accent);
  font-weight: 600;
}

.repo-main {
  min-width: 0;
}

.repo-title {
  display: inline-block;
  font-size: 15.5px;
  font-weight: 620;
  letter-spacing: -0.012em;
  word-break: break-word;
  transition: color 0.15s ease;
}

.owner {
  color: var(--muted);
  font-weight: 450;
}

.repo-desc {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.repo-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  color: var(--dim);
  font-size: 12px;
}

.repo-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.repo-meta svg {
  width: 13px;
  height: 13px;
  opacity: 0.9;
}

.lang-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dim);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.04);
}

.builders {
  display: flex;
  align-items: center;
  padding-left: 2px;
}

.builders img {
  width: 20px;
  height: 20px;
  margin-left: -6px;
  border: 2px solid #0e1015;
  border-radius: 50%;
  background: #1a1d25;
  object-fit: cover;
}

.builders img:first-child {
  margin-left: 0;
}

.gained {
  text-align: right;
  padding-top: 1px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.gained-value {
  display: block;
  color: var(--accent);
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.gained-value.flat {
  color: var(--dim);
  font-weight: 500;
}

.repo-meta .gained-inline {
  display: none;
}

.gained-label {
  display: block;
  margin-top: 1px;
  color: var(--dim);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

/* ------------------------------------------------------------ states/empty */

.state {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
}

.state svg {
  width: 26px;
  height: 26px;
  margin-bottom: 10px;
  color: var(--dim);
}

.state h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}

.state p {
  margin: 0;
  font-size: 13px;
}

.state button {
  margin-top: 16px;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.state button:hover {
  background: rgba(255, 255, 255, 0.09);
}

.skeleton {
  display: grid;
  grid-template-columns: 48px 1fr 150px;
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.sk {
  height: 11px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 37%, rgba(255, 255, 255, 0.05) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

.sk.title { width: 42%; height: 14px; }
.sk.desc { width: 88%; margin-top: 10px; }
.sk.desc.short { width: 62%; margin-top: 7px; }
.sk.meta { width: 30%; height: 9px; margin-top: 12px; }
.sk.gained { width: 62%; height: 14px; margin-left: auto; }

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* ------------------------------------------------------------------ footer */

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  align-items: center;
  justify-content: space-between;
  padding: 34px 2px 64px;
  color: var(--dim);
  font-size: 12px;
}

.foot p {
  margin: 0;
}

.foot a {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.18);
  text-underline-offset: 3px;
}

.foot a:hover {
  color: var(--text);
}

/* --------------------------------------------------------------- responsive */

@media (max-width: 760px) {
  .wrap {
    width: min(var(--wrap), 100% - 28px);
  }

  .hero {
    padding: 38px 0 24px;
  }

  .lede {
    font-size: 14px;
  }

  .controls {
    padding: 12px;
    gap: 10px;
  }

  .segmented {
    width: 100%;
  }

  .segmented button {
    flex: 1;
    padding-inline: 6px;
    font-size: 12px;
  }

  .control-right {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .search-wrap {
    order: 3;
    width: 100%;
  }

  .select-wrap {
    flex: 1;
  }

  .select-wrap select {
    width: 100%;
  }

  .search-wrap kbd {
    display: none;
  }

  .list-head,
  .repo,
  .skeleton {
    grid-template-columns: 30px 1fr;
    gap: 10px;
    padding-inline: 14px;
  }

  .head-gained,
  .repo .gained {
    display: none;
  }

  .repo {
    padding-block: 16px;
  }

  .repo-meta .gained-inline {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    margin-left: auto;
    color: var(--accent);
    font-size: 12px;
    font-weight: 650;
    letter-spacing: -0.01em;
  }

  .repo-meta .gained-inline i {
    color: var(--dim);
    font-size: 10px;
    font-style: normal;
    font-weight: 400;
  }

  .repo-desc {
    font-size: 12.8px;
  }

  .repo-meta {
    gap: 10px;
    font-size: 11.5px;
  }

  .builders {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 28px;
  }

  .hero {
    padding-top: 32px;
  }
}

@media (max-width: 420px) {
  .brand-lite,
  .gh-link-text {
    display: none;
  }

  .live-pill {
    padding-inline: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
