/* ===== STICKY HEADER ===== */

header {
  position: sticky;
  top: 0;
  z-index: 50;

  background: transparent;
  backdrop-filter: none;
  border-bottom: 1px solid transparent;

 transition: background-color 200ms ease, ;
}

header.nav-scrolled {
  position: sticky;
  top: 0;
  z-index: 50; /* higher than the overlay so the button stays clickable */
  backdrop-filter: blur(16px);
  background: var(--bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
/*cleaning up fade on header when scroll*/
body.home .hero,
body.home .hero-image-wrapper {
  margin-top: 0;
}

body.home header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
}

/* Inner layout */
.nav-inner {
  width: 100%;
  margin: 0;
  padding: 0.8rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;  /* brand left, links right */
  box-sizing: border-box;
}

/*-- Desktop Defaults -- */
.nav-links {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
}

.nav-toggle {
  display: flex;
  align-items: center;
  font-size: 1.4rem;
  margin-left: 2rem;
}
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .nav-toggle {
    display: flex;
  }
  .nav-panel-links a {
    display: block !important;
  }
}

/* Brand */
.brand {
  letter-spacing: 0.18em;
  font-size: 0.85rem;
  text-transform: uppercase;
  font-weight: 600;
}

.brand a {
color: var(--accent);
text-decoration: none;
letter-spacing: 0.15em;
  font-size: 1.1rem;
  display: inline-block;
}

/* ===== TOP BAR NAV (INLINE) ===== */

.nav-primary {
  display: flex;
  align-items: center;
}

.nav-primary a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 1.8rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.nav-primary a:hover {
  color: var(--accent);
}

/* Active page highlight */
.nav-active {
  color: var(--accent);
}

/* ===== HAMBURGER BUTTON ===== */

.nav-toggle {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0;
  margin-left: 1rem;
}

/* ===== OVERLAY NAV PANEL ===== */

/* Base: full-screen overlay, hidden by default */

/* Base overlay panel – full width, below header, hidden by default */
.nav-panel {
  position: fixed;
  inset: 0;                 /* full viewport */
  width: 100vw;
  height: 100vh;

  display: none;            /* JS toggles this */
  z-index: 40;              /* was 40 */

  background: rgba(5, 5, 9, 0.84);
  backdrop-filter: blur(18px);

  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-end;    /* desktop: right-aligned */
  padding: 3.5rem 4rem 3rem;
  box-sizing: border-box;
  overflow-y: auto;
}
/* When open: turn on flex */
.nav-panel.open {
  display: flex;
}

/* Links inside overlay */
.nav-panel a {
  display: block;
  margin: 0.9rem 0;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-decoration: none;
  text-align: right;
}

.nav-panel a:hover,
.nav-panel a.nav-active {
  color: var(--accent);
}

/* ===== MOBILE BEHAVIOR ===== */

/* On small screens, hide inline nav and use only hamburger + overlay */
@media (max-width: 800px) {
  .nav-primary {
    display: none;
  }
}

/* HARD OVERRIDES FOR NAV LAYOUT ----------------------------- */

/* Make sure the header itself is full-width */
/*
header {
  width: 100%;
  max-width: none;
  margin: 0;
  backdrop-filter: blur(16px);
  background: var(--bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
*/
/* Nav inner: full-bleed, name left, links cluster right */
.nav-inner {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.8rem 0.75rem 0.8rem 2.5rem;  /* top right bottom left */

  display: flex;
  align-items: center;
  justify-content: flex-start;  /* we’ll use margin-left:auto on the links */
}

/* JOEL DEMAN Brand stays on the left */
.brand {
  display: inline-flex;
  align-items: center;
}

.brand a {
  color: var(--accent);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 1.05rem;
  font-weight: 500;
}

/* Inline nav: pushed all the way right */
.nav-primary {
  display: flex;
  align-items: center;
  margin-left: auto;        /* THIS pins the cluster to the right */
}

.nav-primary a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 1.6rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

/* Hamburger stays on the far right on mobile */
.nav-toggle {
  margin-left: 1rem;
}

@media (max-width: 768px) {
  .nav-inner {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    
    width: 100%;
    max-width: 100%;
    padding: 0.75rem 1rem;
    box-sizing: border-box;
  }
  /* Make the overlay feel full and centered on phones */
  .nav-panel {
    align-items: stretch;         /* full-width column instead of right edge */
    justify-content: flex-start;
    padding: 4.25rem 1.5rem 2.5rem;
  }

  /* If your links live in a list/container inside .nav-panel, stretch it */
  .nav-panel .nav-links,
  .nav-panel ul {
    width: 100%;
  }

  .nav-panel .navlinks,
  .nav-panel ul {
    width: 100%;
  }
  .nav-panel a {
    display: block;
    width: 100%;
    padding: 0.9rem 0;
    font-size: 1.05rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-align: right;
  }
  .nav-links {
    display:none;
  }
  .nav-toggle {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }
  .nav {
    max-width: 100%;
    overflow-x: clip;
  }
  .brand {
    flex: 0 1 auto;
  }
}

/* STICKY NAV CONTAINER – MAKES THE WHOLE BAR FOLLOW SCROLL */
#site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
}

/* Force scrolled state to visibly darken the injected nav header */
#site-nav header.nav-scrolled {
  background: rgba(0,0,0,0.78) !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
}
