/* Paper project page. Text, figures, tables and equations are taken from the paper. */

@font-face { font-family: "Newsreader"; src: url("../../assets/fonts/Newsreader16pt-Regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../../assets/fonts/Newsreader16pt-Medium.woff") format("woff"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../../assets/fonts/Newsreader16pt-Italic.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Newsreader Display"; src: url("../../assets/fonts/Newsreader72pt-Regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../../assets/fonts/IBMPlexSans-Regular-Latin1.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../../assets/fonts/IBMPlexSans-Italic-Latin1.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../../assets/fonts/IBMPlexSans-Medium-Latin1.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../../assets/fonts/IBMPlexSans-SemiBold-Latin1.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --ink: #1B1E26;
  --muted: #5A6070;
  --faint: #8A90A0;
  --rule: #DCDFE6;
  --soft: #ECEEF3;
  --accent: #2F4FD6;
  --accent-soft: #E6EBFB;
  --dot: #9AA0AE;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --display: "Newsreader Display", "Newsreader", Georgia, serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --text: 44rem;
  --wide: 64rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12141A; --surface: #1A1D25; --ink: #E7E9EE; --muted: #A3A9B8; --faint: #7C8394;
    --rule: #2C303B; --soft: #20242D; --accent: #8FA4FF; --accent-soft: #232B47; --dot: #6E7586;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 1.5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 1.0625rem; line-height: 1.68; }
a { color: var(--accent); text-decoration: none; text-underline-offset: .18em; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
img { display: block; max-width: 100%; height: auto; }
sup, sub { font-size: .7em; line-height: 0; }
strong { font-weight: 600; }

/* inline math: variables in serif italic, stacked sub/superscripts */
.m { font-family: var(--serif); font-style: italic; font-size: 1.1em; white-space: nowrap; }
.m .r { font-style: normal; }
.m .hat { position: relative; display: inline-block; }
.m .hat::before { content: "^"; position: absolute; left: 58%; top: -.42em; transform: translateX(-50%); font-size: .8em; font-style: normal; }
.ss { display: inline-flex; flex-direction: column; vertical-align: .52em; line-height: 1; font-size: .66em; margin-left: .04em; }
.ss > span { display: block; }

/* ---------- top / toc ---------- */
.back { max-width: var(--wide); margin: 0 auto; padding: 1rem 1.25rem 0; font-size: .9rem; }
.back a { color: var(--muted); }
.back a:hover { color: var(--ink); text-decoration: none; }

.toc { display: none; }
@media (min-width: 1420px) {
  .toc {
    display: block; position: fixed; top: 6rem; width: 11.5rem;
    left: max(1.5rem, calc((100vw - 77rem) / 2 - 13rem));
    font-size: .84rem; line-height: 1.45;
  }
  .toc p { margin: 0 0 .6rem; color: var(--faint); }
  .toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
  .toc li a { display: block; padding: .28rem 0 .28rem .85rem; margin-left: -1px; color: var(--muted); border-left: 2px solid transparent; }
  .toc li a:hover { color: var(--ink); text-decoration: none; }
  .toc li a.on { color: var(--ink); border-left-color: var(--accent); font-weight: 500; }
}

/* ---------- header ---------- */
header.paper { max-width: var(--wide); margin: 0 auto; padding: 2.6rem 1.25rem 0; text-align: center; }
.venue { display: inline-block; margin: 0 0 1.1rem; padding: .2rem .8rem; border-radius: 999px; font-size: .86rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); }
.venue.pre { color: var(--muted); background: var(--soft); font-weight: 500; }
.paper-title { font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 4.4vw, 3.05rem); line-height: 1.1; letter-spacing: -0.012em; margin: 0 auto 1.4rem; max-width: 54rem; text-wrap: balance; }
.nw { white-space: nowrap; }
.authors { margin: 0 auto .45rem; max-width: 52rem; font-size: 1.04rem; line-height: 1.8; }
.authors span { white-space: nowrap; margin: 0 .45rem; }
.authors a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: .22em; }
.authors a:hover { text-decoration-color: var(--accent); }
.affils { margin: 0 auto .3rem; max-width: 52rem; color: var(--muted); font-size: .93rem; }
.affils span { white-space: nowrap; margin: 0 .5rem; }
.notes { margin: 0 0 1.4rem; color: var(--faint); font-size: .85rem; }
.notes span { margin: 0 .5rem; }
.buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: .55rem; margin: 0; padding: 0; list-style: none; }
.buttons a { display: inline-flex; align-items: center; gap: .45rem; padding: .48rem 1.1rem; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: .95rem; font-weight: 500; }
.buttons a:hover { text-decoration: none; background: var(--accent); color: #fff; }
.buttons svg { width: 1.05rem; height: 1.05rem; }
.buttons .emo { font-size: 1.05rem; line-height: 1; }
.tldr { max-width: 46rem; margin: 2rem auto 0; font-family: var(--serif); font-size: 1.3rem; line-height: 1.5; color: var(--ink); text-wrap: pretty; }

/* ---------- layout ---------- */
main { padding-bottom: 2rem; }
section { max-width: var(--wide); margin: 0 auto; padding: 3.4rem 1.25rem 0; }
section.first { padding-top: 2.4rem; }
h2 { font-family: var(--serif); font-weight: 500; font-size: 2rem; line-height: 1.2; text-align: center; margin: 0 0 1.4rem; letter-spacing: -0.005em; }
h3 { font-family: var(--serif); font-weight: 500; font-size: 1.4rem; line-height: 1.3; margin: 2.6rem auto .9rem; max-width: var(--text); }
h3 .m { font-size: 1em; }
h4 { font-size: 1rem; font-weight: 600; margin: 0 0 .5rem; }
.prose { max-width: var(--text); margin: 0 auto; }
.prose p { margin: 0 0 1.05rem; }
.takeaway { max-width: var(--text); margin: 0 auto 1rem; padding-left: 1rem; border-left: 3px solid var(--accent); font-family: var(--serif); font-size: 1.22rem; line-height: 1.45; }

/* at a glance */
.glance { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; max-width: var(--wide); margin: 0 auto; padding: 0; list-style: none; }
.glance li { border-top: 2px solid var(--accent); padding: .9rem .2rem 0; }
.glance .num { display: block; font-family: var(--display); font-size: 2.6rem; line-height: 1.05; letter-spacing: -0.01em; }
.glance .num small { font-family: var(--sans); font-size: .95rem; color: var(--muted); margin-left: .2rem; letter-spacing: 0; }
.glance .what { display: block; margin-top: .45rem; color: var(--muted); font-size: .95rem; line-height: 1.5; }

/* contributions */
.contrib { max-width: var(--text); margin: 0 auto; padding: 0; list-style: none; counter-reset: c; }
.contrib li { counter-increment: c; position: relative; padding: 0 0 1rem 2.6rem; }
.contrib li::before { content: counter(c); position: absolute; left: 0; top: .05rem; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: .9rem; display: grid; place-items: center; }

/* figures */
figure { margin: 1.6rem auto 0; max-width: var(--wide); }
.plate { background: #FFFFFF; border-radius: 12px; padding: clamp(.6rem, 2vw, 1.3rem); box-shadow: 0 0 0 1px var(--rule); }
.plate.narrow { max-width: 46rem; margin: 0 auto; }
.zoomable { cursor: zoom-in; }
figcaption { max-width: var(--text); margin: .85rem auto 0; font-size: .92rem; line-height: 1.55; color: var(--muted); }
figcaption b.n { color: var(--ink); font-weight: 600; }

/* two-column blocks (losses, ablations) */
.duo { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 1.5rem; max-width: var(--wide); margin: 1.6rem auto 0; }
.duo > div { min-width: 0; background: var(--surface); border-radius: 12px; box-shadow: 0 0 0 1px var(--rule); padding: 1.2rem 1.3rem 1.1rem; }
.duo h4 { font-family: var(--serif); font-weight: 500; font-size: 1.22rem; margin-bottom: .6rem; }
.duo p { margin: 0 0 .8rem; font-size: 1rem; }
.duo .sub-fig { background: #FFFFFF; border-radius: 8px; padding: .5rem; margin: 0 0 .9rem; box-shadow: 0 0 0 1px var(--rule); }
.duo .subcap { font-size: .86rem; color: var(--muted); line-height: 1.5; }
.duo.bare > div { background: none; box-shadow: none; padding: 0; }
.duo.bare .tbl { margin-top: 1.2rem; }

/* display equations */
.eq { max-width: var(--text); margin: .2rem auto 1.1rem; overflow-x: auto; overflow-y: hidden; padding: .3rem 0; text-align: center; }
.eq img { display: inline-block; width: var(--w); max-width: none; height: auto; }
.duo .eq { margin: .2rem 0 .9rem; }
@media (prefers-color-scheme: dark) { .eq img { filter: invert(.92); } }

/* tables */
.tbl { max-width: var(--wide); margin: 1.6rem auto 0; }
.tbl .cap { max-width: var(--text); margin: 0 auto .7rem; font-size: .92rem; color: var(--muted); line-height: 1.55; }
.tbl .cap b.n { color: var(--ink); }
.scroll { overflow-x: auto; background: var(--surface); border-radius: 12px; box-shadow: 0 0 0 1px var(--rule); }
.tbl.narrow .scroll { max-width: 46rem; margin: 0 auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; line-height: 1.4; font-variant-numeric: tabular-nums; }
th, td { padding: .45rem .65rem; text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead th { font-weight: 600; border-bottom: 1px solid var(--rule); vertical-align: bottom; }
thead tr.grp th { font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--rule); text-align: center; }
tbody tr + tr td { border-top: 1px solid var(--soft); }
tr.fam td { color: var(--muted); font-style: italic; text-align: left; background: var(--soft); border-top: 1px solid var(--rule); font-size: .85rem; }
tr.ours td { background: var(--accent-soft); font-weight: 600; }
td.best { font-weight: 700; }
td.second { text-decoration: underline; text-underline-offset: .2em; }
.venue-tag { color: var(--faint); font-size: .78rem; margin-left: .3rem; }
table.dense { font-size: .76rem; }
table.dense th, table.dense td { padding: .34rem .36rem; }
table.dense thead th { font-size: .68rem; line-height: 1.2; white-space: normal; text-align: center; }
table.dense tbody td:first-child, table.dense thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--rule); }
table.dense tr.ours td:first-child { background: var(--accent-soft); }
table.dense tr.fam td:first-child { background: var(--soft); box-shadow: none; }
.tbl.xl { max-width: none; width: max(100%, min(77rem, 100vw - 3rem)); margin-left: calc((100% - max(100%, min(77rem, 100vw - 3rem))) / 2); }
@media (min-width: 1420px) {
  .tbl.xl { width: max(100%, min(77rem, 100vw - 29rem)); margin-left: calc((100% - max(100%, min(77rem, 100vw - 29rem))) / 2); }
}
table.dense thead th:first-child { text-align: left; }
.vsep { border-left: 1px solid var(--rule); }
th.l, td.l { text-align: left; }

/* chart */
.chart { max-width: 52rem; margin: 1.6rem auto 0; background: var(--surface); border-radius: 12px; box-shadow: 0 0 0 1px var(--rule); padding: 1.1rem 1.3rem 1rem; }
.chart-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .6rem 1rem; margin-bottom: .9rem; }
.chart-title { font-weight: 600; font-size: .98rem; }
.chart-sub { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; }
.seg { display: inline-flex; background: var(--soft); border-radius: 999px; padding: .2rem; gap: .2rem; }
.seg button { font: 500 .85rem var(--sans); color: var(--muted); background: transparent; border: 0; border-radius: 999px; padding: .3rem .85rem; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--rule); }
.chart select { font: 500 .88rem var(--sans); color: var(--ink); background: var(--soft); border: 1px solid var(--rule); border-radius: 8px; padding: .32rem .6rem; }
.axis, .row { display: grid; grid-template-columns: 9.5rem 1fr 3.4rem; align-items: center; column-gap: .8rem; }
.axis .track { position: relative; height: 1.3rem; }
.axis .tick { position: absolute; transform: translateX(-50%); font-size: .76rem; color: var(--faint); }
.grp-label { font-size: .78rem; color: var(--faint); margin: .55rem 0 .15rem; }
.row { height: 1.75rem; }
.row .name { font-size: .87rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .track { position: relative; height: 100%; }
.row .track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--soft); }
.gl { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--soft); }
.dot { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 0 2px var(--surface); transition: left .45s cubic-bezier(.2,.7,.2,1); }
.dot::after { content: ""; position: absolute; inset: -8px; }
.row .val { font-size: .84rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.row.ours .name, .row.ours .val { color: var(--ink); font-weight: 600; }
.row.ours .dot { background: var(--accent); width: 14px; height: 14px; margin: -7px 0 0 -7px; }
.tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); font-size: .76rem; padding: .15rem .45rem; border-radius: 4px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; }
.dot:hover .tip, .dot:focus .tip { opacity: 1; }
.chart-note { margin: .7rem 0 0; font-size: .8rem; color: var(--faint); }
@media (prefers-reduced-motion: reduce) { .dot { transition: none; } }

