/* Shared nav behaviour: the current page's link is red, and once the first red bar scrolls up to
   the nav it docks over the faint line beneath it. Each later bar replaces the one before it. */
.nav-links a[aria-current] { color: var(--accent-hover) !important; }

.site-nav::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--accent); opacity: 0; pointer-events: none;
}
.site-nav.has-line::after { opacity: 1; }
.site-nav.line-flick::after { animation: nav-line-flick 420ms steps(1, end); }
@keyframes nav-line-flick {
  0% { opacity: 0; } 14% { opacity: 1; } 28% { opacity: 0.15; } 44% { opacity: 1; }
  60% { opacity: 0.4; } 100% { opacity: 1; }
}

/* the same hairline, for pages that do not use film blocks (About) */
.red-rule { height: 2px; background: var(--accent); margin: 0; }

/* a bar that has docked is drawn by the nav instead, so it never slides under the glass */
html .fb-bar.is-docked, html .red-rule.is-docked { opacity: 0 !important; animation: none !important; }

@media (prefers-reduced-motion: reduce) {
  .site-nav.line-flick::after { animation: none; }
}

/* sub pages: a short red line under the title, a little longer than the title; it docks on the nav like the others */
.title-wrap { display: block; width: fit-content; max-width: 100%; }
.title-rule { height: 2px; background: var(--accent); margin-top: clamp(14px, 1.6vw, 22px);
  width: calc(100% + clamp(12px, 3vw, 48px)); }
html .title-rule.is-docked { opacity: 0 !important; }

/* short separators (About): a short centred red line that grows to the full nav line when it docks */
.red-rule--short {
  background: var(--bg) linear-gradient(var(--accent), var(--accent)) center / min(288px, 40vw) 100% no-repeat;
}
@keyframes nav-line-grow {
  from { clip-path: inset(0 calc(50% - min(144px, 20vw)) 0 calc(50% - min(144px, 20vw))); opacity: 1; }
  to   { clip-path: inset(0 0 0 0); opacity: 1; }
}
body:has(.red-rule--short) .site-nav.line-flick::after { animation: nav-line-grow 560ms cubic-bezier(0.2, 0.8, 0.2, 1); }
@media (prefers-reduced-motion: reduce) {
  body:has(.red-rule--short) .site-nav.line-flick::after { animation: none; }
}

/* film sub-pages: the red line is docked at the top on landing, and the head + players (Hush: head + honors)
   fill one screen under the nav with their content centred */
.sub-gap { height: calc(var(--nav-h) - 2px); }
.film-land { min-height: calc(100svh - var(--nav-h)); display: flex; flex-direction: column; justify-content: center; }
.film-land > .wrap { width: 100%; }
.film-land > .film-head { padding-top: clamp(16px, 3vh, 36px); }
