/* nav.css — the collapsible mobile navbar, shared by base + home.
 *
 * Desktop (>=601px) is untouched: the toggle is hidden and the nav keeps whatever
 * layout each template defines. At <=600px the toggle appears, the links + search
 * (.nav-right) become an in-flow drop panel below the bar (so it pushes content
 * rather than overlaying the signal band), and the links punch in as a staggered
 * cascade each time it opens. JS lives in navmenu.js. */

.navtoggle{ display:none; }   /* desktop: no toggle */

@media (max-width:600px){
  /* bar: brand-wrap + toggle only; .nav-right is an overlay drawer dropped below it */
  nav{ align-items:center; }
  nav.nav-open{ z-index:50; }   /* lift the whole bar above the fixed signal band while open */
  /* the hero's fixed float controls get out of the way while the drawer is open */
  body.nav-open .mute, body.nav-open .vizfloat, body.nav-open .nowplaying{ opacity:0; pointer-events:none; transition:opacity .18s ease; }

  .navtoggle{
    display:grid; place-items:center; width:44px; height:44px; flex:0 0 auto;
    background:rgba(7,9,13,.5); border:1px solid var(--line); border-radius:12px; cursor:pointer;
    transition:border-color .15s ease, box-shadow .15s ease, transform .08s ease;
  }
  .navtoggle:active{ transform:scale(.9); }
  nav.nav-open .navtoggle{ border-color:var(--cyan); box-shadow:0 0 14px rgba(53,224,208,.3); }
  .navtoggle .bars{ position:relative; width:20px; height:14px; }
  .navtoggle .bars span{ position:absolute; left:0; width:100%; height:2px; background:var(--cyan); border-radius:2px;
    box-shadow:0 0 6px rgba(53,224,208,.6); transition:transform .22s cubic-bezier(.2,.9,.1,1), opacity .18s ease, top .22s ease; }
  .navtoggle .bars span:nth-child(1){ top:0; }
  .navtoggle .bars span:nth-child(2){ top:6px; }
  .navtoggle .bars span:nth-child(3){ top:12px; }
  nav.nav-open .navtoggle .bars span:nth-child(1){ top:6px; transform:rotate(45deg); }
  nav.nav-open .navtoggle .bars span:nth-child(2){ opacity:0; }
  nav.nav-open .navtoggle .bars span:nth-child(3){ top:6px; transform:rotate(-45deg); }

  /* a smaller mark so the resting bar isn't too tall */
  .navmark .neon{ width:44px; }

  /* .nav-right → the collapsible overlay drawer (dropped below the bar, over content
     and the fixed signal band) */
  .nav-right{
    position:absolute; top:100%; left:0; right:0; z-index:50;
    flex-direction:column; align-items:stretch; gap:0;
    background:var(--bg2);   /* opaque: the drawer must fully cover the fixed signal band behind it */
    border-top:1px solid var(--line); border-bottom:1px solid var(--line);
    box-shadow:0 22px 44px rgba(0,0,0,.55);
    max-height:0; overflow:hidden; opacity:0;
    transition:max-height .28s cubic-bezier(.2,.8,.2,1), opacity .2s ease;
  }
  nav.nav-open .nav-right{ max-height:76vh; overflow-y:auto; opacity:1; }

  /* links: full-width touch rows (hover kickrow is desktop-only; mobile gets :active) */
  .nav-links{ flex-direction:column; align-items:stretch; gap:0; flex-wrap:nowrap; padding:6px 0; }
  .nav-links a{
    display:block; padding:15px 4px; margin-block:0; font-size:15px; letter-spacing:1px; text-transform:uppercase;
    color:var(--fg); border-left:2px solid transparent;
    transition:background .14s ease, border-color .14s ease, color .12s ease, transform .1s ease;
  }
  .nav-links a > span{ display:inline; }
  .nav-links a:active{
    background:color-mix(in srgb, var(--cyan) 16%, transparent); border-left-color:var(--cyan); color:var(--cyan);
    transform:translateX(7px) skewX(-8deg) scale(1.015);
    box-shadow:-5px 0 0 var(--hot), 0 0 16px rgba(53,224,208,.28);
  }

  /* search sits at the bottom of the panel, full width */
  #omnibox, #omnibox:focus{ width:100%; margin:6px 0 14px; }

  /* cascade: links (and the search) punch in staggered each time the panel opens.
     `backwards` fill keeps each item hidden through its delay, then releases to base
     so the :active tap juice still applies afterward. */
  @keyframes nav-in{
    0%  { opacity:0; transform:translateX(-14px) skewX(6deg); }
    60% { opacity:1; transform:translateX(3px) skewX(-2deg); }
    100%{ opacity:1; transform:none; }
  }
  nav.nav-open .nav-links a{ animation:nav-in .34s cubic-bezier(.2,.9,.1,1) backwards; }
  nav.nav-open .nav-links a:nth-child(1){ animation-delay:.03s; }
  nav.nav-open .nav-links a:nth-child(2){ animation-delay:.07s; }
  nav.nav-open .nav-links a:nth-child(3){ animation-delay:.11s; }
  nav.nav-open .nav-links a:nth-child(4){ animation-delay:.15s; }
  nav.nav-open .nav-links a:nth-child(5){ animation-delay:.19s; }
  nav.nav-open .nav-links a:nth-child(6){ animation-delay:.23s; }
  nav.nav-open #omnibox{ animation:nav-in .34s cubic-bezier(.2,.9,.1,1) backwards; animation-delay:.27s; }
}

@media (max-width:600px) and (prefers-reduced-motion:reduce){
  nav.nav-open .nav-links a, nav.nav-open #omnibox{ animation:none; }
  .navtoggle .bars span, .nav-right{ transition:none; }   /* snap the drawer open, no slide */
}
