/* MoOP project page. Blue = reasoning / CE, amber = action / FM, as in the paper's figures. */
:root {
  --ce: #1f5fbf;
  --ce-soft: #dbe7f8;
  --fm: #e3a008;
  --fm-soft: #fdf1d3;
  --good: #1a7f5a;
  --bad: #b8432f;
  --ink: #18202b;
  --muted: #5b6573;
  --line: #e2e6ec;
  --bg: #ffffff;
  --band: #f6f8fb;
  --card: #ffffff;
  --code-bg: #f3f5f8;
  --fig-bg: #ffffff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ce: #7fb0f5; --ce-soft: #1c2a40; --fm: #f4c04e; --fm-soft: #3a2f14;
    --good: #4cc79a; --bad: #f08a72; --ink: #e8ecf2; --muted: #a2acba; --line: #2a3240;
    --bg: #11151c; --band: #161b24; --card: #1a2029; --code-bg: #1e2530; --fig-bg: #f4f5f7;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ce: #7fb0f5; --ce-soft: #1c2a40; --fm: #f4c04e; --fm-soft: #3a2f14;
  --good: #4cc79a; --bad: #f08a72; --ink: #e8ecf2; --muted: #a2acba; --line: #2a3240;
  --bg: #11151c; --band: #161b24; --card: #1a2029; --code-bg: #1e2530; --fig-bg: #f4f5f7;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.65 "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ce); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; height: auto; display: block; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
section { padding: 64px 0; }
section.band { background: var(--band); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
h2 { font-size: 30px; line-height: 1.25; margin: 0 0 8px; letter-spacing: -.01em; }
h3 { font-size: 20px; margin: 0 0 6px; }
.lede { color: var(--muted); max-width: 760px; margin: 0 0 28px; }
.kicker { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ce); margin-bottom: 6px; }

/* top navigation */
.topnav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topnav .wrap { display: flex; align-items: center; gap: 20px; height: 56px; }
.brand { font-weight: 800; font-size: 19px; color: var(--ink); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand .mo { color: var(--ce); } .brand .op { color: var(--fm); }
.topnav nav { display: flex; gap: 18px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.topnav nav::-webkit-scrollbar { display: none; }
.topnav nav a { color: var(--muted); font-size: 15px; white-space: nowrap; }
.topnav nav a.active, .topnav nav a:hover { color: var(--ink); text-decoration: none; }
.theme-toggle { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px;
  width: 36px; height: 34px; cursor: pointer; display: grid; place-items: center; flex: none; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }

/* hero */
.hero { text-align: center; padding: 56px 16px 24px; }
.wordmark { font-size: clamp(56px, 11vw, 96px); font-weight: 800; line-height: 1; margin: 0; letter-spacing: -.03em; }
.wordmark .mo { color: var(--ce); } .wordmark .op { color: var(--fm); }
.subtitle { font-size: clamp(22px, 3.4vw, 36px); line-height: 1.35; margin: 18px auto 22px; max-width: 820px; font-weight: 600; text-wrap: balance; }
.subtitle span { display: inline-block; }   /* when the title wraps, break at the colon */
.authors { font-size: 17px; max-width: 860px; margin: 0 auto; }
.author { white-space: nowrap; display: inline-block; margin: 0 7px; }
.author.lead { font-weight: 700; }
.author sup, .affil sup { font-size: 11px; margin-left: 1px; }
.affil { color: var(--muted); margin: 10px 0 0; display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; }
.buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 26px 0 8px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-weight: 600; font-size: 15px; }
.btn:hover { text-decoration: none; opacity: .88; }
.btn svg { width: 17px; height: 17px; }
.btn.soon { background: transparent; color: var(--muted); border: 1px solid var(--line); cursor: default; }
.btn.soon:hover { opacity: 1; }
.btn small { font-weight: 400; opacity: .8; }

/* figures */
.figure { background: var(--fig-bg); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin: 0;
  box-shadow: var(--shadow); }
.figure img { margin: 0 auto; }
.figure video { width: 100%; border-radius: 8px; background: #fff; }
.pipeline { margin-bottom: 22px; }
.figure figcaption, .caption { color: var(--muted); font-size: 15px; margin-top: 12px; }
:root[data-theme="dark"] .figure figcaption { color: #4b5563; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .figure figcaption { color: #4b5563; } }
.teaser { margin-top: 28px; }

/* tl;dr and stats */
.tldr { font-size: 20px; line-height: 1.5; text-align: center; max-width: 820px; margin: 36px auto 26px; }
.tldr b.ce { color: var(--ce); } .tldr b.fm { color: var(--fm); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 16px; text-align: center; box-shadow: var(--shadow); }
.stat .num { font-size: 34px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.stat .lbl { color: var(--muted); font-size: 14.5px; line-height: 1.4; margin-top: 6px; }
.stat:nth-child(odd) .num { color: var(--ce); } .stat:nth-child(even) .num { color: var(--fm); }

.abstract { max-width: 820px; }

/* findings and method cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 26px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.card .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800;
  font-size: 15px; color: #fff; background: var(--ce); margin-bottom: 10px; }
.card.fm .n { background: var(--fm); color: #1b1300; }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; }
.card .em { color: var(--ink); font-weight: 600; }
.steps { margin-bottom: 0; }
.eq { font-family: "Source Serif 4", Georgia, serif; font-style: italic; color: var(--ink); white-space: nowrap; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow); margin-bottom: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
thead th { font-size: 13.5px; color: var(--muted); font-weight: 600; background: var(--band); }
thead tr.group th { text-align: center; color: var(--ink); font-size: 14px; }
tbody tr:last-child td { border-bottom: 0; }
tr.ours td { background: var(--ce-soft); }
tr.ours td:first-child { font-weight: 700; }
td.best { font-weight: 800; }
td.sep, th.sep { border-left: 1px solid var(--line); }
.results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 30px; }
.results-grid > *, .cards > * { min-width: 0; }   /* let wide tables scroll inside their cell */
.results-grid h3, .result-block h3 { margin-top: 0; }
.note { color: var(--muted); font-size: 14px; margin: 0 0 26px; }
.result-block { margin-top: 30px; }

/* videos */
.videos { display: grid; gap: 22px; margin-top: 26px; }
.video-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.video-card video { width: 100%; background: #f7f7f2; }
.video-card .meta { padding: 12px 16px 14px; font-size: 15px; }
.video-card .meta b { color: var(--ink); }
.tag { display: inline-block; font-size: 12.5px; font-weight: 700; border-radius: 6px; padding: 1px 7px; margin-right: 4px; }
.tag.pass { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.tag.fail { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }

/* bibtex */
.bib { position: relative; background: var(--code-bg); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; overflow-x: auto; }
.bib pre { margin: 0; font: 13.5px/1.55 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.copy { position: absolute; top: 10px; right: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 8px; padding: 4px 10px; font-size: 13px; cursor: pointer; }
footer { color: var(--muted); font-size: 14px; text-align: center; padding: 32px 0 48px; }

@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cards, .results-grid { grid-template-columns: 1fr; }
  section { padding: 48px 0; }
}
@media (max-width: 480px) {
  body { font-size: 16px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat .num { font-size: 27px; }
  .figure { padding: 10px; }
  h2 { font-size: 25px; }
}

/* ---- charts: validated categorical slots (blue / aqua / yellow), light and dark ---- */
.viz-root { --s-ce: #2a78d6; --s-both: #1baf7a; --s-fm: #eda100; --s-none: #d5dae1; --grid: #e6e9ee; --axis: #8a93a0; }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .viz-root { --s-ce: #3987e5; --s-both: #199e70; --s-fm: #c98500; --s-none: #3b4352; --grid: #2a3240; --axis: #7d8796; }
}
:root[data-theme="dark"] .viz-root { --s-ce: #3987e5; --s-both: #199e70; --s-fm: #c98500; --s-none: #3b4352; --grid: #2a3240; --axis: #7d8796; }
.viz-root svg { width: 100%; height: auto; display: block; overflow: visible; }
.viz-root text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.viz-root text.strong { fill: var(--ink); font-weight: 600; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: var(--muted); margin: 0 0 12px; }
.viz-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw.ce { background: var(--s-ce); } .sw.both { background: var(--s-both); } .sw.fm { background: var(--s-fm); }
.viz-controls { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.viz-controls button { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px;
  padding: 5px 14px; font: 600 14px/1.3 inherit; cursor: pointer; }
.viz-controls button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
#lat-chart { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px; box-shadow: var(--shadow); }
.viz-tip { position: fixed; z-index: 30; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 13px;
  line-height: 1.45; padding: 7px 10px; border-radius: 8px; max-width: 280px; box-shadow: var(--shadow); opacity: 0; transition: opacity .1s; }
.viz-tip.on { opacity: 1; }
.muted { color: var(--muted); }

/* closed-loop front camera */
.cam { margin: 26px 0 30px; }
.cam-tabs { display: grid; gap: 8px; margin-bottom: 14px; }
.tab-row { display: flex; align-items: flex-start; gap: 6px 10px; }
.tab-btns { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.tab-kind { flex: 0 0 140px; padding-top: 5px; font-size: 13.5px; font-weight: 700; color: var(--muted); }
.tab-row button { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px;
  padding: 4px 12px; font: 600 13.5px/1.3 inherit; cursor: pointer; }
.tab-row button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.cam-head { margin-bottom: 8px; }
@media (max-width: 640px) { .tab-row { flex-direction: column; } .tab-kind { flex-basis: auto; padding-top: 0; } }
.cam video { width: 100%; border-radius: 12px; background: #0c0c0e; }
.cam .t { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; margin-left: 6px; }
.cam-caps { display: grid; gap: 8px; margin-top: 10px; }
.bev-key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.bev-key span { display: inline-flex; align-items: center; gap: 6px; }
.bev-key i { position: relative; display: inline-block; flex: none; width: 26px; height: 16px; border-radius: 3px; background: #15181d; }
.bev-key i::after { content: ""; position: absolute; left: 4px; right: 4px; top: 7px; height: 2px; }
.bev-key .k-road::after { top: 3px; height: 10px; background: #373d48; }
.bev-key .k-edge::after { background: #b4bcc7; }
.bev-key .k-flag::after { top: 6px; height: 4px; background: #f0605a; border-radius: 2px; }
.bev-key .k-ego::after { left: 9px; right: 9px; top: 2px; height: 12px; background: #fff; box-shadow: inset 0 0 0 2px #3fbf8a; }
.bev-key .k-traf::after { left: 9px; right: 9px; top: 2px; height: 12px; background: #8d939c; }
.bev-key .k-plan::after { top: 6px; height: 3px; background: #ff9f43; border-radius: 2px; }
.bev-key .k-gt::after { height: 0; border-top: 2px dashed #6fa8ff; }
.bev-key .k-trail::after { top: 6px; height: 3px; background: #e3e6ea; border-radius: 2px; }
.cam-cap { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0;
  transition: border-color .2s, box-shadow .2s; }
.cam-cap.ours { background: var(--ce-soft); }
.cam-cap.hit { border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
.cam-who { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 15px; margin-bottom: 4px; }
.cam-coc { font-size: 14.5px; line-height: 1.45; }
.cam-coc .flag { font-size: 12px; font-weight: 700; color: var(--bad); margin-left: 6px; }
@media (max-width: 640px) { .cam-caps { grid-template-columns: 1fr !important; } }

/* CoC gallery */
.coc-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.coc-head .viz-controls { margin: 0; }
.coc-list { display: grid; gap: 8px; }
.lq-frames { margin: 0 0 14px; }
.lq-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.lq-strip img { width: 100%; height: auto; border-radius: 8px; }
.lq-frames figcaption { color: var(--muted); font-size: 13px; margin-top: 6px; }
.lq-q { font-size: 19px; font-weight: 700; line-height: 1.4; margin-bottom: 10px; }
.lq-refs { color: var(--muted); font-size: 15px; margin-bottom: 12px; } .lq-refs b { color: var(--ink); }
.lq .coc-row { grid-template-columns: 150px 1fr 86px; }
@media (max-width: 560px) { .lq-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .lq .coc-row { grid-template-columns: 1fr auto; } }
.coc-row { display: grid; grid-template-columns: 150px 1fr 74px; gap: 12px; align-items: baseline; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.coc-row.ref { border-color: color-mix(in srgb, var(--ink) 30%, var(--line)); }
.coc-row.ours { background: var(--ce-soft); }
.coc-row .who { font-weight: 700; font-size: 15px; }
.coc-row .txt { font-size: 15.5px; }
.coc-row.degen .txt { color: var(--bad); font-style: italic; }
.coc-row .ade { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; white-space: nowrap; }
.coc-row .flag { font-size: 12px; font-weight: 700; color: var(--bad); margin-left: 6px; font-style: normal; }
@media (max-width: 560px) {
  .coc-row { grid-template-columns: 1fr auto; }
  .coc-row .txt { grid-column: 1 / -1; order: 3; }
}
footer .attrib { margin: 8px 0 0; }
