/* ---------- Harness Updating Is Not Harness Benefit: project page ----------

   Adapted from the WMRL project page template
   (https://xiyuanyang45.github.io/WMRL/), released under CC BY-SA 4.0
   (https://creativecommons.org/licenses/by-sa/4.0/). This adaptation is
   shared under the same license. Changes: palette matched to the paper's
   figures (blue = harness-updating, orange = harness-benefit), chart and
   theorem styles removed, take-away boxes, benchmark cards, compact tables,
   split figure/text rows and a BibTeX copy button added. */

:root {
  /* --- neutrals --- */
  --ink:        #131720;
  --ink-soft:   #4b5565;
  --ink-faint:  #7a8494;
  --rule:       #e3e7ed;
  --rule-soft:  #eef1f5;
  --bg:         #ffffff;
  --tint:       #f6f7f9;
  --tint-cool:  #eef2f7;

  /* --- brand --- */
  --navy:       #1b2c4f;
  --navy-deep:  #121e38;
  --navy-mid:   #2c4470;
  --orange:     #c4581c;   /* harness-benefit, panel (B) of the teaser */
  --orange-hi:  #f08a4b;
  --blue:       #2d5aa6;   /* harness-updating, panel (A) of the teaser */
  --blue-hi:    #8fb2ec;
  --green:      #1a6d35;
  --red:        #a53131;

  --maxw:    1080px;

  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --display: "Source Serif 4", Charter, "Bitstream Charter", Georgia, serif;
  --mono:  "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  --serif: "Cambria Math", "Latin Modern Math", Georgia, "Times New Roman", serif;

  --shadow-sm: 0 1px 2px rgba(11, 27, 51, .05), 0 1px 3px rgba(11, 27, 51, .04);
  --shadow-md: 0 6px 18px rgba(11, 27, 51, .08), 0 1px 3px rgba(11, 27, 51, .05);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17.5px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

a { color: var(--navy); text-decoration: none; border-bottom: 1px solid rgba(27,44,79,.26); }
a:hover { border-bottom-color: var(--orange); color: var(--orange); }

code, .tt { font-family: var(--mono); font-size: .88em; }

/* capability colours, used in the title, tags and take-aways */
.c-up  { color: var(--blue); }
.c-ben { color: var(--orange); }

/* ---------- sticky nav ---------- */

.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transform: translateY(-100%); opacity: 0;
  transition: transform .28s ease, opacity .28s ease, border-color .28s ease;
}
.nav.show { transform: translateY(0); opacity: 1; border-bottom-color: var(--rule); }
.nav .wrap { display: flex; align-items: center; gap: 24px; height: 56px; }
.nav .mark {
  font-family: var(--display);
  font-weight: 700; letter-spacing: .01em; font-size: 17px; color: var(--navy);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nav .links { display: flex; gap: 22px; margin-left: auto; }
.nav a { border-bottom: none; font-size: 14.5px; color: var(--ink-soft); font-weight: 500; white-space: nowrap; }
.nav a:hover { color: var(--orange); }

@media (max-width: 860px) { .nav .links { display: none; } }

/* ---------- header ---------- */

header {
  position: relative;
  padding: 74px 0 4px;
  text-align: center;
  overflow: hidden;
  background:
    linear-gradient(180deg, var(--tint-cool) 0%, rgba(242,245,249,.35) 55%, #fff 100%);
}
header::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 5px;
  background: linear-gradient(90deg, var(--blue) 0 50%, var(--orange) 50% 100%);
}
header .wrap { position: relative; z-index: 1; }

.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 15px 5px 11px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-sm);
  font-size: 12.5px; font-weight: 550; color: var(--ink-soft);
  letter-spacing: .02em; margin-bottom: 26px;
}
.badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--orange); box-shadow: 0 0 0 3px rgba(27,44,79,.10);
}
.badge b { color: var(--navy); font-weight: 650; }

