:root {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

body[data-page="github"] {
  min-height: 100vh;
  margin: 0;
  overflow-x: clip;
  background:
    radial-gradient(circle at 82% 2%, rgba(20, 99, 255, 0.08), transparent 28rem),
    var(--product-bg);
  color: var(--product-text);
}

.github-main {
  width: auto;
  min-width: 0;
  margin-left: var(--product-content-start);
  padding: 30px 32px 48px;
}

.github-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  padding: 18px 0 28px;
}

.github-eyebrow,
.github-board__header > div > span,
.github-new header span {
  color: var(--product-primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.github-hero h1 {
  margin: 8px 0 0;
  font-size: clamp(2.35rem, 5vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: -0.065em;
}

.github-hero__copy p {
  max-width: 700px;
  margin: 18px 0 0;
  color: var(--product-text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

.github-hero__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.github-sync-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--product-text-secondary);
  font-size: 12px;
  white-space: nowrap;
}

.github-sync-state i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--product-success);
}

.github-sync-state.is-warning i {
  border-radius: 2px;
  background: var(--product-orange);
  transform: rotate(45deg);
}

#github-refresh {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--product-border);
  border-radius: 9px;
  background: var(--product-surface);
  color: var(--product-text);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
}

#github-refresh:hover,
#github-refresh:focus-visible {
  border-color: var(--product-primary);
  color: var(--product-primary);
}

.github-board,
.github-new,
.github-methodology {
  border: 1px solid var(--product-border);
  border-radius: 16px;
  background: var(--product-surface);
  box-shadow: var(--product-shadow);
}

.github-board {
  overflow: hidden;
}

.github-board__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 26px 18px;
  border-bottom: 1px solid var(--product-border-soft);
}

.github-board h2,
.github-new h2 {
  margin: 5px 0 0;
  font-size: 1.35rem;
  letter-spacing: -0.025em;
}

.github-board__meta {
  display: flex;
  gap: 28px;
  margin: 0;
}

.github-board__meta div {
  display: grid;
  gap: 4px;
}

.github-board__meta dt {
  color: var(--product-text-tertiary);
  font-size: 10px;
}

.github-board__meta dd {
  margin: 0;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 720;
}

.github-board__summary {
  margin: 0;
  padding: 13px 26px;
  background: var(--product-surface-alt);
  color: var(--product-text-secondary);
  font-size: 11px;
}

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

.github-ranking li + li {
  border-top: 1px solid var(--product-border-soft);
}

.github-ranking a {
  display: grid;
  min-height: 92px;
  grid-template-columns: 42px minmax(240px, 1fr) 110px 110px 126px 24px;
  align-items: center;
  gap: 18px;
  padding: 13px 26px;
  color: inherit;
  text-decoration: none;
}

.github-ranking a:hover,
.github-ranking a:focus-visible {
  background: color-mix(in srgb, var(--product-primary) 5%, var(--product-surface));
}

.github-ranking__rank {
  color: var(--product-text-tertiary);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.github-ranking li:first-child .github-ranking__rank {
  color: var(--product-primary);
  font-size: 18px;
}

.github-ranking__identity {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.github-ranking__identity strong,
.github-ranking__identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.github-ranking__identity strong {
  font-size: 14px;
}

.github-ranking__identity small,
.github-ranking__language {
  color: var(--product-text-tertiary);
  font-size: 11px;
}

.github-ranking__language {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.github-ranking__stars,
.github-ranking__growth {
  display: grid;
  gap: 4px;
  text-align: right;
}

.github-ranking__stars small,
.github-ranking__growth small {
  color: var(--product-text-tertiary);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.github-ranking__stars b,
.github-ranking__growth b {
  font-variant-numeric: tabular-nums;
}

.github-ranking__growth b {
  color: var(--product-primary);
  font-size: 1.35rem;
  letter-spacing: -0.04em;
}

.github-ranking__arrow {
  color: var(--product-primary);
}

.github-state-card {
  margin: 24px;
  padding: 44px 24px;
  border: 1px dashed var(--product-border);
  border-radius: 12px;
  text-align: center;
}

.github-state-card p {
  margin: 8px 0 0;
  color: var(--product-text-tertiary);
  font-size: 12px;
}

.github-new {
  margin-top: 18px;
  padding: 22px 24px 24px;
}

.github-new > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.github-new > header p {
  margin: 0;
  color: var(--product-text-tertiary);
  font-size: 11px;
}

.github-new__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.github-new__list a {
  display: grid;
  min-width: 0;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--product-border-soft);
  border-radius: 10px;
  background: var(--product-surface-alt);
  color: inherit;
  text-decoration: none;
}

.github-new__list strong,
.github-new__list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.github-new__list span {
  color: var(--product-text-tertiary);
  font-size: 10px;
}

.github-methodology {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
  padding: 16px 18px;
  box-shadow: none;
}

.github-methodology strong {
  font-size: 12px;
}

.github-methodology p {
  margin: 0;
  color: var(--product-text-tertiary);
  font-size: 10px;
  line-height: 1.5;
}

.github-methodology a {
  color: var(--product-primary);
  font-size: 11px;
  font-weight: 720;
  text-decoration: none;
  white-space: nowrap;
}

@media (max-width: 1050px) {
  .github-ranking a {
    grid-template-columns: 34px minmax(220px, 1fr) 90px 116px 20px;
  }

  .github-ranking__language {
    display: none;
  }
}

@media (max-width: 699px) {
  .github-main {
    margin-left: 0;
    padding: calc(var(--product-mobile-header-height) + 20px) 16px 34px;
  }

  .github-hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 20px;
    padding-top: 10px;
  }

  .github-hero h1 {
    font-size: clamp(2.45rem, 13vw, 3.5rem);
  }

  .github-hero__actions {
    width: 100%;
    justify-content: space-between;
  }

  .github-board__header,
  .github-new > header {
    align-items: flex-start;
    flex-direction: column;
  }

  .github-board__meta {
    width: 100%;
    justify-content: space-between;
  }

  .github-ranking a {
    min-height: 112px;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 8px 10px;
    padding: 14px 16px;
  }

  .github-ranking__rank {
    grid-row: 1 / 3;
    align-self: start;
    padding-top: 2px;
  }

  .github-ranking__identity {
    grid-column: 2 / 4;
  }

  .github-ranking__stars {
    grid-column: 2;
    text-align: left;
  }

  .github-ranking__growth {
    grid-column: 3;
  }

  .github-ranking__arrow,
  .github-ranking__language {
    display: none;
  }

  .github-new__list {
    grid-template-columns: 1fr;
  }

  .github-methodology {
    grid-template-columns: 1fr;
  }
}

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