/* The one crew bar every /team page wears (2026-09-24). Markup contract lives
   in specs/projects/crew-site/CREW-BAR.md. Pages set body[data-who="hub|sophie|wren|sloane"]. */
:root { --crew-bar-h: 64px; }
.crew-bar {
  position: fixed; inset: 0 0 auto 0; z-index: 80;
  height: var(--crew-bar-h);
  display: flex; align-items: center; gap: clamp(0.75rem, 2vw, 1.75rem);
  padding-inline: clamp(16px, 3.2vw, 40px);
  background: color-mix(in oklab, var(--sw-bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--sw-border);
  font-family: var(--sw-font-sans);
}
.crew-bar__mark { flex: none; font-weight: 800; font-size: 1.22rem; letter-spacing: -0.03em; color: var(--sw-ink); text-decoration: none; }
.crew-bar__mark span { color: var(--sw-coral); }
/* the menu: one tray of tabs; the page you're on is the filled tab, tinted with its coworker's colour */
.crew-bar__nav {
  display: flex; gap: 2px; margin-inline: auto; padding: 4px;
  background: var(--sw-surface); border: 1px solid var(--sw-border); border-radius: 999px;
}
.crew-bar__nav a {
  display: inline-flex; align-items: center; gap: 0.5em; padding: 7px 14px 7px 11px; border-radius: 999px;
  color: var(--sw-ink-muted); text-decoration: none; font-weight: 600; font-size: 0.95rem; white-space: nowrap;
  border: 1px solid transparent;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}
.crew-bar__nav a:hover { color: var(--sw-ink); background: var(--sw-surface-hover); }
.crew-bar__nav a[aria-current="page"] {
  color: var(--sw-ink);
  background: var(--sw-surface-hover);
  border-color: color-mix(in oklab, var(--who-ink) 32%, transparent);
}
.crew-bar__nav a[data-who="sophie"] { --who-ink: var(--sophie-ink); }
.crew-bar__nav a[data-who="wren"] { --who-ink: var(--wren-ink); }
.crew-bar__nav a[data-who="sloane"] { --who-ink: var(--sloane-ink); }
.crew-bar__mk {
  width: 18px; height: 18px; flex: none; background: var(--who-ink);
  -webkit-mask: var(--mk) center / contain no-repeat; mask: var(--mk) center / contain no-repeat;
}
/* name first and strong, the job after it and quieter */
.crew-bar__name { order: 1; color: inherit; }
.crew-bar__role { order: 2; font-weight: 500; color: var(--sw-ink-quiet); }
.crew-bar__sep { display: none; }
/* 2026-09-25: the client-side mirror of "For professionals" on swishwork.com */
.crew-bar__alt { flex: none; color: var(--sw-ink-muted); font-weight: 500; font-size: 0.95rem; text-decoration: none; white-space: nowrap; }
.crew-bar__alt:hover { color: var(--sw-ink); }
/* 2026-09-26: Sign in, a step stronger than For clients (mirrors the client header's crew-bar__signin) */
.crew-bar__signin { flex: none; color: var(--sw-ink); font-weight: 600; font-size: 0.95rem; text-decoration: none; white-space: nowrap; }
.crew-bar__signin:hover { color: var(--sw-ink-muted); }
.crew-bar__theme {
  flex: none; width: 38px; height: 38px; border-radius: 999px; display: grid; place-items: center;
  background: transparent; border: 1px solid var(--sw-border-strong); color: var(--sw-ink); cursor: pointer;
}
.crew-bar__theme:hover { background: var(--sw-surface-hover); }
.crew-bar__theme svg { width: 18px; height: 18px; }
.crew-bar__theme .i-sun { display: none; }
:root[data-theme="dark"] .crew-bar__theme .i-sun { display: block; }
:root[data-theme="dark"] .crew-bar__theme .i-moon { display: none; }
.crew-bar__cta {
  flex: none; display: inline-flex; align-items: center; height: 40px; padding-inline: 18px; border-radius: 999px;
  background: var(--sw-coral); color: #fff; font-weight: 700; font-size: 0.95rem; text-decoration: none;
  transition: background 160ms ease;
}
:root[data-theme="dark"] .crew-bar__cta { color: #0C0B0A; }
.crew-bar__cta:hover { background: var(--sw-coral-hover); }
.crew-bar a:focus-visible, .crew-bar button:focus-visible { outline: 2px solid var(--sw-coral); outline-offset: 3px; }

/* 2026-09-26: the menu button only shows at <=900px, where it replaces the tray, links and switch */
.crew-bar__menu {
  flex: none; width: 40px; height: 40px; border-radius: 999px; display: none; place-items: center;
  background: transparent; border: 1px solid var(--sw-border-strong); color: var(--sw-ink); cursor: pointer; padding: 0;
}
.crew-bar__menu:hover { background: var(--sw-surface-hover); }
.crew-bar__menu svg { width: 20px; height: 20px; overflow: visible; }
.crew-bar__menu path { transform-box: fill-box; transform-origin: center; transition: transform 200ms ease; }
.crew-bar__menu[aria-expanded="true"] .l1 { transform: translateY(4px) rotate(45deg); }
.crew-bar__menu[aria-expanded="true"] .l2 { transform: translateY(-4px) rotate(-45deg); }

/* 2026-09-26: the crew sheet (built by crew-bar.js from the tray) drops from under the bar */
.crew-scrim {
  position: fixed; inset: var(--crew-bar-h) 0 0 0; z-index: 79;
  background: color-mix(in oklab, var(--sw-ink) 28%, transparent);
  opacity: 0; transition: opacity 200ms ease;
}
.crew-sheet {
  position: fixed; top: var(--crew-bar-h); left: 0; right: 0; z-index: 81;
  max-height: calc(100dvh - var(--crew-bar-h)); overflow-y: auto; overscroll-behavior: contain;
  background: var(--sw-bg); border-bottom: 1px solid var(--sw-border);
  box-shadow: 0 18px 40px -18px color-mix(in oklab, var(--sw-ink) 35%, transparent);
  padding: 12px clamp(16px, 3.2vw, 40px) calc(16px + env(safe-area-inset-bottom, 0px));
  font-family: var(--sw-font-sans);
  opacity: 0; transform: translateY(-8px); transition: opacity 200ms ease, transform 200ms ease;
}
.crew-sheet.is-open, .crew-scrim.is-open { opacity: 1; transform: none; }
.crew-sheet[hidden], .crew-scrim[hidden] { display: none; }
.crew-sheet__crew { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.crew-sheet__who {
  display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 14px; border-radius: 16px;
  color: var(--sw-ink); text-decoration: none; border: 1px solid transparent;
}
.crew-sheet__who:hover { background: var(--sw-surface-hover); }
.crew-sheet__who[aria-current="page"] { background: var(--sw-surface-hover); border-color: color-mix(in oklab, var(--who-ink) 32%, transparent); }
.crew-sheet__who[data-who="sophie"] { --who-ink: var(--sophie-ink); }
.crew-sheet__who[data-who="wren"] { --who-ink: var(--wren-ink); }
.crew-sheet__who[data-who="sloane"] { --who-ink: var(--sloane-ink); }
.crew-sheet__chip {
  flex: none; width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center;
  background: var(--sw-surface); border: 1px solid var(--sw-border);
}
.crew-sheet__chip .crew-bar__mk { width: 24px; height: 24px; }
.crew-sheet__txt { display: grid; gap: 2px; min-width: 0; flex: 1 1 auto; }
.crew-sheet__name { font-weight: 700; font-size: 1.1rem; letter-spacing: -0.01em; }
.crew-sheet__role { font-weight: 500; font-size: 0.92rem; color: var(--sw-ink-quiet); }
.crew-sheet__here { flex: none; font-size: 0.8rem; font-weight: 600; color: var(--who-ink); }
.crew-sheet__links { margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid var(--sw-border); display: grid; }
.crew-sheet__link, .crew-sheet__toggle {
  display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 14px; border-radius: 12px;
  color: var(--sw-ink); font: inherit; font-weight: 600; font-size: 1rem; text-decoration: none;
  background: transparent; border: 0; width: 100%; text-align: left; cursor: pointer;
}
.crew-sheet__link--quiet { color: var(--sw-ink-muted); font-weight: 500; }
.crew-sheet__link:hover, .crew-sheet__toggle:hover { background: var(--sw-surface-hover); }
.crew-sheet__track {
  flex: none; position: relative; width: 44px; height: 26px; border-radius: 999px;
  background: var(--sw-border-strong); transition: background-color 160ms ease;
}
.crew-sheet__track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 999px;
  background: var(--sw-surface); box-shadow: 0 1px 2px color-mix(in oklab, var(--sw-ink) 25%, transparent); transition: transform 160ms ease;
}
.crew-sheet__toggle[aria-checked="true"] .crew-sheet__track { background: var(--sw-ink); }
.crew-sheet__toggle[aria-checked="true"] .crew-sheet__track::after { transform: translateX(18px); }
.crew-sheet a:focus-visible, .crew-sheet button:focus-visible { outline: 2px solid var(--sw-coral); outline-offset: -2px; }
:root.crew-sheet-lock, :root.crew-sheet-lock body { overflow: hidden; }

/* narrow (<=900px): the tray, links and switch move into the sheet; the bar is mark, Start, menu */
@media (max-width: 900px) {
  .crew-bar__nav, .crew-bar__alt, .crew-bar__signin, .crew-bar__theme { display: none; }
  .crew-bar__cta { margin-left: auto; }
  .crew-bar__menu { display: grid; }
}
/* 2026-09-26: 901-1180px keeps the tray but drops the roles, so Sign in fits beside it */
@media (min-width: 901px) and (max-width: 1180px) { .crew-bar__role { display: none; } .crew-bar__nav a { padding-inline: 11px 13px; } }
@media (min-width: 901px) { .crew-sheet, .crew-scrim { display: none !important; } }
@media (max-width: 560px) {
  :root { --crew-bar-h: 56px; }
  .crew-bar { gap: 0.6rem; }
  .crew-bar__mark { font-size: 1.1rem; }
  .crew-bar__cta { height: 38px; padding-inline: 15px; font-size: 0.9rem; }
  .crew-bar__menu { width: 38px; height: 38px; }
}
/* small phones: room for the longest CTA ("Start with all three") */
@media (max-width: 360px) {
  .crew-bar { gap: 0.45rem; padding-inline: 14px; }
  .crew-bar__mark { font-size: 1.02rem; }
  .crew-bar__cta { padding-inline: 12px; font-size: 0.84rem; }
}
@media (prefers-reduced-motion: reduce) {
  .crew-sheet, .crew-scrim, .crew-bar__menu path, .crew-sheet__track, .crew-sheet__track::after { transition: none; }
  .crew-sheet { transform: none; }
}
