/* ============================================================
   NAV · HAMBURGER — on phones / small tablets (<=calc(900 * var(--u))) the nav links
   fold into a full-screen panel opened by a three-bar button (nav.js
   toggles .is-open). Shared by every page. Load AFTER the page's own
   nav rules so these win at the breakpoint.
   ============================================================ */
/* ============================================================
   NAV BRAND — the italic "ADAM GALANTE" wordmark at the left of the nav
   (Figma: About frame; sized to match the nav links).
   On every page except the home hero; the home page fades it in as the
   hero hands over to Works (--brand-in is driven by the hero scroll script).
   ============================================================ */
.site-nav .nav-brand{
  position:relative;z-index:var(--z-raised);pointer-events:auto;
  margin:calc(-3 * var(--u)) auto 0 0;align-self:flex-start;
  padding:0;border:0;
  font-size:var(--fs-brand);font-weight:var(--fw-regular);font-style:italic;
  letter-spacing:-.032em;line-height:1.17;text-transform:uppercase;white-space:nowrap;
  color:var(--color-text);text-decoration:none;
  opacity:var(--brand-in,1);
  translate:0 calc((1 - var(--brand-in,1)) * calc(-8 * var(--u)));
  transition:opacity var(--dur-fast) ease;
}
.site-nav .nav-brand:hover{color:var(--color-text-hover);}
.site-nav .nav-brand.is-hidden{pointer-events:none;visibility:hidden;}
@media (max-width:900px){
  .site-nav .nav-brand{margin:calc(20 * var(--u)) auto 0 calc(16 * var(--u));}
}
.nav-toggle{display:none;}
@media (max-width:900px){
  .site-nav{justify-content:flex-end;padding:0;}
  .nav-toggle{
    display:block;position:relative;z-index:var(--z-raised);pointer-events:auto;
    width:calc(48 * var(--u));height:calc(48 * var(--u));margin:calc(6 * var(--u)) calc(8 * var(--u)) 0 0;padding:0;
    background:none;border:0;cursor:pointer;
    -webkit-tap-highlight-color:transparent;
  }
  .nav-toggle span{
    position:absolute;left:calc(13 * var(--u));width:calc(22 * var(--u));height:calc(2 * var(--u));border-radius:1px;
    background:var(--color-text);
    transition:transform var(--dur-base) var(--ease-site),top var(--dur-base) var(--ease-site),opacity var(--dur-fast) ease;
  }
  .nav-toggle span:nth-child(1){top:calc(16 * var(--u));}
  .nav-toggle span:nth-child(2){top:calc(23 * var(--u));}
  .nav-toggle span:nth-child(3){top:calc(30 * var(--u));}
  .site-nav.is-open .nav-toggle span:nth-child(1){top:calc(23 * var(--u));transform:rotate(45deg);}
  .site-nav.is-open .nav-toggle span:nth-child(2){opacity:0;}
  .site-nav.is-open .nav-toggle span:nth-child(3){top:calc(23 * var(--u));transform:rotate(-45deg);}
  .site-nav ul{
    position:absolute;top:0;left:0;width:100%;height:100vh;height:100dvh;
    box-sizing:border-box;
    flex-direction:column;align-items:flex-start;gap:calc(26 * var(--u));
    padding:calc(104 * var(--u)) calc(24 * var(--u)) calc(40 * var(--u));
    background:var(--color-overlay);
    visibility:hidden;opacity:0;
    transition:opacity var(--dur-base) ease,visibility 0s linear var(--dur-base);
    overscroll-behavior:contain;touch-action:none;
  }
  .site-nav.is-open ul{visibility:visible;opacity:1;transition:opacity var(--dur-base) ease;}
  .site-nav a{display:inline-block;font-size:var(--fs-menu);padding-bottom:calc(8 * var(--u));}
  .site-nav a.is-current{padding-bottom:calc(7 * var(--u));}
  .site-nav.is-open{mix-blend-mode:normal;}
}

/* logo mark in place of the wordmark */
.site-nav .nav-brand{display:block;line-height:0;margin-top:calc(-12 * var(--u));}
.site-nav .nav-brand .nav-logo{display:block;width:calc(40 * var(--u));height:calc(40 * var(--u));}
@media (max-width:900px){
  .site-nav .nav-brand{margin-top:calc(14 * var(--u));}
  .site-nav .nav-brand .nav-logo{width:calc(36 * var(--u));height:calc(36 * var(--u));}
}

/* Sub-pages: the nav blends with `difference` (so the links read on any
   backdrop), which turned the black logo tile transparent. The logo is
   therefore its own fixed element OUTSIDE the nav, so it looks exactly like
   the home page: a solid black tile with white letters, at every width. */
.nav-brand--fixed{
  position:fixed;z-index:calc(var(--z-nav) + 1);
  top:calc(21 * var(--u));left:max(var(--gutter), calc(50vw - var(--canvas) / 2 + var(--gutter)));
  display:block;margin:0;padding:0;border:0;line-height:0;
}
.nav-brand--fixed .nav-logo{display:block;width:calc(40 * var(--u));height:calc(40 * var(--u));}
@media (max-width:900px){
  .nav-brand--fixed{top:calc(14 * var(--u));left:calc(16 * var(--u));}
  .nav-brand--fixed .nav-logo{width:calc(36 * var(--u));height:calc(36 * var(--u));}
}

/* ---- nav underline: only the current section is underlined; hovering another
   link draws its line in from left to right (and retracts to the right on leave) ---- */
.site-nav ul a{
  position:relative;
  border-bottom:0;
}
.site-nav ul a::after{
  content:"";
  position:absolute;
  left:0;right:0;bottom:0;
  height:calc(2 * var(--u));
  background:currentColor;
  transform:scaleX(0);
  transform-origin:right center;
  transition:transform .45s var(--ease-site);
  pointer-events:none;
}
.site-nav ul a:hover::after,
.site-nav ul a:focus-visible::after,
.site-nav ul a.is-current::after{
  transform:scaleX(1);
  transform-origin:left center;
}
.site-nav ul a.is-current::after{animation:navLineIn .6s var(--ease-site) .15s backwards;}
@keyframes navLineIn{from{transform:scaleX(0);}}
@media (prefers-reduced-motion:reduce){
  .site-nav ul a::after{transition:none;}
  .site-nav ul a.is-current::after{animation:none;}
}
