/* WASP project page */
:root {
  --ink: #1d2433;
  --text: #2f3747;
  --muted: #6b7280;
  --line: #e3e6eb;
  --bg: #ffffff;
  --tint: #f7f8fa;
  --accent: #e8743b;
  --accent-deep: #c85a22;
  --accent-soft: #fff3ea;
  --q: #f09c52;
  --v: #5688ec;
  --hist: #8c68d8;
  --hist-soft: #f0eafc;
  --good: #22925f;
  --bad: #c8483a;
  --display: "DM Serif Display", Georgia, serif;
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --math: "Times New Roman", Times, "STIX Two Text", serif;
  --maxw: 968px;
  --text-width: 816px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
i, .a-math { font-family: var(--math); }
sub, sup { line-height: 0; }
b, strong { color: var(--ink); font-weight: 650; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
@media (max-width: 480px) { .container { padding: 0 16px; } }

/* ---------- hero ---------- */
.hero { padding: 48px 0 32px; text-align: center; }
.title-row {
  display: flex; align-items: center; justify-content: center; gap: clamp(10px, 2vw, 22px);
  width: fit-content; max-width: 100%; margin: 0 auto 24px;
}
.title-badge { flex: none; width: clamp(52px, 11vw, 108px); height: auto; }
.title {
  max-width: 33ch; min-width: 0; margin: 0; color: #363636; text-align: left; text-wrap: balance;
  font-family: var(--display); font-size: clamp(1.5rem, 4vw, 2.6rem); font-weight: 400; line-height: 1.2; letter-spacing: -.012em;
}
@supports (background-clip: text) or (-webkit-background-clip: text) {
  .title .wasp {
    background-image: linear-gradient(90deg, var(--q), var(--accent) 45%, var(--v));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}
@media (forced-colors: active) {
  .title .wasp { background-image: none; color: CanvasText; }
}
.authors, .affils { margin-inline: auto; line-height: 1.5; text-wrap: balance; }
.authors { font-size: clamp(1.05rem, 2vw, 1.25rem); color: #363636; }
.author, .affils span { display: inline-block; }
.authors a { color: #1678b5; }
.affils { margin-top: 4px; font-size: clamp(1rem, 1.85vw, 1.125rem); color: #4a4a4a; }
.authors sup, .affils sup { font-size: .68em; }
.affils sup { margin-right: .12em; }

.links { margin: 26px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px 9px 15px; border-radius: 999px;
  background: #2b2f38; color: #fff; font-size: 15px; font-weight: 600; transition: background .15s, transform .15s;
}
a.btn:hover { background: #111; text-decoration: none; transform: translateY(-1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn .hf { font-size: 17px; line-height: 1; width: 18px; text-align: center; }
.btn .soon { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: rgba(255,255,255,.18); }
.btn-ghost { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px #cfd4dc; }
.btn-ghost:hover { background: var(--tint); }

/* ---------- sections ---------- */
.section { padding: clamp(24px, 3vw, 36px) 0; }
.section-title {
  margin: 0 0 18px; font-size: clamp(25px, 3vw, 31px); line-height: 1.35; font-weight: 700; letter-spacing: -0.015em; color: var(--ink);
  display: flex; align-items: center; gap: 12px;
}
.section-title .num {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 18px;
}
.sub-title { margin: 36px 0 14px; font-size: 19px; font-weight: 700; color: var(--ink); line-height: 1.35; display: flex; align-items: center; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 24px; height: 24px;
  border-radius: 7px; background: var(--ink); color: #fff; font-size: 13px;
}
.lead { margin: 0 0 8px; max-width: var(--text-width); }
.note { font-size: 14px; color: var(--muted); margin: 10px 0 0; max-width: var(--text-width); }
.note b { color: var(--text); }

/* ---------- figures ---------- */
.fig { margin: 28px auto 0; }
.fig img { margin: 0 auto; border-radius: 6px; }
.fig figcaption { margin: 12px auto 0; max-width: 820px; font-size: 14.5px; color: var(--muted); text-align: center; line-height: 1.55; }
.fig-narrow { max-width: 580px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin: 0; }
.card.fig figcaption { text-align: left; }

/* ---------- animations ---------- */
.anim {
  margin: 0; padding: 14px 12px; background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 10px 30px -22px rgba(29,36,51,.35);
}
.anim + .sub-title { margin-top: 44px; }
.anim-stage svg { display: block; width: 100%; height: auto; overflow: visible; }
.anim-bar { display: flex; align-items: center; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.anim-step {
  font-family: inherit; font-size: 14.5px; line-height: 1; padding: 5px 12px 5px 5px; border: 1px solid #d5d9df;
  border-radius: 999px; background: #fff; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
  transition: border-color .15s, color .15s;
}
.anim-step .n {
  width: 19px; height: 19px; border-radius: 50%; background: #eeeff2; color: var(--muted); font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; transition: background .15s, color .15s;
}
.anim-step:hover { border-color: #b9bfc9; color: var(--ink); }
.anim-step.on { border-color: var(--accent); color: var(--ink); font-weight: 600; }
.anim-step.on .n { background: var(--accent); color: #fff; }
.anim-step:focus-visible, .icon-btn:focus-visible, .tab:focus-visible, .copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-btn {
  margin-left: auto; width: 32px; height: 32px; border-radius: 50%; border: 1px solid #d5d9df; background: #fff; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent-deep); }
/* svg text styles (px here are SVG user units) */
.anim svg text { font-family: var(--font); }
.anim svg .a-math, .anim svg tspan.a-math { font-family: var(--math); }
.a-hdr { font-size: 13.5px; font-weight: 700; letter-spacing: .09em; fill: #7a8291; }
.a-hdr-acc { fill: var(--accent-deep); }
.a-prod { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; fill: #7d68b5; }
.a-quote { font-size: 14.5px; font-style: italic; fill: var(--ink); }
.a-dim { fill: #6b7280; }
.a-body { font-size: 14.5px; fill: var(--ink); }
.a-state-size { font-size: 15px; font-weight: 600; fill: #4b5563; }
.a-lab { font-size: 13px; fill: var(--muted); }
.a-small { font-size: 12px; fill: var(--muted); }
.a-tiny { font-size: 9px; font-weight: 700; }
.a-strong { font-size: 16px; font-weight: 700; fill: var(--ink); }
.a-col { font-size: 13px; font-weight: 700; }
.a-on { font-size: 14px; font-weight: 700; fill: #fff; }
.a-on-s { font-size: 10.5px; }
.a-acc { fill: var(--accent-deep); }
.a-bold { font-weight: 700; }
.a-dimtext { fill: #4b5563; }
.a-chunk { font-size: 12px; font-style: italic; font-family: var(--math); fill: var(--hist); font-weight: 600; }
.a-check { font-size: 14px; font-weight: 800; fill: var(--good); }

/* capture mode (GIF / screenshot export) */
body.capture { background: #fff; padding: 16px; width: 960px; }
body.capture .anim { box-shadow: none; }
body.capture *, body.capture *::before { transition: none !important; }
body.capture .anim-play, body.capture figcaption { visibility: hidden; }


/* ---------- details ---------- */
details.more { margin-top: 22px; }
details.more > summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px;
  color: var(--accent-deep); padding: 6px 12px; border-radius: 8px; border: 1px solid #f2c9ae; background: #fff;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "+"; font-weight: 800; width: 12px; text-align: center; }
details.more[open] > summary::before { content: "−"; }
details.more > summary:hover { background: var(--accent-soft); }

.result-chart { max-width: 620px; }
#efficiency .result-chart { max-width: 560px; }

.result-findings { max-width: var(--text-width); margin: 0; padding-left: 1.3em; }
.result-findings li + li { margin-top: .55em; }
.result-findings li::marker { color: var(--accent-deep); }
#continual .result-chart { max-width: calc(var(--text-width) + 40px); margin-bottom: 24px; background: #fff; border-radius: 6px; }
#continual .result-chart a { display: block; cursor: zoom-in; }
.section .container > :is(.section-title, .sub-title, .lead, .result-findings, .anim, details, .bib) {
  max-width: var(--text-width);
  margin-inline: auto;
}
details.more .table-head { margin-top: 16px; }
details.more:not([open]) .when-open, details.more[open] .when-closed { display: none; }
details.more > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- tables ---------- */
.table-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.legend { font-size: 13.5px; color: var(--muted); }
.tabs { display: inline-flex; padding: 3px; border-radius: 10px; background: #eef0f3; gap: 2px; }
.tab {
  font-family: inherit; font-size: 14px; font-weight: 600; padding: 6px 14px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.tab.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
details .table-wrap { margin-top: 14px; }
table.results { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.results th, .results td { padding: 7px 10px; text-align: center; white-space: nowrap; border-bottom: 1px solid #eef0f3; }
.results thead th { font-weight: 600; color: var(--ink); background: #fafbfc; font-size: 13px; }
.results thead tr.grp th { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); border-bottom: 0; padding-bottom: 0; }
.results thead tr.grp th.g { border-bottom: 2px solid #e3e6eb; }
.results th.l, .results td.l { text-align: left; }
.results td.task { font-weight: 600; color: var(--ink); }
.results td.metric { color: var(--muted); }
.results .ours { background: var(--accent-soft); }
.results thead th.ours { color: var(--accent-deep); background: #ffe9da; }
.results td.b { font-weight: 750; color: var(--ink); }
.results td.s span.v { text-decoration: underline; text-underline-offset: 3px; }
.results tbody tr.avg td { background: #fcfcfd; }
.results tbody tr.avg td.ours { background: #ffeddf; }
.results tbody tr.sep td { border-top: 2px solid #e3e6eb; }
.results tbody tr:last-child td { border-bottom: 0; }
.results .ci { color: #9aa1ad; font-size: 11.5px; margin-left: 2px; }
.sig { color: var(--muted); font-weight: 400; }
.results .sig { font-size: 11px; margin-left: 1px; }
@media (max-width: 640px) {
  .results th, .results td { padding: 6px 7px; }
  .results td.task { white-space: normal; min-width: 92px; }
}

/* ---------- bibtex ---------- */
.bib { position: relative; }
.bib pre {
  margin: 0; padding: 18px 20px; border-radius: 12px; background: #fff; border: 1px solid var(--line);
  overflow-x: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.6; color: var(--ink);
}
.copy {
  position: absolute; top: 10px; right: 10px; font-family: inherit; font-size: 13px; font-weight: 600; padding: 5px 12px;
  border-radius: 8px; border: 1px solid #d5d9df; background: #fff; color: var(--ink); cursor: pointer;
}
.copy:hover { border-color: var(--accent); color: var(--accent-deep); }

/* ---------- footer ---------- */
.footer { padding: 36px 0 48px; text-align: center; font-size: 14px; color: var(--text); }
.footer p { margin: 4px 0; }
.footer .muted { color: var(--muted); font-size: 13px; }
