:root {
  --a: #0F9E8B; --b: #198BA3; --c: #2377BB; --d: #3062C4; --e: #3F4CBE; --f: #4E36B8;
  --grad: linear-gradient(95deg, var(--a), var(--c) 45%, var(--f));
  --ink: #14182b; --body: #3d4358; --muted: #71788f; --line: #e6e8f0; --bg: #fbfbfd; --card: #ffffff;
  --red: #D6604D; --red-soft: #fdf1ee; --green: #1B7837; --green-soft: #eef7f0;
  --radius: 16px; --shadow: 0 1px 2px rgba(20, 24, 43, .04), 0 8px 28px rgba(20, 24, 43, .06);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--body); font: 400 17px/1.65 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--d); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; letter-spacing: .01em; }

/* navigation */
.nav { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: 12px clamp(16px, 4vw, 40px); background: rgba(251, 251, 253, .82); backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font-size: 18px; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.nav nav { display: flex; gap: clamp(12px, 2.4vw, 28px); }
.nav nav a { color: var(--body); font-size: 14.5px; font-weight: 500; }
.nav nav a:hover { color: var(--d); text-decoration: none; }

/* hero */
.hero { position: relative; text-align: center; padding: clamp(48px, 9vw, 96px) 20px 36px; overflow: hidden; }
.glow { position: absolute; inset: -40% 10% auto; height: 520px; background: radial-gradient(closest-side, rgba(35, 119, 187, .16), rgba(78, 54, 184, .07) 55%, transparent); filter: blur(10px); pointer-events: none; }
.hero > *:not(.glow) { position: relative; }
.hero-logo { width: 92px; height: 92px; margin: 0 auto 18px; filter: drop-shadow(0 10px 22px rgba(48, 98, 196, .25)); }
h1 { margin: 0; color: var(--ink); font-size: clamp(40px, 7.2vw, 76px); line-height: 1.04; font-weight: 800; letter-spacing: -.03em; }
.subtitle { max-width: 760px; margin: 16px auto 0; color: var(--ink); font-size: clamp(19px, 2.6vw, 26px); line-height: 1.35; font-weight: 500; letter-spacing: -.01em; }
.authors { margin: 26px 0 0; font-size: 18px; font-weight: 500; }
.authors a { color: var(--ink); border-bottom: 1px solid var(--line); }
.authors a:hover { color: var(--d); text-decoration: none; border-color: var(--d); }
.affil { margin: 4px 0 0; color: var(--muted); font-size: 15.5px; }
.buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 30px; }
.btn { display: inline-flex; align-items: center; gap: 9px; padding: 11px 20px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 15.5px; font-weight: 600; box-shadow: var(--shadow); transition: transform .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-2px); background: #232a4a; text-decoration: none; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.btn .emoji { font-size: 17px; line-height: 1; }
.btn.soon { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn.soon em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--d); background: #eef2fd; padding: 2px 8px; border-radius: 999px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; max-width: 1120px; margin: 18px auto 0; padding: 0 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 20px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: clamp(26px, 3vw, 34px); line-height: 1.1; font-weight: 800; letter-spacing: -.02em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat:first-child b { background: none; color: var(--red); }
.stat span { display: block; margin-top: 8px; color: var(--muted); font-size: 14.5px; line-height: 1.45; }

/* sections */
section.text { max-width: 820px; margin: 0 auto; padding: clamp(44px, 7vw, 76px) 20px 0; }
section.widetext { max-width: 1040px; }
.kicker { display: inline-block; margin-bottom: 10px; font-size: 12.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--b); }
h2 { margin: 0 0 16px; color: var(--ink); font-size: clamp(26px, 3.6vw, 36px); line-height: 1.2; font-weight: 700; letter-spacing: -.02em; }
p { margin: 0 0 16px; }
.figure { max-width: 1120px; margin: clamp(36px, 6vw, 60px) auto 0; padding: 0 20px; }
.figure a { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(10px, 2vw, 22px); box-shadow: var(--shadow); }
.caption { max-width: 900px; margin: 14px auto 0; color: var(--muted); font-size: 14.5px; line-height: 1.55; text-align: center; }
.caption b { color: var(--body); }

