/* BT header component, ported 1:1 from the Next.js sample (Tailwind + motion). Everything is scoped to .bth */

.bth {
  --bth-paper: #f3f5f7;
  --bth-ink: #0a1b33;
  --bth-brand: #00428a;
  --bth-sky: #90caf9;
  --bth-line: #d5dce4;
  --bth-night: #071426;
  --bth-ease: cubic-bezier(0.65, 0.01, 0.05, 0.99);
  /* motion springs sampled as CSS linear(): stiffness 260 / damping 14 and 500 / 25 */
  --bth-spring-shape: linear(0, 0.06, 0.2108, 0.4104, 0.6227, 0.8201, 0.9842, 1.1053, 1.1814, 1.216, 1.2166, 1.1924, 1.1528, 1.1066, 1.0609, 1.0207, 0.9891, 0.9674, 0.9553, 0.9516, 0.9544, 0.9617, 0.9713, 0.9816, 0.9912, 0.9991, 1.005, 1.0087, 1.0104, 1.0105, 1.0093, 1.0074, 1.0052, 1.003, 1.001, 0.9995, 0.9984, 0.9978, 0.9977, 0.9978, 1);
  --bth-spring-btn: linear(0, 0.0275, 0.0996, 0.2017, 0.3213, 0.4479, 0.5731, 0.6906, 0.7962, 0.8871, 0.9621, 1.0211, 1.0648, 1.0945, 1.1122, 1.1196, 1.119, 1.1123, 1.1013, 1.0876, 1.0726, 1.0574, 1.0428, 1.0294, 1.0178, 1.008, 1.0001, 0.9941, 0.9899, 0.9872, 0.9858, 0.9856, 0.9861, 0.9872, 0.9888, 0.9905, 0.9924, 0.9942, 0.9958, 0.9973, 1);
  --bth-display: "Bricolage Grotesque", system-ui, sans-serif;
  --bth-sans: "Instrument Sans", system-ui, sans-serif;
  --bth-mono: "JetBrains Mono", ui-monospace, monospace;
  /* Header height, used to offset the menu content */
  --header-h: 69px;

  position: sticky;
  top: 0;
  z-index: 50;
  font-family: var(--bth-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--bth-ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Local reset so theme/Bootstrap globals don't leak in */
:where(.bth) *,
:where(.bth) *::before,
:where(.bth) *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0 solid;
}
:where(.bth) ul {
  list-style: none;
}
/* Not :where() here: Bootstrap's a { color: #007bff } and a:hover would otherwise win */
.bth a,
.bth a:hover,
.bth a:focus {
  color: inherit;
  text-decoration: none;
}
/* Theme sets .page-template-homepage a { font-family: "Source Sans 3" }; links keep the header's fonts.
   Own rule (0,1,2) so per-link colour rules below keep working */
body .bth a {
  font-family: inherit;
}
:where(.bth) img,
:where(.bth) svg {
  display: block;
  vertical-align: middle;
  max-width: none;
}
:where(.bth) button {
  font: inherit;
  color: inherit;
  background: transparent;
  cursor: pointer;
}
/* Drop Bootstrap's button:focus ring on mouse click; keyboard focus keeps the ring below */
.bth :focus:not(:focus-visible) {
  outline: none;
}
.bth :focus-visible {
  outline: 2px solid var(--bth-brand);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Utility bar ---------- */
.bth-util {
  position: relative;
  z-index: 20;
  display: none;
  background: var(--bth-night);
  color: rgb(255 255 255 / 0.8);
}
.bth-util__inner {
  max-width: 80rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2rem;
  padding: 0.5rem 1.5rem;
  font-family: var(--bth-mono);
  font-size: 0.75rem;
  line-height: 1rem;
}
.bth-util a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.bth-util a:hover {
  color: #fff;
}
.bth-util svg {
  color: var(--bth-sky);
}

/* ---------- Main bar ---------- */
.bth-bar {
  position: relative;
  z-index: 20;
  border-bottom: 1px solid transparent;
  background: var(--bth-paper);
  transition: color 0.3s, background-color 0.3s, border-color 0.3s;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
.bth.is-scrolled .bth-bar {
  border-color: var(--bth-line);
  background: rgb(243 245 247 / 0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.bth-bar__inner {
  position: static;
  max-width: 80rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  /* Slim vertical padding so the bigger logo keeps the bar at its original height (69px / 73px) */
  padding: 0.25rem 1rem;
}
.bth-logo {
  flex-shrink: 0;
}
.bth-logo img {
  height: 60px;
  width: auto;
}
.bth-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bth a.bth-hire {
  display: none;
  align-items: center;
  gap: 0.5rem;
  border-radius: 9999px;
  background: var(--bth-brand);
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: #fff;
  transition: transform 440ms var(--bth-spring-btn);
}
.bth a.bth-hire:hover {
  color: #fff;
  transform: scale(1.03);
}
.bth a.bth-hire:active {
  transform: scale(0.97);
}

/* Menu / Close button */
.bth-menu-btn {
  display: flex;
  height: 2.75rem;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--bth-line);
  border-radius: 9999px;
  background: #fff;
  padding: 0 0.375rem 0 1.25rem;
  color: var(--bth-ink);
}
.bth-menu-btn__text {
  position: relative;
  height: 1.25rem;
  overflow: hidden;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}
.bth-menu-btn__stack {
  display: block;
  transition: transform 0.7s var(--bth-ease);
}
.bth-menu-btn__stack > span {
  display: block;
  height: 1.25rem;
  line-height: 1.25rem;
}
.bth-menu-btn__icon {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background: var(--bth-ink);
  color: #fff;
}
.bth-menu-btn__icon svg {
  transition: transform 0.7s var(--bth-ease);
}
.bth.is-menu-open .bth-menu-btn__stack {
  transform: translateY(-50%);
}
.bth.is-menu-open .bth-menu-btn__icon svg {
  transform: rotate(315deg);
}

/* ---------- Kinetic menu ---------- */
.bth-menu {
  position: fixed;
  inset: 0;
  z-index: 10;
}
.bth-menu[hidden] {
  display: none;
}
.bth-menu__overlay {
  position: absolute;
  inset: 0;
  background: rgb(7 20 38 / 0.4);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.7s var(--bth-ease);
}
.bth-menu.is-open .bth-menu__overlay {
  opacity: 1;
}
.bth-menu.is-closing .bth-menu__overlay {
  opacity: 0;
}

.bth-menu__panel {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
  transition: transform 0.7s var(--bth-ease);
}
.bth-menu.is-closing .bth-menu__panel {
  transform: translateX(120%);
}

.bth-menu__layer {
  position: absolute;
  inset: 0;
  transform: translateX(101%);
  transition: transform 0.575s var(--bth-ease) var(--d);
}
.bth-menu.is-open .bth-menu__layer {
  transform: translateX(0);
}

.bth-menu__grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgb(144 202 249 / 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(144 202 249 / 0.08) 1px, transparent 1px);
  background-size: 48px 48px;
}

.bth-menu__shapes {
  position: absolute;
  right: -4rem;
  bottom: 0;
  width: min(90vw, 520px);
  height: min(90vw, 520px);
  pointer-events: none;
}
.bth-shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.bth-shape g {
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
  transform: scale(0.5) rotate(-10deg);
  transition: transform 910ms var(--bth-spring-shape), opacity 910ms var(--bth-spring-shape);
  transition-delay: var(--d);
}
.bth-shape.is-in g {
  opacity: 1;
  transform: none;
}
.bth-shape.is-out g {
  opacity: 0;
  transform: scale(0.8);
  transition: transform 0.3s cubic-bezier(0.42, 0, 1, 1), opacity 0.3s cubic-bezier(0.42, 0, 1, 1);
}

.bth-menu__content {
  position: relative;
  display: flex;
  height: 100%;
  flex-direction: column;
  overflow-y: auto;
  padding: calc(var(--header-h) + 2rem) 1.5rem 2rem;
}

.bth-link {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  overflow: hidden;
  border-bottom: 1px solid rgb(255 255 255 / 0.1);
  padding: 0.625rem 0;
}
.bth-link__bg {
  position: absolute;
  inset: 0;
  transform-origin: left;
  transform: scaleX(0);
  background: rgb(0 66 138 / 0.5);
  transition: transform 0.5s cubic-bezier(0.65, 0.05, 0, 1);
}
.bth-link:hover .bth-link__bg,
.bth-link:focus-visible .bth-link__bg {
  transform: scaleX(1);
}
.bth-link__num {
  position: relative;
  font-family: var(--bth-mono);
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--bth-sky);
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.25, 0.1, 0.35, 1) calc(0.45s + var(--i) * 0.05s);
}
.bth-link__label {
  position: relative;
  display: block;
  transform-origin: bottom left;
  font-family: var(--bth-display);
  font-size: clamp(2rem, min(10vw, 6.5svh), 3.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.025em;
  color: #fff;
  transform: translateY(140%) rotate(10deg);
  transition: transform 0.7s var(--bth-ease) calc(0.35s + var(--i) * 0.05s);
}
.bth-menu.is-open .bth-link__num {
  opacity: 1;
}
.bth-menu.is-open .bth-link__label {
  transform: none;
}

.bth-menu__extra {
  margin-top: 2rem;
  display: grid;
  gap: 1.5rem;
}
.bth-fade {
  opacity: 0;
  transform: translateY(50%);
  transition: opacity 0.7s var(--bth-ease), transform 0.7s var(--bth-ease);
  transition-delay: calc(0.6s + var(--j) * 0.04s);
}
.bth-menu.is-open .bth-fade {
  opacity: 1;
  transform: none;
}
.bth-eyebrow {
  font-family: var(--bth-mono);
  font-size: 0.75rem;
  line-height: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--bth-sky);
}
.bth-services ul {
  margin-top: 0.75rem;
}
.bth-services li + li {
  margin-top: 0.25rem;
}
.bth-services a {
  color: rgb(255 255 255 / 0.7);
  transition: color 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}
.bth-services a:hover {
  color: #fff;
}
.bth-contact {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  color: rgb(255 255 255 / 0.7);
}
.bth-contact a:not(.bth-cta) {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--bth-mono);
  font-size: 0.875rem;
  line-height: 1.25rem;
}
.bth-contact a:not(.bth-cta):hover {
  color: #fff;
}
.bth-contact svg {
  color: var(--bth-sky);
}
.bth a.bth-cta {
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  align-self: flex-start;
  border-radius: 9999px;
  background: var(--bth-sky);
  padding: 0.875rem 1.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: var(--bth-night);
}
.bth a.bth-cta:hover {
  color: var(--bth-night);
}
.bth-cta svg {
  color: currentColor;
}

/* ---------- Breakpoints (Tailwind sm / md) ---------- */
@media (min-width: 640px) {
  .bth-bar__inner {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  .bth-logo img {
    height: 64px;
  }
  .bth a.bth-hire {
    display: inline-flex;
  }
  .bth-menu__content {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }
  .bth-menu__extra {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 768px) {
  .bth {
    --header-h: 105px;
  }
  .bth-util {
    display: block;
  }
  .bth-menu__panel {
    width: min(640px, 100%);
  }
}

/* Same as motion's reducedMotion="user": transforms jump, opacity still fades */
@media (prefers-reduced-motion: reduce) {
  .bth *,
  .bth *::before,
  .bth *::after {
    transition-property: opacity, color, background-color, border-color !important;
  }
}
