/* menu.css — PredictionLab Nav (desktop glass, mobile solid panel + wave underline) */

.site-header{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 30;
  padding: 18px 22px;
  pointer-events: none;
}

.nav{
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;

  max-width: 1200px;
  margin: 0 auto;

  padding: 10px 14px;
  border-radius: 18px;

  /* desktop: glass */
  background: rgba(6, 14, 32, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  border: 1px solid rgba(160, 190, 255, 0.10);
  box-shadow:
    0 10px 40px rgba(0,0,0,0.28),
    0 0 0 1px rgba(90, 210, 255, 0.06) inset;
}

/* Brand (editorial / authentic) */
.nav__brand{
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1;
  text-decoration: none;
  border-bottom: none;
  user-select: none;
  padding: 4px 6px;
  border-radius: 12px;
}

.nav__brandPred{
  font-family: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: rgba(230,240,255,0.78);
}

.nav__brandLab{
  font-family: "Stick No Bills", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.10em;
  color: rgba(245,250,255,0.92);
  text-shadow:
    0 0 18px rgba(140,110,255,0.16),
    0 0 28px rgba(175,235,255,0.10);
}

/* Menu links container (desktop) */
.nav__menu{
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Links */
.nav__link{
  position: relative;
  display: inline-flex;
  align-items: center;

  text-decoration: none;
  border-bottom: none;
  color: rgba(220, 235, 255, 0.74);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.10em;
  text-transform: uppercase;

  padding: 10px 10px;
  border-radius: 12px;

  transition: color 160ms ease, background 160ms ease, transform 160ms ease;

  /* Wave underline vars */
  --u-op: 0;
  --u-h: 12px;
  --u-gap: 6px;
  --u-speed: 1.35s;
}

.nav__link:hover{
  color: rgba(245, 250, 255, 0.92);
  background: rgba(140, 110, 255, 0.10);
}

.nav__link:active{
  transform: translateY(1px);
}

.nav__link:focus-visible{
  outline: 2px solid rgba(175,235,255,0.25);
  outline-offset: 2px;
}

/* Wave underline */
.nav__link::after{
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(var(--u-gap) * -1);
  height: var(--u-h);

  opacity: var(--u-op);
  transition: opacity 180ms ease;

  background: linear-gradient(
    90deg,
    rgba(90,210,255,0.0),
    rgba(140,110,255,0.80),
    rgba(175,235,255,0.70),
    rgba(90,210,255,0.0)
  );

  -webkit-mask-image: url("data:image/svg+xml;utf8,\
  <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 12'>\
    <path d='M0 6 C10 1 20 11 30 6 S50 11 60 6 S80 1 90 6 S110 11 120 6' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'/>\
  </svg>");
  -webkit-mask-repeat: repeat-x;
  -webkit-mask-size: 120px 12px;
  -webkit-mask-position: 0 0;

  mask-image: url("data:image/svg+xml;utf8,\
  <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 12'>\
    <path d='M0 6 C10 1 20 11 30 6 S50 11 60 6 S80 1 90 6 S110 11 120 6' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'/>\
  </svg>");
  mask-repeat: repeat-x;
  mask-size: 120px 12px;
  mask-position: 0 0;

  animation: navWaveShift var(--u-speed) linear infinite;
}

@keyframes navWaveShift{
  from { -webkit-mask-position: 0 0; mask-position: 0 0; }
  to   { -webkit-mask-position: 120px 0; mask-position: 120px 0; }
}

.nav__link:hover,
.nav__link:focus-visible{
  --u-op: 1;
}

.nav__link.is-active,
.nav__menu li.is-active > .nav__link,
.nav__menu li.current-menu-item > .nav__link,
.nav__menu li.current_page_item > .nav__link,
.nav__menu li.current-menu-ancestor > .nav__link,
.nav__menu li.current_page_ancestor > .nav__link{
  color: rgba(245, 250, 255, 0.94);
  background: rgba(90, 210, 255, 0.08);
  --u-op: 1;
}

body:not(.home) .nav__menu .menu-item-home > .nav__link{
  color: rgba(220, 235, 255, 0.74);
  background: transparent;
  --u-op: 0;
}

/* CTA */
.nav__link--cta{
  color: rgba(10, 18, 34, 0.92);
  background: rgba(175,235,255,0.85);
  letter-spacing: 0.08em;
}
.nav__link--cta:hover{
  background: rgba(175,235,255,0.95);
  color: rgba(10, 18, 34, 0.92);
}
.nav__link--cta::after{
  opacity: 0 !important;
}

/* Mobile toggle button */
.nav__toggle{
  display: none;
  width: 44px;
  height: 40px;
  border: 1px solid rgba(160, 190, 255, 0.14);
  background: rgba(10, 18, 34, 0.35);
  border-radius: 14px;
  cursor: pointer;
}

.nav__toggleIcon{
  display: block;
  width: 18px;
  height: 2px;
  background: rgba(230, 242, 255, 0.85);
  margin: 0 auto;
  position: relative;
  border-radius: 2px;
}
.nav__toggleIcon::before,
.nav__toggleIcon::after{
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: rgba(230, 242, 255, 0.85);
  border-radius: 2px;
  transition: transform 220ms ease, top 220ms ease, opacity 220ms ease;
}
.nav__toggleIcon::before{ top: -6px; }
.nav__toggleIcon::after{ top: 6px; }

/* ===== MOBILE ===== */
@media (max-width: 860px){
  .site-header{ padding: 14px 14px; }
  .nav{ padding: 10px 12px; }

  .nav__toggle{
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav .nav__menu{
    position: absolute;
    right: 0;
    top: 62px;
    width: min(92vw, 420px);
    padding: 16px 24px;
    border-radius: 18px;

    display: grid;
    gap: 10px;

    /* ✅ MOBILE FIX: solid, readable panel (not transparent) */
    background: linear-gradient(
      180deg,
      rgba(8, 14, 28, 0.88),
      rgba(6, 12, 26, 0.98)
    );

    /* Keep blur only as a subtle bonus; background is already solid */
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);

    border: 1px solid rgba(175, 235, 255, 0.16);

    box-shadow:
      0 18px 60px rgba(0,0,0,0.55),
      0 0 0 1px rgba(140,110,255,0.10) inset;

    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease, transform 220ms ease;
  }

  .nav .nav__menu.is-open{
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav__link{
    padding: 12px 12px;
    letter-spacing: 0.08em;

    /* underline a bit lower in mobile */
    --u-gap: 10px;
  }

  /* Mobile links: slightly stronger default contrast */
  .nav__link{
    color: rgba(235, 245, 255, 0.82);
    background: rgba(255,255,255,0.03);
  }
  .nav__link:hover{
    background: rgba(140,110,255,0.16);
    color: rgba(245,250,255,0.94);
  }

  /* CTA more prominent on mobile */
  .nav__link--cta{
    background: rgba(175,235,255,0.92);
  }
}

/* Accessibility helper */
.sr-only{
  position:absolute;
  width:1px;height:1px;
  padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);
  white-space:nowrap;border:0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .nav__link::after{ animation: none; }
  .nav__link{ transition: none; }
  .nav__menu{ transition: none; }
}


/* WP menu markup safety (ul/li reset) */
.nav__menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__menu li {
  margin: 0;
  padding: 0;
}

/* Ensure anchors render consistently */
.nav__menu a {
  text-decoration: none;
}

