/* DMC project page */
:root {
  --bg: #fbfaf7;
  --card: #ffffff;
  --ink: #1c1c1a;
  --ink-2: #45443f;
  --muted: #76746c;
  --rule: #e3e0d8;
  --soft: #efece5;
  --spec: #D65A31;
  --gen: #3182BD;
  --corr: #756BB1;
  --good: #2E8B57;
  --neg: #9a9186;
  --serif: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --measure: 40rem;
  --wide: 62rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141416;
    --card: #1c1c1f;
    --ink: #ebeae5;
    --ink-2: #c3c1ba;
    --muted: #8f8d86;
    --rule: #2d2d31;
    --soft: #242428;
    --spec: #E97A52;
    --gen: #62A7DC;
    --corr: #A39BDB;
    --good: #5DBB84;
    --neg: #8b847b;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.1875rem/1.62 var(--serif);
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--corr); outline-offset: 3px; border-radius: 3px; }
sup { font-size: .62em; line-height: 0; }

main, .hero, footer { padding: 0 20px; }
.hero > * { margin-left: auto; margin-right: auto; }
main > .abstract { max-width: var(--measure); margin-left: auto; margin-right: auto; }

/* ---------- header ---------- */
.hero { padding-top: 88px; text-align: center; }
.hero > * { max-width: var(--wide); }
.venue {
  font: 500 .8125rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin: 0 auto 22px;
}
h1 {
  font: 600 2.75rem/1.14 var(--serif); letter-spacing: -.012em;
  max-width: 50rem; margin: 0 auto 30px; text-wrap: balance;
}
.authors { font: 400 1.0625rem/1.7 var(--sans); margin: 0 auto 4px; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 1.4em; }
.authors a { text-decoration-color: transparent; }
.authors a:hover { text-decoration-color: currentColor; }
.affil { font: 400 .875rem/1.6 var(--sans); color: var(--muted); margin: 0 auto 30px; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 1.6em; }
.links { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 .9375rem/1 var(--sans); padding: 10px 16px;
  border: 1px solid var(--rule); border-radius: 999px; background: var(--card);
  text-decoration: none; color: var(--ink);
  transition: border-color .15s;
}
.btn:hover { border-color: var(--ink-2); }
.btn svg { width: 15px; height: 15px; }
.btn.is-off { color: var(--muted); cursor: default; }
.btn.is-off:hover { border-color: var(--rule); }
.btn em { font-style: normal; font-weight: 400; font-size: .8125rem; }

