/* Shared site bar for cad.cameronbuller.com: wordmark on the left, a two-way switch (Candle | Machine) on the right.
   Each page sets --sb-accent (candle: brass, machine: enamel green). Works without JavaScript. */
:root {
  --sb-bg: rgba(246, 247, 249, .82);
  --sb-ink: #1b2130;
  --sb-muted: #5b6477;
  --sb-line: #d4d9e2;
  --sb-track: #e3e6ec;
  --sb-accent: #8f6519;
  --sb-on-accent: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sb-bg: rgba(17, 20, 27, .8);
    --sb-ink: #e5e8ef;
    --sb-muted: #98a1b3;
    --sb-line: #2a3140;
    --sb-track: #1f2531;
    --sb-accent: #d8a64a;
    --sb-on-accent: #16120a;
  }
}
:root[data-theme="dark"] {
  --sb-bg: rgba(17, 20, 27, .8); --sb-ink: #e5e8ef; --sb-muted: #98a1b3; --sb-line: #2a3140; --sb-track: #1f2531; --sb-accent: #d8a64a; --sb-on-accent: #16120a;
}
.sitebar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 8px max(16px, calc((100% - 1160px) / 2));
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
  background: var(--sb-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--sb-line);
  font: 500 14px/1.2 "IBM Plex Sans", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--sb-ink);
  box-sizing: border-box;
}
.sitebar *, .sitebar *::before, .sitebar *::after { box-sizing: border-box; }
.sitebar__mark { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.sitebar__logo { width: 28px; height: 28px; flex: none; border-radius: 7px; display: grid; place-items: center;
  background: var(--sb-ink); color: var(--sb-bg); font: 600 12px/1 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: -.02em; }
.sitebar__name { font-weight: 600; letter-spacing: .01em; white-space: nowrap; }
.sitebar__tag { font: 500 11px/1 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .14em; text-transform: uppercase; color: var(--sb-muted); }
.sitebar__switch { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--sb-track); border: 1px solid var(--sb-line); flex: none; }
.sitebar__switch a {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 16px; border-radius: 999px;
  color: var(--sb-muted); text-decoration: none; font-weight: 600; font-size: 13.5px; letter-spacing: .01em;
  transition: background-color .18s ease, color .18s ease;
}
.sitebar__switch a:hover { color: var(--sb-ink); }
.sitebar__switch a[aria-current="page"] { background: var(--sb-accent); color: var(--sb-on-accent); box-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
.sitebar__switch a:focus-visible, .sitebar__mark:focus-visible { outline: 2px solid var(--sb-accent); outline-offset: 2px; }
.sitebar__switch svg { width: 15px; height: 15px; flex: none; }
/* the candle page keeps its own body padding: pull the bar out to full width */
.sitebar--bleed { margin: -40px -16px 28px; }
body:has(> .sitebar--bleed) { margin: 0; }   /* the candle page keeps the browser's default 8px body margin */
@media (max-width: 560px) {
  .sitebar__name, .sitebar__tag { display: none; }
  .sitebar__switch a { padding: 7px 14px; }
}
@media (prefers-reduced-motion: reduce) { .sitebar__switch a { transition: none; } }
