/* Colors follow the Oct10 figures: spatial memory and navigation in blue,
   human approach prior and manipulation in orange. */
:root {
  --ink: #1d2733;
  --ink-2: #4a5563;
  --ink-3: #7b8592;
  --bg: #ffffff;
  --bg-alt: #f7f9fc;
  --line: #e3e6ea;
  --card: #ffffff;

  --blue-light: #E6EEF8;
  --blue: #2F6DB5;
  --orange-light: #FBEEE5;
  --orange: #C2571A;
  --navigate: var(--blue);
  --prepare: var(--orange);
  --manipulate: var(--orange);
  --memory: var(--navigate);
  --prior: var(--prepare);
  --prep: var(--prepare);
  --exec: var(--manipulate);

  --ours: var(--exec);
  --base-bar: #b9c0c9;
  --track: #eef0f3;

  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 30, 45, .06), 0 6px 20px rgba(20, 30, 45, .06);
  --font: Arial, Helvetica, sans-serif;
  --mono: Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  zoom: 0.9;
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, video, svg { max-width: 100%; display: block; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
[hidden] { display: none !important; }
b { font-weight: 600; }

.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding-inline: 24px; }
.wrap.narrow { max-width: 860px; }

/* ---------------- hero ---------------- */
.hero { padding-block: 64px 32px; text-align: center; }

.title {
  margin: 0 auto; max-width: 980px;
  font-size: clamp(28px, 4.2vw, 44px); line-height: 1.18; font-weight: 700; letter-spacing: -.02em;
  text-wrap: balance;
}
.brand { color: var(--ink); font-weight: 800; }
.authors { margin: 22px 0 2px; font-size: 19px; }
.author { white-space: nowrap; }
.affils { margin: 0; color: var(--ink-3); font-size: 15px; }

