:root {
  --font-geist-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-geist-mono: "SFMono-Regular", Consolas, monospace;
}

:root {
  --ink: #262a30;
  --text: #4f555f;
  --muted: #777f89;
  --line: #dfe4e7;
  --blue: #337ab7;
  --teal: #2f7b70;
  --blue-soft: #f3f7fb;
  --warm-soft: #fcf7f4;
  --gray-soft: #f6f7f8;
  --green-soft: #e8f5ef;
  --font-sans: var(--font-geist-sans), -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: var(--font-geist-mono), "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: #d7e9f7; }

.paper-section {
  width: min(960px, calc(100% - 40px));
  margin: 0 auto;
  padding: 72px 0;
}

.project-header {
  width: min(940px, calc(100% - 40px));
  margin: 36px auto 38px;
  padding: 46px 54px 48px;
  border: 1px solid #dce4e4;
  border-radius: 14px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 120%, rgba(252, 231, 213, 0.42), transparent 44%),
    linear-gradient(145deg, #f0f7f6 0%, #fbfbf8 66%, #f1f6f7 100%);
  box-shadow: 0 4px 16px rgba(34, 54, 62, 0.04);
}

.artifact-label {
  margin: 0 0 12px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.project-header h1 {
  margin: 0;
  font-size: clamp(42px, 6.5vw, 70px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.05em;
}

.project-subtitle {
  margin: 14px 0 10px;
  color: #56606d;
  font-size: clamp(19px, 2.5vw, 27px);
  line-height: 1.25;
  letter-spacing: -.02em;
}

.report-title {
  max-width: 720px;
  margin: 0 auto 24px;
  color: #626b75;
  font-size: 15px;
  line-height: 1.55;
}

.project-team { margin: 0; font-size: 19px; font-weight: 620; }
.affiliation { margin: 9px 0 0; color: #5f6670; font-size: 15px; }
.resource-row { margin-top: 30px; display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; }
.resource-button {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: #292b2e;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 560;
  transition: background .15s ease, transform .15s ease;
}
.resource-button:hover { background: #111; text-decoration: none; transform: translateY(-1px); }
.resource-button span { color: #d9e4e2; font-family: var(--font-mono); }

h2 { margin: 0 0 24px; font-size: clamp(27px, 3.2vw, 36px); line-height: 1.2; letter-spacing: -.035em; }
h3 { letter-spacing: -.02em; }
.centered-heading { text-align: center; }
.section-intro { max-width: 760px; margin: -10px auto 36px; text-align: center; color: var(--text); line-height: 1.65; }
.paper-section > p, .method-section p, .model-section p { color: var(--text); font-size: 15.5px; line-height: 1.72; }

.framework-section { padding-top: 74px; }
.framework-section h2 { text-align: left; }
figure { margin: 0; }
figcaption, .standalone-caption {
  margin: 15px auto 0;
  max-width: 880px;
  color: #69717a;
  font-size: 12.5px;
  line-height: 1.55;
  text-align: center;
}
.framework-figure {
  position: relative;
  min-height: 360px;
  padding: 54px 34px 106px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfc;
  display: grid;
  grid-template-columns: 1fr 70px 1.08fr 70px 1fr 70px 1.05fr;
  align-items: center;
}
.framework-stage {
  position: relative;
  z-index: 2;
  min-height: 142px;
  padding: 19px 15px;
  border: 1px solid #cfd9de;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(37, 55, 65, .05);
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}
.source-stage { border-top: 4px solid #739ac0; }
.model-stage { border-top: 4px solid #7a74bf; }
.rust-stage { border-top: 4px solid #ce8a5e; }
.verdict-stage { border-top: 4px solid #579a79; }
.stage-tag { margin-bottom: 13px; color: var(--muted); font: 600 9px/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.framework-stage strong { font-size: 15px; }
.framework-stage small { margin-top: 7px; color: var(--muted); font-size: 10px; }
.framework-stage > code { width: fit-content; margin: 12px auto 0; padding: 4px 7px; background: var(--gray-soft); font-size: 10px; }
.feedback-loop { margin: 13px -6px -5px; padding: 7px 5px; border-radius: 5px; background: #f0eefb; color: #605a9c; font-size: 9px; font-weight: 600; }
.figure-arrow { color: #7790a2; display: flex; flex-direction: column; align-items: center; text-align: center; }
.figure-arrow span { font-size: 27px; line-height: 1; }
.figure-arrow small { margin-top: 6px; font-size: 8px; line-height: 1.25; }
.verdict-pills { margin: 13px 0 2px; display: flex; justify-content: center; gap: 5px; }
.verdict-pills span { padding: 5px 8px; border-radius: 4px; background: #dbf1e5; color: #2f7556; font: 700 9px/1 var(--font-mono); }
.verdict-pills span:last-child { background: #f8e3df; color: #a9584d; }
.reference-track {
  position: absolute;
  left: 7%;
  right: 5.5%;
  bottom: 34px;
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  color: #647985;
  font-size: 10px;
}
.reference-track strong { color: #47616e; font-size: 10px; }
.reference-line { height: 1px; background: #96aab5; position: relative; }
.reference-line::after { content: ""; position: absolute; right: 0; top: -3px; border-left: 6px solid #96aab5; border-top: 3px solid transparent; border-bottom: 3px solid transparent; }

.abstract-section { padding-top: 58px; }
.abstract-copy { max-width: 820px; margin: 0 auto; }
.abstract-copy p { margin: 0 0 14px; color: var(--text); font-size: 15px; line-height: 1.7; text-align: justify; }
.summary-metrics { max-width: 820px; margin: 34px auto 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.summary-metrics > div { padding: 17px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-align: center; }
.summary-metrics strong { display: block; color: var(--teal); font-size: 25px; line-height: 1; }
.summary-metrics span { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; }

.full-width-section { width: 100%; }
.inner-paper { padding-top: 64px; padding-bottom: 64px; }
.motivation-section { background: var(--warm-soft); border-top: 1px solid #f0e6e0; border-bottom: 1px solid #f0e6e0; }
.problem-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.problem-grid article { min-height: 178px; padding: 22px; border: 1px solid #eddcd3; border-top: 3px solid #d98668; border-radius: 8px; background: rgba(255,255,255,.78); }
.problem-grid article > span { color: #b66a51; font: 650 10px/1 var(--font-mono); }
.problem-grid h3 { margin: 14px 0 9px; font-size: 16px; }
.problem-grid p { margin: 0; color: #687078; font-size: 12.5px; line-height: 1.58; }
.gate-figure { margin-top: 52px; text-align: center; }
.gate-figure h3 { margin: 0 0 20px; font-size: 22px; }
.gate-row { display: grid; grid-template-columns: 1fr 30px 1fr 30px 1fr 30px 1fr; align-items: center; }
.gate-row > div { min-height: 106px; padding: 17px 10px; border: 1px solid #e1d9d4; border-radius: 7px; background: #fff; display: flex; flex-direction: column; align-items: center; }
.gate-row span { width: 22px; height: 22px; border-radius: 50%; background: #f1ded5; color: #9b5c47; display: grid; place-items: center; font-size: 10px; font-weight: 700; }
.gate-row strong { margin-top: 10px; font-size: 14px; }
.gate-row small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.gate-row i { color: #b9a9a0; font-style: normal; font-size: 22px; }

.method-section { background: var(--blue-soft); border-bottom: 1px solid #e4ebf1; }
.method-figure { position: relative; margin-top: 32px; padding: 34px 32px 86px 104px; border: 1px solid #d9e2ea; border-radius: 9px; background: #fff; }
.method-lane { position: relative; min-height: 74px; display: grid; grid-template-columns: 1fr 34px 1fr 34px 1fr; align-items: center; }
.method-lane + .method-lane { margin-top: 24px; }
.lane-label { position: absolute; right: calc(100% + 14px); width: 76px; color: var(--muted); font-size: 9px; line-height: 1.3; text-align: right; text-transform: uppercase; letter-spacing: .06em; }
.method-node { min-height: 58px; padding: 11px; border: 1px solid #b9cfdf; border-radius: 6px; background: #edf6fc; display: grid; place-items: center; color: #3d6782; font-size: 12px; font-weight: 620; text-align: center; }
.candidate-lane .method-node { border-color: #d9c8b5; background: #fdf4e9; color: #876341; }
.method-lane b { color: #8fa6b5; text-align: center; font-weight: 500; }
.output-node { border-width: 2px; }
.shared-inputs { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 74px; padding: 10px 4px; border-radius: 5px; background: #e9eef1; color: #64747f; font-size: 9px; text-align: center; }
.comparison-bracket { position: absolute; left: 69%; right: 4%; bottom: 20px; padding-top: 15px; border-top: 2px solid #5e947b; display: flex; justify-content: space-between; color: #537563; font-size: 9px; }
.comparison-bracket strong { font-size: 10px; }
.method-details { margin-top: 34px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.method-details article { padding: 21px; border: 1px solid #d8e2ea; border-radius: 8px; background: rgba(255,255,255,.72); }
.detail-label { color: #507898; font: 650 9px/1 var(--font-mono); text-transform: uppercase; }
.method-details h3 { margin: 12px 0 8px; font-size: 16px; }
.method-details p { margin: 0; font-size: 12.5px; line-height: 1.56; }
.subsection-heading { margin: 38px 0 6px; font-size: 21px; }

.benchmark-section { padding-top: 78px; }
.results-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 18px; align-items: start; }
.result-table h3 { margin: 0 0 12px; font-size: 18px; text-align: center; }
.ours-row td { background: var(--green-soft); color: #285f48; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; color: #4e5660; font-size: 13px; }
th, td { padding: 14px 16px; border-bottom: 1px solid #e5e8ea; text-align: left; }
th { background: #f3f7f9; color: #65717b; font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
.total-row td { background: #fbfaf2; }
.settings-panel { margin-top: 34px; padding: 27px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfc; display: grid; grid-template-columns: .85fr 1.15fr; gap: 34px; }
.settings-panel h3 { margin: 0 0 8px; font-size: 19px; }
.settings-panel p { margin: 0; color: var(--text); font-size: 12.5px; line-height: 1.6; }
.settings-panel dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.settings-panel dl div { padding: 7px 0; border-bottom: 1px solid #e6eaec; display: flex; justify-content: space-between; gap: 12px; }
.settings-panel dt { color: var(--muted); font-size: 11px; }
.settings-panel dd { margin: 0; color: var(--ink); font: 600 11px/1.4 var(--font-mono); }
.research-note { margin-top: 22px; padding: 17px 20px; border-left: 4px solid #d3bc67; background: #fbf8e9; display: flex; gap: 18px; align-items: baseline; }
.research-note strong { flex: 0 0 auto; font-size: 13px; }
.research-note p { margin: 0; color: #696755; font-size: 12px; line-height: 1.55; }

.model-section { background: var(--gray-soft); border-top: 1px solid #e8eaec; border-bottom: 1px solid #e8eaec; }
.model-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: 44px; align-items: start; }
.model-name { margin: 0 0 9px !important; color: var(--teal) !important; font: 650 18px/1.3 var(--font-mono) !important; }
.model-facts { margin: 25px 0; display: flex; flex-wrap: wrap; gap: 18px; }
.model-facts span { font-size: 12px; font-weight: 620; }
.model-facts small { display: block; margin-bottom: 4px; color: var(--muted); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.code-block { overflow: hidden; border: 1px solid #d8dde0; border-radius: 8px; background: #fff; }
.code-block-title { padding: 10px 15px; border-bottom: 1px solid #e3e6e8; background: #fafbfb; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }
.code-block pre, .citation-section pre { margin: 0; padding: 21px; overflow-x: auto; color: #3d4650; font: 11px/1.7 var(--font-mono); }

.reproduce-section > p { max-width: 760px; }
.reproduction-grid { margin-top: 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.reproduction-grid article { min-height: 130px; padding: 20px 21px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.reproduction-grid span { color: var(--blue); font: 650 10px/1 var(--font-mono); }
.reproduction-grid h3 { margin: 10px 0 16px; font-size: 15px; }
.reproduction-grid code { display: block; overflow-x: auto; padding: 9px; border-radius: 4px; background: var(--gray-soft); color: #59616a; font-size: 10px; }
.centered-link { margin-top: 28px !important; text-align: center; }
.centered-link a { font-weight: 620; }

.limitations-section { background: #fafafa; border-top: 1px solid #eceeef; border-bottom: 1px solid #eceeef; }
.limitations-section ol { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.limitations-section li { padding: 18px; border: 1px solid #e1e4e6; border-radius: 7px; background: #fff; display: flex; gap: 14px; }
.limitations-section li span { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; background: #edf0f1; display: grid; place-items: center; color: #707880; font-size: 10px; font-weight: 700; }
.limitations-section li p { margin: 0; color: var(--text); font-size: 12.5px; line-height: 1.58; }

.citation-section { padding-bottom: 84px; }
.citation-section > p { margin-bottom: 18px; }
.citation-section pre { border: 1px solid #e0e3e5; border-radius: 7px; background: #f6f7f8; }
footer { padding: 30px 20px; background: #f6f7f8; color: #7b8289; text-align: center; font-size: 11px; line-height: 1.7; }
footer p { margin: 2px 0; }

@media (max-width: 820px) {
  .framework-figure { padding: 26px; grid-template-columns: 1fr; gap: 10px; }
  .figure-arrow { transform: rotate(90deg); height: 34px; justify-content: center; }
  .figure-arrow small { display: none; }
  .reference-track { display: none; }
  .summary-metrics { grid-template-columns: 1fr 1fr; }
  .problem-grid, .method-details { grid-template-columns: 1fr; }
  .gate-row { grid-template-columns: 1fr; gap: 7px; }
  .gate-row i { transform: rotate(90deg); line-height: .8; }
  .settings-panel, .model-layout { grid-template-columns: 1fr; }
  .results-grid { grid-template-columns: 1fr; }
  .method-figure { padding-left: 26px; }
  .lane-label, .shared-inputs { position: static; width: auto; text-align: left; transform: none; grid-column: 1 / -1; margin-bottom: 8px; }
  .method-lane { grid-template-columns: 1fr 24px 1fr 24px 1fr; }
  .comparison-bracket { left: 52%; }
}

@media (max-width: 580px) {
  .paper-section { width: min(100% - 28px, 960px); padding: 52px 0; }
  .project-header { width: calc(100% - 24px); margin-top: 12px; padding: 36px 18px; }
  .artifact-label { font-size: 10px; }
  .resource-button { min-height: 39px; padding: 0 14px; font-size: 12px; }
  .abstract-copy p { text-align: left; }
  .summary-metrics, .reproduction-grid, .limitations-section ol { grid-template-columns: 1fr; }
  .settings-panel dl { grid-template-columns: 1fr; }
  .research-note { align-items: flex-start; flex-direction: column; gap: 7px; }
  .method-figure { padding: 24px 14px 76px; }
  .method-lane { grid-template-columns: 1fr; gap: 7px; }
  .method-lane b { transform: rotate(90deg); }
  .comparison-bracket { left: 12px; right: 12px; }
  .model-layout { gap: 28px; }
  th, td { padding: 11px 12px; white-space: nowrap; }
}
