:root {
  color-scheme: light;
  --ink: #21202b;
  --muted: #53515e;
  --accent: #42339a;
  --line: #dedce7;
  --paper: #fff;
  --tint: #f7f6fb;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 1rem/1.75 var(--sans); }
[hidden] { display: none !important; }
.wrap { width: min(900px, 100% - 40px); margin-inline: auto; }
a { color: var(--accent); text-underline-offset: .21em; }
a:hover { color: #2c2170; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid #6756cf;
  outline-offset: 3px;
}
button { cursor: pointer; font: inherit; }
.skip { position: absolute; top: 10px; left: 10px; z-index: 2; transform: translateY(-140%); background: var(--paper); padding: 4px 8px; }
.skip:focus { transform: none; }

.paper-header { text-align: center; padding: clamp(36px, 6vw, 66px) 0 clamp(24px, 4vw, 38px); }
.project-mark { display: block; width: clamp(49px, 8vw, 64px); height: auto; margin: 0 auto 14px; }
h1 { margin: 0 auto 22px; font-weight: 600; }
.project-name { display: block; color: var(--accent); font: 750 clamp(2.7rem, 9vw, 5.05rem)/1 var(--sans); letter-spacing: -.065em; }
.paper-title { display: block; margin-top: 14px; font: 500 clamp(1.19rem, 3.6vw, 2.2rem)/1.13 var(--serif); letter-spacing: -.025em; }
.paper-title > span { display: block; }
.authors { margin: 0 auto; }
.authors > p:first-child { color: var(--ink); font-size: 1rem; line-height: 1.85; margin: 0 auto 6px; }
.authors sup { font-size: .67em; }
.affiliations { margin: 0; color: var(--muted); font-size: .875rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 16px; line-height: 1.7; }
.author-note { color: var(--muted); font-size: .83rem; margin: 4px 0 0; }
.project-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 20px; }
.project-links > * { border: 1px solid #cdc9de; border-radius: 6px; padding: 5px 13px; min-height: 36px; font-size: .91rem; line-height: 25px; font-weight: 650; }
.project-links a { text-decoration: none; color: var(--accent); background: #f5f3fc; }
.project-links a:hover { border-color: var(--accent); background: #eeebfa; }
.project-links a:active { background: #e7e2f7; }

main.wrap { padding-bottom: 58px; }
main section { padding-top: 23px; margin-top: 32px; border-top: 1px solid var(--line); }
h2 { font: 600 clamp(1.65rem, 4vw, 2.06rem)/1.25 var(--serif); letter-spacing: -.023em; margin: 0 0 10px; }
h3 { font: 600 clamp(1.22rem, 2.8vw, 1.55rem)/1.3 var(--serif); margin: 27px 0 8px; }
p { margin: 0; }
.paper-figure { margin: 16px auto 0; }
.paper-figure > a { display: block; width: 100%; border-radius: 4px; }
.paper-figure img { display: block; width: 100%; height: auto; }
.paper-figure figcaption { margin-top: 8px; color: var(--muted); font-size: .9rem; line-height: 1.55; }
.teaser { margin-top: 0; }
.teaser > a { border: 1px solid var(--line); padding: clamp(6px, 2vw, 17px); }
.teaser figcaption { text-align: center; max-width: 710px; margin-inline: auto; }
.result-figure > a { max-width: 765px; margin: 0 auto; }
.paper-figure a:hover { outline: 1px solid #cec6e7; outline-offset: 3px; }
.figure-with-text { display: grid; grid-template-columns: 1fr minmax(0, 1.1fr); gap: clamp(20px, 4vw, 42px); align-items: center; }
.figure-with-text .paper-figure { margin: 0; }
.gain-figure { margin: 17px 0 0; padding: 14px clamp(12px, 2.5vw, 24px); border: 1px solid var(--line); border-radius: 8px; }
.gain-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 0; margin: 0 0 12px; border: 0; min-width: 0; }
.gain-controls legend { margin-bottom: 5px; padding: 0; font-size: .875rem; font-weight: 650; }
.gain-controls label { display: flex; position: relative; cursor: pointer; }
.gain-controls input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.gain-controls label span { border: 1px solid var(--line); border-radius: 5px; padding: 3px 10px; font-size: .875rem; }
.gain-controls :checked + span { border-color: #c7bbe8; color: var(--accent); background: #f3effb; font-weight: 650; }
.gain-controls :focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.gain-columns { display: grid; grid-template-columns: minmax(150px, .9fr) minmax(0, 2fr) minmax(90px, .65fr); align-items: center; gap: 14px; }
.gain-header { padding-block: 5px; color: var(--muted); font-size: .875rem; border-bottom: 1px solid var(--line); }
.gain-header > :last-child { text-align: right; }
.gain-row { border-bottom: 1px solid var(--line); min-height: 60px; padding-block: 6px; }
.gain-label { line-height: 1.32; font-weight: 650; }
.gain-figure small { display: block; color: var(--muted); font-size: .875rem; font-weight: 400; }
.gain-value { text-align: right; line-height: 1.35; font-variant-numeric: tabular-nums; }
.gain-track { position: relative; display: block; height: 28px; }
.gain-track::before { position: absolute; content: ""; inset: 0 auto 0 16.6667%; border-left: 1px dashed #9b97a6; }
.gain-interval { position: absolute; top: calc(50% - 1px); left: var(--low); width: calc(var(--high) - var(--low)); height: 2px; background: #7162aa; }
.gain-dot { position: absolute; top: 50%; left: var(--mean); width: 9px; height: 9px; border-radius: 50%; background: var(--accent); transform: translate(-50%, -50%); }
.gain-scale { padding-top: 5px; }
.gain-ticks { grid-column: 2; position: relative; height: 18px; color: var(--muted); font-size: .875rem; }
.gain-ticks span { position: absolute; white-space: nowrap; }
.gain-ticks span:nth-child(2) { left: 16.6667%; transform: translateX(-50%); }
.gain-ticks span:nth-child(3) { left: 50%; transform: translateX(-50%); }
.gain-ticks span:last-child { right: 0; }
.gain-figure figcaption { margin-top: 10px; color: var(--muted); font-size: .9rem; line-height: 1.55; }

.workflow-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 7px; font-weight: 600; }
.citation { background: var(--tint); border: 1px solid var(--line); border-radius: 6px; }
#copy-citation { float: right; margin: 7px; padding: 2px 8px; color: var(--accent); background: var(--paper); border: 1px solid #cdc9de; border-radius: 4px; font-size: .85rem; font-weight: 600; }
#copy-citation:hover { background: #eeebfa; }
.citation pre { padding: 11px 13px; margin: 0; overflow: auto; font: .84rem/1.55 "Cascadia Code", Consolas, monospace; }
#copy-status { color: var(--muted); font-size: .87rem; margin-top: 3px; }

dialog { width: min(1100px, calc(100% - 24px)); color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 7px; padding: 12px; max-height: 90dvh; overflow: auto; }
dialog::backdrop { background: #151020b5; }
#close-figure { display: block; margin: 0 0 8px auto; padding: 2px 9px; color: var(--accent); background: var(--tint); border: 1px solid var(--line); border-radius: 5px; }
.figure-stage { overflow-x: auto; }
.figure-stage img { display: block; width: 100%; min-width: 660px; height: auto; }

@media (max-width: 520px) {
  .wrap { width: calc(100% - 30px); }
  .paper-header { padding-top: 28px; }
  .affiliations { gap: 0 10px; }
  .authors > p:first-child { font-size: .91rem; }
  .paper-figure figcaption { font-size: .87rem; }
  main section { margin-top: 25px; padding-top: 17px; }
  .gain-header { display: none; }
  .gain-row { grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; row-gap: 0; padding-block: 7px 2px; }
  .gain-track { grid-column: 1 / -1; grid-row: 2; }
  .gain-ticks { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  .figure-with-text { grid-template-columns: 1fr; gap: 14px; }
}

@media (prefers-reduced-motion: no-preference) {
  .project-links a { transition: background-color .18s ease, border-color .18s ease; }
  .gain-interval { transition: left .28s ease, width .28s ease; }
  .gain-dot { transition: left .28s ease; }
  dialog[open] { animation: settle-in .24s ease-out both; }
  @keyframes settle-in {
    from { opacity: .45; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
