.bw-shell {
  --bw-ease: cubic-bezier(0.22, 1, 0.36, 1);
  position: fixed;
  inset: 12px 0 auto;
  z-index: 70;
  color: var(--fps-ink);
  pointer-events: none;
  font-family: "Mulish", Arial, sans-serif;
}

.bw-shell[data-tone="ink"] {
  color: var(--fps-paper);
}

.bw-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
  width: calc(100% - clamp(40px, 8vw, 112px));
  max-width: 1600px;
  height: 62px;
  margin-inline: auto;
  padding: 7px 0;
  border: 1px solid transparent;
  border-radius: 999px;
  pointer-events: auto;
  transition:
    width 700ms var(--bw-ease),
    max-width 700ms var(--bw-ease),
    padding 700ms var(--bw-ease),
    background-color 250ms,
    border-color 250ms,
    box-shadow 250ms,
    color 250ms;
}

.bw-shell[data-scrolled] .bw-bar {
  width: calc(100% - 32px);
  max-width: 850px;
  padding-inline: 24px 7px;
  border-color: color-mix(in srgb, var(--fps-paper) 16%, transparent);
  background: color-mix(in srgb, var(--fps-ink) 91%, transparent);
  color: var(--fps-paper);
  box-shadow: 0 8px 32px #0a232414;
  backdrop-filter: blur(24px) saturate(140%);
}

.bw-logo {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 44px;
  width: 142px;
  gap: 9px;
}

.bw-logo-mark {
  display: block;
  width: 100%;
  height: auto;
  fill: currentColor;
}

.bw-right,
.bw-links {
  display: flex;
  align-items: center;
}

.bw-right {
  gap: 30px;
  margin-left: auto;
}

.bw-links {
  gap: 28px;
}

.bw-dropdown > summary,
.bw-nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.bw-dropdown > summary {
  list-style: none;
}

.bw-dropdown > summary::-webkit-details-marker,
.bw-mobile-menu > summary::-webkit-details-marker,
.bw-mobile-group > summary::-webkit-details-marker {
  display: none;
}

.bw-dropdown > summary > svg {
  width: 10px;
  height: 6px;
  opacity: 0.7;
  transition: transform 220ms var(--bw-ease);
}

.bw-dropdown[open] > summary > svg {
  transform: rotate(180deg);
}

.bw-dropdown[open] > summary,
.bw-nav-link:hover {
  text-decoration: underline;
  text-decoration-color: var(--fps-accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}

.bw-contact {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  gap: 13px;
  min-height: 46px;
  padding: 5px 5px 5px 20px;
  border-radius: 999px;
  background: var(--fps-accent);
  color: var(--fps-ink);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color 180ms;
}

.bw-contact-arrow {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--fps-ink);
  color: var(--fps-paper);
}

.bw-contact svg,
.bw-all svg,
.bw-submenu-links > a > svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 220ms var(--bw-ease);
}

.bw-contact:hover {
  background: var(--fps-accent-hover);
}

.bw-contact:hover svg {
  transform: translateX(2px);
}

.bw-submenu {
  position: absolute;
  inset: calc(100% + 12px) 0 auto auto;
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 36px;
  width: min(720px, calc(100vw - 40px));
  padding: 32px;
  border: 1px solid color-mix(in srgb, var(--fps-paper) 15%, transparent);
  border-radius: 24px;
  background: var(--fps-ink);
  color: var(--fps-paper);
  box-shadow: 0 16px 60px #0a232433;
  animation: bw-menu-in 220ms var(--bw-ease);
}

/* Keep the seven expertises visible without a tall, single-column menu. */
@media (min-width: 1024px) {
  .bw-dropdown:first-child .bw-submenu {
    grid-template-columns: 1fr;
    gap: 12px;
    width: min(760px, calc(100vw - 40px));
    max-height: calc(100dvh - 110px);
    overflow-y: auto;
    padding: 24px;
  }
  .bw-dropdown:first-child .bw-submenu-aside {
    flex-direction: row;
    align-items: center;
    gap: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgb(232 238 238 / 17%);
  }
  .bw-dropdown:first-child .bw-submenu-aside > p {
    margin: 0;
    font-size: 20px;
    line-height: 1.3;
  }
  .bw-dropdown:first-child .bw-all {
    flex: none;
  }
  .bw-dropdown:first-child .bw-submenu-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 28px;
  }
  .bw-dropdown:first-child .bw-submenu-links > a {
    min-height: 86px;
    padding: 14px 0;
    gap: 12px;
  }
  .bw-dropdown:first-child .bw-submenu-links > a:last-child,
  .bw-dropdown:first-child
    .bw-submenu-links
    > a:nth-child(odd):nth-last-child(2) {
    border-bottom: 0;
  }
  .bw-dropdown:first-child .bw-link-description {
    font-size: 12px;
    line-height: 1.5;
  }
}

