/* =====================================================================================
   1.0l NEXT LEVEL - NL NAV looks (batch B5-nav). Every rule is gated by html.nl-<ID> (public/js/nl-core.js NL.flag).
   E21: the gold pill that slides to the lit tab (120 ms), the tab press spring. Transform / opacity / scale only.
   (E22's slide is driven per frame by public/js/cinematics.js; E23's rise is Web Animations in public/js/nl-nav.js.)
   ===================================================================================== */

/* ---- E21 the sliding pill: the notch on top of the bar + a soft gold glow behind the icon ---- */
.nlBarPill { display: none; }
html.nl-E21 #ccTabBar .nlBarPill {
  display: block; position: absolute; left: 0; top: 0; bottom: var(--sa-bottom, env(safe-area-inset-bottom, 0px));
  width: 0; pointer-events: none; z-index: 0; opacity: 0;
  transform: translate3d(0, 0, 0);
  transition: transform 120ms cubic-bezier(.2, .9, .3, 1.12), width 120ms ease-out, opacity 120ms ease-out;
  will-change: transform;
}
html.nl-E21 #ccTabBar .nlBarPill.show { opacity: 1; }
html.nl-E21 #ccTabBar .nlBarPill.nlPillNoAnim { transition: none; }
/* the notch: same gold tab the old per-tab ::before drew, now one piece that travels */
html.nl-E21 #ccTabBar .nlBarPill::before {
  content: ''; position: absolute; left: 14%; right: 14%; top: -3px; height: 5px;
  background: var(--pow, #ffd23f); border: 2px solid #0a0618; border-top: 0; border-radius: 0 0 8px 8px;
  box-shadow: 0 2px 8px rgba(255, 210, 63, .45);
}
/* the glow pool behind the icon */
html.nl-E21 #ccTabBar .nlBarPill::after {
  content: ''; position: absolute; left: 10%; right: 10%; top: 4px; height: 38px; border-radius: 14px;
  background: radial-gradient(ellipse at 50% 55%, rgba(255, 210, 63, .30), rgba(255, 210, 63, 0) 72%);
}
/* HOME has its own gold plate: the pill fades out as it arrives there */
html.nl-E21 #ccTabBar .nlBarPill.main { opacity: 0; }
/* the per-tab notch + glow step aside for the travelling pill */
html.nl-E21 #ccTabBar .ccBarTab.on::before { opacity: 0; }
html.nl-E21 #ccTabBar .ccBarTab.on .ccBarPlate::after { opacity: 0; }
/* the lit tab's label and icon colour change on the tap frame, quickly but not as a hard blink */
html.nl-E21 #ccTabBar .ccBarTab { transition: color 90ms ease-out; }

/* ---- E21 the press spring: .86 on the finger, 1.12 overshoot, settle (300 ms). On the plate, so the icon's
   own .on scale and :active nudge still compose. ---- */
html.nl-E21 #ccTabBar .ccBarTab.ccPress .ccBarPlate { animation: nlTabPress 300ms cubic-bezier(.3, .7, .4, 1) both; }
@keyframes nlTabPress {
  0% { scale: .86; }
  38% { scale: 1.12; }
  68% { scale: .97; }
  100% { scale: 1; }
}
html.nl-E21 #ccTabBar .ccBarTab.ccPress .ccBarLbl { animation: nlTabLbl 240ms ease-out both; }
@keyframes nlTabLbl { 0% { translate: 0 1px; } 45% { translate: 0 -2px; } 100% { translate: 0 0; } }

/* ---- calm: REDUCE MOTION / ANIMATIONS NONE - the pill jumps, nothing springs ---- */
html[data-anim="none"].nl-E21 #ccTabBar .nlBarPill { transition: none; }
html[data-anim="none"].nl-E21 #ccTabBar .ccBarTab.ccPress .ccBarPlate,
html[data-anim="none"].nl-E21 #ccTabBar .ccBarTab.ccPress .ccBarLbl { animation: none; }
@media (prefers-reduced-motion: reduce) {
  html.nl-E21 #ccTabBar .nlBarPill { transition: none; }
  html.nl-E21 #ccTabBar .ccBarTab.ccPress .ccBarPlate,
  html.nl-E21 #ccTabBar .ccBarTab.ccPress .ccBarLbl { animation: none; }
}
/* battery mode (SOME): the slide stays, the label hop goes */
html[data-anim="some"].nl-E21 #ccTabBar .ccBarTab.ccPress .ccBarLbl { animation: none; }
