/* ============================================================
   Contributor profiles - a profile (contributor.html, hc-) and every
   contributor (contributors.html, hcx-)

   Loaded after site.css and hub.css. A rank or an achievement sets its
   own color on the element that shows it (--rk, and --rk-rgb as
   "r, g, b" for the soft glows), so every rank reads in its own color
   while everything else stays on the site's neutral surfaces. Every
   animation has a reduced-motion override at the end.
   ============================================================ */

/* ---------------- a profile: the hero ---------------- */

.hc-hero {
  --rk: #8c9197;
  --rk-rgb: 140, 145, 151;
  position: relative;
  overflow: hidden;
  padding: 34px 0 44px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg-0);
}
/* The rank's light, from behind the avatar. */
.hc-glow {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(520px 300px at 14% 30%, rgba(var(--rk-rgb), 0.17), transparent 70%),
    radial-gradient(900px 260px at 50% -10%, rgba(var(--rk-rgb), 0.06), transparent 75%);
}
.hc-hero .container { position: relative; z-index: 1; }
.hc-wrap { max-width: 1040px; }

.hc-id { display: flex; align-items: center; gap: 30px; margin-top: 6px; }
.hc-avatar-wrap { position: relative; flex: none; width: 124px; height: 124px; }
.hc-avatar-wrap .hc-avatar {
  width: 124px; height: 124px;
  border: 0;
  box-shadow: 0 0 0 3px var(--bg-0), 0 0 0 5px var(--rk), 0 12px 44px rgba(var(--rk-rgb), 0.28);
}
.hc-avatar-emblem {
  position: absolute; right: -8px; bottom: -6px;
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--bg-0);
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.55));
}
.hc-avatar-emblem .hub-emblem .hub-emblem-hex { fill-opacity: 0.26; }

.hc-id-main { min-width: 0; }
.hc-eyebrow {
  margin: 0 0 4px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
}
.hc-name {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  margin: 0 0 8px;
  font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.1;
  color: var(--ink);
}
.hc-name-text { min-width: 0; overflow-wrap: anywhere; }
.hc-name .hub-badge { font-size: 0.66rem; }
.hc-rank { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 1.05rem; }
.hc-rank-name {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em;
  color: var(--rk);
  text-shadow: 0 0 22px rgba(var(--rk-rgb), 0.35);
}
.hc-rank-since { color: var(--muted); font-size: 0.88rem; }
.hc-rank-none { color: var(--muted); font-size: 0.95rem; }
.hc-rank-desc { margin: 4px 0 0; color: var(--ink-dim); font-size: 0.95rem; max-width: 560px; }
.hc-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 14px; font-size: 0.86rem; color: var(--muted); }
.hc-links svg { width: 15px; height: 15px; }
.hc-fact { display: inline-flex; align-items: center; gap: 6px; }
.hc-gh { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-dim); font-weight: 600; }
.hc-gh:hover { color: #fff; }
.hc-gh .hub-ext { width: 12px; height: 12px; }
.hc-self {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 14px;
  font-size: 0.84rem; color: var(--muted); cursor: pointer;
}

/* The outline while the profile loads. */
.hc-id-skel { min-height: 124px; }
.hc-skel-avatar { width: 124px; height: 124px; border-radius: 50%; flex: none; }
.hc-skel-lines { display: grid; gap: 12px; flex: 1; max-width: 420px; }
.hc-skel-lines .hub-skel { height: 14px; border-radius: 6px; }
.hc-skel-lines .hub-skel:nth-child(2) { height: 34px; width: 80%; }
.hc-skel-lines .hub-skel:nth-child(3) { width: 55%; }

#hcState { padding: 20px 0 4px; }

/* ---------------- a profile: the numbers ---------------- */

.hc-body { padding-top: 34px; }
.hc-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 42px; }
.hc-tile { min-width: 0; }
.hc-tile:hover { transform: none; }
.hc-tile-main { display: flex; flex-direction: column; min-width: 0; }
.hc-tile .st-label { margin-top: 6px; color: var(--muted); }