h1.title {
  font-family: var(--display);
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.018em;
  font-weight: 600;
  margin: 0 0 14px;
  color: var(--navy);
  text-wrap: balance;
}
.subtitle {
  font-family: var(--display);
  font-size: clamp(19px, 2.2vw, 26px);
  line-height: 1.3; font-weight: 500;
  color: var(--ink-soft);
  margin: 0 auto 26px; max-width: 820px;
  text-wrap: balance;
}

.authors {
  font-size: 16.5px; line-height: 1.85;
  margin: 0 auto 12px; max-width: 940px; color: var(--ink);
  text-wrap: balance;
}
.authors sup, .affil sup, .note sup { font-size: 10.5px; color: var(--orange); font-weight: 700; }

.au { display: inline-block; white-space: nowrap; margin-right: 4px; }

.affil { font-size: 15px; color: var(--ink-faint); margin: 0 auto 4px; max-width: 1000px; text-wrap: balance; }
.affil .au { margin: 0 11px; }
.note { font-size: 13.5px; color: var(--ink-faint); margin: 10px 0 0; }
.note a { color: var(--ink-soft); }
.note .sep-dot { margin: 0 8px; }

.featured {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 18px 7px 14px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-sm);
  font-size: 14px; color: var(--ink-soft);
  margin-bottom: 54px;
}
.featured svg { width: 15px; height: 15px; flex: none; fill: var(--orange); }
.featured a { font-weight: 600; }

/* ---------- buttons ---------- */

.buttons {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center; margin: 32px 0 20px;
}

.btn {
  --brand: var(--navy);
  --brand-ink: #fff;
  --brand-edge: #cdd4de;

  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 10px;
  background: #fff;
  color: var(--brand);
  font-size: 15px; font-weight: 600; letter-spacing: .005em;
  white-space: nowrap;
  border: 1px solid var(--brand-edge);
  box-shadow: var(--shadow-sm);
  transition: background .16s, border-color .16s, color .16s,
              transform .14s, box-shadow .16s;
}
.btn:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn svg { width: 17px; height: 17px; flex: none; }

