/* Street Banker public header.
 *
 * Hand-written rather than Tailwind classes: the build is checked in and
 * frozen (tests/test_stylesheet.py fails on any arbitrary value the build
 * has not seen), and this header needs exact values - an 86px bar, a 42px
 * CTA, a 2px radius, a scroll transition under 200ms. Tokens live at the
 * top so nothing downstream repeats a raw hex.
 */

:root {
  --sbh-surface: 13 12 11;          /* var(--sb-ground), no blue cast */
  --sbh-ivory: var(--sb-ink);
  --sbh-ivory-muted: var(--sb-ink-2);
  --sbh-brass: var(--sb-gold);
  --sbh-brass-lit: var(--sb-gold-bright);
  --sbh-ink: var(--sb-surface-2);
  --sbh-height: 86px;
  --sbh-height-mobile: 70px;
  --sbh-max: 1480px;
  --sbh-pad: 32px;
}
/* Space the page keeps for the bar, so nothing jumps when it sticks. */
.sbh-shell { --sbh-current: var(--sbh-height-mobile); }
@media (min-width: 1024px) { .sbh-shell { --sbh-current: var(--sbh-height); } }

.sbh {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--sbh-height-mobile);
  background: rgb(var(--sbh-surface) / 0.88);
  border-bottom: 1px solid rgb(242 238 230 / 0.10);
  transition: background-color 160ms ease, backdrop-filter 160ms ease,
              border-color 160ms ease;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
@media (min-width: 1024px) { .sbh { height: var(--sbh-height); } }

/* After ~24px of scroll: denser surface, restrained blur. Not frosted. */
.sbh[data-scrolled="true"] {
  background: rgb(var(--sbh-surface) / 0.97);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom-color: rgb(242 238 230 / 0.14);
}

.sbh-inner {
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
  max-width: var(--sbh-max);
  padding: 0 20px;
}
@media (min-width: 1024px) { .sbh-inner { padding: 0 24px; } }
@media (min-width: 1180px) { .sbh-inner { padding: 0 var(--sbh-pad); } }

/* --- brand lockup ------------------------------------------------------- */
.sbh-brand { display: flex; align-items: center; gap: 14px; text-decoration: none; flex: 0 0 auto; }
/* flex: 0 0 auto so the lockup is never squeezed by a long CTA - a
   compressed wordmark is the one thing a brand lockup must never do. */
.sbh-logo { width: 148px; height: auto; display: block; flex: 0 0 auto; }
@media (min-width: 1024px) { .sbh-logo { width: 170px; } }
@media (min-width: 1180px) { .sbh-logo { width: 195px; } }

.sbh-rule {
  width: 1px;
  height: 30px;
  background: rgb(242 238 230 / 0.18);
  display: none;
}
.sbh-descriptor {
  display: none;
  font-size: 12px;
  line-height: 1.45;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sbh-ivory-muted);
  font-weight: 600;
}
@media (min-width: 1280px) {
  .sbh-rule, .sbh-descriptor { display: block; }
}

/* --- navigation --------------------------------------------------------- */
.sbh-nav { display: none; align-items: center; gap: 22px; margin: 0 auto; }
@media (min-width: 1024px) { .sbh-nav { display: flex; } }
@media (min-width: 1180px) { .sbh-nav { gap: 30px; } }

.sbh-link {
  position: relative;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--sbh-ivory-muted);
  text-decoration: none;
  padding: 8px 0;
  transition: color 140ms ease;
  white-space: nowrap;
}
.sbh-link:hover { color: var(--sbh-ivory); }
.sbh-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1.5px;
  background: var(--sbh-brass);
  transform: scaleX(0);
  transition: transform 140ms ease;
}
.sbh-link[aria-current="true"] { color: var(--sbh-ivory); }
.sbh-link[aria-current="true"]::after { transform: scaleX(1); }

/* --- right cluster ------------------------------------------------------ */
.sbh-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
@media (min-width: 1024px) { .sbh-right { gap: 22px; margin-left: 0; } }

.sbh-login {
  display: none;
  font-size: 12px;
  font-weight: 500;
  color: var(--sbh-ivory-muted);
  text-decoration: none;
  padding: 10px 2px;
  transition: color 140ms ease;
}
.sbh-login:hover { color: var(--sbh-ivory); }
@media (min-width: 1024px) { .sbh-login { display: inline-block; } }

.sbh-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--sb-r-control);
  background: var(--sbh-brass);
  color: var(--sbh-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 140ms ease;
}
.sbh-cta:hover { background: var(--sbh-brass-lit); }
/* "RUN A FREE CATALOG SWEEP" does not fit a phone beside a logo and a
   menu button, and it does not fit a 1024px laptop beside five nav items
   either: brand 195 + nav 480 + cluster 267 is wider than the viewport.
   Below 1180px the button carries the short name of the same action -
   not a different, vaguer one - and the row fits without squeezing. */
.sbh-cta-full { display: none; }
.sbh-cta-short { display: inline; }
@media (min-width: 1180px) {
  .sbh-cta-full { display: inline; }
  .sbh-cta-short { display: none; }
}
@media (min-width: 1024px) { .sbh-cta { height: 42px; padding: 0 22px; } }

.sbh-burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border: 1px solid rgb(242 238 230 / 0.18);
  border-radius: var(--sb-r-control);
  background: transparent;
  color: var(--sbh-ivory);
  cursor: pointer;
}
@media (min-width: 1024px) { .sbh-burger { display: none; } }

/* --- focus: replaced, never removed ------------------------------------- */
.sbh a:focus-visible,
.sbh button:focus-visible,
.sbh-drawer a:focus-visible,
.sbh-drawer button:focus-visible,
.sbh-skip:focus {
  outline: 2px solid var(--sbh-brass);
  outline-offset: 3px;
  border-radius: var(--sb-r-control);
}

.sbh-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 80;
  background: var(--sbh-ink);
  color: var(--sbh-ivory);
  padding: 12px 18px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.sbh-skip:focus { left: 12px; top: 12px; }

/* --- mobile drawer ------------------------------------------------------ */
.sbh-drawer[hidden] { display: none; }
.sbh-drawer {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  justify-content: flex-end;
  background: rgb(6 6 5 / 0.6);
}
.sbh-panel {
  width: min(360px, 88vw);
  height: 100%;
  overflow-y: auto;
  background: rgb(var(--sbh-surface) / 0.99);
  border-left: 1px solid rgb(242 238 230 / 0.12);
  padding: 18px 20px calc(28px + env(safe-area-inset-bottom));
  padding-right: calc(20px + env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: sbh-slide 180ms ease-out;
}
@keyframes sbh-slide { from { transform: translateX(14px); opacity: 0.4; } }

.sbh-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgb(242 238 230 / 0.10);
}
.sbh-close {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgb(242 238 230 / 0.18);
  border-radius: var(--sb-r-control);
  background: transparent;
  color: var(--sbh-ivory);
  cursor: pointer;
}
.sbh-drawer-link {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 4px 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--sbh-ivory);
  text-decoration: none;
  border-bottom: 1px solid rgb(242 238 230 / 0.06);
}
.sbh-drawer-link:hover { color: var(--sbh-brass-lit); }
.sbh-drawer-cta {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: var(--sb-r-control);
  background: var(--sbh-brass);
  color: var(--sbh-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
}

body.sbh-locked { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .sbh, .sbh-link, .sbh-link::after, .sbh-cta, .sbh-login { transition: none; }
  .sbh-panel { animation: none; }
  html { scroll-behavior: auto; }
}
