/* The Bitmesh bar on an app's own pages: the studio's logo, the app's name, its guides and
   its store links. Same bar and colours as apps.bitmesh.ai, whatever the page below looks like.
   Self-contained: it does not rely on the page's own stylesheet.
   .bm--over lies over a dark opening scene and turns solid once the page scrolls;
   without it the bar is solid and sticks to the top. */
.bm {
  --bm-ink: #f4f8ff; --bm-ink-2: #a9bbd3; --bm-pale: #ceeafd; --bm-blue: #17a2ff;
  --bm-edge: var(--gut, var(--sc-gutter, clamp(20px, 4vw, 56px)));   /* the page's own gutter, so the logo lines up with the text */
  position: sticky; top: 0; z-index: 40;
  background: #050d1c; box-shadow: 0 1px 0 rgba(206, 234, 253, .12);
  font: 500 15px/1.2 "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.bm--over { position: fixed; inset: 0 0 auto; background: transparent; box-shadow: none; transition: background-color .3s; }
.bm--over.is-solid { background: rgba(5, 13, 28, .82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 1px 0 rgba(206, 234, 253, .12); }
/* the landing page's Contents ribbon hangs from the top right corner: leave it room */
.bm--over .bm__bar { max-width: none; padding-right: calc(clamp(14px, 3.6vw, 52px) + 42px + 18px); }

/* app pages bring their own stylesheets: keep their bare element rules out of the bar */
.bm, .bm * { box-sizing: border-box; }
.bm { margin: 0; padding: 0; border: 0; letter-spacing: normal; text-transform: none; color: var(--bm-ink); }
.bm a { margin: 0; padding: 0; border: 0; background: none; box-shadow: none; text-transform: none; letter-spacing: normal; font: inherit; min-height: 0; }
.bm img { max-width: none; margin: 0; box-shadow: none; }

.bm__bar { display: flex; align-items: center; gap: 18px; height: 68px; padding-inline: var(--bm-edge); max-width: calc(1280px + 2 * var(--bm-edge)); margin-inline: auto; }
.bm a { text-decoration: none; }
.bm a:focus-visible { outline: 2px solid var(--bm-pale); outline-offset: 4px; border-radius: 6px; }
.bm__logo { flex: none; line-height: 0; }
.bm__logo img { height: 34px; width: auto; display: block; }
.bm .bm__app { flex: none; display: inline-flex; align-items: center; gap: 9px; padding-left: 18px; color: var(--bm-ink);
  border-left: 1px solid rgba(206, 234, 253, .2); white-space: nowrap; }
.bm__app img { width: 26px; height: 26px; border-radius: 7px; display: block; }
.bm__links { margin-left: auto; display: flex; align-items: center; gap: clamp(14px, 2vw, 28px); white-space: nowrap; }
.bm .bm__links a { color: var(--bm-ink-2); transition: color .2s, border-color .2s; }
.bm .bm__links a:hover { color: var(--bm-ink); }
.bm .bm__links a[aria-current="page"] { color: var(--bm-ink); }
.bm .bm__links .bm__store { color: var(--bm-ink); padding: 8px 16px; border: 1px solid rgba(206, 234, 253, .25); border-radius: 999px; }
.bm .bm__links .bm__store:hover { border-color: var(--bm-pale); color: var(--bm-pale); }

/* The line under every app page: who makes it and what its AI runs on. */
.bm-by { margin: 0; padding: 14px 20px; background: var(--bm-ground, #050d1c); color: rgba(206, 234, 253, .7); text-align: center;
  font: 500 13px/1.5 "Instrument Sans", system-ui, sans-serif; letter-spacing: normal; text-transform: none; }
.bm-by a { color: #fff; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(206, 234, 253, .45); }
.bm-by a:hover { text-decoration-color: #fff; }
/* the running chapter title some landing pages put in the bar */
.bm__run { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--bm-ink-2); font-size: 14px; font-style: italic; }
.bm__run:empty { display: none; }

@media (max-width: 1180px) { .bm__opt { display: none; } }
@media (max-width: 1060px) {
  /* one store link: the visitor's own */
  .bm__play { display: none; }
  .is-android .bm__play { display: inline-block; }
  .is-android .bm__store:not(.bm__play) { display: none; }
}
@media (max-width: 900px) {
  /* the guides are in the page's footer, and in Contents on the landing page */
  .bm__guide, .bm__run { display: none; }
  .bm__logo img { height: 30px; }
}
@media (max-width: 520px) {
  .bm__bar { gap: 12px; height: 60px; }
  .bm .bm__app { padding-left: 12px; font-size: 14px; }
  .bm .bm__links .bm__store { padding: 8px 12px; font-size: 13px; }
  .bm--over .bm__bar { padding-right: calc(14px + 36px + 10px); }
}
@media (max-width: 400px) { .bm .bm__app { font-size: 0; gap: 0; } }
@media (prefers-reduced-motion: reduce) { .bm, .bm a { transition: none; } }