/* ---------- teaser ---------- */
.teaser { max-width: var(--wide) !important; margin: 56px auto 0; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.panel { background: var(--card); border: 1px solid var(--rule); border-radius: 10px; padding: 14px 14px 8px; }
.ptitle { font: 600 .75rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); text-align: left; margin: 2px 0 6px 4px; }
.ptitle .schem { font-weight: 400; letter-spacing: .04em; text-transform: none; font-style: italic; margin-left: .6em; }
.teaser svg { display: block; width: 100%; height: auto; cursor: pointer; overflow: visible; }
.teaser figcaption.steps { max-width: none; margin: 18px auto 0; font: 400 .875rem/1.45 var(--sans); color: var(--muted); text-align: center; }
.stepbar { display: flex; justify-content: center; align-items: center; gap: 10px; }
.steps ol { list-style: none; display: flex; flex-wrap: nowrap; gap: 8px; margin: 0; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; }
.steps li button, .replay {
  font: 500 .8125rem/1 var(--sans); color: var(--muted); background: none; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--rule); border-radius: 999px; padding: 8px 13px; transition: color .25s, border-color .25s, background .25s;
}
.steps li button::before { content: counter(s) "  "; white-space: pre; font-variant-numeric: tabular-nums; opacity: .7; }
.steps li button:hover, .replay:hover { color: var(--ink); border-color: var(--ink-2); }
.steps li.on button { color: var(--ink); border-color: var(--ink-2); background: var(--card); }
.steps .it { font: italic 400 1.05em/1 var(--serif); }
.replay { display: inline-flex; align-items: center; gap: 6px; border-style: dashed; }
.replay svg { width: 13px; height: 13px; }
.steptext { text-wrap: balance; max-width: 44rem; min-height: 3em; margin: 14px auto 0; font: 400 1rem/1.5 var(--serif); color: var(--ink-2); text-align: center; }
.textbtn {
  font: 500 .8125rem/1 var(--sans); color: var(--muted); background: none; border: 0; padding: 6px 2px; cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: .25em;
}
.textbtn:hover { color: var(--ink); }
.rail { stroke: var(--rule); stroke-width: 1.5; stroke-dasharray: 3 5; }
.lamlabel { font: italic 400 15px var(--serif); fill: var(--muted); }
.axis { fill: none; stroke: var(--ink-2); stroke-width: 1.2; }
.axlabel { font: 400 13px var(--sans); fill: var(--muted); }
.iso { fill: none; stroke: var(--rule); stroke-width: 1; stroke-dasharray: 2 4; }
.isolabel { font: 400 12px var(--sans); fill: var(--muted); }
.front { fill: none; stroke: var(--neg); stroke-width: 3; stroke-linecap: round; }
.dmc { fill: none; stroke: var(--corr); stroke-width: 3.5; stroke-linecap: round; }
.curvelabel { font: 500 13px var(--sans); }
.c-front { fill: var(--neg); } .c-dmc { fill: var(--corr); }
.shift { stroke: var(--good, #2E8B57); stroke-width: 2.2; stroke-linecap: round; }
.mlabel.small { font-size: 18px; }
.shiftlabel { font: 600 13px var(--sans); fill: var(--good, #2E8B57); }
.f-good { fill: var(--good, #2E8B57); }
@media (max-width: 760px) {
  .duo { grid-template-columns: 1fr; gap: 14px; }
  .stepbar { flex-direction: column; gap: 10px; }
  .steps ol { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .steps li button { width: 100%; padding: 10px 10px; }
  .teaser .axlabel, .teaser .curvelabel, .teaser .shiftlabel { font-size: 18px; }
  .teaser .isolabel, .teaser .lamlabel { font-size: 17px; }
}

.abstract { font-size: 1.3125rem; line-height: 1.55; margin-top: 40px; margin-bottom: 0; color: var(--ink); }

/* ---------- sections ---------- */
section { margin-top: 112px; }
section > * { max-width: var(--measure); margin-left: auto; margin-right: auto; }
h2 { font: 600 1.75rem/1.2 var(--serif); letter-spacing: -.008em; margin-top: 0; margin-bottom: 20px; }
h3 { font: 600 1rem/1.35 var(--sans); margin-top: 0; margin-bottom: 8px; letter-spacing: -.003em; }
.sub-h { font: 600 1.3125rem/1.3 var(--serif); margin-top: 64px; margin-bottom: 12px; }
p { margin-top: 0; margin-bottom: 1em; }
section p + figure, section .eq + p { margin-top: 0; }
.wide { max-width: var(--wide) !important; }

.eq { margin: 6px auto 22px; overflow-x: auto; overflow-y: hidden; font-size: 1.05em; }
.eq .katex-display { margin: .4em 0; }
.eq-narrow { display: none; }
.eq-loss { font-size: .98em; max-width: 50rem !important; }
.m-spec, .m-spec * { color: var(--spec); }
.m-gen, .m-gen * { color: var(--gen); }
.m-corr, .m-corr * { color: var(--corr); }

/* ---------- figures ---------- */
figure { margin: 36px auto 40px; }
figcaption { font: 400 .875rem/1.55 var(--sans); color: var(--muted); margin-top: 12px; max-width: var(--measure); }
.fig figcaption { margin-left: auto; margin-right: auto; }
.paper { background: #fff; border: 1px solid var(--rule); border-radius: 8px; padding: 14px; }
.paper img { display: block; width: 100%; height: auto; }

/* ---------- charts (shared) ---------- */
.chart { font-family: var(--sans); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 18px; font: 400 .8125rem/1.3 var(--sans); color: var(--ink-2); margin-bottom: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.k-spec { background: var(--spec); }
.k-ghost { width: 2px; height: 14px; border-radius: 1px; background: var(--ink); }
.k-ink { background: var(--ink-2); }
.k-ink2 { background: color-mix(in oklab, var(--ink-2) 35%, var(--bg)); }
.axis { position: relative; height: 18px; margin-left: 68px; margin-right: 56px; font: 400 .75rem/1 var(--sans); color: var(--muted); border-top: 1px solid var(--rule); margin-top: 6px; }
.axis span { position: absolute; top: 6px; transform: translateX(-50%); font-variant-numeric: tabular-nums; }
.blab { width: 68px; flex: none; font: 500 .875rem/1 var(--sans); color: var(--ink-2); }
.bval { width: 56px; flex: none; padding-left: 10px; font: 500 .875rem/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.track { position: relative; flex: 1; height: 100%; }

/* trade-off bars */
.bars { display: grid; gap: 10px; }
.brow { display: flex; align-items: center; height: 30px; }
.brow .fill { position: absolute; left: 0; top: 3px; bottom: 3px; width: 0; border-radius: 0 4px 4px 0; background: color-mix(in oklab, var(--ink-2) 22%, var(--bg)); transition: width 1.1s cubic-bezier(.6,.05,.25,1), background-color .6s; }
.brow .ghost { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; opacity: 0; transition: opacity .4s; }
.brow .bval { width: 120px; }
.brow .bval b { font-weight: 500; color: var(--muted); margin-left: 8px; }
#tradeChart .axis { margin-right: 120px; }
.brow.is-to .fill { background: var(--spec); }
.brow.is-to .ghost { opacity: 1; }

/* gamma bars */
.gbars { display: grid; gap: 14px; }
.grow { display: flex; align-items: center; }
.gpair { flex: 1; display: grid; gap: 3px; position: relative; }
.gbar { position: relative; height: 12px; }
.gbar i { position: absolute; right: 0; top: 0; bottom: 0; border-radius: 4px 0 0 4px; background: var(--ink-2); }
.gbar.kg i { background: color-mix(in oklab, var(--ink-2) 35%, var(--bg)); }
.gbar em { position: absolute; top: 50%; transform: translate(-100%, -50%); padding-right: 6px; font: 500 .75rem/1 var(--sans); font-style: normal; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gpair::after { content: ""; position: absolute; right: -1px; top: -4px; bottom: -4px; width: 1px; background: var(--ink-2); }
.gbars .bval { width: 64px; display: grid; gap: 3px; font-size: .75rem; line-height: 12px; }
.gbars .bval span:last-child { color: var(--muted); }
.gaxis { margin-right: 64px; }

/* heatmap */
.heat-wide { display: grid; grid-template-columns: 76px repeat(11, 1fr) 14px 1fr; gap: 3px; font: 500 .8125rem/1 var(--sans); }
.heat-wide .hh { color: var(--muted); font-weight: 400; text-align: center; padding: 0 0 8px; font-size: .75rem; }
.heat-wide .rl { display: flex; align-items: center; color: var(--ink-2); }
.cell { display: flex; align-items: center; justify-content: center; height: 38px; border-radius: 4px; font-variant-numeric: tabular-nums; color: var(--ink); cursor: default; }
.cell.dark { color: #fff; }
.cell.avg { font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.heat-tall { display: none; }
.heat-tall { grid-template-columns: 1fr 76px 76px; gap: 3px; font: 500 .8125rem/1 var(--sans); }
.heat-tall .hh { color: var(--muted); font-weight: 400; text-align: center; padding-bottom: 6px; font-size: .75rem; }
.heat-tall .rl { display: flex; align-items: center; color: var(--ink-2); }
.heat-tall .cell { height: 30px; }
#heat figcaption { margin-left: auto; margin-right: auto; }
.nw { white-space: nowrap; }

/* parameter dot plot */
.dots { display: grid; gap: 4px; }
.drow { display: flex; align-items: center; height: 34px; }
.drow .blab { width: 104px; }
.dtrack { position: relative; flex: 1; height: 100%; }
.dtrack::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--rule); }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; }
.dtrack .dot { position: absolute; top: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 2px var(--bg); }
.d1 { background: color-mix(in oklab, var(--ink-2) 25%, var(--bg)); }
.d2 { background: color-mix(in oklab, var(--ink-2) 55%, var(--bg)); }
.d3 { background: var(--ink-2); }
.d4 { background: var(--corr); width: 13px; height: 13px; }
.dtrack .dlab { position: absolute; top: 50%; transform: translate(12px, -50%); font: 600 .8125rem/1 var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; }
.daxis { margin-left: 104px; margin-right: 44px; }
.dots .drow { padding-right: 44px; }

/* cos bars */
.cbars { display: grid; gap: 10px; position: relative; }
.crow { display: flex; align-items: center; height: 26px; }
.crow .fill { position: absolute; left: 0; top: 4px; bottom: 4px; border-radius: 0 4px 4px 0; background: var(--corr); }
.crow.is-off .fill { background: color-mix(in oklab, var(--ink-2) 40%, var(--bg)); }
#cosChart .axis { margin-right: 56px; }

/* ---------- widget ---------- */
.widget { margin: 40px auto 44px; padding: 26px 26px 20px; background: var(--card); border: 1px solid var(--rule); border-radius: 10px; }
.widget svg { display: block; width: 100%; height: auto; }
.wctl { display: flex; align-items: center; gap: 14px; margin: 8px 0 12px; }
.wctl label { font: italic 400 1.35rem/1 var(--serif); }
.wctl output { font: 500 1rem/1 var(--sans); font-variant-numeric: tabular-nums; min-width: 2.6em; text-align: right; }
input[type=range] { flex: 1; -webkit-appearance: none; appearance: none; background: transparent; height: 28px; margin: 0; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--gen), var(--corr) 50%, var(--spec)); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--gen), var(--corr) 50%, var(--spec)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: var(--card); border: 2px solid var(--corr); }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--card); border: 2px solid var(--corr); }
input[type=range]:focus-visible { outline: none; }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px color-mix(in oklab, var(--corr) 30%, transparent); }
input[type=range]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px color-mix(in oklab, var(--corr) 30%, transparent); }
.wread { border-top: 1px solid var(--rule); padding-top: 14px; min-height: 6.4em; }
.wmix { font: 400 1.0625rem/1.3 var(--serif); margin: 0 0 6px; font-variant-numeric: tabular-nums; }
.wmix sub { font-size: .7em; }
.wtext { font: 400 .9375rem/1.55 var(--sans); color: var(--ink-2); margin: 0; }

/* shared svg */
svg text { font-family: var(--sans); }
.f-spec { fill: var(--spec); } .f-gen { fill: var(--gen); } .f-corr { fill: var(--corr); } .f-ink { fill: var(--ink); }
.s-spec { stroke: var(--spec); } .s-gen { stroke: var(--gen); }
.ring { fill: none; stroke-width: 1.2; }
.goal.gen .ring { stroke: color-mix(in oklab, var(--gen) 45%, var(--bg)); }
.goal.spec .ring { stroke: color-mix(in oklab, var(--spec) 45%, var(--bg)); }
.goal .ring:nth-child(3) { fill: color-mix(in oklab, currentColor 0%, transparent); }
.goal.gen .ring:nth-child(3) { fill: color-mix(in oklab, var(--gen) 14%, var(--bg)); }
.goal.spec .ring:nth-child(3) { fill: color-mix(in oklab, var(--spec) 14%, var(--bg)); }
.glabel { font-size: 14px; fill: var(--muted); }
.alabel { font-size: 15px; font-weight: 500; }
.mlabel { font: italic 400 21px var(--serif); fill: var(--ink); }
.mlabel .sub { font: 400 13px var(--sans); font-style: normal; }
.slabel { font: 400 16px var(--serif); fill: var(--corr); }
.pt { stroke: var(--bg); stroke-width: 2.5; }
.arrow { stroke-width: 3; stroke-linecap: round; }
.band { stroke: var(--corr); stroke-opacity: .16; stroke-width: 22; stroke-linecap: round; }
.corr-line { stroke: var(--corr); stroke-width: 2.5; stroke-linecap: round; }
.star { fill: var(--corr); stroke: var(--bg); stroke-width: 2; stroke-linejoin: round; }
.star.is-ghost { fill: var(--bg); stroke: var(--corr); stroke-width: 1.6; }
.cursor { fill: none; stroke: var(--corr); stroke-width: 2; }
.tick { fill: var(--corr); opacity: .5; }

/* ---------- aside ---------- */
.aside { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--rule); max-width: var(--wide) !important; }
.aside p { font: 400 .9375rem/1.6 var(--sans); color: var(--ink-2); margin: 0; }
section#method > .aside { max-width: var(--measure) !important; }

/* ---------- bibtex ---------- */
.bib { position: relative; background: var(--soft); border-radius: 8px; }
.bib pre { margin: 0; padding: 20px 22px; overflow-x: auto; font: 400 .8125rem/1.6 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; color: var(--ink-2); }
.bib .copy { position: absolute; top: 10px; right: 14px; }

footer { margin-top: 120px; padding-bottom: 56px; }
footer p { max-width: var(--measure); margin: 0 auto !important; font: 400 .8125rem/1.5 var(--sans); color: var(--muted); border-top: 1px solid var(--rule); padding-top: 18px; margin: 0; }

/* tooltip */
.tip { position: fixed; z-index: 10; pointer-events: none; background: var(--ink); color: var(--bg); font: 500 .75rem/1.35 var(--sans); padding: 6px 8px; border-radius: 5px; max-width: 240px; }

/* reveal once */
.js .reveal { opacity: 0; transform: translateY(10px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  body { font-size: 1.0625rem; line-height: 1.6; }
  .hero { padding-top: 56px; }
  h1 { font-size: 1.875rem; line-height: 1.18; margin-bottom: 22px; }
  .authors { font-size: 1rem; }
  .affil { font-size: .8125rem; }
  .abstract { font-size: 1.125rem; }
  section { margin-top: 80px; }
  h2 { font-size: 1.5rem; }
  .steps { flex-direction: column; align-items: center; gap: 2px; }
  .steps ol { flex-direction: column; align-items: center; gap: 2px; }
  .aside { grid-template-columns: 1fr; gap: 24px; }
  .heat-wide { display: none; }
  .heat-tall { display: grid; }
  .widget { padding: 18px 16px 16px; }
  .eq-loss { display: none; }
  .eq-narrow { display: block; }
  .drow .blab { width: 88px; font-size: .8125rem; }
  .daxis { margin-left: 88px; }
  .brow .bval { width: 104px; }
  #tradeChart .axis { margin-right: 104px; }
  .blab { width: 60px; }
  .axis { margin-left: 60px; }
  .paper { padding: 6px; }
  .teaser .glabel { font-size: 22px; }
  .teaser .alabel { font-size: 22px; }
  .teaser .mlabel { font-size: 30px; }
  .teaser .mlabel .sub { font-size: 19px; }
  .teaser .slabel { font-size: 24px; }
  #wSvg .mlabel { font-size: 30px; }
  #wSvg .mlabel .sub { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
