/* CROSS site chrome, Swiss style: design tokens, the black top bar and the footer. Loaded by every page, including the
   CROSS 1 paper page (v1/), which loads it before its own stylesheet; class names are prefixed (sh-, sf-).
   Style: one grotesque (Inter Tight) at large sizes with tight tracking, black hairline rules, a 12-column grid that
   spans the window, square corners, no shadows, a red accent (yellow in the dark theme). */

/* ------------------------------------------------------------------ tokens */
:root {
  color-scheme: light;
  --bg: #fafaf7;
  --bg-tint: #f2f2ef;
  --surface: #ffffff;
  --surface-2: #f2f2ef;
  --surface-3: #e9e9e6;
  --ink: #111110;
  --ink-2: #3a3a38;
  --ink-3: #66665f;
  --line: #d9d9d3;           /* hairline: rows, cells */
  --line-2: #b8b8b1;
  --rule: #111110;           /* rule: section and title borders */
  --accent: #e4321b;         /* marks, active states, annotations */
  --accent-hover: #c22914;
  --accent-ink: #c22914;     /* accent as small text (4.5:1 on --bg) */
  --accent-soft: #fbe5e1;
  --accent-line: #efb1a7;
  --good: #0b7040;
  --good-soft: #e1f4e8;
  --bad: #b83434;
  --bad-soft: #fbe6e6;
  --bar-muted: #c9c9c4;
  --grid: #e9e9e6;
  --shadow-sm: none;
  --shadow: none;
  --shadow-lg: none;
  /* full-bleed colour bands */
  --band-yellow: #f6ee1f;
  --band-pink: #f5a3b7;
  --band-blue: #1f61d6;
  --band-mint: #a3e4d7;
  /* system colours (fixed per system on every page; validated categorical slots) */
  --c-cross: #e4321b;
  --c-orbslam3: #2a78d6;
  --c-rtabmap: #1baf7a;
  --c-lingbot_map: #eda100;
  --c-vggt_slam: #e87ba4;
  --c-amb3r_slam: #008300;
  --c-mast3r_slam: #6250d6;
  --c-gt: #8d8b84;
  /* the black bar and black blocks: the same in both themes */
  --night: #000000;
  --night-2: #111110;
  --night-3: #1b1b1a;
  --night-line: rgba(255, 255, 255, .16);
  --night-ink: #f0efea;
  --night-ink-2: rgba(240, 239, 234, .74);
  --night-ink-3: rgba(240, 239, 234, .52);
  --code-bg: #f2f2ef;
  --code-bar: #e9e9e6;
  --code-line: #d9d9d3;
  --code-ink: #111110;
  --code-dim: #6d6d68;
  --radius: 0px;
  --radius-sm: 0px;
  --header-h: 34px;          /* the top bar */
  --m: 20px;                 /* page margin */
  --g: 16px;                 /* grid gutter */
  --maxw: none;
  --font: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (max-width: 760px) { :root { --m: 12px; --g: 10px; } }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #0e0e0e;
    --bg-tint: #151514;
    --surface: #161615;
    --surface-2: #1a1a19;
    --surface-3: #232321;
    --ink: #f0efea;
    --ink-2: #c8c7c1;
    --ink-3: #8e8e88;
    --line: #2b2b29;
    --line-2: #3d3d3a;
    --rule: #f0efea;
    --accent: #ffc400;
    --accent-hover: #ffd23f;
    --accent-ink: #ffc400;
    --accent-soft: #2e2608;
    --accent-line: #6b5408;
    --good: #3cc47a;
    --good-soft: #15301f;
    --bad: #ff6464;
    --bad-soft: #3a1d1d;
    --bar-muted: #4a4a47;
    --grid: #232321;
    --c-cross: #ff5a43;
    --c-orbslam3: #3987e5;
    --c-rtabmap: #199e70;
    --c-lingbot_map: #c98500;
    --c-vggt_slam: #d55181;
    --c-amb3r_slam: #008300;
    --c-mast3r_slam: #9085e9;
    --c-gt: #8a8a84;
    --code-bg: #1a1a19;
    --code-bar: #232321;
    --code-line: #2b2b29;
    --code-ink: #f0efea;
    --code-dim: #8e8e88;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0e0e;
  --bg-tint: #151514;
  --surface: #161615;
  --surface-2: #1a1a19;
  --surface-3: #232321;
  --ink: #f0efea;
  --ink-2: #c8c7c1;
  --ink-3: #8e8e88;
  --line: #2b2b29;
  --line-2: #3d3d3a;
  --rule: #f0efea;
  --accent: #ffc400;
  --accent-hover: #ffd23f;
  --accent-ink: #ffc400;
  --accent-soft: #2e2608;
  --accent-line: #6b5408;
  --good: #3cc47a;
  --good-soft: #15301f;
  --bad: #ff6464;
  --bad-soft: #3a1d1d;
  --bar-muted: #4a4a47;
  --grid: #232321;
  --c-cross: #ff5a43;
  --c-orbslam3: #3987e5;
  --c-rtabmap: #199e70;
  --c-lingbot_map: #c98500;
  --c-vggt_slam: #d55181;
  --c-amb3r_slam: #008300;
  --c-mast3r_slam: #9085e9;
  --c-gt: #8a8a84;
  --code-bg: #1a1a19;
  --code-bar: #232321;
  --code-line: #2b2b29;
  --code-ink: #f0efea;
  --code-dim: #8e8e88;
}