/* example */
.example { margin: 26px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.ex-prompt { padding: 13px 20px; color: var(--muted); font-size: 14.5px; border-bottom: 1px solid var(--line); background: #f7f8fb; }
.ex-row { display: flex; align-items: center; gap: 14px; padding: 15px 20px; }
.ex-row + .ex-row { border-top: 1px solid var(--line); }
.ex-row p { margin: 0; color: var(--ink); font-size: 17.5px; font-weight: 500; }
.tag { flex: none; width: 64px; text-align: center; padding: 3px 0; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.bad .tag { background: var(--red-soft); color: var(--red); }
.good .tag { background: var(--green-soft); color: var(--green); }
mark { background: none; color: var(--red); font-weight: 700; }

/* cards and metrics */
.cards, .metrics { display: grid; gap: 14px; margin: 26px 0; }
.cards { grid-template-columns: repeat(2, 1fr); }
.metrics { grid-template-columns: repeat(3, 1fr); }
.card, .metric { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card b { display: block; color: var(--ink); font-size: 23px; font-weight: 700; letter-spacing: -.01em; }
.card span { color: var(--muted); font-size: 14.5px; }
.metric { position: relative; padding-top: 24px; overflow: hidden; }
.metric::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--grad); }
.metric h3 { margin: 0; font-size: 25px; font-weight: 800; letter-spacing: .02em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.metric h4 { margin: 2px 0 10px; color: var(--ink); font-size: 14.5px; font-weight: 600; }
.metric p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.55; }

/* code */
.code { position: relative; margin: 22px 0 0; padding: 18px 20px; background: #12162a; color: #e4e7f5; border-radius: var(--radius); overflow-x: auto; font: 400 13.5px/1.7 "JetBrains Mono", ui-monospace, Menlo, monospace; box-shadow: var(--shadow); }
.code code { font: inherit; white-space: pre; }
.code .c { color: #7f88ab; } .code .k { color: #8fb7ff; } .code .s { color: #7fdcc4; }
.copy { position: absolute; top: 10px; right: 10px; padding: 4px 11px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 8px; background: rgba(255, 255, 255, .07); color: #cfd4ea; font: 600 12px Inter, sans-serif; cursor: pointer; }
.copy:hover { background: rgba(255, 255, 255, .16); }

/* leaderboard */
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin: 20px 0 12px; color: var(--muted); font-size: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend .dot { position: static; transform: none; }
.legend .line { width: 2px; height: 15px; background: var(--ink); opacity: .55; }
.filter { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; color: var(--body); font-weight: 500; cursor: pointer; }
.filter input { accent-color: var(--d); width: 15px; height: 15px; }
.tablewrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 14.5px; }
th { padding: 13px 16px; color: var(--muted); font-size: 12.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; text-align: left; border-bottom: 1px solid var(--line); background: #f7f8fb; cursor: pointer; user-select: none; white-space: nowrap; }
th:hover, th.sorted { color: var(--d); }
th.sorted::after { content: " ●"; font-size: 8px; vertical-align: middle; }
td { padding: 10px 16px; border-bottom: 1px solid #f0f1f6; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafbfe; }
th.l { width: 31%; }
td.l b { color: var(--ink); font-weight: 600; white-space: nowrap; }
.role { margin-left: 9px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.role.cur { background: #e9f6f4; color: #0c7e6f; }
.role.held { background: #efedfb; color: #4E36B8; }
.vals { display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
.vb { color: var(--muted); } .va { color: var(--ink); font-weight: 700; } .arrow { color: #b4b9c9; font-size: 12px; }
.track { position: relative; height: 12px; margin-top: 5px; border-radius: 999px; background: #f0f1f6; }
.span { position: absolute; top: 4px; height: 4px; border-radius: 999px; background: linear-gradient(90deg, #f0b9ae, #7fcfc3); }
.dot { position: absolute; top: 50%; width: 10px; height: 10px; border-radius: 50%; transform: translate(-50%, -50%); border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(20, 24, 43, .08); display: inline-block; }
.dot.base { background: var(--red); } .dot.aligned { background: var(--a); }
.hline { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink); opacity: .5; border-radius: 2px; }
.note { margin-top: 12px; color: var(--muted); font-size: 13.5px; }

footer { margin-top: clamp(56px, 9vw, 96px); padding: 30px 20px 44px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 14.5px; }
footer p { margin: 0; }

@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .metrics { grid-template-columns: 1fr; }
  .nav nav a:nth-child(-n+2) { display: none; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .stats, .cards { grid-template-columns: 1fr; }
  .filter { margin-left: 0; }
}
