/* Shared mobile hamburger navigation — only affects viewports <= 720px.
   Desktop layout is untouched. The JS normalizes each page's nav by adding
   the .site-nav class and injecting a .nav-toggle button. */

/* Full-bleed header bar: the dark background spans the entire viewport width
   while the brand + nav stay aligned to the page shell. Applied to every page. */
.site-header::before,
.top-nav::before,
.header-inner::before,
.shell > header::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  z-index: -1;
  background: inherit;
  border-bottom: inherit;
  -webkit-backdrop-filter: inherit;
  backdrop-filter: inherit;
}

/* Shared brand icon — identical on every page (matches index.html diamond). */
.brand .brand-mark {
  width: 2.5rem;
  height: 2.5rem;
  aspect-ratio: 1;
  border: 1px solid rgba(72, 245, 255, 0.55);
  border-radius: 0.5rem;
  display: grid;
  place-items: center;
  padding: 0;
  color: transparent;
  font-size: 0;
  line-height: 0;
  background: linear-gradient(135deg, rgba(72, 245, 255, 0.22), rgba(255, 61, 242, 0.18));
  box-shadow: 0 0 32px rgba(72, 245, 255, 0.28), inset 0 0 20px rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.brand .brand-mark span {
  display: block;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  border: 2px solid #63e6ff;
  border-radius: 0;
  background: transparent;
  transform: rotate(45deg);
  box-shadow: 0 0 18px #63e6ff;
}

.nav-toggle { display: none; }

@media (max-width: 720px) {
  /* Keep brand + hamburger on one row, let the menu wrap below. */
  .site-header,
  .top-nav,
  .header-inner,
  .shell > header {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    width: 2.7rem;
    height: 2.7rem;
    padding: 0;
    border-radius: 0.6rem;
    border: 1px solid rgba(150, 190, 220, 0.32);
    background: rgba(255, 255, 255, 0.06);
    color: #eaf4ff;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .nav-toggle:focus-visible { outline: 2px solid #63e6ff; outline-offset: 2px; }
  .nav-toggle svg { width: 1.4rem; height: 1.4rem; stroke: currentColor; stroke-width: 2; fill: none; }
  .nav-toggle .nav-x { display: none; }
  .nav-open .nav-toggle .nav-bars { display: none; }
  .nav-open .nav-toggle .nav-x { display: block; }

  /* Collapse the menu by default; show it as a stacked panel when open. */
  .site-nav {
    display: none !important;
    flex-basis: 100%;
    width: 100%;
  }
  .nav-open .site-nav {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(150, 190, 220, 0.16);
  }
  .nav-open .site-nav a {
    display: block;
    width: 100%;
    padding: 0.8rem 0.7rem;
    border-radius: 0.5rem;
    font-size: 1rem;
  }
  .nav-open .site-nav a:hover,
  .nav-open .site-nav a:focus-visible {
    background: rgba(99, 230, 255, 0.1);
    outline: none;
  }
  /* Disable the desktop underline-animation pseudo element inside the panel. */
  .nav-open .site-nav a::after { display: none !important; }
}