/* ------------------------------------------------------------------ top bar */
.sh {
  position: sticky; top: 0; z-index: 60;
  height: var(--header-h);
  background: #000; color: #f0efea;
  font-family: var(--font); font-size: 13px; line-height: 1; letter-spacing: 0;
}
.sh-inner { height: 100%; padding-inline: var(--m); display: flex; align-items: center; gap: 20px; }
.sh-brand {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  color: #f0efea; text-decoration: none; font-weight: 500; font-size: 13px; letter-spacing: .01em;
}
.sh-brand .sh-mark { display: none; }
.sh-nav {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 18px;
}
.sh-nav a, .sh-ext {
  color: rgba(240, 239, 234, .74); text-decoration: none; white-space: nowrap;
  text-underline-offset: 4px; text-decoration-thickness: 1px; transition: color .15s;
}
.sh-nav a:hover, .sh-ext:hover { color: #f0efea; }
.sh-nav a[aria-current] { color: #f0efea; text-decoration: underline; }
.sh-actions { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.sh-ext .soon { color: rgba(240, 239, 234, .45); }
.theme-toggle, .sh-menu {
  height: var(--header-h); padding: 0; border: 0; background: none; color: rgba(240, 239, 234, .74);
  display: inline-flex; align-items: center; gap: 6px; font: inherit; cursor: pointer;
}
.theme-toggle:hover, .sh-menu:hover { color: #f0efea; }
.theme-toggle svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .theme-toggle .i-sun { display: none; }
  :root:where(:not([data-theme="light"])) .theme-toggle .i-moon { display: block; }
}
.sh-menu { display: none; }
.sh-menu svg { display: none; }
.sh-menu::after { content: "Menu"; }
.sh-menu[aria-expanded="true"]::after { content: "Close"; }
.sh-drawer {
  position: absolute; left: 0; right: 0; top: var(--header-h);
  display: grid; padding: 4px var(--m) 14px; background: #000; border-top: 1px solid rgba(240, 239, 234, .16);
}
.sh-drawer[hidden] { display: none; }
.sh-drawer a {
  padding: 11px 0; border-bottom: 1px solid rgba(240, 239, 234, .12);
  color: #f0efea; text-decoration: none; font-size: 22px; letter-spacing: -0.02em; line-height: 1.1;
}
.sh-drawer a[aria-current] { color: var(--accent); }
@media (max-width: 900px) {
  .sh-nav, .sh-ext { display: none; }
  .js .sh-menu { display: inline-flex; }
  /* without JavaScript the menu cannot open: the links stay in the bar and scroll sideways */
  html:not(.js) .sh-nav {
    display: flex; position: static; transform: none; min-width: 0; height: 100%; overflow-x: auto; scrollbar-width: none;
  }
}
/* without JavaScript the theme follows the system, and the toggle would do nothing */
html:not(.js) .theme-toggle { display: none; }
/* pages that used to start on a dark band: the bar is always solid now */
body.night-top .sh { margin-bottom: 0; }

/* ------------------------------------------------------------------ footer */
.sf { margin-top: 0; border-top: 1px solid var(--rule); padding: 18px 0 22px; font-family: var(--font); font-size: 13px; line-height: 1.4; color: var(--ink); }
.sf-wrap { padding-inline: var(--m); }
.sf-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--g); row-gap: 22px; }
.sf-about { grid-column: 1 / 5; }
.sf-col { grid-column: span 2; display: flex; flex-direction: column; gap: 4px; }
.sf-col:first-of-type { grid-column: 7 / 9; }
@media (max-width: 900px) {
  .sf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sf-about { grid-column: 1 / -1; }
  .sf-col, .sf-col:first-of-type { grid-column: span 1; }
}
.sf-brand { display: inline-block; color: var(--ink); text-decoration: none; font-size: 34px; letter-spacing: -0.045em; line-height: 1; }
.sf-brand .sh-mark { display: none; }
.sf-about p { margin-top: 10px; max-width: 34ch; color: var(--ink-2); }
.sf-about .sf-org { margin-top: 4px; color: var(--ink-3); }
.sf-col h2 { margin: 0 0 6px; padding-bottom: 6px; border-bottom: 1px solid var(--rule); font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--ink); }
.sf-col a { color: var(--ink-2); text-decoration: none; }
.sf-col a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.sf-soon { color: var(--ink-3); }
.sf-tag { margin-left: 4px; color: var(--ink-3); white-space: nowrap; }
.sf-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px;
  margin-top: 26px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--ink-3);
}
.sf-bottom a { color: var(--ink-2); }
.sf-top { text-decoration: none; }

/* ------------------------------------------------------------------ helpers the chrome needs */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  padding: 10px 14px; background: var(--ink); color: var(--bg);
  font-weight: 500; text-decoration: none; transition: top .15s;
}
.skip-link:focus { top: 8px; }
