/* Shared BC-TH ↔ PAAM brand shell — P-004 */
:root {
  --shell-content: 1320px;
  --shell-pad-xl: 40px;
  --shell-pad-lg: 32px;
  --shell-pad-md: 24px;
  --shell-pad-sm: 18px;
  --shell-text: 700px;
  --shell-text-wide: 760px;
  --shell-form: 700px;
  --shell-gold: #c9a24d;
  --shell-gold-2: #e8d08b;
  --shell-navy: #0c1f33;
  /* Dominant plate from bc-th-color-bg.png (rgb 30,51,68) — consulting chrome only */
  --shell-consulting: #1e3344;
  --shell-paam: #091826;
  --shell-radius-btn: 8px;
  --shell-font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --shell-utility-h: 40px;
  --shell-header-h: 68px;
  --shell-sticky-h: calc(var(--shell-utility-h) + var(--shell-header-h));
  --shell-focus: #e8d08b;
}

.shell-sticky {
  position: sticky;
  top: 0;
  z-index: 200;
}

.shell-wrap {
  width: min(var(--shell-content), calc(100% - (var(--shell-pad-lg) * 2)));
  margin-inline: auto;
}

@media (max-width: 1024px) {
  .shell-wrap {
    width: min(var(--shell-content), calc(100% - (var(--shell-pad-md) * 2)));
  }
}

@media (max-width: 640px) {
  .shell-wrap {
    width: calc(100% - (var(--shell-pad-sm) * 2));
  }
  :root {
    --shell-utility-h: 36px;
    --shell-header-h: 60px;
  }
}

/* —— Utility / brand switch —— */
.brand-utility {
  font-family: var(--shell-font);
  font-size: 12px;
  line-height: 1.3;
  height: var(--shell-utility-h);
  min-height: var(--shell-utility-h);
  max-height: var(--shell-utility-h);
  display: flex;
  align-items: center;
  box-sizing: border-box;
  overflow: hidden;
}

.brand-utility--product {
  background: #071420;
  color: #c5d0da;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-utility--consulting {
  background: var(--shell-consulting);
  color: #c5d0da;
  /* Same chrome as main header — no seam line above the logo */
  border-bottom: none;
}

.brand-utility__inner {
  width: min(var(--shell-content), calc(100% - (var(--shell-pad-lg) * 2)));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  min-height: 0;
  padding-block: 0;
}

@media (max-width: 1024px) {
  .brand-utility__inner {
    width: min(var(--shell-content), calc(100% - (var(--shell-pad-md) * 2)));
  }
}

@media (max-width: 640px) {
  .brand-utility__inner {
    width: calc(100% - (var(--shell-pad-sm) * 2));
    justify-content: center;
  }
}

.brand-switch {
  display: inline-flex;
  align-items: stretch;
  width: auto;
  max-width: max-content;
  flex: 0 1 auto;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

.brand-switch a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  text-decoration: none;
  font-weight: 650;
  font-size: 12px;
  white-space: nowrap;
  color: inherit;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-switch a:last-child {
  border-right: 0;
}

.brand-switch a:focus-visible {
  outline: 2px solid var(--shell-gold);
  outline-offset: -2px;
  z-index: 1;
}

.brand-switch a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.94);
  color: var(--shell-consulting);
  box-shadow: inset 0 0 0 1px rgba(30, 51, 68, 0.18);
}

.brand-utility--product .brand-switch a[aria-current="page"] {
  color: var(--shell-paam);
}

.brand-switch a:not([aria-current="page"]):hover {
  background: rgba(255, 255, 255, 0.1);
}

.brand-switch__ext {
  font-size: 11px;
  opacity: 0.8;
  font-weight: 700;
}

.brand-switch__full {
  display: inline;
}

.brand-switch__short {
  display: none;
}

@media (max-width: 520px) {
  .brand-switch__full {
    display: none;
  }
  .brand-switch__short {
    display: inline;
  }
  .brand-switch a {
    padding: 7px 10px;
  }
}

/* —— Main header chrome (shared structure) —— */
.shell-header {
  font-family: var(--shell-font);
  height: var(--shell-header-h);
  min-height: var(--shell-header-h);
  max-height: var(--shell-header-h);
  display: flex;
  align-items: center;
  box-sizing: border-box;
  overflow: hidden;
}

