:root {
  --ink: #1a1f2e;
  --ink-soft: #3d4558;
  --muted: #6b7385;
  --paper: #f7f4ef;
  --paper-2: #ffffff;
  --line: rgba(26, 31, 46, 0.08);
  --brand: #7962BD;
  --brand-deep: #5a4599;
  --brand-soft: rgba(121, 98, 189, 0.12);
  --accent: #0f766e;
  --accent-soft: rgba(15, 118, 110, 0.12);
  --shadow: 0 18px 50px rgba(26, 31, 46, 0.08);
  --radius: 18px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Outfit", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(121, 98, 189, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(15, 118, 110, 0.12), transparent 50%),
    linear-gradient(180deg, #efeae2 0%, var(--paper) 40%, #ebe7e0 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(26, 31, 46, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 31, 46, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, black, transparent 85%);
}

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

.hero-banner {
  position: relative;
  width: 100%;
  overflow: hidden;
  line-height: 0;
}

.hero-banner-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
  object-position: center;
}

.hero-copy .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  border: 1px solid rgba(121, 98, 189, 0.18);
  color: var(--brand-deep);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hero-copy h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.5vw, 2.8rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink);
}

.hero-copy > p {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 56ch;
  line-height: 1.5;
}

.hero-copy h2 {
  margin: 0 0 6px;
}

.hero-copy .sub {
  margin: 0;
  color: var(--muted);
  max-width: 60ch;
}

.page {
  width: min(1200px, calc(100% - 32px));
  margin: 24px auto 64px;
  position: relative;
  z-index: 2;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  animation: rise 0.6s ease 0.05s both;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.brand-mark .orb {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--brand), var(--brand-deep));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(121, 98, 189, 0.3);
}

.brand-mark strong {
  display: block;
  font-size: 0.98rem;
  letter-spacing: -0.02em;
}

.brand-mark span {
  color: var(--muted);
  font-size: 0.8rem;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-link {
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.9rem;
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.topbar-link.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(121, 98, 189, 0.28);
}

.topbar-link:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.section-intro {
  margin: 8px 0 18px;
  animation: rise 0.65s ease 0.08s both;
}

.section-intro h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  letter-spacing: -0.02em;
}

.section-intro p {
  margin: 0;
  color: var(--muted);
  max-width: 60ch;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.metric {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--paper-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  animation: rise 0.65s ease both;
}

.metric:nth-child(1) { animation-delay: 0.1s; }
.metric:nth-child(2) { animation-delay: 0.14s; }
.metric:nth-child(3) { animation-delay: 0.18s; }

.metric::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  right: -30px;
  top: -40px;
  border-radius: 50%;
  background: var(--brand-soft);
}

.metric:nth-child(2)::after { background: var(--accent-soft); }
.metric:nth-child(3)::after { background: rgba(217, 119, 6, 0.12); }

.metric .icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand-deep);
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.metric:nth-child(2) .icon { background: var(--accent-soft); color: var(--accent); }
.metric:nth-child(3) .icon { background: rgba(217, 119, 6, 0.12); color: #b45309; }

.metric h3 {
  margin: 0;
  font-size: 1.7rem;
  letter-spacing: -0.03em;
  position: relative;
  z-index: 1;
}

.metric p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  position: relative;
  z-index: 1;
}

.panel {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  overflow: hidden;
  animation: rise 0.7s ease 0.2s both;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 16px 0;
}

.tab-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-soft);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.tab-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(26, 31, 46, 0.08);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(121, 98, 189, 0.28);
}

.tab-btn.jobs-link {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

.leaderboard-section {
  display: none;
  padding: 16px;
}

.leaderboard-section.active {
  display: block;
  animation: fadeSlide 0.35s ease both;
}

.table-shell {
  overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  max-height: min(70vh, 720px);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

th, td {
  padding: 13px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(180deg, #f4f1fb, #ebe6f8);
  color: var(--brand-deep);
  font-weight: 600;
  cursor: pointer;
  letter-spacing: -0.01em;
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: rgba(121, 98, 189, 0.05);
}

tbody tr:last-child td {
  border-bottom: none;
}

.chart-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 28px;
  overflow: visible;
}

.chart-card:last-child { margin-bottom: 8px; }

.chart-card h3 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.chart-container {
  position: relative;
  width: 100%;
  height: 480px;
  min-height: 480px;
}

.chart-container.chart-tall {
  height: 640px;
  min-height: 640px;
}

#userstats {
  display: none;
  flex-direction: column;
  gap: 8px;
}

#userstats.active {
  display: flex;
}

.filters-section {
  display: none;
  padding: 0 16px 8px;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}

.filter-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.filter-select {
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: var(--font-body);
}

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

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 860px) {
  .metrics { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; }
}
