/* =============================================================================
   BuddieSpace — Header / Navigation
   Figma node: 1:329  |  File: RwwSPnE42UdisR1nLlsl9D
   Reference canvas: 1440 px wide
   All layout dims: clamp(min, Figma_px / 1440 * 100 vw, max)
   ============================================================================= */

/* ── Shell ──────────────────────────────────────────────────────────────────── */

.bs-header {
  background-color: #ffffff;
  border-bottom: 1px solid #21254a;
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.bs-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Figma px-[49px] → 49/1440*100 = 3.4 vw */
  padding: 0 clamp(16px, 3.4vw, 49px);
  /* Height: logo 82 px + comfortable vertical space */
  height: clamp(64px, 6.94vw, 100px);
  max-width: 1440px;
  margin: 0 auto;
  position: relative;
  gap: clamp(12px, 1.5vw, 20px);
}

/* ── Logo ────────────────────────────────────────────────────────────────────── */

.bs-header__logo {
  display: block;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 0;
}

/* Outer navy circle — reproduces Figma "Ellipse 1" (82 × 82, fill #21254A)
   82/1440*100 = 5.69 vw */
.bs-header__logo-badge {
  width:  clamp(48px, 5.69vw, 82px);
  height: clamp(48px, 5.69vw, 82px);
  border-radius: 50%;
  background-color: #21254a;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

/* Inner clipping rect — Figma: 61.646 × 60.338 px, offset (10.46, 11.11), rounded 20.639 px
   All values as % of the 82 px badge so they scale proportionally */
.bs-header__logo-clip {
  position: absolute;
  top:    13.55%; /* 11.11 / 82 */
  left:   12.76%; /* 10.46 / 82 */
  width:  75.18%; /* 61.646 / 82 */
  height: 73.58%; /* 60.338 / 82 */
  border-radius: 25%;
  overflow: hidden;
}

/* Logo artwork — Figma: w 189.61%, h 129.12%, left -43.37%, top -19.21% of the clip rect */
.bs-header__logo-img {
  position: absolute;
  width:  189.61%;
  height: 129.12%;
  left:   -43.37%;
  top:    -19.21%;
  max-width: none;
  display: block;
  object-fit: cover;
}

/* ── Desktop Nav ─────────────────────────────────────────────────────────────── */

/* nav-wrap: on desktop acts as a transparent flex container */
.bs-header__nav-wrap {
  display: flex;
  align-items: center;
  flex: 1;
  /* gap between nav group and CTA group */
  gap: clamp(16px, 2.08vw, 30px);
  margin-left: clamp(16px, 2.64vw, 38px);
}

.bs-header__nav {
  display: flex;
  align-items: center;
  /* gap-[33px] → 33/1440*100 = 2.29 vw */
  gap: clamp(12px, 2.29vw, 33px);
  flex: 1;
  flex-wrap: wrap;
}

/* Regular link — Figma: Inter Medium 20 px, color #21254A */
.bs-header__nav-link {
  font-family: 'Inter', sans-serif;
  font-size: clamp(13px, 1.39vw, 20px);
  font-weight: 500;
  color: #21254a;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  transition: opacity 0.15s ease;
}

.bs-header__nav-link:hover {
  opacity: 0.65;
}

/* Active state — Figma: Inter Black 26 px, underline (see "Home") */
.bs-header__nav-link.is-active {
  /* 26/1440*100 = 1.8 vw */
  font-size: clamp(16px, 1.8vw, 26px);
  font-weight: 900;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* ── CTA Buttons ─────────────────────────────────────────────────────────────── */

.bs-header__ctas {
  display: flex;
  align-items: center;
  /* gap-[12px] → 12/1440*100 = 0.83 vw */
  gap: clamp(8px, 0.83vw, 12px);
  flex-shrink: 0;
}

/* Base button — Figma: 104 × 40 px, rounded-[14px], Inter Medium 20 px */
.bs-header__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* h-[40px] → 40/1440*100 = 2.78 vw */
  height: clamp(32px, 2.78vw, 40px);
  /* w-[104px] → 104/1440*100 = 7.22 vw */
  min-width: clamp(76px, 7.22vw, 104px);
  padding: 0 clamp(8px, 0.69vw, 10px);
  border-radius: 14px;
  font-family: 'Inter', sans-serif;
  font-size: clamp(13px, 1.39vw, 20px);
  font-weight: 500;
  color: #000000;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.bs-header__btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

/* Login — Figma bg #59ACF8 */
.bs-header__btn--login {
  background-color: #59acf8;
}

/* Sign up — Figma bg #B0F288 */
.bs-header__btn--signup {
  background-color: #b0f288;
}

/* ── Hamburger (hidden on desktop) ──────────────────────────────────────────── */

.bs-header__hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.bs-header__hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #21254a;
  border-radius: 2px;
  transition: transform 0.28s ease, opacity 0.28s ease;
  transform-origin: center;
}

.bs-header__hamburger.is-active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.bs-header__hamburger.is-active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.bs-header__hamburger.is-active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* =============================================================================
   Tablet — max-width: 1023 px
   ============================================================================= */

@media (max-width: 1023px) {
  .bs-header__hamburger {
    display: flex;
  }

  /* Drawer: absolute below the header bar, slides down */
  .bs-header__nav-wrap {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #ffffff;
    border-bottom: 2px solid #21254a;
    flex-direction: column;
    align-items: flex-start;
    padding: 0 clamp(16px, 3.4vw, 49px);
    gap: 0;
    margin-left: 0;
    box-shadow: 0 8px 24px rgba(33, 37, 74, 0.1);
    /* Slide animation via max-height */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.32s ease, padding 0.32s ease;
  }

  .bs-header__nav-wrap.is-open {
    max-height: 560px;
    padding: 20px clamp(16px, 3.4vw, 49px) 28px;
  }

  .bs-header__nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
    flex-wrap: nowrap;
  }

  .bs-header__nav-link {
    font-size: 18px;
    width: 100%;
    padding: 14px 0;
    border-bottom: 1px solid rgba(33, 37, 74, 0.1);
  }

  .bs-header__nav-link.is-active {
    font-size: 20px;
  }

  .bs-header__nav-link:last-child {
    border-bottom: none;
  }

  .bs-header__ctas {
    padding-top: 20px;
    width: 100%;
  }

  .bs-header__btn {
    height: 42px;
    font-size: 16px;
    min-width: 108px;
  }
}

/* =============================================================================
   Mobile — max-width: 599 px
   ============================================================================= */

@media (max-width: 599px) {
  .bs-header__inner {
    padding: 0 16px;
    height: 60px;
  }

  .bs-header__logo-badge {
    width:  48px;
    height: 48px;
  }

  .bs-header__nav-wrap.is-open {
    padding: 16px 16px 24px;
  }

  .bs-header__nav-link {
    font-size: 17px;
    padding: 12px 0;
  }

  .bs-header__ctas {
    flex-direction: row;
  }

  .bs-header__btn {
    flex: 1;
    height: 40px;
    font-size: 15px;
    border-radius: 12px;
  }
}
