/* header height variables */
:root {
  --header-h: 56px;       /* desktop header height used for main offset */
  --header-h-mobile: 50px;/* mobile header height */
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: black;
  box-shadow: 0 2px 5px rgba(0,0,0,0.25);
  z-index: 1000;
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.25rem;
  max-width: 1400px;
  margin: 0 auto;
  box-sizing: border-box;
}

.brand {
  display: flex;
  align-items: center;
  z-index: 1001;
}

.brand-name {
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.logo {
  height: 32px;         /* reasonable logo height */
  width: auto;
  display: block;
  flex-shrink: 0;
  margin-right: auto;
  align-self: center;
}

/* push nav-links to the far right on desktop */
.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  color: #fff;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  font-weight: 500;
  transition: opacity 0.3s ease;
}

.nav-links a:hover,
.nav-links a:focus {
  opacity: 0.7;
}

.mobile-menu {
  display: none;
  background: none;
  border: 0;
  padding: 0.5rem;
  cursor: pointer;
  z-index: 1001;
}
.mobile-menu span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  margin: 4px 0;
  transition: all 0.3s ease;
}
.mobile-menu.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.mobile-menu.open span:nth-child(2) {
  opacity: 0;
}
.mobile-menu.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ensure main content sits below the fixed header */
main { padding-top: var(--header-h); }

@media (max-width: 768px) {
  nav {
    padding: 0.5rem 1rem; /* reduced vertical padding on mobile */
  }

  .brand-name {
    font-size: 1.3rem;
  }

  .mobile-menu {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .nav-links {
    display: none; /* hidden by default on mobile */
    position: fixed;
    top: var(--header-h-mobile); /* position mobile menu right below header */
    left: 0;
    right: 0;
    background: black;
    flex-direction: column;
    gap: 0;
    padding: 1rem 0;
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
    z-index: 999;
    max-height: calc(100vh - var(--header-h-mobile));
    overflow-y: auto;
    animation: slideDown 0.3s ease;
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 1.05rem;
    text-align: center;
  }

  .nav-links a:hover {
    background: rgba(255,255,255,0.1);
  }

  /* ensure main offset uses mobile header when on small screens */
  main { padding-top: var(--header-h-mobile); }

  .mobile-menu span {
    width: 20px;
    height: 2px;
    margin: 3px 0;
  }
}