.bw-submenu-aside {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 36px;
}

.bw-submenu-aside > p {
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.04em;
  font-weight: 600;
}

.bw-aside-star {
  display: inline-block;
  margin-left: 4px;
  color: var(--fps-accent);
}

.bw-all {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.bw-submenu-links > a,
.bw-mobile-group > div > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding-block: 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--fps-paper) 17%, transparent);
}

.bw-submenu-links > a:first-child {
  padding-top: 0;
}

.bw-submenu-links > a:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.bw-link-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bw-link-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 650;
}

.bw-link-description {
  color: color-mix(in srgb, var(--fps-paper) 70%, transparent);
  font-size: 12px;
}

.bw-submenu-links > a:hover > svg {
  transform: translateX(4px);
}

.bw-shape {
  display: inline-block;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  background: var(--fps-lilac);
  clip-path: polygon(
    50% 0,
    63% 16%,
    83% 7%,
    85% 29%,
    100% 39%,
    85% 55%,
    93% 77%,
    70% 80%,
    60% 100%,
    43% 84%,
    23% 94%,
    19% 72%,
    0 60%,
    16% 43%,
    8% 22%,
    30% 20%
  );
}

.bw-shape--flower {
  border-radius: 40%;
  clip-path: none;
  background: var(--fps-accent);
}

.bw-shape--star {
  background: var(--fps-turquoise);
}

.bw-mobile-menu {
  display: none;
}

.bw-shell :where(a, summary):focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 5px;
  border-radius: 4px;
}

@keyframes bw-menu-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1023px) {
  .bw-shell {
    top: 8px;
  }

  .bw-bar {
    width: calc(100% - 40px);
    height: 54px;
    gap: 16px;
  }

  .bw-logo {
    width: 128px;
  }

  .bw-links,
  .bw-desktop-contact {
    display: none;
  }

  .bw-shell[data-scrolled] .bw-bar {
    width: calc(100% - 24px);
    padding: 4px 5px 4px 16px;
  }

  .bw-mobile-menu {
    display: block;
  }

  .bw-mobile-menu > summary {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 5px 5px 5px 20px;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    list-style: none;
    cursor: pointer;
  }

  .bw-burger {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 5px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--fps-ink);
    color: var(--fps-paper);
  }

  .bw-burger > span {
    width: 13px;
    height: 1.5px;
    background: currentColor;
    transition: transform 220ms var(--bw-ease);
  }

  .bw-shell[data-scrolled] .bw-burger,
  .bw-mobile-menu[open] .bw-burger {
    background: var(--fps-paper);
    color: var(--fps-ink);
  }

  .bw-mobile-menu[open] .bw-burger > span:first-child {
    transform: translateY(3.25px) rotate(45deg);
  }

  .bw-mobile-menu[open] .bw-burger > span:last-child {
    transform: translateY(-3.25px) rotate(-45deg);
  }

  .bw-mobile-panel {
    position: fixed;
    z-index: 1;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    height: 100dvh;
    padding: 110px 24px max(30px, env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--fps-ink);
    color: var(--fps-paper);
    animation: bw-menu-in 220ms var(--bw-ease);
  }

  .bw-bar:has(.bw-mobile-menu[open]) {
    color: var(--fps-paper);
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .bw-mobile-group > summary,
  .bw-mobile-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 72px;
    border-bottom: 1px solid
      color-mix(in srgb, var(--fps-paper) 20%, transparent);
    font-size: clamp(24px, 6vw, 36px);
    font-weight: 550;
    letter-spacing: -0.03em;
    list-style: none;
  }

  .bw-mobile-link > svg,
  .bw-mobile-group > summary > svg {
    width: 20px;
    height: 20px;
  }

  .bw-mobile-group > div {
    padding-block: 12px;
  }

  .bw-mobile-group > div > a > svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
  }

  .bw-mobile-bottom {
    display: grid;
    gap: 24px;
  }

  .bw-mobile-bottom .bw-contact {
    width: fit-content;
    min-height: 50px;
  }

  .bw-mobile-note {
    opacity: 0.6;
    font-size: 13px;
  }

  html:has(.bw-mobile-menu[open]),
  body:has(.bw-mobile-menu[open]) {
    overflow: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bw-shell *,
  .bw-shell *::before,
  .bw-shell *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* The captured app's scroll-up navigation duplicates the custom header. */
.slide-in-active {
  display: none !important;
}

.bw-logo-name {
  font-size: 27px;
  font-weight: 750;
  letter-spacing: -0.06em;
  line-height: 1;
}
@media (max-width: 1023px) {
  .bw-logo-name {
    font-size: 24px;
  }
}