.hc-next .st-icon { background: rgba(var(--rk-rgb), 0.08); border-color: rgba(var(--rk-rgb), 0.3); }
.hc-next-head { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.hc-next-k {
  font-size: 0.64rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
}
.hc-next-head b {
  font-family: var(--font-display); font-size: 1.12rem; font-weight: 700; line-height: 1.2;
  color: var(--rk);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hc-next .hc-bar { margin-top: 9px; }

/* A progress bar in the rank's or achievement's color. */
.hc-bar {
  display: block; height: 5px; width: 100%;
  border-radius: 999px; background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}
.hc-bar > span {
  display: block; height: 100%; width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(var(--rk-rgb), 0.55), var(--rk));
  transition: width 0.6s ease;
}

/* ---------------- a profile: blocks ---------------- */

.hc-block { margin-bottom: 44px; }
.hc-block-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.hc-block-head h2 { margin: 0; font-size: 1.3rem; font-weight: 700; letter-spacing: -0.015em; }
.hc-count { color: var(--muted); font-size: 0.86rem; }

/* Achievements: earned ones lit in their color, the rest dim with how
   far along they are. */
.hc-ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.hc-ach {
  position: relative;
  display: flex; align-items: flex-start; gap: 15px;
  padding: 16px 18px;
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  overflow: hidden;
}
.hc-ach.is-earned {
  border-color: rgba(var(--rk-rgb), 0.32);
  background:
    radial-gradient(240px 120px at 0% 0%, rgba(var(--rk-rgb), 0.13), transparent 70%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
}
.hc-ach-emblem { flex: none; line-height: 0; }
.hc-ach.is-earned .hc-ach-emblem { filter: drop-shadow(0 0 10px rgba(var(--rk-rgb), 0.35)); }
.hc-ach.is-locked .hc-ach-emblem { filter: grayscale(1); opacity: 0.45; }
.hc-ach-main { min-width: 0; flex: 1; }
.hc-ach-rule {
  margin: 0 0 2px;
  font-size: 0.64rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
}
.hc-ach.is-earned .hc-ach-rule { color: rgba(var(--rk-rgb), 0.85); }
.hc-ach-name { margin: 0 0 3px; font-size: 1rem; font-weight: 700; color: var(--ink); }
.hc-ach.is-locked .hc-ach-name { color: var(--ink-dim); }
.hc-ach-desc { margin: 0; font-size: 0.86rem; line-height: 1.5; color: var(--muted); }
.hc-ach-foot { margin-top: 10px; }
.hc-ach-when { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 600; color: var(--rk); }
.hc-ach-when svg { width: 14px; height: 14px; }
.hc-ach.is-locked .hc-bar > span { background: var(--line-strong); }
.hc-ach-progress { display: block; margin-top: 6px; font-size: 0.78rem; color: var(--muted); }

/* Contributions. */
/* One column that may be narrower than its longest chip: the chips wrap
   instead of widening the page. */
.hc-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.hc-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  background: var(--panel);
}
.hc-item-ic {
  flex: none; width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.03); color: var(--muted);
}
.hc-item-ic svg { width: 17px; height: 17px; }
.hc-item-ic.is-fix { color: var(--hub-info); border-color: var(--hub-info-line); background: var(--hub-info-soft); }
.hc-item-ic.is-feature { color: var(--accent); border-color: var(--line-accent); background: var(--accent-soft); }
.hc-item-main { min-width: 0; flex: 1; }
.hc-item-title { margin: 0 0 6px; font-family: var(--font-body); font-size: 0.97rem; font-weight: 600; line-height: 1.4; }
.hc-item-title a { color: var(--ink); overflow-wrap: anywhere; }
/* A pull request's title wraps here (the hub's pull request link keeps
   to one line elsewhere). */
