/* BRAINDANCE · Smart navigation & scroll progress
   Adds to the approved header without changing its size: a 2px lime progress line at the very top,
   a lime label for the section in view and one underline that travels between links. */

/* progress: fixed above the header, never takes pointer events or layout space */
.scroll-progress { position: fixed; left: 0; right: 0; top: 0; z-index: 60; height: 2px; pointer-events: none; transform-origin: 0 50%; transform: scaleX(var(--progress, 0)); background: var(--lime); will-change: transform; }

/* active label */
.nav a[aria-current="location"] { color: var(--lime); }
.nav a[aria-current="location"]:hover { color: var(--lime); }

@media (min-width: 1024px) {
  .nav { position: relative; }
  /* one indicator travels; the per-link hover line becomes a quiet off-white hint so the two never compete */
  .nav a::after { background: rgba(245, 245, 242, .45); }
  .nav a[aria-current="location"]::after { transform: scaleX(0); }
  .nav-ind { position: absolute; left: 0; bottom: -6px; height: 2px; width: var(--w, 0px); background: var(--lime); pointer-events: none;
    transform: translateX(var(--x, 0px)); opacity: var(--o, 0);
    transition: transform 520ms cubic-bezier(.22, 1, .36, 1), width 520ms cubic-bezier(.22, 1, .36, 1), opacity 300ms var(--ease-out); }
  .nav-ind.no-anim { transition: none; }
}
@media (max-width: 1023px) {
  .nav-ind { display: none; }
  /* full-screen menu: the active section keeps its lime label */
  .nav ul a[aria-current="location"] { color: var(--lime); }
}

/* letters (split by nav.js); on desktop they are plain text */
.nav-chars { display: inline-block; white-space: nowrap; }
.nav-chars .ch { display: inline-block; }

/* mobile menu: each label rises from below, letter by letter, link after link */
@media (max-width: 1023px) {
  .nav ul a .nav-chars { overflow: hidden; padding-bottom: .14em; margin-bottom: -.14em; vertical-align: bottom; }
  .nav ul a .ch { transform: translateY(115%); transition: transform 200ms var(--ease-out); }
  .nav.is-open ul a .ch { transform: none; transition: transform 700ms cubic-bezier(.22, 1, .36, 1); transition-delay: calc(120ms + var(--li, 0) * 70ms + var(--ci, 0) * 22ms); }
  .nav .nav-cta-mobile { opacity: 0; transform: translateY(16px); transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out); }
  .nav.is-open .nav-cta-mobile { opacity: 1; transform: none; transition: opacity 500ms var(--ease-out) 650ms, transform 600ms var(--ease-out) 650ms; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-ind { transition: none; }
  .nav ul a .ch, .nav.is-open ul a .ch { transform: none; transition: none; }
  .nav .nav-cta-mobile, .nav.is-open .nav-cta-mobile { opacity: 1; transform: none; transition: none; }
}
