:root {
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 16px;
  --radius-sm: 10px;
  --max: 1180px;
  --header-h: 68px;
  --ease: cubic-bezier(0.25, 0.8, 0.25, 1);
}

[data-theme="light"] {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #e04f3d;
  --accent-dim: rgba(224, 79, 61, 0.12);
  --accent-hover: #c73d2d;
  --chip: #eef2f7;
  --gold: #b45309;
  --silver: #475569;
  --bronze: #9a3412;
  --glow: 0 20px 50px rgba(15, 23, 42, 0.08);
  --header-bg: rgba(244, 246, 251, 0.9);
}

[data-theme="dark"] {
  --bg: #0a0f1a;
  --surface: #121a2a;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --border: #1e293b;
  --accent: #ff6b5b;
  --accent-dim: rgba(255, 107, 91, 0.14);
  --accent-hover: #ff8578;
  --chip: #1a2438;
  --gold: #fcd34d;
  --silver: #cbd5e1;
  --bronze: #fdba74;
  --glow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --header-bg: rgba(10, 15, 26, 0.88);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.35s var(--ease), color 0.35s var(--ease);
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  display: block;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.1rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand img {
  height: 60px;
  width: auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav a {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
  background: var(--chip);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, transform 0.15s;
}
.icon-btn:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.icon-btn svg {
  width: 18px;
  height: 18px;
}

.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  text-decoration: none;
}

.auth-btn-login {
  background: var(--accent);
  color: #fff;
  border: none;
}

.auth-btn-login:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-dim);
  color: #fff;
}

.auth-btn-register {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.auth-btn-register:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.nav-burger {
  display: none;
}

@media (max-width: 720px) {
  .nav-burger {
    display: inline-flex;
  }
  .nav {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--header-h);
    flex-direction: column;
    padding: 0.75rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    transform: translateY(-130%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s var(--ease), opacity 0.25s;
  }
  .nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav a {
    width: 100%;
    text-align: center;
  }
}

/* Main */
main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.75rem 1.1rem 3.5rem;
}

/* Hero */
.hero {
  padding: 1.5rem 0 2rem;
  text-align: center;
}
.hero-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}
.hero h1 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.85rem, 4.5vw, 2.45rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
}
.hero p {
  margin: 0 auto;
  max-width: 520px;
  color: var(--muted);
  font-size: 1rem;
}

/* Section */
.block {
  margin-top: 2.75rem;
}
.block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.block-head h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.block-head span {
  font-size: 0.8rem;
  color: var(--muted);
}

/* Horizontal strip */
.strip {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.strip::-webkit-scrollbar {
  height: 6px;
}
.strip::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}

.agent-card {
  flex: 0 0 min(280px, 85vw);
  scroll-snap-align: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--glow);
  transition: border-color 0.2s;
}
.agent-card:hover {
  border-color: var(--accent);
}
.agent-card .row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.agent-card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}
.agent-card .vendor {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.2rem;
}
.agent-card p {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}
.score {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: var(--accent-dim);
  color: var(--accent);
  white-space: nowrap;
}

/* Global ranking table */
.rank-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--glow);
}
.rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.rank-table th,
.rank-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.rank-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--chip);
}
.rank-table tr:last-child td {
  border-bottom: none;
}
.rank-table td:first-child {
  font-family: var(--mono);
  font-weight: 700;
  width: 3rem;
  color: var(--muted);
}
.medal-1 {
  color: var(--gold);
}
.medal-2 {
  color: var(--silver);
}
.medal-3 {
  color: var(--bronze);
}

/* LLM page */
.llm-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1.25rem 0 1.5rem;
  align-items: center;
}
.search {
  flex: 1;
  min-width: 200px;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
}
.search:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.pill-count {
  font-size: 0.8rem;
  color: var(--muted);
}

.llm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.85rem;
}
.llm-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  transition: border-color 0.2s;
}
.llm-card:hover {
  border-color: var(--accent);
}
.llm-card .prov {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.llm-card .name {
  font-weight: 700;
  font-size: 0.95rem;
}
.llm-card .hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.35rem;
  line-height: 1.4;
}

.llm-card.hidden {
  display: none;
}

.disclaimer {
  margin-top: 2rem;
  padding: 0.85rem 1rem;
  font-size: 0.78rem;
  color: var(--muted);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  background: var(--chip);
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 1.1rem;
  margin-top: auto;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.footer-inner a {
  color: var(--muted);
}
.footer-inner a:hover {
  color: var(--accent);
}

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