.hc-item-title .hub-pr-link { white-space: normal; }
.hc-item-title a:hover { color: #fff; }
.hc-item-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  font-size: 0.8rem; color: var(--muted);
}
.hc-kind {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-soft);
}
.hc-kind.is-fix { color: var(--hub-info); border-color: var(--hub-info-line); background: var(--hub-info-soft); }
.hc-kind.is-feature { color: var(--accent); border-color: var(--line-accent); background: var(--accent-soft); }
.hc-ref {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; max-width: 100%;
  padding: 2px 4px 2px 10px; border-radius: 14px;
  border: 1px solid var(--line-soft); background: #1c1c1f;
  color: var(--ink-dim); font-weight: 600;
}
.hc-ref:hover { color: #fff; border-color: var(--line); }
.hc-ref .hub-status { padding: 1px 8px; font-size: 0.6rem; }
.hc-more { margin-top: 14px; }
.hc-more:empty { display: none; }

/* ---------------- every contributor ---------------- */

/* The ranks, lowest first, as a ladder. */
.hcx-ladder {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 8px;
  margin-bottom: 38px;
}
.hcx-ladder:empty { display: none; }
.hcx-rung {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 8px;
  border: 1px solid rgba(var(--rk-rgb), 0.28); border-radius: 999px;
  background: rgba(var(--rk-rgb), 0.07);
  font-size: 0.86rem;
}
.hcx-rung-name { font-weight: 700; color: var(--rk); }
.hcx-rung-req { color: var(--muted); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.hcx-step { display: inline-flex; color: var(--muted-2); }
.hcx-step svg { width: 14px; height: 14px; }

.hcx-group { margin-bottom: 40px; }
.hcx-group-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 6px; }
.hcx-group-emblem { display: inline-flex; line-height: 0; filter: drop-shadow(0 0 12px rgba(var(--rk-rgb), 0.35)); }
.hcx-group-head h2 { margin: 0; font-size: 1.35rem; font-weight: 700; letter-spacing: -0.015em; color: var(--rk, var(--ink)); }
.hcx-group-req { color: var(--muted); font-size: 0.86rem; }
.hcx-group-n {
  margin-left: auto;
  font-size: 0.78rem; color: var(--muted);
  padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line-soft);
}
.hcx-group-desc { margin: 0 0 16px; color: var(--muted); font-size: 0.9rem; }
.hcx-group-head + .hcx-grid { margin-top: 14px; }

.hcx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.hcx-skel { height: 78px; border-radius: var(--radius); }
.hcx-card {
  --rk: #8c9197;
  --rk-rgb: 140, 145, 151;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  color: var(--ink);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.hcx-card:hover {
  color: var(--ink);
  border-color: rgba(var(--rk-rgb), 0.45);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(var(--rk-rgb), 0.12);
}
.hcx-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hcx-avatar { position: relative; flex: none; width: 48px; height: 48px; }
.hcx-avatar .hub-avatar {
  width: 48px; height: 48px; border: 0;
  box-shadow: 0 0 0 2px var(--panel), 0 0 0 3.5px rgba(var(--rk-rgb), 0.85);
}
.hcx-av-emblem {
  position: absolute; right: -6px; bottom: -5px;
  display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--panel);
}
.hcx-card-main { display: flex; flex-direction: column; min-width: 0; }
.hcx-name { font-weight: 700; font-size: 0.98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hcx-nums { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 5px; font-size: 0.8rem; color: var(--muted); }
.hcx-num { display: inline-flex; align-items: center; gap: 5px; }
.hcx-num svg { width: 13px; height: 13px; opacity: 0.8; }
.hcx-num b { color: var(--ink-dim); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------------- small screens ---------------- */

@media (max-width: 900px) {
  .hc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .hc-hero { padding: 22px 0 32px; }
  /* Two by two: the numbers and the rank, each without its mark. */
  .hc-stats .st-icon { display: none; }
  .hc-id { flex-direction: column; align-items: flex-start; gap: 20px; }
  .hc-avatar-wrap, .hc-avatar-wrap .hc-avatar, .hc-skel-avatar { width: 96px; height: 96px; }
  .hc-skel-lines { width: 100%; }
  .hc-stats { gap: 10px; margin-bottom: 34px; }
  .hc-stats .stat-tile { padding: 14px; gap: 11px; }
  .hc-stats .st-num { font-size: 1.35rem; }
  .hc-ach-grid, .hcx-grid { grid-template-columns: minmax(0, 1fr); }
  .hc-item { padding: 12px 13px; gap: 11px; }
  .hcx-group-n { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .hc-bar > span, .hcx-card { transition: none; }
  .hcx-card:hover { transform: none; }
}
