:root {
  --font-main: "Outfit", "Inter", sans-serif;
  --font-mono: "Fira Code", monospace;

  --bg-color: #f8fafc;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --accent-primary: #2563eb;
  --accent-secondary: #7c3aed;
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-hover: rgba(255, 255, 255, 0.9);

  --max-width: 1200px;
  --spacing: 2rem;
  --radius: 20px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Liquid Background Elements */
.bg-blobs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  filter: blur(100px);
  opacity: 0.25;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  animation: move 20s infinite alternate;
}

.blob-1 {
  width: 500px;
  height: 500px;
  background: var(--accent-primary);
  top: -150px;
  left: -150px;
  opacity: 0.6;
}

.blob-2 {
  width: 450px;
  height: 450px;
  background: var(--accent-secondary);
  bottom: -100px;
  right: -100px;
  animation-duration: 25s;
  opacity: 0.5;
}

.blob-3 {
  width: 400px;
  height: 400px;
  background: #10b981;
  top: 40%;
  left: 30%;
  animation-duration: 30s;
  opacity: 0.4;
}

@keyframes move {
  from {
    transform: translate(0, 0) rotate(0deg);
  }

  to {
    transform: translate(120px, 80px) rotate(360deg);
  }
}

header {
  max-width: var(--max-width);
  margin: 3rem auto 2rem;
  padding: 0 var(--spacing);
  text-align: center;
}

h1 {
  font-family: "Outfit", sans-serif;
  font-size: 4.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
  letter-spacing: -0.05em;
  line-height: 1.1;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 2rem;
  display: block;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  max-width: 900px;
  margin: 0 auto 2rem;
}

.stat-grid article {
  display: flex;
  flex-direction: column;
  padding: 1.15rem 0.75rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.04);
}

.stat-grid strong {
  color: var(--accent-primary);
  font-size: 1.65rem;
  line-height: 1.1;
}

.stat-grid span {
  margin-top: 0.35rem;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.intro-container {
  max-width: var(--max-width);
  margin: 1.5rem auto;
  text-align: left;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.03);
  border-radius: 24px;
  padding: 2rem;
}

.expandable-controls {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: 1.5rem 0 1.5rem;
}

