/* ===================== Header (glassy, but without “washed out” gray) ===================== */
header.site {
  position: sticky;
  top: 0;
  z-index: 1000;

  /* More opaque so it doesn’t look gray against light backgrounds */
  background: linear-gradient(
    180deg,
    rgba(34,211,238,0.12),  /* subtle cyan glow */
    rgba(16,22,42,0.8) 30%,
    rgba(16,22,42,0.6) 100%
  );


  border-bottom: 1px solid rgba(255,255,255,.08);

  /* Disable blur by default (prevents the header from looking gray on landing) */
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* If the browser supports blur, apply a subtle blur without whitening */
@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))) {
  header.site.use-glass {
    background: linear-gradient(
    180deg,
    rgba(34,211,238,0.12),  /* subtle cyan glow */
    rgba(16,22,42,0.8) 30%,
    rgba(16,22,42,0.6) 100%
  );
    -webkit-backdrop-filter: saturate(140%) blur(6px);
    backdrop-filter: saturate(140%) blur(6px);
  }
}

/* Layout */
header.site .nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .6rem 0;
}

/* Brand */
header.site .brand {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  text-decoration: none;
}
header.site .brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--acc-2);
  box-shadow: 0 0 8px var(--acc-2);
}

/* Navigation links */
header.site .primary .container {
  display: flex;
  gap: 1.5rem;
}
header.site .primary a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  padding: .4rem .6rem;
  border-radius: 10px;
  transition: color .2s ease, background .2s ease, text-shadow .2s ease;
}
header.site .primary a:hover,
header.site .primary a[aria-current="page"],
header.site .primary a:focus-visible {
  color: var(--ink);
  background: rgba(125,211,252,.10);
  text-shadow: 0 0 10px rgba(125,211,252,.35);
  outline: none;
}

/* Mobile menu (checkbox hack) */
#menu-toggle { 
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
}

/* Menu button (hamburger) */
.menu-btn {
  display: none;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  padding: .25rem .5rem;
  border-radius: .5rem;
}
.menu-btn:focus-visible {
  outline: 2px solid rgba(125,211,252,.6);
  outline-offset: 2px;
}

/* Responsive behavior */
@media (max-width: 760px) {
  /* Hide nav links by default on mobile */
  header.site .primary .container {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 0;
    gap: .75rem;
  }

  /* Show hamburger */
  .menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* When toggled, show the nav */
  /* Structure expected:
     <input id="menu-toggle" type="checkbox">
     <nav class="primary"> <div class="container"> ...links... </div> </nav>
  */
  #menu-toggle:checked ~ nav.primary .container {
    display: flex;
  }
}

/* Reduce motion niceties */
@media (prefers-reduced-motion: reduce) {
  header.site .primary a {
    transition: none;
  }
}
