/* ============================================================
   anoghai.com — Waheed Anogh AI Leaderboard
   Clean light theme. Hairline borders, tabular numbers,
   monochrome with a single tinted column.
   ============================================================ */

:root {
  --bg: #ffffff;
  --text: #0f0f0f;
  --muted: #6b7280;
  --faint: #9ca3af;
  --line: #e9e9e9;
  --line-strong: #d7d7d7;
  --tint: #fafafa;
  --tint-strong: #f4f4f5;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: #0f0f0f;
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
  border-radius: 4px;
}

a {
  color: inherit;
}

p {
  margin: 0;
}

.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;
}

/* ------------------------------------------------------------
   Page frame
   ------------------------------------------------------------ */
.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 26px 32px 48px;
}

.site-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.wordmark:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.head-sub {
  font-size: 13px;
  color: var(--faint);
}

main {
  padding-top: 44px;
}

h1 {
  margin: 0 0 12px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 24px;
  font-size: 13.5px;
  color: var(--muted);
}

/* ------------------------------------------------------------
   Leaderboard table
   ------------------------------------------------------------ */
.table-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

#board {
  width: 100%;
  min-width: 1150px;
  border-collapse: separate;
  border-spacing: 0;
}

#board th,
#board td {
  padding: 12px 10px;
  text-align: right;
  white-space: nowrap;
}

/* Header cells (sticky to the top of the viewport).
   Full task names are shown, wrapped over multiple lines, at 0.8x. */
#board thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  border-bottom: 1px solid var(--line-strong);
  font-size: 8.8px; /* 0.8x */
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--muted);
  vertical-align: bottom;
  white-space: normal;
  min-width: 78px;
}

#board th.col-model {
  text-align: left;
}

.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
  border: 0;
  background: none;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
  cursor: pointer;
}

.sort-btn:hover {
  color: var(--text);
}

.sort-btn .arrow {
  font-size: 8px;
  line-height: 1;
  opacity: 0.4;
}

#board th[aria-sort="descending"] .sort-btn,
#board th[aria-sort="ascending"] .sort-btn {
  color: var(--text);
}

#board th[aria-sort="descending"] .arrow,
#board th[aria-sort="ascending"] .arrow {
  opacity: 1;
}

/* Body — table font scaled to 0.8x */
#board tbody td {
  border-bottom: 1px solid var(--line);
  font-size: 11.2px; /* 0.8x */
  font-variant-numeric: tabular-nums;
}

#board tbody tr:last-child td {
  border-bottom: 0;
}

#board tbody tr:hover td {
  background: var(--tint);
}

#board tbody tr:hover td.col-overall {
  background: #f0f0f1;
}

/* Model cell — sticky on horizontal scroll, links to the model page */
.col-model {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 230px;
  min-width: 230px;
  text-align: left;
  background: var(--bg);
  border-right: 1px solid var(--line);
}

#board thead th.col-model {
  z-index: 3; /* sticky top + sticky left: above everything */
}

#board tbody tr:hover .col-model {
  background: var(--tint);
}

.model-link {
  display: block;
  text-decoration: none;
  border-radius: 6px;
}

.model-link:hover .model-name {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.model-link:focus-visible {
  outline-offset: 4px;
}

.model {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.model-name {
  font-weight: 600;
  font-size: 11.6px; /* 0.8x */
  letter-spacing: -0.005em;
}

.model-note {
  font-size: 9.6px; /* 0.8x */
  color: var(--faint);
}

/* Score columns */
.col-score {
  width: 74px;
}

/* Overall — the tinted, emphasized column */
.col-overall {
  background: var(--tint-strong);
}

#board thead th.col-overall {
  background: var(--tint-strong);
}

#board tbody td.col-overall {
  font-weight: 700;
  font-size: 11.6px; /* 0.8x */
  border-left: 1px solid var(--line);
}

/* Empty state */
.empty {
  padding: 40px 14px;
  text-align: center;
  color: var(--faint);
  font-size: 14px;
}

/* ------------------------------------------------------------
   Note + footer
   ------------------------------------------------------------ */
.note {
  margin-top: 14px;
  padding-left: 2px;
  font-size: 12.5px;
  color: var(--faint);
}

footer {
  margin-top: 56px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--faint);
}

/* ------------------------------------------------------------
   Model page (generated: public/models/<slug>.html)
   ------------------------------------------------------------ */
.back-link {
  margin-bottom: 18px;
  font-size: 13.5px;
}

.back-link a {
  color: var(--muted);
  text-decoration: none;
}

.back-link a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.model-page h1 {
  margin-bottom: 8px;
}

.model-meta {
  margin-bottom: 36px;
  font-size: 13.5px;
  color: var(--muted);
}

.model-meta strong {
  color: var(--text);
  font-weight: 600;
}

.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 860px;
}

.task-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
}

.task-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.task-card-title {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.task-card-title h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.task-card-meta {
  font-size: 12.5px;
  color: var(--faint);
}

.task-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.task-score {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--tint-strong);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.btn-download,
.btn-quiet {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn-download {
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--text);
}

.btn-download:hover:not([disabled]) {
  background: var(--tint);
  border-color: #c4c4c4;
}

.btn-download[disabled] {
  color: var(--faint);
  border-color: var(--line);
  background: var(--tint);
  cursor: not-allowed;
}

.btn-quiet {
  border: 1px solid transparent;
  background: none;
  color: var(--muted);
}

.btn-quiet:hover {
  color: var(--text);
  background: var(--tint);
}

.prompt-block {
  padding: 16px 20px 18px;
  background: var(--tint);
}

.prompt-block p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: #3f3f46;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.tasks-list > .empty {
  padding: 32px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  text-align: center;
  color: var(--faint);
  font-size: 14px;
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 640px) {
  .page {
    padding: 20px 18px 36px;
  }

  main {
    padding-top: 32px;
  }

  h1 {
    font-size: 22px;
  }

  #board th,
  #board td {
    padding: 12px 10px;
  }

  .task-card-head {
    flex-direction: column;
  }

  .task-card-actions {
    width: 100%;
  }
}

/* ------------------------------------------------------------
   Motion preferences
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
