/* Shared site header and primary navigation fixture. */

.bento-header {
  position: sticky;
  top: 0;
  z-index: 90;
  border-bottom: 0;
  background: linear-gradient(180deg, rgba(8, 3, 10, 0.96), rgba(8, 3, 10, 0.76));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.34);
  padding: 0 1.5rem;
}

.bento-page > .bento-header:not(.bg-orb):not(.bg-grid-glow) {
  z-index: 90;
}

.bento-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  pointer-events: none;
  background: linear-gradient(90deg, #8ff7ff 0%, #d697ff 55%, #ff88b0 100%);
  box-shadow:
    0 0 10px rgba(143, 247, 255, 0.28),
    0 0 14px rgba(214, 151, 255, 0.18);
}

.bento-header-inner {
  max-width: 1600px;
  margin: 0 auto;
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-link {
  text-decoration: none;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: clamp(0.28rem, 0.55vw, 0.46rem);
  transition: filter 200ms ease;
}

.brand-book-icon {
  display: none;
  width: clamp(2rem, 2.5vw, 2.65rem);
  height: clamp(2rem, 2.5vw, 2.65rem);
  flex: 0 0 auto;
  background:
    transparent
    url("assets/mobile-nav/book-menu-closed.webp")
    center / contain
    no-repeat;
  filter: drop-shadow(0 0 6px rgba(255, 76, 114, 0.32));
}

.brand-link-image {
  display: block;
  width: clamp(10rem, 14vw, 13rem);
  height: auto;
}

.brand-link:hover {
  filter: drop-shadow(0 0 8px rgba(255, 26, 102, 0.5));
}

.brand-link.is-book-open .brand-book-icon {
  background-image: url("assets/mobile-nav/book-menu-opened.webp");
}

.brand-link.is-book-animating-open .brand-book-icon {
  background-image: url("assets/mobile-nav/book-menu-open.webp");
}

.brand-link.is-book-animating-close .brand-book-icon {
  background-image: url("assets/mobile-nav/book-menu-close.webp");
}

@media (min-width: 861px) {
  .brand-book-icon {
    display: block;
  }
}

.feature-nav-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #f4fbff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  overflow: visible;
  padding: 0;
  box-shadow: none;
  transition:
    transform 160ms ease,
    filter 160ms ease;
}

.feature-nav-toggle:hover,
.feature-nav-toggle:focus-visible {
  transform: translateY(-1px);
  filter: drop-shadow(0 0 8px rgba(255, 76, 114, 0.28));
}

.feature-nav-toggle:focus-visible {
  outline: 2px solid rgba(111, 242, 255, 0.5);
  outline-offset: 2px;
}

.feature-nav-toggle-icon,
.feature-nav-toggle-icon::before,
.feature-nav-toggle-icon::after {
  display: block;
  width: 0.88rem;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #8ff7ff 0%, #d697ff 55%, #ff88b0 100%);
  box-shadow:
    0 0 8px rgba(0, 234, 255, 0.42),
    0 0 14px rgba(214, 26, 255, 0.2);
  transition:
    transform 180ms ease,
    opacity 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.feature-nav-toggle-icon {
  position: relative;
  width: 2.85rem;
  height: 2.85rem;
  border-radius: 0;
  background:
    transparent
    url("assets/mobile-nav/book-menu-closed.webp")
    center / contain
    no-repeat;
  box-shadow: none;
  filter: drop-shadow(0 0 6px rgba(255, 76, 114, 0.32));
}

.feature-nav-toggle-icon::before,
.feature-nav-toggle-icon::after {
  content: none;
  position: absolute;
  left: 0;
}

.feature-nav-toggle.is-open .feature-nav-toggle-icon {
  background-image: url("assets/mobile-nav/book-menu-opened.webp");
  box-shadow: none;
}

.feature-nav-toggle.is-animating-open .feature-nav-toggle-icon {
  background-image: url("assets/mobile-nav/book-menu-open.webp");
}

.feature-nav-toggle.is-animating-close .feature-nav-toggle-icon {
  background-image: url("assets/mobile-nav/book-menu-close.webp");
}

.feature-nav-toggle-icon::before {
  transform: translateY(-6px);
}

.feature-nav-toggle-icon::after {
  transform: translateY(6px);
}

.bento-nav {
  display: flex;
  gap: 1.5rem;
}

.bento-nav a {
  font-family: "CookieRun KR", "Outfit", sans-serif;
  color: var(--text-soft, #dfc8d5);
  text-decoration: none;
  font-size: 1rem;
  letter-spacing: 0.02em;
  transition: color 200ms ease, text-shadow 200ms ease;
}

.bento-nav a:hover,
.bento-nav a:focus-visible,
.bento-nav a[aria-current="page"] {
  color: #fff;
  text-shadow: 0 0 10px rgba(0, 234, 255, 0.6);
  outline: none;
}

@media (max-width: 860px) {
  .bento-header {
    overflow: visible;
    padding: 0 0.25rem;
  }

  .bento-header-inner {
    position: relative;
    overflow: visible;
    flex-wrap: nowrap;
    gap: 0.75rem;
    min-height: 3.2rem;
    padding: 0.45rem;
  }

  .feature-nav-toggle {
    display: none;
    order: -1;
    width: 2.3rem;
    height: 2.3rem;
  }

  .brand-link {
    display: inline-flex !important;
    order: -1;
    cursor: pointer;
    max-width: min(78vw, 15rem);
    gap: 0.32rem;
  }

  .brand-link:focus-visible {
    outline: 2px solid rgba(111, 242, 255, 0.5);
    outline-offset: 3px;
    border-radius: 0.45rem;
  }

  .brand-book-icon {
    display: block;
    width: 2.3rem;
    height: 2.3rem;
  }

  .bento-nav {
    display: none;
    position: absolute;
    top: calc(100% + 0.55rem);
    left: 0;
    right: 0;
    z-index: 60;
    flex-basis: auto;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.7rem;
    border: 1px solid rgba(255, 188, 210, 0.16);
    border-radius: 0.95rem;
    background: linear-gradient(180deg, rgba(14, 6, 12, 0.96), rgba(10, 4, 8, 0.9));
    box-shadow: 0 20px 36px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(18px) saturate(1.12);
    -webkit-backdrop-filter: blur(18px) saturate(1.12);
  }

  .feature-nav-toggle.is-open ~ .bento-nav,
  .brand-link.is-mobile-nav-open ~ .bento-nav {
    display: flex;
  }

  .bento-nav a {
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    transition: background 150ms ease;
  }

  .bento-nav a:hover,
  .bento-nav a:focus-visible,
  .bento-nav a[aria-current="page"] {
    background: rgba(255, 255, 255, 0.06);
  }

  .brand-link-image {
    width: min(7.5rem, 32vw);
  }
}
