/* ===========================================================
   Code Olympiad 2081 - Participants page
   The competing teams in the Night Shift world from ARUN-PROFILE.md:
   amber phosphor accents, mono metadata, a campus brand chip, and
   team cards that keep the same shape on a phone and a laptop.
   Token-driven only.
   =========================================================== */

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-block: clamp(var(--space-4xl), 9vw, var(--space-6xl)) var(--space-4xl);
  overflow: hidden;
}

/* Static phosphor glow, no animated blobs */
.hero::before {
  content: "";
  position: absolute;
  top: -240px;
  right: -180px;
  width: 560px;
  height: 560px;
  border-radius: var(--radius-full);
  background: radial-gradient(closest-side, var(--color-phosphor), transparent 72%);
  opacity: 0.07;
  pointer-events: none;
  z-index: -1;
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    var(--color-border-hairline),
    var(--color-phosphor),
    var(--color-border-hairline)
  );
  opacity: 0.35;
  pointer-events: none;
}

.hero__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-mono);
  font-size: var(--text-kicker);
  letter-spacing: 0.04em;
  color: var(--color-text-tertiary);
  padding: var(--space-2xs) var(--space-sm);
  border: 1px solid var(--color-border-hairline);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  margin-bottom: var(--space-xl);
}

.hero__brand-logo {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.hero__title {
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.02;
  color: var(--color-text-primary);
}

.hero__accent {
  color: var(--color-phosphor);
}

.hero__lede {
  margin-top: var(--space-lg);
  max-width: 52ch;
  color: var(--color-text-secondary);
  font-size: 1.0625rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
}

.hero__actions .btn {
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--space-xl);
  max-width: 460px;
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border-hairline);
}

.stat__num {
  font-family: var(--font-mono);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  line-height: 1;
  color: var(--color-phosphor);
  font-variant-numeric: tabular-nums;
}

.stat__label {
  display: block;
  margin-top: var(--space-2xs);
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  color: var(--color-text-tertiary);
}

.hero__note {
  margin-top: var(--space-xl);
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  color: var(--color-text-tertiary);
}

/* ---------- Toolbar wrap ---------- */
.roster-toolbar {
  position: sticky;
  top: var(--nav-height);
  z-index: 800;
  background: var(--color-nav-material);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--color-border-hairline);
  margin-bottom: var(--space-2xl);
}

.roster-count {
  margin-left: auto;
  align-self: center;
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  color: var(--color-text-tertiary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Segmented restyled as mono chips (participants page scope) */
.roster-toolbar .segmented {
  background: transparent;
  padding: 0;
  gap: var(--space-lg);
  border-radius: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.roster-toolbar .segmented__thumb {
  display: none;
}

.roster-toolbar .segmented__btn {
  position: relative;
  min-height: 0;
  padding: var(--space-2xs) 0;
  border-radius: 0;
  background: transparent;
  font-family: var(--font-mono);
  font-size: var(--text-kicker);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--color-text-tertiary);
  transition: color var(--motion-instant) var(--ease-touch);
}

.roster-toolbar .segmented__btn::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 2px;
  background: var(--color-phosphor);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform var(--motion-base) var(--ease-touch);
}

.roster-toolbar .segmented__btn[aria-selected="true"] {
  color: var(--color-phosphor);
}

.roster-toolbar .segmented__btn[aria-selected="true"]::after {
  transform: scaleX(1);
}

.roster-toolbar .search input {
  font-family: var(--font-mono);
  font-size: var(--text-kicker);
}

/* ---------- Teams ---------- */
.org {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: var(--space-2xl);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-lg);
  width: 100%;
}

/* ---------- Team card ---------- */
.team {
  --role: var(--color-phosphor);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border-hairline);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform var(--motion-base) var(--ease-touch),
    box-shadow var(--motion-base) var(--ease-touch),
    border-color var(--motion-base) var(--ease-touch);
}

/* Cursor-follow glow, no 3D rotation */
.team::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  background: radial-gradient(
    260px circle at var(--mx, 50%) var(--my, 20%),
    color-mix(in srgb, var(--role) 12%, transparent),
    transparent 72%
  );
  opacity: 0;
  transition: opacity var(--motion-base) var(--ease-touch);
  pointer-events: none;
}

@media (hover: hover) {
  .team:hover {
    transform: translateY(-6px);
    border-color: color-mix(in srgb, var(--role) 55%, var(--color-border-strong));
    box-shadow: var(--shadow-float);
  }

  .team:hover::before,
  .team:focus-visible::before {
    opacity: 1;
  }
}

.team:active {
  transform: scale(0.98);
}

.team__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm);
}

.team__name {
  font-size: var(--text-title);
  font-weight: 700;
  color: var(--color-text-primary);
  overflow-wrap: anywhere;
}

.team__lang {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  letter-spacing: 0.06em;
  color: var(--role);
  padding: var(--space-hair) var(--space-xs);
  border: 1px solid color-mix(in srgb, var(--role) 45%, transparent);
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.team__meta {
  display: grid;
  gap: var(--space-2xs);
}

.team__meta-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
}

.team__meta-row dt {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
}

.team__meta-row dd {
  color: var(--color-text-secondary);
  font-size: 0.9375rem;
}

.team__members {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-2xs);
}

.team__members li {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  color: var(--color-text-secondary);
  padding: var(--space-2xs) var(--space-xs);
  border: 1px solid var(--color-border-hairline);
  border-radius: var(--radius-full);
}

/* Language tint mapping (also the filter groups) */
.team[data-group="c"] {
  --role: var(--color-role-lead);
}

.team[data-group="cpp"] {
  --role: var(--color-role-secretary);
}

.team[data-group="py"] {
  --role: var(--color-role-tech);
}

.team[data-group="js"] {
  --role: var(--color-role-exec);
}

.team[data-group="java"] {
  --role: var(--color-accent);
}

/* ---------- Empty state ---------- */
.roster-empty {
  text-align: center;
  padding: var(--space-5xl) var(--space-md);
  color: var(--color-text-tertiary);
}

.roster-empty svg {
  width: var(--icon-lg);
  height: var(--icon-lg);
  margin-bottom: var(--space-md);
}

/* ---------- Closing quote ---------- */
.closing-quote {
  max-width: 60ch;
  margin-inline: auto;
  text-align: center;
  padding-block: var(--space-2xl) var(--space-2xl);
}

.closing-quote p {
  font-family: var(--font-mono);
  font-size: var(--text-sub);
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.closing-quote cite {
  display: block;
  margin-top: var(--space-sm);
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  font-style: normal;
  color: var(--color-text-tertiary);
}

/* ---------- Responsive ---------- */
@media (max-width: 520px) {
  .stats {
    gap: var(--space-lg);
  }

  .team__head {
    flex-direction: column;
    align-items: flex-start;
  }
}