.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 26px 0 36px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 999px;
  background: var(--blue); color: #fff; text-decoration: none; font-weight: 600; font-size: 15px;
  transition: transform .15s ease, background .15s ease;
}
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn:hover { background: #25578f; transform: translateY(-1px); }
.btn.is-disabled { background: #c9ced5; cursor: default; transform: none; }
.btn small { font-weight: 500; opacity: .85; }

.teaser { margin: 0; }
.teaser-image { display: block; width: 100%; max-width: 760px; height: auto; margin: 0 auto; background: #fff; }
.teaser figcaption {
  max-width: 820px; margin: 16px auto 0; color: var(--ink-2); font-size: 16px; text-align: center;
}
.speed {
  display: inline-block; margin-right: 6px; padding: 0 7px; border-radius: 6px;
  background: var(--bg-alt); border: 1px solid var(--line);
  font-size: 12px; font-weight: 700; color: var(--ink-2); vertical-align: 2px;
}

/* ---------------- sections ---------------- */
.section { padding-block: 56px; }
.section.alt { background: var(--bg-alt); }
.section-title {
  margin: 0 0 22px; text-align: center;
  font-size: clamp(24px, 3vw, 32px); font-weight: 700; letter-spacing: -.015em;
}
.section-title.left { text-align: left; font-size: 24px; margin-bottom: 10px; }
.section-title.left + p + .section-title.left { margin-top: 26px; }
.lede { max-width: 820px; margin: 0 auto 30px; text-align: center; color: var(--ink-2); }
.abstract { color: var(--ink); margin: 0; }
.note { color: var(--ink-3); font-size: 15px; }
.muted { color: var(--ink-3); }

/* Semantic accents for search, approach and manipulation. */
.c-memory { --accent: var(--memory); }
.c-exec { --accent: var(--exec); }
.c-prep { --accent: var(--prep); }

/* ---------------- video ---------------- */
.video-frame { max-width: 960px; margin: 0 auto; }
.video-frame video { width: 100%; aspect-ratio: 16 / 9; border-radius: 4px; background: #000; }

/* ---------------- figures ---------------- */
.figure { margin: 0; }
.figure img { width: 100%; border-radius: 8px; }
.figure.wide { margin-bottom: 36px; }
.figure.wide img { border-radius: 0; }
.figure figcaption { margin-top: 10px; font-size: 14.5px; color: var(--ink-2); line-height: 1.55; }
.figure.wide figcaption { max-width: 900px; margin-inline: auto; text-align: center; }

/* ---------------- method ---------------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; align-items: center; }
.method-row { padding-block: 30px; border-top: 1px solid var(--line); }
.method-copy h3 { margin: 0 0 18px; font-size: 22px; line-height: 1.35; }
.method-copy h4 { color: var(--accent); margin: 18px 0 6px; font-size: 17px; }
.method-copy p { margin: 0 0 14px; color: var(--ink-2); font-size: 16px; }
.human-video video { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #171c20; }
.btn:focus-visible, .copy:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* Supplementary navigation example within Code-as-Policy. */
.navigation-example { grid-column: 1 / -1; width: 100%; max-width: 760px; margin: 8px auto 0; }
.navigation-call { margin: 0 0 10px; color: var(--memory); font-family: var(--mono); font-size: 16px; }
.navigation-call code { font: inherit; }
.navigation-example video { width: 100%; height: auto; border-radius: 4px; background: #171c20; }

/* code card */
.code-card { border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: #fff; }
.code-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 14px; font-family: var(--mono); font-size: 12px; color: var(--ink-2); background: var(--blue-light);
}
.dot-row { display: flex; gap: 6px; }
.dot-row i { width: 9px; height: 9px; border-radius: 50%; background: #aebdce; display: block; }
.code-card pre { margin: 0; padding: 16px; overflow-x: auto; }
.code-card code { font-family: var(--mono); font-size: 13px; line-height: 1.65; color: var(--ink); }
.code-card .c { color: var(--ink-3); }
.code-card .f { color: var(--ink); }
.code-card .f.c-memory { color: var(--memory); }
.code-card .f.c-prep { color: var(--prep); }
.code-card .f.c-exec { color: var(--exec); }
.code-card .s { color: var(--ink); }
/* diagrams */
.diagram svg { width: 100%; height: auto; }
.d-desk { fill: #f1f2f4; stroke: #b9bfc7; stroke-width: 1.2; }
.d-can { fill: var(--orange); stroke: var(--orange); }
.d-label { font: 500 13px var(--font); fill: var(--ink-3); }
.d-label.can { fill: var(--orange); }
.d-label.human { fill: var(--prep); font-weight: 600; }
.d-label.robot { fill: #fff; font-weight: 600; }
.d-small { font: 400 11.5px var(--font); fill: var(--ink-3); }
.d-small.human { fill: var(--prep); font-weight: 600; }
.d-human { fill: var(--prep); }
.d-robot { fill: var(--exec); }
.d-bearing { stroke: var(--prior); stroke-width: 2; stroke-dasharray: 5 4; }
.d-arrow { stroke: var(--exec); stroke-width: 2; marker-end: none; }
.d-look { stroke: #9aa3ad; stroke-width: 1.2; stroke-dasharray: 2 3; }
.start rect { fill: var(--blue-light); stroke: var(--blue); stroke-width: 1.2; }
.start text { font: 600 14px var(--font); fill: var(--ink); }
.start.human rect { fill: var(--orange-light); stroke: var(--prep); }
.start.human text { fill: var(--prep); }

/* ---------------- results ---------------- */
.result-block { margin-top: 48px; }
.result-block:first-of-type { margin-top: 8px; }
.result-title { display: flex; align-items: center; gap: 10px; font-size: 22px; margin: 0 0 10px; }
.tag { flex-shrink: 0; padding: 3px 8px; border-radius: 4px; background: var(--accent);
  color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .04em; }

.result-block.c-exec .result-title .tag,
.result-block.c-exec .clip-label.ours { background: #000; color: #fff; }


.result-block > p { color: var(--ink-2); margin: 0 0 20px; max-width: 900px; }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.clip { margin: 0; position: relative; border-radius: 4px; overflow: hidden; background: #1c232b; }
.clip video { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 9; }
.clip-label {
  position: absolute; top: 10px; left: 10px; z-index: 1;
  padding: 3px 10px; border-radius: 6px; font-size: 13px; font-weight: 700;
  background: rgba(20, 26, 34, .72); color: #fff; backdrop-filter: blur(4px);
}
.clip-label.ours { background: var(--accent); }
.clip video[tabindex] { cursor: pointer; }
.clip video:focus { outline: none; }
.clip video:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.clip.is-paused::after {
  content: "❚❚ paused"; position: absolute; top: 10px; right: 10px; z-index: 1; pointer-events: none;
  padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 700;
  background: rgba(20, 26, 34, .72); color: #fff;
}
.clip-caption { margin: 10px 0 22px; font-size: 14.5px; color: var(--ink-3); }

.nav-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(6, 1fr);
  grid-template-areas:
    "big big big big pov pov"
    "big big big big pov pov"
    "s1 s1 s2 s2 s3 s3";
}
.nav-grid .big { grid-area: big; }
.nav-grid .pov { grid-area: pov; }
.nav-grid .small:nth-of-type(3) { grid-area: s1; }
.nav-grid .small:nth-of-type(4) { grid-area: s2; }
.nav-grid .small:nth-of-type(5) { grid-area: s3; }
.nav-grid .big video, .nav-grid .pov video { aspect-ratio: auto; }

.prior-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 36px; align-items: center; margin-block: 24px; }
.prior-context { color: var(--ink-2); margin: 0; max-width: 620px; }

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

/* ---------------- footer ---------------- */
.footer { padding-block: 34px 48px; border-top: 1px solid var(--line); text-align: center; font-size: 13.5px; color: var(--ink-3); }
.footer a { color: var(--ink-2); }


/* ---------------- responsive ---------------- */
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .prior-layout { grid-template-columns: 1fr; }
  .start-map { max-width: 320px; margin: 0 auto; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap { padding-inline: 16px; }
  .hero { padding-block: 40px 24px; }
  .br-wide { display: none; }
  .compare { grid-template-columns: 1fr; }
  .nav-grid { grid-template-columns: 1fr 1fr; grid-template-areas: "big big" "pov pov" "s1 s2" "s3 s3"; }
  .section { padding-block: 40px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