.btn-arxiv  { --brand: #b31b1b; --brand-edge: #e8c4c4; }
.btn-pdf    { --brand: #475569; --brand-edge: #cfd6e0; }
.btn-github { --brand: #24292f; --brand-edge: #ccd1d8; }
.btn-cite   { --brand: var(--navy); --brand-edge: #cdd4de; }

/* ---------- sections ---------- */

section { padding: 78px 0; }
section.alt { background: var(--tint); }
section + section:not(.alt):not(.statband) { border-top: 1px solid var(--rule-soft); }

.h2row { display: flex; align-items: center; gap: 14px; margin: 0 0 26px; }
.h2row .no {
  flex: none;
  font-family: var(--mono);
  font-size: 11.5px; font-weight: 700; letter-spacing: .1em;
  color: #fff;
  background: var(--navy);
  border-radius: 6px; padding: 4px 9px;
}
.h2row .no.up  { background: var(--blue); }
.h2row .no.ben { background: var(--orange); }
h2 {
  font-family: var(--display);
  font-size: clamp(25px, 2.6vw, 34px);
  line-height: 1.2;
  letter-spacing: -0.012em; font-weight: 600;
  margin: 0; color: var(--navy);
}
h3 {
  font-family: var(--display);
  font-size: 22px; font-weight: 600; letter-spacing: -.006em;
  margin: 52px 0 12px; color: var(--navy);
}

p { margin: 0 0 17px; }
p:last-child { margin-bottom: 0; }

.lead {
  font-size: 19.5px; line-height: 1.6; color: var(--ink);
  letter-spacing: -.004em;
}
.abstract { font-size: 17px; line-height: 1.75; color: var(--ink-soft); }
.abstract b, .abstract em { color: var(--ink); }
.abstract b { font-weight: 640; }

/* ---------- figures as cards ---------- */

figure {
  margin: 30px 0 8px;
  background: var(--tint);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
}
figure img {
  width: 100%; height: auto; display: block;
  background: #fff;
}
figure a.zoom { display: block; border-bottom: none; cursor: zoom-in; }
.figscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; background: #fff; }
.figpad { padding: 18px 22px; background: #fff; }
@media (max-width: 760px) {
  .figscroll img { min-width: 640px; }
}
figcaption {
  font-size: 14.5px; line-height: 1.62; color: var(--ink-soft);
  margin: 0; padding: 17px 24px 19px;
  border-top: 1px solid var(--rule);
  background: var(--tint);
  text-align: left;
}
figcaption b { color: var(--ink); font-weight: 640; }
figcaption .fignum {
  display: inline-block;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--orange); margin-right: 9px;
}
.scrollhint { display: none; }
@media (max-width: 760px) {
  .scrollhint {
    display: block; font-size: 12.5px; color: var(--ink-faint);
    padding: 7px 16px 0; background: #fff; text-align: right;
  }
}

.teaser { padding: 54px 0 0; }
.teaser figure { margin-top: 0; box-shadow: var(--shadow-md); }
.alt figcaption { background: #fff; }
.alt figure { background: #fff; }

/* figure beside text */
.split {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 34px; align-items: center; margin-top: 30px;
}
.split.narrow-fig { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.split figure { margin: 0; }
.split .tablecol { align-self: start; }

/* ---------- stat band ---------- */

.statband {
  background: var(--navy-deep);
  color: #fff;
  padding: 52px 0;
  position: relative;
  margin-top: 54px;
}
.statband::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, var(--blue) 0 50%, var(--orange) 50% 100%);
}
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; }
.stat { position: relative; padding-left: 18px; }
.stat::before {
  content: ""; position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 3px; border-radius: 2px;
  background: var(--orange);
}
.stat.up::before { background: var(--blue-hi); }
.stat .t {
  display: block;
  font-size: 12.5px; font-weight: 650;
  letter-spacing: .05em; text-transform: uppercase;
  color: var(--orange-hi);
  margin-bottom: 8px;
}
.stat.up .t { color: var(--blue-hi); }
.stat .k {
  display: block;
  font-family: var(--display);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 600; line-height: 1.05; letter-spacing: -.02em;
  color: #fff; font-variant-numeric: tabular-nums;
}
.stat .k.k-text { font-size: clamp(22px, 2.2vw, 28px); letter-spacing: -.01em; }
.stat .lbl {
  display: block; margin-top: 10px;
  font-size: 14px; line-height: 1.5; color: #a9b7cc;
}
.stat .lbl b { color: #e6ecf5; font-weight: 600; }

/* ---------- cards ---------- */

.two-col   { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 30px; }
.three-col { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 18px; }

.card {
  position: relative;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--navy);
  border-radius: 12px;
  padding: 22px 24px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card.up  { border-left-color: var(--blue); }
.card.ben { border-left-color: var(--orange); }
.card h4 {
  margin: 0 0 8px; font-size: 18px; font-weight: 650;
  color: var(--navy); font-family: var(--display); letter-spacing: -.005em;
}
.card p { font-size: 15.5px; color: var(--ink-soft); margin: 0; line-height: 1.62; }
.card p + p { margin-top: 10px; }
.card .tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 8px;
}
.card.up .tag  { color: var(--blue); }
.card.ben .tag { color: var(--orange); }
.card .eqline { margin: 4px 0 12px; }

.bench .meta {
  display: block; margin-top: 12px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .03em;
  color: var(--ink-faint);
}

/* inline math */
.math {
  font-family: var(--serif); font-style: italic;
  font-size: 1.07em; letter-spacing: .01em; white-space: nowrap;
}
.math sub, .math sup { font-size: .72em; font-style: normal; }
.math .rm { font-style: normal; }
.eqline {
  display: block;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 10px 14px; margin: 6px 0 18px;
  border: 1px solid var(--rule); border-radius: 8px;
  background: var(--tint);
  text-align: center;
}
.alt .eqline { background: #fff; }

/* ---------- take-away ---------- */

.takeaway {
  margin: 34px 0 0;
  padding: 18px 22px 18px 24px;
  border-radius: 12px;
  background: var(--tint-cool);
  border: 1px solid #d9e1ec;
  border-left: 4px solid var(--navy);
  font-size: 16.5px; line-height: 1.65; color: var(--ink);
}
.takeaway.up  { border-left-color: var(--blue); }
.takeaway.ben { border-left-color: var(--orange); background: #fbf1ea; border-color: #f0dccd; }
.takeaway .label {
  display: block;
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 4px;
}
.takeaway.up .label  { color: var(--blue); }
.takeaway.ben .label { color: var(--orange); }

/* ---------- tables ---------- */

.tablewrap {
  overflow-x: auto;
  margin: 6px 0 10px;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: #fff;
}

table {
  border-collapse: collapse;
  width: 100%; min-width: 420px;
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
}

table th, table td { padding: 9px 10px; text-align: center; white-space: nowrap; }
table th { font-weight: 640; color: var(--navy); }

thead { background: var(--tint); }
thead tr:last-child th  { border-bottom: 1px solid var(--rule); }
tbody tr { border-bottom: 1px solid var(--rule-soft); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover td { background: rgba(45,90,166,.05); }

th.spangroup { border-bottom: 1px solid var(--rule); }
td.method, th.method { text-align: left; padding-left: 18px; }
td.method { font-weight: 550; color: var(--ink); }
tr.drift td { border-top: 1px solid var(--rule); background: var(--tint); }

td b { font-weight: 700; color: var(--green); }
td u { text-decoration-color: var(--red); text-underline-offset: 3px; color: var(--red); }
td.low { color: var(--red); font-style: italic; }
.sep  { border-left: 1px solid var(--rule); }

.tabtitle { font-size: 15px; color: var(--ink-soft); margin: 0 0 10px; line-height: 1.55; }
.tabtitle b { color: var(--navy); font-weight: 650; }
.tabtitle .fignum {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--orange); margin-right: 9px;
}
.tabnote { font-size: 13.5px; color: var(--ink-faint); line-height: 1.6; margin: 0; }

/* ---------- bibtex ---------- */

.bibwrap { position: relative; }
pre.bibtex {
  background: var(--navy-deep);
  border: 1px solid var(--navy-deep);
  border-radius: 14px;
  padding: 22px 24px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13.5px; line-height: 1.65;
  color: #dbe3ef;
  margin: 0;
  box-shadow: var(--shadow-sm);
}
.copy {
  position: absolute; top: 12px; right: 12px;
  font: 600 12.5px var(--sans);
  color: #dbe3ef; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18); border-radius: 8px;
  padding: 6px 12px; cursor: pointer;
  transition: background .15s ease;
}
.copy:hover { background: rgba(255,255,255,.16); }

/* ---------- footer ---------- */

footer {
  padding: 40px 0 68px;
  text-align: center;
  font-size: 13.5px; color: var(--ink-faint);
  border-top: 1px solid var(--rule-soft);
}
footer a { color: var(--ink-faint); }

/* ---------- scroll reveal (only when the script runs) ---------- */

.js .reveal { opacity: 0; transform: translateY(14px); }
.js .reveal.in { opacity: 1; transform: none; transition: opacity .5s ease, transform .5s ease; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .reveal.in { opacity: 1; transform: none; transition: none; }
  .card, .btn { transition: none; }
}

/* ---------- responsive ---------- */

@media (max-width: 940px) {
  body { font-size: 16px; }
  header { padding-top: 52px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
  .two-col, .three-col { grid-template-columns: minmax(0, 1fr); }
  .split, .split.narrow-fig { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  section { padding: 54px 0; }
  .statband { padding: 40px 0; }
  h3 { margin-top: 42px; }
}

@media (max-width: 560px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
  .buttons {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px; max-width: 360px; margin-left: auto; margin-right: auto;
  }
  .btn { padding: 10px 12px; font-size: 14px; justify-content: center; }
  .wrap { padding: 0 16px; }
  .lead { font-size: 17.5px; }
  .affil .au { margin: 0 7px; }
  figcaption { padding: 14px 16px 16px; }
  .card { padding: 18px 18px; }
  .takeaway { padding: 16px 16px 16px 18px; font-size: 15.5px; }
  pre.bibtex { padding: 46px 16px 18px; font-size: 12.5px; }
}
