/* HEADER: transparent over the hero, white after scrolling (or on inner pages). */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  color: var(--white);
  transition: background-color .25s, color .25s, box-shadow .25s;
}
.site-header.is-scrolled, .site-header.is-solid, .site-header.nav-open {
  background: var(--white); color: var(--night);
  box-shadow: 0 1px 0 var(--line), 0 6px 20px rgba(12, 35, 64, .06);
}
.site-header__bar { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }

.brand { display: flex; align-items: center; gap: .8rem; color: inherit; text-decoration: none; min-width: 0; }
.brand__logo {
  flex: none; width: 48px; height: 48px; display: grid; place-items: center;
  background: var(--white); border-radius: 10px; padding: 4px;
  box-shadow: 0 0 0 1px rgba(12, 35, 64, .12);
}
.brand__logo img { width: 100%; height: 100%; object-fit: contain; }
.brand__name { font: 600 1.05rem/1.15 var(--font-head); letter-spacing: -.005em; max-width: 21ch; }

.site-nav__list { list-style: none; display: flex; align-items: center; gap: .25rem; }
.site-nav a {
  display: block; padding: .6rem .9rem; border-radius: var(--radius);
  color: inherit; text-decoration: none; font: 500 1rem/1.2 var(--font-head);
  transition: background-color .2s, color .2s;
}
.site-nav a:hover { background: rgba(255, 255, 255, .16); }
.is-scrolled .site-nav a:hover, .is-solid .site-nav a:hover, .nav-open .site-nav a:hover { background: var(--panel-soft); }
.site-nav a[aria-current] { box-shadow: inset 0 -3px 0 var(--sun); border-radius: 0; }

/* Projects drop-down */
.has-sub { position: relative; }
.has-sub > a::after { content: ""; display: inline-block; margin-left: .5rem; width: .42em; height: .42em; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-.15em) rotate(45deg); }
.sub {
  list-style: none; position: absolute; left: 0; top: 100%; min-width: 230px;
  background: var(--white); color: var(--night); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: .4rem; margin-top: .25rem;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .18s, transform .18s, visibility .18s;
}
.has-sub:hover .sub, .has-sub:focus-within .sub { opacity: 1; visibility: visible; transform: none; }
.site-nav .sub a { color: var(--night); }
.site-nav .sub a:hover { background: var(--panel-soft); }

/* Mobile menu button */
.nav-toggle { display: none; width: 46px; height: 46px; border: 0; background: transparent; color: inherit; cursor: pointer; border-radius: var(--radius); padding: 0; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: currentColor; margin: 5px auto; transition: transform .2s, opacity .2s; }
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 960px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--white); color: var(--night);
    box-shadow: 0 16px 24px rgba(12, 35, 64, .12);
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
    display: none; padding: .5rem 1.5rem 1.25rem;
  }
  .nav-open .site-nav { display: block; }
  .site-nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav a { padding: .85rem .5rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .site-nav a[aria-current] { box-shadow: inset 3px 0 0 var(--sun); }
  .has-sub > a::after { display: none; }
  .sub { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; padding: 0 0 0 1rem; margin: 0; min-width: 0; }
  .site-nav .sub a { font-weight: 400; }
}
@media (max-width: 480px) {
  .brand__name { font-size: .95rem; }
}
