/* ==========================================================================
   COMPONENT — Nav / header
   Markup:  components/nav.html   (header.nav)
   Anchor:  links to #home #about #services #experience #insights #contact
   Behaviour: scripts/main.js (mobile menu open/close, active link highlight)
   ========================================================================== */

.nav{
  position:fixed;
  z-index:100;
  top:0;left:0;right:0;
  background-color:rgba(255,255,255,.82);
  backdrop-filter:blur(18px);
  border-bottom:1px solid rgba(219,229,223,.7);
  transition:background-color .25s ease,backdrop-filter .25s ease,border-color .25s ease;
}

/* At the very top of the page the hero photograph is the backdrop, so the bar
   gets out of the way and lets the image show. scripts/main.js keeps .nav-at-top
   ONLY while the page still sits at its starting position: the first pixel of
   scroll drops it and the frosted bar fades straight in. The photo's top strip is
   light (luma 236/255), so the dark links stay readable while it is transparent.
   blur(0px) rather than none, so the frosted state can animate in smoothly. */
.nav.nav-at-top{
  background-color:transparent;
  backdrop-filter:blur(0px);
  border-bottom-color:transparent;
}

/* An open mobile menu always needs a solid backdrop, hero or no hero.
   (Must stay after .nav-at-top — equal specificity, so order decides.) */
.nav.nav-open{
  background-color:rgba(255,255,255,.96);
  backdrop-filter:blur(18px);
  border-bottom-color:var(--line);
}
.nav-inner{
  height:var(--nav-h);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:28px;
}
.brand{
  display:flex;
  align-items:center;
  gap:9px;
  min-width:180px;
}
.brand-mark{
  width:30px;height:38px;
  object-fit:contain;
}
.brand-text{line-height:1}
.brand-text strong{
  display:block;
  color:var(--green);
  font-family:"Manrope",sans-serif;
  font-size:20px;
  letter-spacing:-.04em;
}
.brand-text small{
  color:var(--green-dark);
  font-size:9px;
  font-weight:700;
  letter-spacing:.12em;
}
.nav-links{
  display:flex;
  align-items:center;
  gap:30px;
  font-size:13px;
  color:#48534f;
}
.nav-links a{
  position:relative;
  padding:6px 0;
}
.nav-links a::after{
  content:"";
  position:absolute;
  left:0;bottom:0;
  width:0;height:2px;
  background:var(--green);
  transition:.25s ease;
}
.nav-links a:hover::after,
.nav-links a.active::after{width:100%}
.nav-cta{min-width:auto}
.menu{
  display:none;
  background:none;
  border:0;
  font-size:24px;
  line-height:1;
  color:var(--green);
  cursor:pointer;
}

/* ---------- Responsive ---------- */

@media(max-width:1050px){
  .nav-links{gap:18px}
}

@media(max-width:800px){
  .nav-links,
  .nav-cta{display:none}
  .menu{display:block}

  /* Open state (class toggled on <header class="nav"> by scripts/main.js) */
  .nav.nav-open .nav-inner{
    display:grid;
    grid-template-columns:1fr auto;
    grid-template-areas:
      "brand menu"
      "links links"
      "cta   cta";
    height:auto;
    padding-bottom:16px;
  }
  .nav.nav-open .brand{grid-area:brand}
  .nav.nav-open .menu{grid-area:menu;justify-self:end}
  .nav.nav-open .nav-links{
    grid-area:links;
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:0;
    margin-top:10px;
    font-size:15px;
    border-top:1px solid var(--line);
  }
  .nav.nav-open .nav-links a{
    padding:12px 0;
    border-bottom:1px solid var(--line);
  }
  .nav.nav-open .nav-links a::after{display:none}
  .nav.nav-open .nav-cta{
    grid-area:cta;
    display:inline-flex;
    justify-self:start;
    margin-top:16px;
  }
}
