/* The sticky bar at the top of every page: the homepage (scripts/build-home.js) and the project pages
   (src/templates/project-page.html). Each page sets --fill (0 to 1) as it scrolls, which tints the bar
   from the page colour to the panel colour and brings in its bottom line. Project pages tie it to their
   title flying into the bar (js/project-page.js); the homepage to how far it has scrolled.
   Uses the page's colour tokens and .wrap. */
.bar{position:sticky;top:0;z-index:20;
  background:var(--bg);background:color-mix(in srgb,var(--panel) calc(var(--fill,0) * 100%),var(--bg));
  border-bottom:4px solid rgba(18,27,43,var(--fill,0));box-shadow:0 6px 0 rgba(18,27,43,calc(var(--fill,0) * .35))}
.bar-in{display:flex;align-items:center;gap:16px;height:72px;font-family:var(--display)}
.bar .brand{flex:none;font-weight:900;font-size:34px;letter-spacing:-.02em;text-decoration:none;white-space:nowrap}
.bar .brand:hover{color:var(--gold)}

/* project pages: the page title, flown in by js/project-page.js.
   The same line-height and letter-spacing as h1, so the flying title lands exactly on it */
.bar-title{margin-left:auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-decoration:none;
  font:900 28px/.92 var(--display);letter-spacing:-.04em;padding:2px 0;opacity:0;pointer-events:none}
.bar.titled .bar-title{pointer-events:auto}
html:not(.js) .bar-title{display:none}

/* homepage: the section links */
.bar-links{display:flex;gap:26px;list-style:none;margin:0 0 0 auto;padding:0;font-size:15px;line-height:1.5}
.bar-links a{text-decoration:none;font-weight:500;color:var(--soft)}
.bar-links a:hover{color:var(--text)}

@media (max-width:640px){
  .bar-in{height:62px;gap:12px}
  .bar .brand{font-size:24px}
  .bar-title{font-size:23px}
  .bar-links{gap:16px;font-size:14px}
}
/* too narrow for the name and the links side by side: the links get a row of their own under the name */
@media (max-width:480px){
  .bar-in:has(.bar-links){flex-wrap:wrap;height:auto;gap:2px 0;padding-top:10px;padding-bottom:10px}
  .bar-links{margin-left:0;gap:clamp(12px,4vw,16px)}
}
