@font-face {
  font-family: "Instrument Serif";
  src: url("assets/fonts/instrument-serif.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root { --site-nav-height: 66px; }

.nav {
  --nav-ease: cubic-bezier(.2,.7,.15,1);
  position: sticky;
  top: 0;
  z-index: 50;
  box-sizing: border-box;
  height: var(--site-nav-height);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(22px, 4.4vw, 76px);
  border-bottom: 1px solid transparent;
  color: #fff0dc;
  font: 400 13px/normal "PingFang SC", "HarmonyOS Sans SC", "Source Han Sans SC", "Noto Sans SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: background .5s var(--nav-ease), backdrop-filter .5s var(--nav-ease), border-color .5s var(--nav-ease);
}

#nav { position: fixed; inset-inline: 0; }

.nav.is-solid {
  background: rgba(28,21,18,.82);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-bottom-color: rgba(255,240,220,.08);
}

.nav .brand {
  color: #fff0dc;
  font: 19px/1 "Instrument Serif", Georgia, serif;
  letter-spacing: .13em;
  text-shadow: 0 1px 14px rgba(60,20,4,.35);
}

.nav a, .nav a:hover { color: inherit; text-decoration: none; }
.nav a:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.nav__links {
  display: flex;
  align-items: center;
  letter-spacing: .06em;
  color: rgba(255,240,220,.9);
}
.nav__links a { position: relative; padding: 6px 0; opacity: .92; transition: opacity .3s; }
.nav__links a + a { margin-left: 14px; padding-left: 15px; }
.nav__links a + a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 10px;
  background: rgba(255,240,220,.34);
  transform: translateY(-50%);
}
.nav__links a::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s var(--nav-ease);
}
.nav__links a + a::after { left: 15px; }
.nav__links a:is(:hover, :focus-visible, [aria-current]) { opacity: 1; }
.nav__links a:is(:hover, :focus-visible, [aria-current])::after { transform: scaleX(1); }

@media (max-width: 860px) {
  :root { --site-nav-height: 58px; }

  .nav {
    background: rgba(28,21,18,.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  .nav .brand { font-size: 16px; }
  .nav__links { font-size: 11px; letter-spacing: .02em; }
  .nav__links a + a { margin-left: 8px; padding-left: 9px; }
  .nav__links a + a::after { left: 9px; }
}

@media (max-width: 540px) {
  :root { --site-nav-height: 82px; }

  .nav {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
  }
  .nav__links { width: 100%; justify-content: space-between; white-space: nowrap; }
  .nav__links a + a { margin-left: 0; padding-left: 6px; }
  .nav__links a + a::after { left: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .nav, .nav__links a, .nav__links a::after { transition: none; }
}
