:root {
  --bg: #fff;
  --panel: #f6f8fa;
  --ink: #111c30;
  --muted: #5a6680;
  --line: #dde1e8;
  --acc: #5547ea;
  --acc-soft: #eeecfe;
  --on-acc: #fff;
  --grad: linear-gradient(90deg, #b0eca1, #74dad1 55%, #8cb3e4);
  --body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 var(--body);
}
h1, h2 { margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: var(--acc); }
button { font: inherit; color: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

.gradbar { height: 4px; background: var(--grad); }

.sec {
  display: grid;
  gap: 18px;
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding: clamp(22px, 4vw, 44px) clamp(16px, 4vw, 48px);
}
.ruled { box-shadow: 0 -1px 0 var(--line); }
.scroll { overflow-x: auto; min-width: 0; }
.tiny { font-size: 12px; color: var(--muted); }

h2 { font: 800 clamp(18px, 2.2vw, 22px)/1.1 var(--mono); }
h2::before { content: "## "; color: var(--acc); }

/* hero */
.hero { text-align: center; justify-items: center; }
.eyebrow { font: 600 12.5px/1.55 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--acc); }
.ttl { font: 700 clamp(34px, 6vw, 62px)/1 var(--mono); letter-spacing: -.025em; }
.ttl .dot { color: var(--acc); }
.q { font-size: clamp(17px, 2.2vw, 21px); max-width: 40ch; }
.auth { font-size: 14px; color: var(--muted); max-width: 70ch; }
.auth b { color: var(--ink); font-weight: 500; }

.btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.btn {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink);
  font: 13px/1.55 var(--mono);
  text-decoration: none;
  white-space: nowrap;
}
a.btn:hover { border-color: var(--acc); color: var(--acc); }
.btn.p { background: var(--acc); border-color: var(--acc); color: var(--on-acc); }
a.btn.p:hover { color: var(--on-acc); opacity: .9; }
.btn.soon { background: var(--panel); border-color: var(--line); color: var(--muted); }
.btn.soon small { font-size: 10.5px; letter-spacing: .04em; }

.meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; font: 12.5px/1.55 var(--mono); color: var(--muted); }
.meta b { color: var(--ink); font-weight: 600; }
.langrow { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.langrow span { padding: 2px 8px; border: 1px solid var(--line); border-radius: 3px; background: var(--panel); font: 11.5px/1.55 var(--mono); }

/* overview */
.overview p { color: var(--muted); font-size: 16px; line-height: 1.65; }

/* leaderboard */
.lb { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.lb th {
  padding: 8px 10px;
  border-bottom: 1.5px solid var(--ink);
  color: var(--muted);
  font: 600 11.5px/1.55 var(--mono);
  letter-spacing: .04em;
  text-align: right;
  text-transform: uppercase;
  white-space: nowrap;
}
.lb th button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}
.lb .ar { display: inline-block; width: 1em; margin-left: 2px; color: var(--line); text-align: center; }
.lb th button:hover .ar { color: var(--muted); }
.lb th[aria-sort="ascending"], .lb th[aria-sort="descending"] { color: var(--ink); }
.lb th[aria-sort="ascending"] .ar, .lb th[aria-sort="descending"] .ar { color: var(--acc); }
.lb td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.lb .l { text-align: left; }
.lb .rk { color: var(--muted); font-family: var(--mono); }
.lb .m { font-weight: 600; }
.lb .m small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.lb .mono { font-family: var(--mono); }
.lb .sc { font-family: var(--mono); font-weight: 600; }
.lb .pm { color: var(--muted); font-size: 12px; font-weight: 400; }
.lb tr.top .sc { color: var(--acc); }
.lb tr.top .pm { color: var(--muted); }

/* by language */
.bl { width: 100%; min-width: 860px; border-collapse: collapse; font: 13px/1.55 var(--mono); font-variant-numeric: tabular-nums; }
.bl th { padding: 8px; border-bottom: 1.5px solid var(--ink); color: var(--muted); font: 600 11px/1.3 var(--mono); text-align: right; vertical-align: bottom; }
.bl th small { display: block; font-weight: 400; }
.bl td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.bl .l { text-align: left; }
.bl .m { font-family: var(--body); font-size: 14px; font-weight: 600; }
.bl .n { color: var(--muted); }
.bl td.best { background: var(--acc-soft); color: var(--acc); font-weight: 800; }
.bl tr.all td { border-top: 1.5px solid var(--ink); border-bottom: 0; font-weight: 600; }

/* method */
.flow { display: grid; grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr) 22px minmax(0, 1fr) 22px minmax(0, 1fr); }
.fs { display: grid; gap: 8px; align-content: start; padding: 14px; border: 1px solid var(--line); background: var(--panel); }
.fs.hot { border-color: var(--acc); background: var(--acc-soft); }
.fn { display: flex; gap: 8px; align-items: baseline; font: 700 16px/1.55 var(--mono); }
.fn .k { color: var(--muted); font-size: 11px; font-weight: 400; }
.fc { display: grid; }
.fc b { color: var(--acc); font: 700 clamp(26px, 3.4vw, 36px)/1 var(--mono); font-variant-numeric: tabular-nums; }
.fc span { color: var(--muted); font-size: 12.5px; }
.fbar { height: 4px; background: var(--line); }
.fbar i { display: block; height: 100%; background: var(--acc); }
.fs p { font-size: 13.5px; }
.loop { padding-top: 6px; border-top: 1px dashed var(--acc); color: var(--acc); font: 11.5px/1.55 var(--mono); }
.far { display: flex; align-items: center; justify-content: center; color: var(--muted); font-family: var(--mono); }
@media (max-width: 800px) {
  .flow { grid-template-columns: minmax(0, 1fr); }
  .far { height: 22px; transform: rotate(90deg); }
}

/* faq and citation */
.narrow { display: grid; gap: 14px; min-width: 0; max-width: 820px; }
.faq { display: grid; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  padding: 14px 0;
  font: 600 16.5px/1.55 var(--mono);
  list-style: none;
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { flex: none; color: var(--acc); content: "+"; font: 400 18px/1.55 var(--mono); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 16px; color: var(--muted); font-size: 14.5px; line-height: 1.6; }

.citehead { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.copyb { padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); font: 12.5px/1.55 var(--mono); cursor: pointer; }
.copyb:hover { border-color: var(--acc); color: var(--acc); }
.bib { margin: 0; padding: 16px 18px; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font: 12.5px/1.6 var(--mono); white-space: pre; }
.bib .k { color: var(--acc); }
.credit { color: var(--muted); font-size: 13px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
