/* Shared stylesheet for the EMNLP 2026 project pages (RwR, KoNA). */

:root {
  --bg: #ffffff;
  --surface: #faf7f9;
  --ink: #17151a;
  --text: #37333b;
  --muted: #6b6671;
  --line: #ebe6ea;
  --line-strong: #d8d0d6;
  --accent: #c80060;
  --accent-ink: #a8004f;
  --accent-tint: #fbe8f0;
  --accent-rule: #f0b8d0;
  --good: #14784a;
  --good-tint: #e5f3eb;
  --bad: #b3261e;
  --bad-tint: #fcebea;
  --blue: #1f5fbf;
  --blue-tint: #e9f0fb;
  --neutral-fill: #c9c3c8;
  --figure-bg: #ffffff;
  --radius: 10px;
  --maxw: 1040px;
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--accent-rule); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
b, strong { color: var(--ink); font-weight: 600; }
code { font: 0.88em/1 var(--mono); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } body { font-size: 16px; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 22px; height: 56px; }
.brand { font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.brand span { color: var(--muted); font-weight: 500; }
.spacer { flex: 1; }
.toc { display: flex; gap: 20px; font-size: 14px; }
.toc a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.toc a:hover, .toc a.is-active { color: var(--ink); }
.quick { display: flex; gap: 4px; }
.quick a { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: var(--muted); }
.quick a:hover { color: var(--ink); background: var(--surface); }
.quick svg { width: 18px; height: 18px; }
@media (max-width: 820px) { .toc { display: none; } }

/* ---------- hero ---------- */
.hero { padding: 76px 0 56px; }
.eyebrow { display: inline-flex; align-items: center; gap: 12px; margin: 0; font: 600 13px/1 var(--font); letter-spacing: 0.09em; text-transform: uppercase; color: var(--accent-ink); }
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--accent); }
h1.title { margin: 22px 0 0; font-weight: 700; color: var(--ink); letter-spacing: -0.028em; line-height: 1.06; font-size: clamp(2.3rem, 5.4vw, 3.75rem); max-width: 22ch; }
h1.title .main { color: var(--accent); }
h1.title .sub { display: block; margin-top: 14px; font-size: clamp(1.2rem, 2.5vw, 1.7rem); font-weight: 600; line-height: 1.28; letter-spacing: -0.015em; max-width: 44ch; }
.authors { margin: 30px 0 0; font-size: 18px; color: var(--ink); }
.authors a { color: var(--ink); text-decoration-color: var(--line-strong); white-space: nowrap; }
.authors a:hover { text-decoration-color: var(--accent); }
.authors sup { color: var(--muted); font-size: 0.68em; margin-left: 1px; }
.authors .sep { color: var(--line-strong); margin: 0 10px; }
.affils { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.affils sup { font-size: 0.7em; margin-right: 2px; }
.affils .sep { margin: 0 8px; color: var(--line-strong); }
.links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 17px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg);
  color: var(--ink); text-decoration: none; font: 500 15px/1 var(--font); cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.btn:hover { border-color: var(--accent); background: var(--accent-tint); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn .emoji { font-size: 16px; line-height: 1; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.tldr { margin: 44px 0 0; padding: 2px 0 2px 22px; border-left: 3px solid var(--accent); font-size: clamp(1.06rem, 1.9vw, 1.28rem); line-height: 1.55; color: var(--ink); max-width: 64ch; }
.note { margin: 18px 0 0; font-size: 14px; color: var(--muted); }
.note b { color: var(--muted); }

/* ---------- sections ---------- */
section.block { padding: 76px 0; border-top: 1px solid var(--line); }
.kicker { margin: 0 0 14px; font: 600 12px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-ink); }
h2 { margin: 0; font-size: clamp(1.65rem, 3.2vw, 2.2rem); line-height: 1.18; letter-spacing: -0.022em; color: var(--ink); font-weight: 700; max-width: 40ch; }
h3 { margin: 0 0 8px; font-size: 19px; line-height: 1.3; color: var(--ink); letter-spacing: -0.01em; font-weight: 650; }
.lead { margin: 16px 0 0; max-width: 68ch; font-size: 18px; }
@media (max-width: 640px) { section.block { padding: 56px 0; } .lead { font-size: 16.5px; } }
.prose p { max-width: 70ch; margin: 16px 0 0; }
.abstract p { max-width: 72ch; margin: 18px 0 0; }
.sub-block { margin-top: 56px; }
.sub-block > p { max-width: 70ch; margin: 8px 0 0; }
.caption, figcaption { margin-top: 12px; font-size: 14px; line-height: 1.55; color: var(--muted); max-width: 78ch; }

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

/* ---------- small labels ---------- */
.tag { display: inline-block; font: 600 11px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; padding: 5px 8px; border-radius: 4px; white-space: nowrap; }
.tag.harm { color: var(--bad); background: var(--bad-tint); }
.tag.pseudo { color: var(--blue); background: var(--blue-tint); }
.tag.plain { color: var(--muted); background: var(--surface); border: 1px solid var(--line); }
.label { margin: 0 0 8px; font: 600 11.5px/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.verdict { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.verdict.ok { color: var(--good); background: var(--good-tint); }
.verdict.no { color: var(--bad); background: var(--bad-tint); }
.verdict svg { width: 13px; height: 13px; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 28px; margin-top: 36px; }
.stat { padding-top: 16px; border-top: 1px solid var(--line-strong); }
.stat .num { font-size: 32px; font-weight: 700; line-height: 1.1; color: var(--ink); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .num .from { color: var(--muted); font-weight: 600; }
.stat .num .arrow { color: var(--muted); font-weight: 400; margin: 0 6px; }
.stat .num .to { color: var(--accent); }
.stat p { margin: 8px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.stats-label { margin: 34px 0 0; }
.stats.tight { margin-top: 12px; }

/* ---------- segmented control ---------- */
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 28px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 999px; max-width: 100%; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; font: 500 14px/1.2 var(--font); color: var(--muted); cursor: pointer; }
.seg button:hover { color: var(--ink); }
.seg button[aria-selected="true"], .seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
@media (max-width: 520px) { .seg { border-radius: 14px; } .seg button { border-radius: 11px; } }

/* ---------- bar charts ---------- */
.bars { margin-top: 24px; }
.bars .group-label { margin: 22px 0 6px; font: 600 11.5px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.bars .group-label:first-child { margin-top: 0; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr) 44px minmax(0, 150px); align-items: center; gap: 14px; padding: 6px 0; font-size: 14.5px; }
.bar-row .name { color: var(--ink); line-height: 1.3; }
.bar-row .track { position: relative; height: 12px; background: var(--surface); border-radius: 3px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.bar-row .fill { position: absolute; inset: 0 auto 0 0; width: calc(var(--v) * 100%); background: var(--neutral-fill); border-radius: 3px; transition: width 0.35s ease; }
.bar-row.hl .fill { background: var(--accent); }
.bar-row.hl .name { font-weight: 600; }
.bar-row .val { text-align: right; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.bar-row .side { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.bars-head { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr) 44px minmax(0, 150px); gap: 14px; font-size: 12.5px; color: var(--muted); padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.bars-head span:nth-child(3) { text-align: right; }
@media (max-width: 640px) {
  .bar-row, .bars-head { grid-template-columns: minmax(0, 1fr) 44px; gap: 4px 12px; }
  .bar-row .name { grid-column: 1 / -1; }
  .bar-row .track { grid-column: 1; }
  .bar-row .side { grid-column: 1 / -1; margin-top: -2px; }
  .bars-head span:nth-child(1), .bars-head span:nth-child(4) { display: none; }
}

/* ---------- tables ---------- */
.tbl-wrap { margin-top: 18px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; padding-left: 0; }
.tbl thead th { font-weight: 600; font-size: 12.5px; line-height: 1.35; color: var(--muted); vertical-align: bottom; border-bottom: 1px solid var(--line-strong); }
.tbl thead tr.super th { border-bottom: 0; padding-bottom: 6px; color: var(--ink); text-align: center; }
.tbl thead tr.super th:not(:empty) { box-shadow: inset 0 -1px 0 var(--line); }
.tbl td { color: var(--text); }
.tbl td:first-child { color: var(--ink); }
.tbl tr.group td { padding-top: 20px; font: 600 11.5px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); background: transparent; }
.tbl tr.hl td { background: var(--accent-tint); color: var(--ink); }
.tbl tr.hl td:first-child { font-weight: 600; padding-left: 10px; box-shadow: inset 2px 0 0 var(--accent); }
.tbl td.b { font-weight: 700; color: var(--ink); }
.tbl td.cell-hl { background: var(--accent-tint); font-weight: 700; color: var(--accent-ink); }
.tbl .dim { color: var(--muted); }
.tbl-note { margin-top: 10px; font-size: 13.5px; color: var(--muted); max-width: 80ch; }

/* ---------- details ---------- */
details.more { margin-top: 26px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
details.more summary { cursor: pointer; padding: 14px 0; font-weight: 600; color: var(--ink); list-style: none; display: flex; align-items: center; gap: 10px; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "+"; width: 14px; font: 600 16px/1 var(--mono); color: var(--accent); }
details.more[open] summary::before { content: "\2212"; }
details.more > div { padding-bottom: 20px; }

/* ---------- figures ---------- */
figure { margin: 28px 0 0; }
.frame { background: var(--figure-bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.frame img { margin: 0 auto; }

/* ---------- cards / panels ---------- */
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0; margin-top: 32px; border-top: 1px solid var(--line); }
.fact { padding: 18px 20px 18px 0; border-bottom: 1px solid var(--line); }
.fact p { margin: 0; font-size: 15px; line-height: 1.55; }
.fact p.label { margin-bottom: 6px; font-size: 11.5px; line-height: 1.3; }

/* ---------- code / bibtex ---------- */
.codebox { position: relative; margin-top: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.codebox pre { margin: 0; padding: 20px 22px; overflow-x: auto; font: 13.5px/1.65 var(--mono); color: var(--ink); }
.copy { position: absolute; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--bg); color: var(--muted); font: 500 13px/1 var(--font); cursor: pointer; }
.copy:hover { color: var(--ink); border-color: var(--accent); }
.copy svg { width: 14px; height: 14px; }
@media (max-width: 640px) {
  .codebox pre { padding-top: 50px; }
  table.tbl { font-size: 13.5px; }
  .tbl th, .tbl td { padding: 8px 8px; }
  .tbl thead th { white-space: normal; min-width: 64px; }
}

/* ---------- footer ---------- */
footer.site { padding: 36px 0 56px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
footer.site a { color: var(--muted); }
footer.site p { margin: 0; }
