/* ---------------------------------------------------------------------------
   Self-Trained Verification — project page
   Typography: Avenir Next with a clean system-font fallback chain.
--------------------------------------------------------------------------- */

:root {
  --fg:         #1c1c1e;
  --fg-muted:   #5a5a60;
  --fg-faint:   #888;
  --bg:         #ffffff;
  --link:       #1463b0;
  --link-hover: #0d4a85;
  --rule:       #e5e5ea;
  --code-bg:    #f6f6f8;
  --content-w:  720px;
  --gutter:     1.25rem;
}

html {
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
*, *::before, *::after { box-sizing: inherit; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Avenir Next", "Avenir", "Nunito Sans",
               system-ui, -apple-system, BlinkMacSystemFont,
               "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.content {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 4rem var(--gutter) 5rem;
}

/* ------------------------------- header --------------------------------- */
.paper-header {
  margin-bottom: 2.5rem;
  text-align: center;
}
.paper-header h1 {
  font-size: 1.85rem;
  line-height: 1.25;
  font-weight: 600;
  margin: 0 0 0.9rem;
  letter-spacing: -0.01em;
}
.paper-header h1 .hl-training { color: #b93245; }
.paper-header h1 .hl-test     { color: #2980b9; }
.paper-header .authors {
  margin: 0;
  font-size: 1.05rem;
  color: var(--fg);
}
.paper-header .authors a {
  color: inherit;
  border-bottom: 1px dotted var(--fg-muted);
}
.paper-header .authors a:hover {
  color: var(--link);
  border-bottom-color: currentColor;
  border-bottom-style: solid;
}
.paper-header .affiliation {
  margin: 0.2rem 0 0;
  color: var(--fg-muted);
  font-size: 0.95rem;
}
.paper-header .meta {
  margin: 0.3rem 0 0;
  color: var(--fg-faint);
  font-size: 0.95rem;
}
.paper-header .links {
  margin: 1rem 0 0;
  font-size: 1rem;
  color: var(--fg-muted);
}
.paper-header .links a { margin: 0 0.15rem; }

/* ------------------------------- tldr ----------------------------------- */
.tldr {
  background: var(--code-bg);
  border-left: 3px solid var(--fg);
  border-radius: 0 6px 6px 0;
  padding: 1rem 1.25rem;
  margin: 2rem 0 2.5rem;
}
.tldr h2 {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.tldr p {
  margin: 0.55rem 0;
}
.tldr p:first-of-type { margin-top: 0; }
.tldr p:last-of-type { margin-bottom: 0; }

/* ------------------------------- headline stats ------------------------- */
.headline-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2rem 0;
  padding: 1.2rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.stat {
  text-align: center;
  padding: 0 0.5rem;
}
.stat-number {
  display: block;
  font-size: 2.2rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.88rem;
  color: var(--fg-muted);
  line-height: 1.35;
}

/* ------------------------------- toc ------------------------------------ */
.toc {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 1rem 0 0.5rem;
  margin: 2rem 0 3rem;
}
.toc h2 {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin: 0 0 0.4rem;
}
.toc ol {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--fg-muted);
}
.toc li { margin: 0.15rem 0; }
.toc a { color: var(--fg); }

/* ------------------------------- sections ------------------------------- */
section { margin: 2.6rem 0; }
section + section { margin-top: 3.2rem; }

h2 {
  font-size: 1.3rem;
  line-height: 1.3;
  font-weight: 600;
  margin: 0 0 0.9rem;
  letter-spacing: -0.005em;
}
h3 {
  font-size: 1.08rem;
  line-height: 1.35;
  font-weight: 600;
  margin: 2rem 0 0.7rem;
  letter-spacing: -0.003em;
}
section section { margin-top: 0; }
section section + section { margin-top: 0; }

p { margin: 0.85rem 0; }
ul { padding-left: 1.25rem; margin: 0.85rem 0; }
ul li { margin: 0.35rem 0; }

strong { font-weight: 600; }
em { font-style: italic; }

/* ------------------------------- links ---------------------------------- */
a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 80ms ease, border-color 80ms ease;
}
a:hover { color: var(--link-hover); border-bottom-color: currentColor; }

/* ------------------------------- figures -------------------------------- */
figure {
  margin: 2rem 0;
}
figure.hero { margin: 2rem 0 2rem; }
figure.narrow {
  max-width: 58%;
  margin-left: auto;
  margin-right: auto;
}
figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}
figcaption {
  margin-top: 0.55rem;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--fg-muted);
}
figcaption strong { color: var(--fg); }

/* ------------------------------- tables --------------------------------- */
.table-wrap { margin: 1.2rem 0; overflow-x: auto; }
table.ablation {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.95rem;
}
table.ablation th,
table.ablation td {
  padding: 0.45rem 0.8rem;
  text-align: left;
}
table.ablation th {
  font-weight: 600;
  border-bottom: 1.5px solid var(--fg);
}
table.ablation td:nth-child(2),
table.ablation td:nth-child(3),
table.ablation th:nth-child(2),
table.ablation th:nth-child(3) {
  text-align: right;
  font-variant-numeric: tabular-nums;
  width: 6.5rem;
}
table.ablation tr.group td {
  padding-top: 0.7rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
}
table.ablation tbody tr:not(.group):last-child td { padding-bottom: 0.55rem; }

/* ------------------------------- code / citation ------------------------ */
code, pre {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;
  font-size: 0.88rem;
}
pre {
  background: var(--code-bg);
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  overflow-x: auto;
  line-height: 1.55;
  margin: 0.6rem 0 0;
}
pre code { background: none; padding: 0; }

/* BibTeX copy-to-clipboard */
.bibtex-wrap { position: relative; }
.copy-btn {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  font: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.22rem 0.55rem;
  color: var(--fg-muted);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 80ms ease, color 80ms ease, border-color 80ms ease;
}
.copy-btn:hover { color: var(--fg); border-color: var(--fg-muted); opacity: 1; }
.copy-btn.is-copied { color: #2980b9; border-color: #2980b9; }
.citation { margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.citation h2 {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

/* ------------------------------- responsive ----------------------------- */
@media (max-width: 600px) {
  body { font-size: 16px; line-height: 1.6; }
  .content { padding: 2.5rem 1rem 3.5rem; }
  .paper-header h1 { font-size: 1.55rem; }
  h2 { font-size: 1.18rem; }
  h3 { font-size: 1.03rem; }
  figure.narrow { max-width: 100%; }
  .headline-stats { grid-template-columns: 1fr; gap: 0.6rem; }
  .stat-number { font-size: 1.8rem; }
}
