/* Palette only: match the archive footer while retaining the existing navigation layout. */
body header.masthead, body.reference-home header.masthead {
  --archive-menu-surface:#852e3e;
  --archive-menu-text:#fff7f1;
  --archive-menu-accent:#f5d9c7;
  background:var(--archive-menu-surface);
  color:var(--archive-menu-text);
  border-bottom-color:rgba(255,247,241,.20);
}
body header.masthead a.brand, body.reference-home header.masthead a.brand { color:var(--archive-menu-text); }
body header.masthead a.brand > span, body.reference-home header.masthead a.brand > span { color:var(--archive-menu-accent); }
body header.masthead nav a, body.reference-home header.masthead nav a { color:var(--archive-menu-text); }
body header.masthead nav a:hover, body header.masthead nav a[aria-current="page"],
body.reference-home header.masthead nav a:hover, body.reference-home header.masthead nav a[aria-current="page"] {
  color:var(--archive-menu-accent);
  border-bottom-color:var(--archive-menu-accent);
}
body header.masthead .home-menu summary, body.reference-home header.masthead .home-menu summary { color:var(--archive-menu-text); }
body header.masthead .home-menu > nav, body.reference-home header.masthead .home-menu > nav {
  background:var(--archive-menu-surface); border-color:rgba(255,247,241,.25);
}
body header.masthead :is(a,summary):focus-visible { outline:2px solid var(--archive-menu-accent); outline-offset:3px; }
/* Desktop-only moving underline; keep the regular active-section border as fallback. */
@media (min-width:761px) and (hover:hover) and (pointer:fine) {
  body header.masthead .head-inner > nav.has-sliding-underline { position:relative; }
  body header.masthead .head-inner > nav.has-sliding-underline > a,
  body.reference-home header.masthead .head-inner > nav.has-sliding-underline > a {
    border-bottom-color:transparent;
  }
  .desktop-nav-underline {
    position:absolute; top:0; left:0; width:var(--underline-width,0px); height:1px;
    transform:translate(var(--underline-x,0px),var(--underline-y,0px));
    border-radius:1px; background:var(--archive-menu-accent,#f5d9c7); pointer-events:none;
    transition:transform 270ms cubic-bezier(.22,.72,.26,1), width 270ms cubic-bezier(.22,.72,.26,1);
  }
}
@media (max-width:760px), (hover:none), (pointer:coarse) {
  .desktop-nav-underline { display:none; }
}
@media (prefers-reduced-motion:reduce) {
  .desktop-nav-underline { transition:none; }
}
