/* Project page styles, following the Academic Project Page Template (Bulma + Nerfies). */
:root {
  --dsr-teal: #127369;
  --dsr-shade: #e3f1ee;
  --dsr-orange: #b5650d;
  --finding: #5b7c82;
  --finding-bg: #eef2f3;
  --ink: #363636;
  --muted: #6b6b6b;
  --rule: #e3e3e3;
}

html { color-scheme: light; background: #fff; }
body { font-family: 'Noto Sans', sans-serif; color: var(--ink); background: #fff; }

.publication-title, .publication-authors, .teaser, .title, .subtitle, .stage-card h4 {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
}

/* ---------- hero ---------- */
.hero-body { padding-top: 3.5rem; padding-bottom: 1.5rem; }
.publication-title { line-height: 1.25; font-size: 2.4rem !important; }
.publication-title .dsr-icon { height: 1.05em; vertical-align: -0.16em; margin-right: 0.3em; }
.publication-authors { margin-top: 0.4rem; }
.publication-authors a, .publication-authors .author-name { color: hsl(204, 86%, 45%) !important; }
.publication-authors a:hover { text-decoration: underline; }
.publication-authors sup { font-size: 0.7em; color: var(--ink); margin-left: 0.05em; }
.author-block { display: inline-block; margin: 0 0.15em; }
.affiliations { color: var(--muted); font-size: 1.05rem !important; }
.affiliations .author-block { margin: 0 0.55em; }
.affiliations sup { color: var(--muted); }
.venue { font-family: 'Google Sans', 'Noto Sans', sans-serif; font-size: 1.15rem; font-weight: 600; color: var(--dsr-teal); margin-top: 0.5rem; }
.publication-links { margin-top: 1.1rem; }
.link-block { display: inline-block; }
.link-block a { margin: 5px 3px; }
.link-block .button.is-static-soon { opacity: 0.55; cursor: default; pointer-events: none; }
.hf-logo { font-style: normal; font-size: 1.05em; line-height: 1; }

/* ---------- teaser ---------- */
.teaser .hero-body { padding-top: 0.5rem; padding-bottom: 2.5rem; }
.teaser img { display: block; width: 100%; margin: 0 auto; }
.teaser .subtitle { font-size: 1.1rem; line-height: 1.55; margin-top: 1rem; color: #4a4a4a; }

/* ---------- body sections ---------- */
.section { padding: 2.75rem 1.5rem; }
.section .title.is-3 { margin-bottom: 1.2rem; }
.content p, .content li { font-size: 1.08rem; line-height: 1.7; }
.content h3.title { font-size: 1.3rem; margin-top: 2rem; margin-bottom: 0.8rem; }
.abstract p { font-size: 1.08rem; line-height: 1.7; }

figure.paper-figure { margin: 1.6rem auto 1.8rem; text-align: center; }
figure.paper-figure img { width: 100%; height: auto; display: block; margin: 0 auto; }
figure.paper-figure.medium img { max-width: 760px; }
figure.paper-figure.narrow img { max-width: 600px; }
figure.paper-figure img + img { margin-top: 0.6rem; }
figure.paper-figure figcaption {
  font-style: normal; font-size: 0.95rem; line-height: 1.55; color: #555; text-align: left;
  max-width: 860px; margin: 0.7rem auto 0;
}
.content figure.paper-figure { margin-left: auto; margin-right: auto; }

.takeaway {
  background: var(--finding-bg); border-left: 4px solid var(--finding);
  padding: 0.9rem 1.2rem; margin: 1.5rem 0; border-radius: 0 6px 6px 0;
}
.takeaway p { margin: 0 !important; font-size: 1.08rem; }

/* Three failure modes of unconstrained regression */
.stage-card {
  height: 100%; background: #fff; border: 1px solid var(--rule); border-top: 3px solid var(--dsr-orange);
  border-radius: 6px; padding: 0.85rem 1rem;
}
.stage-card h4 { font-size: 1.08rem !important; font-weight: 600; margin: 0 0 0.35rem !important; color: var(--ink); }
.stage-card p { font-size: 0.98rem !important; line-height: 1.6 !important; margin: 0 !important; }

.dsr { color: var(--dsr-teal); font-weight: 600; }
.mjx-chtml, mjx-container { font-size: 105% !important; }
mjx-container[display="true"] { overflow-x: auto; overflow-y: hidden; padding: 0.2rem 0; }

/* ---------- code / pseudocode ---------- */
.content pre { background: #f6f6f8; border-radius: 6px; font-size: 0.86rem; line-height: 1.55; padding: 1rem 1.15rem; }
.code-label { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.3rem !important; }
.code-label code { color: var(--ink); background: #ececf0; }
.content pre.pseudocode { font-size: 0.88rem; line-height: 1.6; }
.pseudocode .kw { color: var(--dsr-teal); font-weight: 600; }
.pseudocode .cm { color: #8a8a8a; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 1.2rem auto 0.4rem; }
.content table.results {
  width: auto; border-collapse: collapse; margin: 0 auto; font-size: 0.98rem; min-width: 560px;
  font-variant-numeric: tabular-nums;
}
.content table.results th, .content table.results td { padding: 0.38rem 0.85rem; border: none; text-align: right; white-space: nowrap; vertical-align: middle; }
.content table.results th { font-weight: 600; border-bottom: 1.5px solid #333; color: var(--ink); }
.content table.results thead tr:first-child th { border-top: 1.5px solid #333; }
.content table.results thead tr.grp th { border-bottom: none; padding-bottom: 0.1rem; }
.content table.results thead tr.grp th.span { text-align: center; }
.content table.results thead tr.grp th.span span { display: block; border-bottom: 1px solid #999; padding-bottom: 0.15rem; }
.content table.results thead tr.grp th[rowspan] { border-bottom: 1.5px solid #333; vertical-align: bottom; }
.content table.results tbody tr:last-child td { border-bottom: 1.5px solid #333; }
.content table.results td.l, .content table.results th.l { text-align: left; }
.content table.results td.c, .content table.results th.c { text-align: center; }
.content table.results th.gap, .content table.results td.gap { padding-left: 1.4rem; }
.content table.results tr.group-start td { border-top: 1px solid #bbb; }
/* Benchmark tables with mean ± std: tighter cells so they fit the 960px column. */
.content table.results.wide { font-size: 0.9rem; }
.content table.results.wide th, .content table.results.wide td { padding: 0.36rem 0.4rem; }
.content table.results.wide th.gap, .content table.results.wide td.gap { padding-left: 1rem; }
.content table.results.wide th:first-child, .content table.results.wide td:first-child { padding-left: 0.2rem; }
/* Eleven-column generalization table. */
.content table.results.xwide { font-size: 0.86rem; }
.content table.results.xwide th.gap, .content table.results.xwide td.gap { padding-left: 0.85rem; }
.content table.results tr.ours td { background: var(--dsr-shade); }
.content table.results tr.ablation td { color: var(--muted); }
.content table.results td b { font-weight: 700; }
.content table.results td u { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
.content table.results .ci { font-size: 0.8em; color: #777; margin-left: 0.25em; }
.content table.results b .ci { color: inherit; }
/* Text table (benchmarks): text cells wrap, so it fits the column on desktop and scrolls on phones. */
.content table.results.data { width: 100%; min-width: 680px; font-size: 0.95rem; }
.content table.results.data td.l { white-space: normal; }
.content table.results.data td.nw { white-space: nowrap; }
.content table.results.data td code { font-size: 0.85em; color: var(--ink); background: #ececf0; white-space: nowrap; }
.table-caption { font-size: 0.95rem; color: #555; line-height: 1.55; max-width: 860px; margin: 0.6rem auto 1.6rem; }
.table-caption code { font-size: 0.85em; color: var(--ink); background: #ececf0; }

/* ---------- bibtex / footer ---------- */
.bib-wrap { position: relative; }
.bib-wrap pre { white-space: pre-wrap; padding-right: 5rem; }
.copy-btn { position: absolute; top: 0.6rem; right: 0.6rem; z-index: 1; }
.footer { padding: 2.5rem 1.5rem 3rem; background: #fafafa; }
.footer p { font-size: 0.9rem; color: #666; }

/* ---------- small screens ---------- */
@media screen and (max-width: 768px) {
  .hero-body { padding: 2.2rem 1rem 1rem; }
  .publication-title { font-size: 1.75rem !important; }
  .publication-authors { font-size: 1.05rem !important; }
  .affiliations { font-size: 0.98rem !important; }
  .affiliations .author-block { margin: 0.1em 0.4em; }
  .publication-authors br.wide-only { display: none; }
  .section { padding: 2rem 1rem; }
  .content p, .content li, .abstract p { font-size: 1rem; }
  .teaser .subtitle { font-size: 1rem; }
  mjx-container[display="true"] { font-size: 86% !important; }
  .content table.results { font-size: 0.9rem; }
  .content pre.pseudocode { font-size: 0.78rem; }
  .stage-card { height: auto; }
}

/* Bulma heroes are column flexboxes with auto-margined containers, which then size to their widest
   child (a table); pin them to the section width so wide tables scroll inside .table-wrap instead. */
.hero > .container { width: 100%; min-width: 0; }