.shell-header--product {
  background: rgba(9, 24, 38, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #e6edf3;
}

/* BC-TH main header: match bc-th-color-bg.png plate (#1e3344) */
.shell-header--consulting,
.site-header.shell-header--consulting {
  background: var(--shell-consulting);
  backdrop-filter: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #e6edf3;
}

.shell-header__inner {
  width: min(var(--shell-content), calc(100% - (var(--shell-pad-lg) * 2)));
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
  min-height: 0;
  min-width: 0;
}

@media (max-width: 1024px) {
  .shell-header__inner {
    width: min(var(--shell-content), calc(100% - (var(--shell-pad-md) * 2)));
  }
}

@media (max-width: 640px) {
  .shell-header__inner {
    width: calc(100% - (var(--shell-pad-sm) * 2));
  }
}

.shell-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.shell-logo img {
  display: block;
  height: 30px;
  width: auto;
}

/*
 * BC-TH color-bg PNG bakes a pure-black top band (rows 0–11 of 267).
 * Clip that band via overflow on the view box. Use margin (not padding)
 * for vertical breathing room — padding would re-expose the clipped band.
 */
.shell-header--consulting .shell-logo {
  --bc-logo-src-h: 267;
  --bc-logo-clip-top: 12;
  --bc-logo-view-h: 30px;
  box-sizing: content-box;
  overflow: hidden;
  height: var(--bc-logo-view-h);
  padding: 0;
  margin-block: 8px;
  width: auto;
  max-width: min(128px, 40vw);
  align-items: flex-start;
  line-height: 0;
}

.shell-header--consulting .shell-logo img {
  height: calc(
    var(--bc-logo-view-h) * var(--bc-logo-src-h) /
      (var(--bc-logo-src-h) - var(--bc-logo-clip-top))
  );
  width: auto;
  max-width: none;
  margin-top: calc(
    -1 * var(--bc-logo-view-h) * var(--bc-logo-clip-top) /
      (var(--bc-logo-src-h) - var(--bc-logo-clip-top))
  );
  object-fit: contain;
  object-position: left top;
}

@media (max-width: 640px) {
  .shell-header--consulting .shell-logo {
    --bc-logo-view-h: 26px;
    margin-block: 7px;
    max-width: min(112px, 38vw);
  }
}

.shell-nav {
  flex: 1;
  min-width: 0;
}

.shell-nav ul {
  display: flex;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.shell-nav a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 550;
  color: inherit;
  opacity: 0.82;
}

.shell-header--product .shell-nav a {
  color: #cfd8e3;
  opacity: 1;
}

.shell-nav a:hover,
.shell-nav a.is-on {
  opacity: 1;
  color: #fff;
}

.shell-header--consulting .shell-nav a {
  color: #cfd8e3;
  opacity: 1;
}

.shell-header--consulting .shell-nav a:hover,
.shell-header--consulting .shell-nav a.is-on {
  color: #fff;
  opacity: 1;
  box-shadow: inset 0 -2px 0 0 var(--shell-gold);
}

.shell-nav a:focus-visible,
.shell-actions a:focus-visible,
.shell-actions button:focus-visible,
.shell-burger:focus-visible {
  outline: 2px solid var(--shell-focus);
  outline-offset: 3px;
}

.shell-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 1;
  min-width: 0;
}

.shell-lang {
  display: inline-flex;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  overflow: hidden;
}

.shell-header--consulting .shell-lang {
  border-color: rgba(255, 255, 255, 0.18);
  background: transparent;
}

.shell-lang button {
  border: 0;
  background: transparent;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}

.shell-header--product .shell-lang button,
.shell-header--consulting .shell-lang button {
  color: #cfd8e3;
}

.shell-lang button.is-on,
.shell-lang button.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.shell-header--consulting .shell-lang button.is-on,
.shell-header--consulting .shell-lang button.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.shell-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: var(--shell-radius-btn);
  font-weight: 650;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.shell-btn--gold {
  background: linear-gradient(90deg, var(--shell-gold), var(--shell-gold-2));
  color: #141414;
}

.shell-btn--line {
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
  background: transparent;
}

.shell-header--consulting .shell-btn--line {
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.shell-burger {
  display: none;
  margin-left: auto;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: transparent;
  color: inherit;
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 650;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

.shell-header--consulting .shell-burger {
  border-color: rgba(255, 255, 255, 0.22);
  color: #e6edf3;
  background: transparent;
}

@media (max-width: 1100px) {
  .shell-actions .shell-btn--gold.shell-btn--hide-md {
    display: none;
  }
}

@media (max-width: 980px) {
  .shell-burger {
    display: inline-flex;
  }
  /* Keep header compact: primary CTA lives in page/body; avoid h-scroll with burger */
  .shell-actions .shell-btn--gold {
    display: none;
  }
  .shell-nav {
    display: none;
    position: absolute;
    left: var(--shell-pad-md);
    right: var(--shell-pad-md);
    top: calc(100% + 6px);
    background: var(--shell-paam);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 10px;
    z-index: 210;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  }
  .shell-header--consulting + .shell-nav,
  .shell-header--consulting .shell-nav {
    background: var(--shell-consulting);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  }
  .shell-sticky {
    position: sticky;
  }
  .shell-header {
    position: relative;
  }
  .shell-nav.is-open {
    display: block;
  }
  .shell-nav ul {
    flex-direction: column;
    gap: 2px;
  }
  .shell-nav a {
    display: block;
    padding: 10px 8px;
  }
  .shell-actions .shell-btn--line {
    display: none;
  }
}

/* Anchor offset under sticky stack */
.shell-anchor,
section[id],
.band[id],
.page-section[id] {
  scroll-margin-top: calc(var(--shell-sticky-h) + 12px);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
