/* ============================================================================
   FOREFITTER — global suite bar (shared across the hub, Ball Lab, Shaft Lab)

   One consistent brand + cross-navigation strip on every site. Colours and type
   come from forefitter-tokens.css, which every bay loads first — the literals
   below are only the fallback for the (shouldn't-happen) case where the token
   sheet 404s, so the bar never renders as unstyled text.

   Served at /shared/forefitter-bar.css. The markup is mirrored inline in each
   site (hub index.html, shaftology index.html, and the two Next layout.tsx
   files); only the `data-ff-active` value differs. Keep the copies in sync with
   `node sync-shared.mjs`.
   ========================================================================== */

.ff-bar {
  --ff-h: 48px;
  --ff-bg: var(--bg-2, #0b0f0d);
  --ff-line: var(--line, rgba(216, 255, 62, 0.14));
  --ff-ink: var(--ink, #eaf0ea);
  --ff-dim: var(--ink-dim, #8b9a90);
  --ff-volt: var(--volt, #d8ff3e);
  --ff-active: var(--volt-soft, rgba(216, 255, 62, 0.12));

  position: sticky;
  top: 0;
  z-index: var(--z-bar, 300);
  height: var(--ff-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 clamp(14px, 4vw, 32px);
  background: var(--ff-bg);
  border-bottom: 1px solid var(--ff-line);
  font-family: var(--mono, 'JetBrains Mono', ui-monospace, monospace);
  -webkit-font-smoothing: antialiased;
}
:root[data-theme="light"] .ff-bar {
  --ff-bg: var(--panel, #ffffff);
}
.ff-bar * { box-sizing: border-box; }

/* ---- brand → hub ---- */
.ff-bar__brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; flex: none; }
.ff-bar__mark { display: block; }
/* official ForeFitter emblem — monochrome, mirrors the brand's white/navy usage */
.ff-bar__mark path, .ff-bar__mark polygon { fill: var(--ff-ink); }
/* wordmark = the logo's own lettering (vector), so it matches the brand exactly */
.ff-bar__word { display: block; height: 15px; width: auto; }
.ff-bar__word .wm-fore path { fill: var(--ff-ink); }
.ff-bar__word .wm-fitter path { fill: var(--ff-volt); }

/* ---- app switcher (the cross-navigation) ---- */
.ff-bar__switch {
  display: flex; align-items: center; gap: 3px;
  margin: 0 auto 0 4px; padding: 3px;
  border: 1px solid var(--ff-line); border-radius: 999px;
}
.ff-bar__switch a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ff-dim); text-decoration: none; white-space: nowrap;
  transition: color 0.18s ease, background 0.18s ease;
}
.ff-bar__switch a::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: 0.4; flex: none; transition: opacity 0.18s, box-shadow 0.18s;
}
.ff-bar__switch a:hover { color: var(--ff-ink); }

/* active tab — driven by data-ff-active on the container */
.ff-bar[data-ff-active="overview"] a[data-ff="overview"],
.ff-bar[data-ff-active="ball"]     a[data-ff="ball"],
.ff-bar[data-ff-active="shaft"]    a[data-ff="shaft"],
.ff-bar[data-ff-active="coach"]    a[data-ff="coach"],
.ff-bar[data-ff-active="course"]   a[data-ff="course"] {
  color: var(--ff-volt); background: var(--ff-active);
}
.ff-bar[data-ff-active="overview"] a[data-ff="overview"]::before,
.ff-bar[data-ff-active="ball"]     a[data-ff="ball"]::before,
.ff-bar[data-ff-active="shaft"]    a[data-ff="shaft"]::before,
.ff-bar[data-ff-active="coach"]    a[data-ff="coach"]::before,
.ff-bar[data-ff-active="course"]   a[data-ff="course"]::before {
  opacity: 1; box-shadow: 0 0 8px var(--ff-volt);
}

/* ---- theme toggle ---- */
.ff-bar__theme {
  margin-left: auto; flex: none;
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--ff-line); border-radius: 999px; background: transparent;
  color: var(--ff-dim); cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.ff-bar__theme:hover { color: var(--ff-volt); border-color: var(--ff-volt); transform: rotate(-18deg); }
.ff-bar__theme svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ff-bar__theme .ff-moon { fill: currentColor; stroke: none; }
:root[data-theme="dark"]  .ff-bar__theme .ff-sun  { display: none; }
:root[data-theme="light"] .ff-bar__theme .ff-moon { display: none; }

/* ---- responsive ----
   With four bays the switcher no longer fits a phone, so below 620px it becomes
   a horizontally scrollable strip rather than forcing the whole page wide. The
   brand and the theme toggle stay pinned either side of it. */
@media (max-width: 620px) {
  .ff-bar { gap: 10px; padding: 0 12px; }
  .ff-bar__word { display: none; }
  .ff-bar__switch {
    margin-left: 0; gap: 2px; padding: 2px;
    min-width: 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .ff-bar__switch::-webkit-scrollbar { display: none; }
  .ff-bar__switch a { padding: 6px 10px; font-size: 0.64rem; letter-spacing: 0.02em; gap: 5px; }
  .ff-bar__switch a::before { width: 5px; height: 5px; }
}
@media (max-width: 380px) {
  .ff-bar__switch a::before { display: none; }
  .ff-bar__switch a { padding: 6px 8px; }
}