.expand-btn {
  background: white;
  border: 1px solid #e2e8f0;
  padding: 0.8rem 1.5rem;
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.expand-btn i,
.expand-btn svg,
.expand-btn .icon-emoji {
  width: 1.1rem;
  height: 1.1rem;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.expand-btn i {
  opacity: 0.9;
}

.expand-btn .fa-github {
  font-size: 1.25rem;
  /* Optical boost for GitHub icon */
}

.icon-emoji {
  font-size: 0.9rem;
  /* Optical reduction for emoji */
  line-height: 1;
  margin-top: -1px;
}

.expand-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.expand-btn.active {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}

.link-btn {
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.expandable-content {
  display: none;
  max-width: var(--max-width);
  margin: -1rem auto 2.5rem;
  text-align: left;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.05);
  animation: fadeInDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.expandable-content.active {
  display: block;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Markdown Styling */
.markdown-body h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.markdown-body h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 20px;
  background: var(--accent-primary);
  border-radius: 4px;
}

.markdown-body p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 0.8rem;
  line-height: 1.6;
}

.markdown-body strong {
  color: var(--text-primary);
}

.markdown-body a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid rgba(37, 99, 235, 0.2);
  transition: all 0.2s;
}

.markdown-body a:hover {
  border-bottom-color: var(--accent-primary);
  background: rgba(37, 99, 235, 0.05);
}

.markdown-body ul,
.markdown-body ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.markdown-body li {
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.markdown-body code {
  font-family: var(--font-mono);
  background: #f1f5f9;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  font-size: 0.9em;
  color: #e11d48;
}

.markdown-body pre {
  background: #0f172a;
  padding: 1.5rem;
  border-radius: 12px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.markdown-body pre code {
  background: transparent;
  padding: 0;
  color: #f8fafc;
}

/* Subtitle handled above */

main {
  max-width: var(--max-width);
  margin: 0 auto 6rem;
  padding: 0 var(--spacing);
}

.controls {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

.search-container {
  flex-grow: 1;
  min-width: 240px;
  max-width: 420px;
}

.select-container {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.select-container[hidden] {
  display: none;
}

.select-container label {
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

select {
  min-width: 160px;
  padding: 0.72rem 2.2rem 0.72rem 0.9rem;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.9rem;
}

select:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input[type="text"] {
  width: 100%;
  padding: 0.85rem 1.25rem;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 1rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

input[type="text"]:focus {
  outline: none;
  background: #fff;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
  transform: translateY(-1px);
}

#stats-summary {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Scrollbar Wrappers */
.scrollbar-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  height: 12px;
  margin-bottom: 4px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.02);
}

#top-scrollbar-content {
  height: 1px;
}

.table-outer-container {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.05);
}

.table-container {
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
  min-width: 1200px;
  /* Force minimum width to trigger scrollbar */
}

th {
  text-align: left;
  padding: 1.5rem 1rem;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

th:hover {
  background: rgba(0, 0, 0, 0.02);
  color: var(--text-primary);
}

td {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
  transition: background 0.2s ease;
}

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

tr:hover td {
  background: rgba(255, 255, 255, 0.5);
}

/* Explicit Widths */
.col-llm {
  min-width: 210px;
}

.col-retriever {
  min-width: 180px;
}

.col-submitted {
  min-width: 180px;
}

.col-scaffold {
  min-width: 120px;
}

.col-metric {
  min-width: 110px;
}

.rank-column {
  min-width: 52px;
  text-align: center;
  color: var(--text-secondary);
}

.model-column {
  min-width: 220px;
  position: sticky;
  left: 0;
  z-index: 2;
  background: rgba(255, 255, 255, 0.97);
}

th.model-column {
  z-index: 3;
}

.model-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.primary-metric {
  color: var(--accent-primary);
}

.coverage-count {
  display: block;
  margin-top: 0.2rem;
  color: var(--text-secondary);
  font-size: 0.72rem;
}

.coverage-warning {
  color: #b45309;
  font-weight: 600;
}

.na-value {
  color: #94a3b8;
  font-weight: 400;
}

.empty-cell,
.error-cell {
  padding: 4rem;
  text-align: center;
}

.error-cell {
  color: #dc2626;
}

.metric-cell {
  font-weight: 700;
  color: var(--accent-primary);
}

.table-note {
  max-width: var(--max-width);
  margin: 1rem auto 0;
  color: var(--text-secondary);
  font-size: 0.86rem;
  text-align: left;
}

.taxonomy-panel {
  max-width: var(--max-width);
  margin: 1.5rem auto 0;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.04);
}

.taxonomy-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.taxonomy-heading h3 {
  font-size: 1.25rem;
}

.taxonomy-heading p {
  max-width: 390px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-align: right;
}

.eyebrow {
  color: var(--accent-primary);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem 1.4rem;
}

.glossary-grid > div {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 0.65rem;
  align-items: start;
  padding: 0.6rem 0;
  border-top: 1px solid #e2e8f0;
}

.glossary-grid code {
  color: var(--accent-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
}

.glossary-grid span {
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.5;
}

.glossary-grid b {
  color: var(--text-primary);
}

@media (max-width: 720px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .taxonomy-heading {
    display: block;
  }

  .taxonomy-heading p {
    margin-top: 0.35rem;
    text-align: left;
  }

  .glossary-grid {
    grid-template-columns: 1fr;
  }
}

/* LLM Row Alignment */
.llm-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.model-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s;
  display: inline-block;
}

.model-name:hover {
  color: var(--accent-primary);
}

/* Green tag for open weight models */
.tag-open-weight {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.tag-proprietary {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Scaffold Tags */
.tag-scaffold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
  width: 85px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: help;
}

.tag-scaffold-standard {
  background: rgba(100, 116, 139, 0.1);
  color: var(--text-secondary);
}

.tag-scaffold-custom {
  background: rgba(239, 68, 68, 0.1);
  /* Red */
  color: #ef4444;
  /* Red */
}

/* Enhanced Tooltip */
.tooltip-container {
  position: relative;
  display: inline-block;
}

.tooltip-content {
  visibility: hidden;
  position: absolute;
  z-index: 100;
  top: 125%;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  background: #ffffff;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}

.tooltip-container:hover .tooltip-content {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(10px);
}

.tooltip-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 0.25rem;
}

.tooltip-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.tooltip-code {
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--accent-primary);
}

.evaluation-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Citation Section */
.citation-section {
  margin-top: 5rem;
  text-align: left;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.citation-section h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-weight: 700;
}

.citation-section p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}

.citation-block-wrapper {
  position: relative;
  background: #1e293b;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

#citation-content {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.6;
  margin: 0;
}

.copy-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 10;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

.copy-btn.copied {
  background: #10b981;
  border-color: #10b981;
}

footer {
  text-align: center;
  padding: 6rem 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

@media (max-width: 768px) {
  h1 {
    font-size: 2.75rem;
  }

  .controls {
    flex-direction: column;
    gap: 1rem;
  }

  .search-container {
    max-width: 100%;
  }
}

/* Custom Scrollbar Styling */
::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}