/* code + bibtex */
.code { position: relative; max-width: var(--text); margin: 0 auto 1rem; }
.code pre { margin: 0; padding: 1rem 1.1rem; background: var(--soft); border-radius: 10px; box-shadow: 0 0 0 1px var(--rule); overflow-x: auto; font-family: var(--mono); font-size: .82rem; line-height: 1.6; color: var(--ink); }
.bib pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.code button { position: absolute; top: .5rem; right: .5rem; font: 500 .8rem var(--sans); color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-radius: 999px; padding: .22rem .75rem; cursor: pointer; }
.code button:hover { border-color: var(--accent); }
.repo { max-width: var(--text); margin: 0 auto 1.2rem; }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 50; background: rgba(10, 12, 16, .86); display: none; align-items: center; justify-content: center; padding: 2.5rem 1rem; cursor: zoom-out; }
.lb.open { display: flex; }
.lb img { max-width: min(96vw, 1800px); max-height: 92vh; background: #fff; border-radius: 8px; padding: .6rem; }
.lb button { position: absolute; top: .8rem; right: 1rem; font: 500 .9rem var(--sans); color: #fff; background: rgba(255,255,255,.14); border: 0; border-radius: 999px; padding: .35rem .9rem; cursor: pointer; }

footer { max-width: var(--wide); margin: 3.5rem auto 0; padding: 1.3rem 1.25rem 2.4rem; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; flex-wrap: wrap; gap: .6rem 1.2rem; color: var(--faint); font-size: .85rem; }
footer a { color: var(--muted); }

@media (max-width: 760px) {
  body { font-size: 1rem; }
  header.paper { padding-top: 1.6rem; }
  .tldr { font-size: 1.15rem; }
  .glance { grid-template-columns: 1fr; gap: .9rem; }
  .glance .num { font-size: 2.2rem; }
  .duo { grid-template-columns: 1fr; }
  h2 { font-size: 1.65rem; }
  .affils span, .notes span { display: block; white-space: normal; margin: 0; }
  .authors span { margin: 0 .3rem; }
  .axis, .row { grid-template-columns: 6.6rem 1fr 3rem; column-gap: .5rem; }
  .chart { padding: .9rem .8rem; }
  .eq img { width: var(--wm, var(--w)); max-width: 100%; }
  table tbody td:first-child, table thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--rule); }
  table tr.ours td:first-child { background: var(--accent-soft); }
  table tr.fam td:first-child { background: var(--soft); box-shadow: none; }
  th, td { padding: .4rem .5rem; }
}
