/* TogetherBench — landing site
   Style: clean / academic (swe-chat.com), with the >_< brand accent. */

:root {
  --bg:        #fafafa;
  --surface:   #ffffff;
  --ink:       #15151a;
  --muted:     #62626d;
  --faint:     #9a9aa4;
  --line:      #ececec;
  --line-2:    #e2e2e6;
  --accent:    #ff1f6b;        /* brand pink (from the >_< icon) */
  --accent-50: #fff0f5;
  --accent-ink:#cc0a52;
  --dark:      #161618;        /* brand dark square */
  --dark-2:    #232327;
  --radius:    14px;
  --radius-sm: 9px;
  --maxw:      1120px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --mono: "Google Sans Code", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; height: auto; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,250,250,.82);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 22px; height: 60px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 650; letter-spacing: -.01em; }
.brand img { width: 28px; height: 28px; border-radius: 7px; display: block; }
.brand b { font-size: 17px; }
.brand .tld { color: var(--accent); }
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav-links a {
  color: var(--muted); font-size: 14.5px; font-weight: 500;
  padding: 7px 12px; border-radius: 8px; transition: .15s;
}
.nav-links a:hover { color: var(--ink); background: #f0f0f0; }
.nav-links a.active { color: var(--accent-ink); background: var(--accent-50); }
.nav-links a.active:hover { background: var(--accent-50); }
.nav-links a.gh { display: inline-flex; align-items: center; gap: 7px; }
.nav-links a.gh svg { width: 17px; height: 17px; }
.nav-cta {
  background: var(--ink); color: #fff !important; padding: 8px 15px !important;
  border-radius: 9px !important;
}
.nav-cta:hover { background: var(--accent) !important; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 84px 0 56px; }
.prompt {
  display: inline-flex; align-items: center; gap: 2px;
  font-family: var(--mono); font-size: 34px; font-weight: 700;
  background: var(--dark); color: #fff;
  padding: 12px 20px; border-radius: 16px; margin-bottom: 28px;
  box-shadow: 0 12px 34px -16px rgba(0,0,0,.5);
}
.prompt .gt { color: #fff; }
.prompt .cur { color: #fff; animation: blink 1.2s steps(1) infinite; }
.prompt .lt { color: var(--accent); }
@keyframes blink { 50% { opacity: .15; } }

.hero h1 {
  font-size: clamp(38px, 6vw, 62px); line-height: 1.04; margin: 0 0 18px;
  letter-spacing: -.03em; font-weight: 720;
}
.hero h1 .pink { color: var(--accent); }
.hero .lede {
  max-width: 720px; margin: 0 auto; font-size: clamp(17px, 2.1vw, 20px);
  color: var(--muted); line-height: 1.55;
}
.hero .sub { max-width: 660px; margin: 18px auto 0; font-size: 15px; color: var(--faint); }
.hero-actions { margin-top: 32px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 560; padding: 11px 20px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  cursor: pointer; transition: .15s;
}
.btn:hover { border-color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }

/* ---------- per-page header (multi-page) ---------- */
.page-head { padding: 78px 0 10px; }
.page-head.center { text-align: center; }
.page-title { font-size: clamp(38px, 6vw, 62px); line-height: 1.04; letter-spacing: -.03em; margin: 0 0 16px; font-weight: 720; }
.page-title .pink { color: var(--accent); }
.page-lede { max-width: 680px; font-size: clamp(16px, 2vw, 19px); color: var(--muted); line-height: 1.55; margin: 0; }
.page-head.center .page-lede { margin-left: auto; margin-right: auto; }

/* ---------- stat strip ---------- */
.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
}
.stat { padding: 22px 20px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: none; }
.stat .n { font-size: 32px; font-weight: 700; letter-spacing: -.02em; font-family: var(--mono); }
.stat .n .u { color: var(--accent); }
.stat .l { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* ---------- sections ---------- */
section { padding: 64px 0; }
.divider { border: none; border-top: 1px solid var(--line); margin: 0; }
.eyebrow {
  font-family: var(--mono); font-size: 16px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 10px;
}
.sec-title { font-size: clamp(26px, 3.6vw, 36px); letter-spacing: -.02em; margin: 0 0 14px; font-weight: 680; }
.sec-intro { max-width: 680px; color: var(--muted); font-size: 17px; margin: 0 0 40px; }

/* findings cards */
.findings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.finding {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 26px 24px;
}
.finding .fnum { font-family: var(--mono); font-size: 13px; color: var(--accent); font-weight: 600; }
.finding h3 { font-size: 18px; margin: 12px 0 8px; letter-spacing: -.01em; }
.finding p { margin: 0; color: var(--muted); font-size: 15px; }

/* distribution bars */
.dists { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 8px; }
.dist h4 { font-size: 14px; font-weight: 600; margin: 0 0 16px; color: var(--ink); }
.dist h4 span { color: var(--faint); font-weight: 500; }
.bar-row { display: grid; grid-template-columns: 112px 1fr 34px; align-items: center; gap: 12px; margin-bottom: 11px; }
.bar-row .bl { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: 8px; background: #eee; border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 6px; }
.bar-row .bv { font-size: 12.5px; color: var(--faint); text-align: right; font-family: var(--mono); }

/* cohort chips */
.cohorts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.cohort {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px;
  border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 7px 14px;
}
.cohort .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.cohort .ag { color: var(--faint); }

/* ---------- tasks ---------- */
.tasks-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 26px 0 22px; }
.search {
  flex: 1; min-width: 220px; display: flex; align-items: center; gap: 9px;
  border: 1px solid var(--line-2); background: var(--surface); border-radius: 10px; padding: 0 13px;
}
.search svg { width: 16px; height: 16px; color: var(--faint); flex: none; }
.search input { border: none; outline: none; background: none; font: inherit; padding: 11px 0; width: 100%; color: var(--ink); }
.selects { display: flex; gap: 10px; flex-wrap: wrap; }
.selects select {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; cursor: pointer;
  appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2362626d' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px;
}
.selects select:hover { border-color: var(--ink); }
.count { font-size: 14px; color: var(--muted); }
.count b { color: var(--ink); font-family: var(--mono); }

.task-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 20px 22px; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s;
  display: flex; flex-direction: column;
}
.card:hover { border-color: #cfcfd6; box-shadow: 0 8px 26px -18px rgba(0,0,0,.35); }
.card.open { border-color: var(--accent); box-shadow: 0 10px 30px -18px rgba(255,31,107,.5); }
.card-tags { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.tag {
  font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  letter-spacing: .01em; line-height: 1.5; white-space: nowrap;
}
.tag.cat   { background: var(--accent-50); color: var(--accent-ink); }
.tag.diff  { border: 1px solid var(--line-2); color: var(--muted); }
.tag.diff[data-d="easy"]   { color: #1a7f4b; border-color: #bfe6cf; background: #f1fbf5; }
.tag.diff[data-d="medium"] { color: #9a6700; border-color: #f0dca6; background: #fffaf0; }
.tag.diff[data-d="hard"]   { color: #b42318; border-color: #f3c9c4; background: #fef3f2; }
.tag.lang { border: 1px solid var(--line-2); color: var(--muted); font-family: var(--mono); font-weight: 500; }
.card h3 { font-size: 16.5px; line-height: 1.35; margin: 0 0 8px; letter-spacing: -.01em; font-weight: 620; }
.card h3 a { color: inherit; }
.card h3 a:hover { color: var(--accent-ink); }
.card .blurb { font-size: 14px; color: var(--muted); margin: 0; flex: 1; }
.card-foot {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--faint);
}
.card-foot .repo { font-family: var(--mono); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.card-foot .repo svg { width: 13px; height: 13px; opacity: .65; }
.card-foot .m { display: inline-flex; align-items: center; gap: 5px; }
.card-foot .m svg { width: 13px; height: 13px; }
.card-foot .spacer { margin-left: auto; }
.card-foot .toggle { color: var(--accent); font-weight: 600; }

/* expanded detail */
.detail { display: none; margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line-2); }
.card.open .detail { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(-3px); } }
.detail .summary { font-size: 14.5px; color: var(--ink); margin: 0 0 20px; line-height: 1.62; }
.dlabel { font-family: var(--mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin: 0 0 12px; font-weight: 600; }
.dlabel svg { width: 13px; height: 13px; vertical-align: -2px; }
.dblock { margin-bottom: 22px; }

/* user correction loop */
.turns { display: flex; flex-direction: column; gap: 10px; }
.turn { display: grid; grid-template-columns: 26px 1fr; gap: 12px; }
.turn .ix { font-family: var(--mono); font-size: 12px; color: var(--faint); text-align: right; padding-top: 2px; }
.turn .body { border-left: 2px solid var(--line-2); padding-left: 14px; }
.turn .kind {
  display: inline-block; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  padding: 1px 7px; border-radius: 5px; margin-bottom: 4px; color: var(--muted); background: #f1f1f3;
}
.turn .kind.request { color: var(--accent-ink); background: var(--accent-50); }
.turn .kind.question { color: #2f5fb0; background: #eef3fc; }
.turn .ttext { font-size: 13.5px; color: var(--ink); margin: 0; }
.turn .quote { font-size: 12.5px; color: var(--muted); font-style: italic; margin: 4px 0 0; }
.turn .quote::before { content: "“"; } .turn .quote::after { content: "”"; }

/* goals */
.goal { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); align-items: start; }
.goal:first-child { border-top: none; }
.goal .w { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.tier { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 1px 6px; border-radius: 5px; margin-right: 7px; vertical-align: middle; }
.tier.core { background: var(--accent); color: #fff; }
.tier.secondary { background: #e8e8ec; color: var(--muted); }
.tier.polish { background: #f1f1f3; color: var(--faint); }
.goal .gtext { font-size: 13.5px; color: var(--ink); }

/* meta grid in detail */
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px 20px; padding-top: 4px; }
.meta-grid .mi { min-width: 0; }
.meta-grid .mi .k { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
.meta-grid .mi .v { font-size: 14px; color: var(--ink); font-family: var(--mono); margin-top: 3px; overflow-wrap: anywhere; word-break: break-word; }
.meta-grid .mi .v a { color: var(--accent-ink); border-bottom: 1px solid transparent; }
.meta-grid .mi .v a:hover { border-color: var(--accent-ink); }
.empty { text-align: center; color: var(--faint); padding: 50px 0; font-size: 15px; }

/* ---------- team (professional bordered grid with avatars) ---------- */
.team-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px;
  background: var(--line-2); border: 1px solid var(--line-2);
  border-radius: var(--radius); overflow: hidden; margin-top: 8px;
}
.team-cell { background: var(--surface); padding: 28px 16px; text-align: center; }
.team-cell.empty { padding: 0; }
.team-avatar { margin-bottom: 14px; }
.team-avatar img {
  width: 56px; height: 56px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--line-2); display: inline-block;
}
.team-initials {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%;
  background: #f0f0f3; border: 2px solid var(--line-2);
  font-family: var(--mono); font-size: 16px; font-weight: 700;
  color: var(--muted); letter-spacing: .02em;
}
.team-name { font-size: 15px; font-weight: 640; letter-spacing: -.01em; color: var(--ink); }
.team-name a { border-bottom: 1px solid transparent; transition: .15s; }
.team-name a:hover { color: var(--accent-ink); border-color: var(--accent-ink); }
.team-role { font-size: 11.5px; color: var(--muted); font-family: var(--mono); margin-top: 5px;
  text-transform: uppercase; letter-spacing: .04em; }
.team-role.lead { color: var(--accent-ink); }
.team-aff { font-size: 12px; color: var(--faint); margin-top: 4px; }
@media (max-width: 860px) {
  .team-grid { grid-template-columns: repeat(3, 1fr); }
  .team-cell.empty { display: none; }
}
@media (max-width: 520px) {
  .team-grid { grid-template-columns: repeat(2, 1fr); }
}

/* discord button */
.btn-discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.btn-discord:hover { background: #4654d6; border-color: #4654d6; }
.btn-discord svg { fill: #fff; }

/* inline prose links */
.sec-intro a { color: var(--accent-ink); font-weight: 560; border-bottom: 1px solid rgba(204,10,82,.28); transition: border-color .15s; }
.sec-intro a:hover { border-bottom-color: var(--accent-ink); }
.sec-intro a.person-inline { color: var(--accent); border-bottom: 0; white-space: nowrap; }
.sec-intro a.person-inline:hover { text-decoration: underline; text-underline-offset: 2px; }
.mini-avatar {
  width: 1.35em; height: 1.35em; border-radius: 50%; object-fit: cover; object-position: center;
  vertical-align: -0.33em; margin: 0 .32em 0 .12em;
  border: 1px solid var(--line-2); background: var(--accent-50);
}
.mini-logo {
  width: 1.05em; height: 1.05em; vertical-align: -0.18em; margin: 0 .55em 0 .32em;
}

/* citation */
.cite-box {
  position: relative; background: #f2f2f4; border: 1px solid #e6e6ea; border-radius: var(--radius);
  padding: 22px 24px; margin-top: 8px; overflow: auto; max-width: 820px;
}
.cite-box pre { margin: 0; font-family: var(--mono); font-size: 13px; color: #33333a; line-height: 1.65; white-space: pre; }
.copy-btn {
  position: absolute; top: 14px; right: 14px; font: inherit; font-size: 12.5px;
  color: #555; background: #fff; border: 1px solid #ddd;
  border-radius: 8px; padding: 5px 12px; cursor: pointer; transition: .15s;
}
.copy-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); background: var(--dark); color: #c9c9d0; padding: 48px 0 40px; }
footer .wrap { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
footer .fb { display: flex; align-items: center; gap: 11px; }
footer .fb img { width: 30px; height: 30px; border-radius: 7px; }
footer .fb b { color: #fff; font-size: 16px; }
footer .fb .tld { color: var(--accent); }
footer p { margin: 12px 0 0; font-size: 13.5px; color: #8a8a96; max-width: 420px; }
footer .flinks { display: flex; gap: 26px; flex-wrap: wrap; }
footer .flinks a { color: #c9c9d0; font-size: 14px; }
footer .flinks a:hover { color: var(--accent); }

/* ---------- per-task metrics (heatmap + model breakdown) ---------- */
.card-metrics { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.cm-heatmap { display: flex; gap: 2px; margin-bottom: 8px; }
.mbar {
  flex: 1; height: 6px; border-radius: 3px; min-width: 0;
  transition: opacity .15s;
}
.card-metrics:hover .mbar { opacity: .85; }
.cm-stats { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cm-stat { font-size: 12px; color: var(--faint); font-family: var(--mono); }

/* model performance detail rows */
.mr-header {
  display: grid; grid-template-columns: 90px 1fr 48px 48px 40px; gap: 8px;
  align-items: center; padding: 0 0 6px; margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 600;
}
.mr-header .mr-bar-label { padding-left: 0; }
.mr-row {
  display: grid; grid-template-columns: 90px 1fr 48px 48px 40px; gap: 8px;
  align-items: center; padding: 5px 0;
}
.mr-row:hover { background: #fafafb; border-radius: 6px; }
.mr-model { font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mr-bar-track { height: 7px; background: #eee; border-radius: 4px; overflow: hidden; }
.mr-bar-fill { height: 100%; border-radius: 4px; transition: width .3s; }
.mr-score { font-size: 12.5px; font-family: var(--mono); color: var(--muted); text-align: right; }
.mr-score.mr-pass { color: #16a34a; font-weight: 700; }
.mr-corr { font-size: 12px; font-family: var(--mono); color: var(--faint); text-align: right; }
.mr-time { font-size: 12px; font-family: var(--mono); color: var(--faint); text-align: right; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .findings, .dists { grid-template-columns: 1fr; gap: 16px; }
  .task-grid { grid-template-columns: 1fr; }
  .nav-links a:not(.gh):not(.active) { display: none; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr; }
  .stat { border-left: none; border-top: 1px solid var(--line); }
  .stat:first-child { border-top: none; }
  section { padding: 48px 0; }
}
