/* ── SITE NAV ──
   Shared by every page. Relies on the colour variables each page defines in :root. */
nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 2rem;
  padding: 0 clamp(1.5rem, 5vw, 4rem); height: 64px;
  background: rgba(10,22,40,0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  margin-right: auto;
  font-family: 'Syne', sans-serif; font-weight: 800; font-size: 1.1rem;
  color: var(--white); text-decoration: none; letter-spacing: -.01em;
  white-space: nowrap;
}
.nav-logo .moose-icon {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center; overflow: hidden;
  box-shadow: 0 0 14px rgba(0,194,255,.35);
}
.nav-logo .moose-icon img { width: 100%; height: 100%; object-fit: cover; }

.nav-links { display: flex; gap: 2rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  position: relative;
  color: var(--text-muted); text-decoration: none;
  font-size: .875rem; font-weight: 500; letter-spacing: .01em; transition: color .2s;
}
.nav-links a:hover, .nav-links a:focus-visible, .nav-links a[aria-current="page"] { color: var(--accent); }
/* Underline marks the current page so it isn't signalled by colour alone */
.nav-links a[aria-current="page"]::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px;
  height: 2px; border-radius: 2px; background: var(--accent);
}

/* ── Industries dropdown ── */
.nav-links { align-items: center; }
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  position: relative;
  display: inline-flex; align-items: center; gap: .35rem;
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-size: .875rem; font-weight: 500; letter-spacing: .01em;
  color: var(--text-muted); transition: color .2s;
}
.nav-dropdown-toggle::after {
  content: ''; width: 6px; height: 6px; margin-top: -3px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); transition: transform .2s, margin .2s;
}
.nav-dropdown-toggle:hover, .nav-dropdown-toggle[aria-expanded="true"], .nav-dropdown-toggle.is-current { color: var(--accent); }
.nav-dropdown-toggle[aria-expanded="true"]::after { transform: rotate(-135deg); margin-top: 3px; }
.nav-dropdown-toggle.is-current { box-shadow: 0 8px 0 -6px var(--accent); }

.nav-submenu {
  display: none;
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  width: 320px; padding-top: 22px;
}
/* Panel sits inside the padded list so the pointer can cross the gap without it closing */
.nav-submenu-panel {
  list-style: none; margin: 0;
  background: #0a1628; border: 1px solid var(--border); border-radius: 12px;
  padding: .5rem; box-shadow: 0 20px 48px rgba(0,0,0,.45);
}
.nav-dropdown.is-open .nav-submenu { display: block; }
.nav-submenu a {
  display: block; padding: .7rem .85rem; border-radius: 8px;
  color: var(--white); transition: background .15s;
}
.nav-submenu a::after { display: none; }
.nav-submenu a:hover, .nav-submenu a:focus-visible { background: rgba(0,194,255,.08); color: var(--white); }
.nav-submenu a[aria-current="page"] { background: rgba(0,194,255,.1); color: var(--white); box-shadow: inset 3px 0 0 var(--accent); }
.nav-submenu b { display: block; font-weight: 600; font-size: .9rem; }
.nav-submenu small { display: block; margin-top: .15rem; font-size: .78rem; color: var(--text-muted); line-height: 1.4; }
.nav-submenu .nav-submenu-all { margin-top: .35rem; padding-top: .35rem; border-top: 1px solid var(--border); }
.nav-submenu .nav-submenu-all a { color: var(--accent); font-size: .85rem; font-weight: 600; }

.nav-cta {
  background: var(--blue-brand); color: var(--white);
  padding: .4rem 1.1rem; border-radius: 6px;
  font-size: .875rem; font-weight: 500; letter-spacing: .01em;
  text-decoration: none; white-space: nowrap;
  transition: background .2s, box-shadow .2s;
}
.nav-cta:hover, .nav-cta:focus-visible, .nav-cta[aria-current="page"] {
  background: var(--blue-bright); color: var(--white);
  box-shadow: 0 0 18px rgba(0,194,255,.3);
}

nav a:focus-visible, .nav-toggle:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px;
}

/* Menu button: hidden on desktop */
.nav-toggle {
  display: none;
  width: 40px; height: 40px; margin-right: -8px; padding: 0;
  background: none; border: 0; cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  display: block; width: 22px; height: 2px; border-radius: 2px;
  background: var(--white); transition: transform .2s, background .2s;
}
.nav-toggle-bar { position: relative; }
.nav-toggle-bar::before, .nav-toggle-bar::after { content: ''; position: absolute; left: 0; }
.nav-toggle-bar::before { top: -7px; }
.nav-toggle-bar::after  { top: 7px; }
nav.is-open .nav-toggle-bar { background: transparent; }
nav.is-open .nav-toggle-bar::before { transform: translateY(7px) rotate(45deg); }
nav.is-open .nav-toggle-bar::after  { transform: translateY(-7px) rotate(-45deg); }

/* Tablets: tighten spacing so the full desktop nav still fits */
@media (min-width: 769px) and (max-width: 1080px) {
  nav { gap: 1.25rem; }
  .nav-links { gap: 1.25rem; }
  .nav-logo { font-size: 1rem; }
}
@media (min-width: 769px) and (max-width: 960px) {
  .nav-logo { min-width: 0; font-size: .85rem; line-height: 1.1; white-space: normal; }
  .nav-logo-text { max-width: 6.5em; }
  .nav-cta { padding: .4rem .85rem; }
}

@media (max-width: 768px) {
  nav { gap: .75rem; }
  .nav-toggle { display: inline-flex; }

  /* Links drop into a full-width panel under the bar */
  .nav-links {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    padding: .5rem clamp(1.5rem, 5vw, 4rem) 1rem;
    background: #0a1628;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 16px 32px rgba(0,0,0,.35);
  }
  nav.is-open .nav-links { display: flex; }
  .nav-links li + li { border-top: 1px solid var(--border); }
  .nav-links a { display: block; padding: .9rem 0; font-size: 1rem; }
  .nav-links a[aria-current="page"]::after { left: -.75rem; right: auto; top: 50%; bottom: auto; width: 3px; height: 1.1em; transform: translateY(-50%); }

  /* Industries expands in place inside the panel */
  .nav-links { align-items: stretch; max-height: calc(100vh - 64px); overflow-y: auto; }
  .nav-dropdown-toggle { width: 100%; justify-content: space-between; padding: .9rem 0; font-size: 1rem; }
  .nav-dropdown-toggle::after { margin-right: .35rem; }
  .nav-dropdown-toggle.is-current { box-shadow: none; }
  .nav-submenu { position: static; transform: none; width: auto; padding: 0 0 .6rem; }
  .nav-submenu-panel { background: none; border: 0; box-shadow: none; padding: 0; }
  .nav-submenu li + li { border-top: 0; }
  .nav-submenu a { padding: .6rem .85rem; }
}

@media (max-width: 520px) {
  /* Long wordmark wraps to two lines so the button and menu still fit */
  .nav-logo { min-width: 0; gap: 8px; font-size: .85rem; line-height: 1.1; white-space: normal; }
  .nav-logo-text { max-width: 6.5em; }
  .nav-logo .moose-icon { width: 30px; height: 30px; }
  .nav-cta { padding: .4rem .8rem; font-size: .8rem; }
}

@media (max-width: 340px) {
  .nav-logo-text { display: none; }
}
