/* The top bar and the footer every page shares (api/hosts.py builds them), and the front page's scene. */

/* ---- top bar ---- */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: var(--s8); height: 48px;
  padding: 0 max(var(--s6), calc((100% - var(--page)) / 2 + var(--s6))); background: var(--bg); border-bottom: 1px solid var(--line); font-size: var(--fs-13); line-height: var(--lh-ui); }
.top .brand { font: 600 var(--fs-16) var(--mono); color: var(--text); letter-spacing: -.02em; }
.top .brand:hover { text-decoration: none; }
#nav { display: flex; gap: var(--s6); align-self: stretch; }
#nav a { display: flex; align-items: center; gap: var(--s1); color: var(--muted); font-size: var(--fs-14);
  border-bottom: 1px solid transparent; margin-bottom: -1px; transition: color var(--fast); }
#nav a:hover { color: var(--text); text-decoration: none; }
#nav a.on { color: var(--text); border-bottom-color: var(--text); }
/* the board's own views (only on app.): a two-way switch next to "Board" */
.views { display: inline-flex; border: 1px solid var(--line-strong); margin-left: calc(-1 * var(--s4)); }
.views a { display: flex; align-items: center; height: 28px; padding: 0 var(--s3); color: var(--text-2); font-size: var(--fs-13); }
.views a + a { border-left: 1px solid var(--line-strong); }
.views a:hover { color: var(--text); text-decoration: none; }
.views a.on { background: var(--text); color: var(--bg); }
.views .lock { display: inline-flex; margin-left: 4px; opacity: .7; }
.top .controls { margin-left: auto; display: flex; align-items: center; gap: var(--s2); }
.top .prefs { display: flex; align-items: center; gap: var(--s2); }
.top .menu-only, .top .menu-btn, .top .prefs .lbl { display: none; }
.top .btn { display: inline-flex; align-items: center; height: 30px; font-size: var(--fs-13); text-decoration: none; color: var(--text); }
.top .btn.primary { color: var(--bg); }
.acct { display: flex; align-items: center; gap: var(--s4); margin-left: var(--s2); }
.signin { color: var(--text-2); font-size: var(--fs-14); }
.signin:hover { color: var(--text); text-decoration: none; }
.who { display: inline-flex; align-items: center; gap: var(--s2); height: 30px; padding: 0 var(--s3); color: var(--text-2);
  border: 1px solid var(--line-strong); font-size: var(--fs-13); }
.who:hover { color: var(--text); text-decoration: none; border-color: var(--muted); }
.who .plan-tag { font-size: var(--fs-11); line-height: 16px; padding: 0 6px; color: var(--blue);
  background: color-mix(in srgb, var(--blue) 12%, transparent); }
.who .plan-tag.free { color: var(--text-2); background: var(--bg-2); }

@media (max-width: 900px) { .top { gap: var(--s4); padding: 0 var(--s4); } }
@media (max-width: 700px) {
  .top { gap: var(--s3); padding: 0 var(--s3); }
  #nav { gap: var(--s4); }
  #nav .ext, .top .get-key { display: none; }
  .top.on-app #nav { display: none; }     /* on the board, the views switch takes the room; Docs, Pricing: the menu */
  .views { margin-left: 0; }
  .top .menu-btn { display: inline-flex; }
  .top .prefs { display: none; position: fixed; top: 52px; right: var(--s2); z-index: 60; flex-direction: column; align-items: stretch;
    gap: var(--s2); padding: var(--s3); background: var(--bg); border: 1px solid var(--line-strong); box-shadow: var(--shadow); min-width: 200px; }
  .top .prefs.open { display: flex; }
  .top .prefs .icon-btn { width: 100%; justify-content: flex-start; gap: var(--s2); padding: 0 var(--s2); color: var(--text-2); }
  .top .prefs .lbl { display: inline; font-size: var(--fs-12); }
  .top .menu-only { display: flex; flex-direction: column; border-top: 1px solid var(--line); padding-top: var(--s2); }
  .top .menu-only a { padding: 6px var(--s2); color: var(--text-2); font-size: var(--fs-14); }
  .who { padding: 0 var(--s2); font-size: var(--fs-12); }
  .acct { margin-left: 0; }
}

/* ---- footer ---- */
/* the footer stays at the bottom of the window on short pages: the page is a column, the footer takes the slack */
body:has(> .gfoot) { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body:has(> .gfoot) > :not(.top, .gfoot, dialog, script) { width: 100%; box-sizing: border-box; flex: none; }
.gfoot { border-top: 1px solid var(--line); margin-top: auto; font-size: var(--fs-12); color: var(--text-2); }
.gfoot-in { display: flex; align-items: baseline; gap: var(--s6); flex-wrap: wrap; max-width: var(--page); margin: 0 auto;
  padding: var(--s6); box-sizing: border-box; }
body:has(> .gfoot) > :nth-last-child(2 of :not(script, dialog)) { margin-bottom: var(--s16); }
.gfoot .brand { font: 600 var(--fs-14) var(--mono); color: var(--text); }
.gfoot nav { display: flex; gap: var(--s4); flex-wrap: wrap; }
.gfoot nav a { color: var(--text-2); }
.gfoot .tag { margin-left: auto; color: var(--muted); }
@media (max-width: 640px) { .gfoot-in { flex-direction: column; gap: var(--s3); padding: var(--s4); } .gfoot .tag { margin-left: 0; } }

/* ---- the front page's pixel wordmark (web/assets/scene.svg, tools/make_scene.py): strengths of the text colour ---- */
.scene-wrap { max-width: calc(var(--prose) + 2 * var(--s6)); margin: calc(var(--s16) + var(--s4)) auto 0; padding: 0 var(--s6) var(--s6); }
.scenes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s6); max-width: 360px; margin: 0 auto; }
.scenes figure { margin: 0; }
.scenes figcaption { margin-top: var(--s2); font-size: var(--fs-12); color: var(--muted); text-align: center; }
.scene { display: block; width: 100%; height: auto; }
.scene :is(.p, .g, .s, .l) { fill: var(--text); }
.scene .g { fill-opacity: .7; }
.scene .s { fill-opacity: .4; }
.scene .l { fill-opacity: .18; }
.scene .m { fill: var(--bg); }
body:has(> .gfoot) > .scene-wrap:not(#_) { margin-bottom: 0; }   /* :not(#_): beats the gap-before-footer rule above */
@media (max-width: 640px) { .scene-wrap { padding: 0 var(--s4) var(--s4); margin-top: calc(var(--s12) + var(--s2)); } }
