:root {
  --ink: #171827;
  --body: #343646;
  --muted: #686b7d;
  --rule: #dcdde6;
  --paper: #ffffff;
  --soft: #f7f7fa;
  --violet: #454b91;
  --violet-light: #f0f1fb;
  --coral: #b85e48;
  --mint: #337e79;
  --paper-width: 1080px;
  --wide-width: 1360px;
  --figure-width: 1280px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: clip;
  color: var(--body);
  background: var(--paper);
  font-family: Inter, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: var(--violet); }
button { font: inherit; }
sup { font-size: .68em; }
figure { margin: 0; }
.paper-width { width: min(calc(100% - 48px), var(--paper-width)); margin-inline: auto; }
.wide-width { width: min(calc(100% - 48px), var(--wide-width)); margin-inline: auto; }

.masthead {
  position: relative;
  padding: 56px 0 42px;
  text-align: center;
}
.masthead::before {
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  content: "";
  transform: translateX(-50%);
  border-bottom: 1px solid var(--rule);
  background: radial-gradient(900px 280px at 50% -90px, var(--violet-light), transparent 72%);
}
.section-label,
.mini-label {
  color: var(--violet);
  font: 500 12px/1.4 DM Mono, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.masthead h1 {
  max-width: 900px;
  margin: 0 auto;
  color: var(--ink);
  font-family: Newsreader, Georgia, serif;
  font-size: clamp(36px, 4.3vw, 52px);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -.01em;
}
.title-highlight { color: var(--violet); }
.authors {
  max-width: 850px;
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px 17px;
  color: #292b3b;
  font-size: 18px;
  line-height: 1.45;
}
.affiliations {
  max-width: 880px;
  margin: 11px auto 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}
.affiliations p { margin: 3px 0; }
.affiliation-mark { margin: 16px auto 0; }
.affiliation-mark img { width: 126px; height: auto; margin: auto; }
.paper-links {
  margin: 22px 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
}
.paper-links a,
.paper-links button {
  padding: 9px 16px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}
.paper-links a:first-child { color: #fff; border-color: var(--ink); background: var(--ink); }
.paper-links a:hover,
.paper-links button:hover { border-color: var(--violet); color: var(--violet); }
.paper-links small { margin-left: 3px; color: #888a98; font-size: 10px; font-weight: 500; }
.one-line {
  max-width: 850px;
  margin: 25px auto 0;
  color: #505264;
  font-family: Newsreader, Georgia, serif;
  font-size: 18px;
  line-height: 1.48;
}
.one-line strong { color: var(--coral); font-weight: 600; }

.paper-section {
  position: relative;
  z-index: 0;
  padding: 52px 0;
  border-top: 1px solid var(--rule);
}
.section-alt::before {
  position: absolute;
  z-index: -1;
  inset: 0 auto 0 50%;
  width: 100vw;
  content: "";
  transform: translateX(-50%);
  background: var(--soft);
}
.paper-section > .section-label,
.narrow-intro > .section-label {
  margin: 0 0 7px;
  text-align: center;
}
.paper-section > h2,
.narrow-intro h2 {
  max-width: 900px;
  margin: 0 auto 18px;
  color: var(--ink);
  font-family: Newsreader, Georgia, serif;
  font-size: clamp(25px, 3vw, 31px);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -.012em;
  text-align: center;
}
.paper-section > p:not(.section-label):not(.section-subtitle),
.narrow-intro > p:not(.section-label):not(.section-subtitle) { max-width: 780px; margin: 0 auto 16px; }
.paper-section > .section-subtitle,
.narrow-intro > .section-subtitle {
  margin: -8px 0 20px;
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
  text-align: center;
}
.narrow-intro { width: min(calc(100% - 48px), var(--paper-width)); margin: 0 auto 28px; }

figcaption,
.table-caption,
.figure-note {
  padding: 10px 2px 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}
figcaption strong,
.table-caption strong { color: var(--ink); }

.framework-lead { padding-top: 36px; padding-bottom: 42px; }
.framework-lead .academic-figure { width: min(100%, 1280px); }

.teaser-section { padding-top: 42px; }
.teaser-wrap { max-width: 1120px; }
.research-teaser {
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--rule);
  box-shadow: 0 1px 2px rgba(25, 27, 50, .03), 0 8px 26px rgba(25, 27, 50, .05);
}
.teaser-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
}
.teaser-cell {
  min-width: 0;
  padding: 23px 25px;
  background: #fff;
}
.teaser-cell h3 {
  margin: 8px 0 5px;
  color: var(--ink);
  font-family: Newsreader, Georgia, serif;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.2;
}
.teaser-cell > p:not(.teaser-pill):not(.teaser-verdict) {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
.teaser-pill {
  display: inline-block;
  margin: 0;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--violet);
  background: var(--violet-light);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  line-height: 1.5;
  text-transform: uppercase;
}
.teaser-pill.challenge { color: #a74432; background: #fff0ec; }
.teaser-pill.answer { color: #236f69; background: #e9f6f3; }
.teaser-pill.neutral { color: #55586d; background: #f0f1f5; }
.space-contrast {
  display: grid;
  grid-template-columns: 1fr 70px 1fr;
  align-items: center;
  margin: 20px 0 15px;
}
.space-contrast > div:not(.space-gap) {
  min-height: 86px;
  display: grid;
  align-content: center;
  padding: 12px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  text-align: center;
}
.space-contrast b { color: var(--ink); font-size: 14px; }
.space-contrast span { display: block; margin-top: 4px; color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.space-gap { text-align: center; }
.space-gap span { font-size: 8.5px; text-transform: uppercase; }
.space-gap b { display: block; color: var(--coral); font-size: 25px; font-weight: 400; }
.autoencoding-flow { margin: 18px 0 12px; }
.flow-row {
  display: grid;
  grid-template-columns: .72fr auto 1.3fr auto .8fr auto .9fr auto 1.1fr;
  align-items: center;
  gap: 5px;
}
.flow-row span {
  min-height: 50px;
  display: grid;
  place-items: center;
  padding: 6px;
  border: 1px solid #cfd1dc;
  border-radius: 6px;
  color: var(--ink);
  background: var(--soft);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
}
.flow-row span:nth-of-type(2) { border-color: #777db0; background: var(--violet-light); }
.flow-row span:nth-of-type(3) { border-color: #77a59f; background: #e9f6f3; }
.flow-row b { color: var(--muted); font-size: 13px; }
.feedback-row { display: flex; justify-content: center; gap: 22px; margin-top: 10px; color: var(--coral); font-size: 10px; font-weight: 700; }
.feedback-row span:last-child { color: var(--mint); }
.teaser-verdict {
  display: flex;
  gap: 7px;
  margin: 12px 0 0;
  padding-top: 11px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.teaser-verdict b { color: var(--ink); }
.representation-map {
  margin: 17px 0 12px;
  padding: 14px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--soft);
}
.hierarchy-line { display: flex; align-items: center; justify-content: center; gap: 9px; }
.hierarchy-line span { padding: 5px 12px; border: 1px solid #bcc0d0; border-radius: 6px; color: var(--ink); background: #fff; font-size: 12px; font-weight: 700; }
.hierarchy-line b { color: var(--violet); }
.representation-map p { margin: 9px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.representation-map p b { color: var(--ink); }
.requirement-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.requirement-strip span { color: var(--muted); font-size: 10.5px; line-height: 1.4; }
.requirement-strip b { display: block; color: var(--violet); font-size: 11.5px; }
.stage-lines { margin: 15px 0 13px; border-block: 1px solid var(--rule); }
.stage-lines > div { display: grid; grid-template-columns: 86px 118px 1fr; gap: 8px; align-items: baseline; padding: 9px 0; }
.stage-lines > div + div { border-top: 1px solid var(--rule); }
.stage-lines b { color: var(--ink); font-size: 13px; }
.stage-lines span { color: var(--violet); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.stage-lines p { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.teaser-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.teaser-metrics div { padding: 9px; border-radius: 7px; background: var(--soft); text-align: center; }
.teaser-metrics b { display: block; color: var(--violet); font-family: Newsreader, Georgia, serif; font-size: 22px; line-height: 1; }
.teaser-metrics span { display: block; margin-top: 4px; color: var(--muted); font-size: 9.5px; line-height: 1.3; }
.research-teaser > figcaption { margin: 0; padding: 13px 17px; background: #fff; }

.abstract-text { max-width: 800px; margin: auto; }
.abstract-text p { margin: 0 0 14px; color: var(--muted); font-size: 17.5px; }
.abstract-text p:first-child { color: var(--ink); }
.contribution-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-block: 1px solid var(--rule);
}
.contribution-grid article { padding: 18px; border-right: 1px solid var(--rule); }
.contribution-grid article:last-child { border: 0; }
.contribution-grid span { color: var(--coral); font: 500 12px DM Mono, monospace; }
.contribution-grid h3 { margin: 7px 0 6px; color: var(--ink); font-family: Newsreader, Georgia, serif; font-size: 19px; line-height: 1.2; }
.contribution-grid p { margin: 0; color: var(--muted); font-size: 14px; }

.academic-figure {
  width: min(100%, var(--figure-width));
  margin-inline: auto;
  padding: 8px;
  border: 1px solid #d5d6df;
  border-radius: 7px;
  background: var(--paper);
}
.academic-figure img { width: 100%; }
.academic-figure a { display: block; }
.method-overview { width: min(100vw - 48px, var(--figure-width)); margin: 30px 50% 0; transform: translateX(-50%); }
.result-figure { margin-top: 27px; }
.result-figure + .result-figure { margin-top: 34px; }
.reconstruction-gallery { display: grid; gap: 30px; }
.gallery-note { margin: 16px 0 0; color: var(--muted); font-size: 13px; text-align: center; }

.display-equation,
.hierarchy-equation {
  margin: 20px 0;
  padding: 8px 14px;
  overflow-x: auto;
  border-block: 1px solid var(--rule);
  background: var(--soft);
  font-size: 15px;
  text-align: center;
}
.equation-explain { color: var(--muted); font-size: 14px; }
.method-list { margin-top: 28px; border-top: 1px solid var(--rule); }
.method-list article { display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--rule); }
.method-list article > span { color: var(--coral); font: 500 12px DM Mono, monospace; }
.method-list h3 { margin: 0 0 3px; color: var(--ink); font-family: Newsreader, Georgia, serif; font-size: 19px; }
.method-list p { margin: 0; color: var(--muted); font-size: 14.5px; }

.loop-objectives {
  width: min(100%, var(--figure-width));
  margin: 25px auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.loop-objectives article {
  min-width: 0;
  padding: 19px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--paper);
}
.loop-objectives article:first-child { border-top: 3px solid var(--coral); }
.loop-objectives article:last-child { border-top: 3px solid var(--mint); }
.loop-objectives h3,
.loop-figures h3 { margin: 7px 0 2px; color: var(--ink); font-family: Newsreader, Georgia, serif; font-size: 21px; line-height: 1.2; }
.loop-subtitle { min-height: 22px; margin: 0 0 8px; color: var(--violet); font-size: 14px; font-weight: 600; }
.objective-summary { min-height: 42px; margin: 0; color: #5b5d70; font-size: 13px; }
.loop-objectives article > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.compact-equation { min-height: 82px; display: grid; align-items: center; overflow-x: auto; font-size: 13px; }
.loop-figures {
  width: min(100%, var(--figure-width));
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: stretch;
}
.loop-figures figure { padding: 13px; border: 1px solid var(--rule); border-radius: 7px; background: var(--paper); }
.loop-figures figure:first-child { border-top: 3px solid var(--coral); }
.loop-figures figure:last-child { border-top: 3px solid var(--mint); }
.loop-figures img { width: 100%; height: 610px; object-fit: contain; object-position: top center; }
.figure-note { width: min(100%, var(--paper-width)); margin: 17px auto 0; padding: 11px 14px; border-left: 3px solid var(--violet); background: var(--violet-light); }

.signal-equations { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 25px; }
.signal-equations article { min-width: 0; padding: 17px; border: 1px solid var(--rule); border-top: 3px solid var(--violet); border-radius: 7px; }
.signal-equations article:nth-child(2) { border-top-color: var(--mint); }
.signal-equations article > div { min-height: 90px; display: grid; align-items: center; overflow-x: auto; font-size: 13px; }
.signal-equations article > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 14px; }

.results-table-wrap { margin-top: 22px; overflow-x: auto; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th,
td { padding: 10px 12px; border-bottom: 1px solid var(--rule); text-align: right; white-space: nowrap; }
th:first-child,
td:first-child { text-align: left; }
th { color: var(--ink); font-size: 13px; font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }
tr.ours td { color: #2b317b; background: var(--violet-light); font-weight: 700; }
.table-caption { padding-left: 0; }
.result-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 22px; }
.result-summary article { padding: 14px; border: 1px solid var(--rule); border-left: 3px solid var(--violet); border-radius: 5px; }
.result-summary article:nth-child(2) { border-left-color: var(--coral); }
.result-summary article:nth-child(3) { border-left-color: var(--mint); }
.result-summary b { color: var(--ink); font-family: Newsreader, Georgia, serif; font-size: 21px; }
.result-summary p { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; }
.subsection-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 42px 0 6px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.3;
}
.subsection-title span {
  padding: 2px 8px;
  border-radius: 6px;
  color: var(--violet);
  background: var(--violet-light);
  font-size: 12px;
}
.subsection-intro { color: var(--muted); font-size: 15.5px; }
.ablation-track { max-width: 780px; margin: 21px auto; }
.ablation-track > div {
  display: grid;
  grid-template-columns: 145px 1fr 43px;
  gap: 11px;
  align-items: center;
  margin: 9px 0;
}
.ablation-track span { color: var(--muted); font-size: 13px; text-align: right; }
.ablation-track i {
  position: relative;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #ececf2;
}
.ablation-track i::after {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--score) * 2%);
  content: "";
  border-radius: inherit;
  background: #9da0b8;
}
.ablation-track .best i::after { background: var(--violet); }
.ablation-track b { color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.controlled-findings { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.controlled-findings article { padding: 16px 18px; border: 1px solid var(--rule); border-radius: 8px; }
.controlled-findings .mini-label { margin: 0 0 6px; }
.controlled-findings article > b { color: var(--ink); font-family: Newsreader, Georgia, serif; font-size: 22px; }
.controlled-findings article > p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 13.5px; }
.ablation-results { margin-top: 27px; }
.ablation-table th:first-child,
.ablation-table td:first-child { width: 48%; white-space: normal; }

.gallery-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 18px;
}
.gallery-tabs button {
  padding: 7px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.gallery-tabs button:hover { border-color: var(--violet); color: var(--violet); }
.gallery-tabs button.active { border-color: var(--violet); color: #fff; background: var(--violet); }
.academic-figure[hidden] { display: none; }
.reconstruction-gallery,
.editing-gallery { min-height: 0; }
.editing-gallery { display: grid; gap: 30px; }
.editing-gallery .result-figure { margin: 0; }

.downstream-comparison {
  max-width: 780px;
  margin: 24px auto 12px;
  border-block: 1px solid var(--rule);
}
.downstream-comparison > div {
  display: grid;
  grid-template-columns: 1fr 70px 30px 70px;
  align-items: center;
  padding: 11px 13px;
  border-bottom: 1px solid var(--rule);
}
.downstream-comparison > div:last-child { border-bottom: 0; }
.downstream-comparison b { color: var(--ink); font-size: 14px; }
.downstream-comparison span { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.downstream-comparison i { color: var(--muted); text-align: center; font-style: normal; }
.downstream-comparison strong { color: var(--mint); text-align: right; font-variant-numeric: tabular-nums; }

.release-list { columns: 2; column-gap: 50px; padding-left: 20px; }
.release-list li { margin-bottom: 8px; color: var(--muted); font-size: 15px; break-inside: avoid; }
.release-list .ready { color: var(--violet); font-weight: 600; }
.bibtex-block { margin-top: 28px; border: 1px solid #36384d; border-radius: 6px; background: #242638; color: #eee; }
.bibtex-block > div { display: flex; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid #424459; color: #bbb; font: 500 12px DM Mono, monospace; text-transform: uppercase; }
.bibtex-block button { border: 0; color: #c5c8ff; background: transparent; cursor: pointer; }
pre { margin: 0; padding: 19px; overflow-x: auto; font: 400 13px/1.65 DM Mono, monospace; }

footer { padding: 30px 0; border-top: 1px solid var(--rule); background: var(--soft); }
.footer-inner { color: var(--muted); font-size: 13px; text-align: center; }
.footer-inner p { margin: 3px 0; }
.footer-inner a { text-decoration: none; }
.copy-note { position: fixed; right: 20px; bottom: 20px; padding: 9px 13px; border-radius: 4px; color: white; background: var(--violet); font-size: 12px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.copy-note.show { opacity: 1; }

@media (max-width: 850px) {
  .masthead { padding-top: 46px; }
  .teaser-grid,
  .contribution-grid,
  .signal-equations,
  .loop-objectives,
  .loop-figures,
  .result-summary { grid-template-columns: 1fr; }
  .controlled-findings { grid-template-columns: 1fr; }
  .flow-row { grid-template-columns: 1fr; }
  .flow-row b { transform: rotate(90deg); text-align: center; }
  .feedback-row { flex-direction: column; gap: 3px; text-align: center; }
  .space-contrast { grid-template-columns: 1fr; }
  .space-gap { padding: 4px 0; transform: rotate(90deg); }
  .requirement-strip { grid-template-columns: 1fr; }
  .stage-lines > div { grid-template-columns: 88px 1fr; }
  .stage-lines p { grid-column: 1 / -1; }
  .contribution-grid article { border-right: 0; border-bottom: 1px solid var(--rule); }
  .contribution-grid article:last-child { border-bottom: 0; }
  .loop-subtitle,
  .objective-summary { min-height: 0; }
  .loop-figures img { height: auto; }
  .release-list { columns: 1; }
}

@media (max-width: 540px) {
  body { font-size: 15.5px; }
  .paper-width,
  .wide-width,
  .narrow-intro { width: calc(100% - 28px); }
  .masthead h1 { font-size: 36px; }
  .authors { font-size: 15px; }
  .affiliations { font-size: 12.5px; }
  .paper-section { padding: 43px 0; }
  .paper-section > h2,
  .narrow-intro h2 { font-size: 26px; }
  .paper-links { gap: 6px; }
  .paper-links a,
  .paper-links button { font-size: 13px; }
  .method-list article { grid-template-columns: 34px 1fr; gap: 9px; }
  .teaser-cell { padding: 20px 17px; }
  .teaser-metrics { grid-template-columns: 1fr; }
  .ablation-track > div { grid-template-columns: 105px 1fr 38px; }
  .ablation-track span { font-size: 11px; }
  .downstream-comparison > div { grid-template-columns: 1fr 46px 20px 46px; padding-inline: 7px; }
  .academic-figure { padding: 5px; }
  .compact-equation,
  .signal-equations article > div { font-size: 11px; }
}
