/* ==========================================================================
   DashView — landing page navigation (css/nav-pro.css)
   --------------------------------------------------------------------------
   Loaded LAST on index.html. It replaces the look of the top bar that earlier
   layers (index-pro / index-glass / index-plus / index-smooth) each tweaked.

   What it does
   · Three-column bar: brand | centred links | actions, so the links are truly
     centred no matter how wide the buttons are.
   · Transparent over the hero, frosted bar with a hairline once you scroll.
   · One control height (40px) for theme toggle, Sign in, Request access, menu.
   · Calm hover + an accent underline that marks the section you are reading.
   · Mobile menu actually opens: the bar itself no longer uses backdrop-filter
     or will-change, because either one turns the bar into the containing block
     of the fixed menu panel and clips it to 64px (the old menu showed nothing).
   Pure presentation: no markup, ids or behaviour are changed here.
   ========================================================================== */

:root { --nav-h: 68px; }
@media (max-width: 720px) { :root { --nav-h: 64px; } }

/* ── The bar ───────────────────────────────────────────────────────────────
   #nav (id) beats the !important background / border that index-glass.css sets
   on .nav and .nav.scrolled. The frosted layer lives on ::before so that the
   bar itself never creates a containing block for the fixed mobile panel.   */
#nav {
  --np-line: var(--g-edge, rgba(255, 255, 255, .12));
  --np-hover: rgba(127, 127, 127, .12);
  height: var(--nav-h);
  background: transparent !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  will-change: auto;
  transition: transform .45s var(--ease-out, cubic-bezier(.16, 1, .3, 1));
}
html[data-theme="light"] #nav { --np-line: rgba(20, 24, 19, .1); }

#nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--np-line);
  box-shadow: 0 12px 32px -24px rgba(0, 0, 0, .55);
  opacity: 0;
  transition: opacity .3s ease;
}
#nav.scrolled::before,
#nav.menu-open::before { opacity: 1; }

/* index-plus.css puts a blur on .nav-inner while the menu is open; that would
   trap the fixed panel inside the bar, so it is switched off here. */
#nav .nav-inner {
  background: none !important;
  border: 0 !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* ── Layout (desktop and wide tablet) ─────────────────────────────────── */
.nav-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 24px;
  min-height: var(--nav-h);
}
.nav-brand { justify-self: start; gap: 10px; font-size: 1.0625rem; font-weight: 700; letter-spacing: -.015em; }
.nav-logo-ring { width: 32px; height: 32px; border-radius: 9px; }
.nav-links { justify-self: center; margin: 0; padding: 0; gap: 4px; }
.nav-actions { justify-self: end; gap: 10px; }

/* ── Links ─────────────────────────────────────────────────────────────── */
.nav-links a {
  position: relative;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: -.005em;
  color: var(--text2);
  background: transparent;
  transition: color .2s ease, background-color .2s ease;
}
.nav-links a:not(.active):hover { color: var(--text); background: var(--np-hover, rgba(127, 127, 127, .12)); }
.nav-links a.active { color: var(--text); background: transparent; }
.nav-links a.active::after,
.nav-links a.active:hover::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 2px;
  width: auto; height: 2px; margin: 0;
  border-radius: 2px;
  background: var(--amber);
  animation: npLine .35s var(--ease-out, cubic-bezier(.16, 1, .3, 1)) both;
}
@keyframes npLine { from { transform: scaleX(.3); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }

/* ── Actions: one height, one radius ──────────────────────────────────── */
.nav-actions .theme-toggle,
.nav-burger {
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid var(--np-line);
  background: transparent;
  color: var(--text2);
}
.nav-actions .theme-toggle:hover,
.nav-burger:hover { background: var(--np-hover, rgba(127, 127, 127, .12)); color: var(--text); transform: none; }
.nav-actions .theme-toggle:active { transform: scale(.94); }
.nav-actions .theme-toggle { margin-right: 6px; }
.nav-actions .theme-toggle::after { /* hairline between the toggle and the two buttons */
  content: "";
  position: absolute;
  right: -9px; top: 50%;
  width: 1px; height: 20px; margin-top: -10px;
  background: var(--np-line);
}

.nav-actions .btn {
  height: 40px; min-height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: .875rem; font-weight: 600;
}
/* Sign in: quiet. Request access: the one loud thing in the bar. */
#loginBtn {
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: var(--text);
}
#loginBtn:hover { background: var(--np-hover, rgba(127, 127, 127, .12)); border-color: transparent; color: var(--text); }
#waitlistBtn {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 8px 20px -10px var(--amber);
}
#waitlistBtn:hover { transform: translateY(-1px); }

/* Visible keyboard focus everywhere in the bar */
#nav a:focus-visible,
#nav button:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* ── Wide tablets: the bar has only four links now, so it fits from 861px ─ */
@media (min-width: 861px) {
  .nav-links { display: flex; }
  .nav-links .nav-menu-only { display: none; }
  .nav-burger { display: none; }
  .nav-actions { margin-left: 0; }
}

/* ── Phones and small tablets: brand left, actions right, menu button ──── */
@media (max-width: 860px) {
  .nav-inner { display: flex; column-gap: 12px; }
  .nav-actions { margin-left: auto; gap: 8px; }
  .nav-actions .theme-toggle { margin-right: 0; }
  .nav-actions .theme-toggle::after { display: none; }
  .nav-burger { display: flex; }
}
@media (max-width: 720px) {
  .nav-actions .btn { padding: 0 14px; }
}

/* ── Mobile menu panel ─────────────────────────────────────────────────── */
@media (max-width: 860px) {
  #nav.menu-open { transform: none !important; will-change: auto; }
  #nav.menu-open::before { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; } /* solid, nothing bleeds through */
  #nav.menu-open .nav-links {
    justify-self: stretch;   /* justify-self:center would shrink the fixed panel to its content */
    background: var(--bg);
    border-top: 1px solid var(--np-line);
    padding-top: 6px;
  }
  #nav.menu-open .nav-links a,
  #nav.menu-open .nav-links button {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%;
    padding: 17px 4px;
    border-radius: 0;
    border-bottom: 1px solid var(--np-line);
    font-size: 1.0625rem; font-weight: 600;
    color: var(--text);
    background: none;
    text-align: left;
  }
  #nav.menu-open .nav-links a:not(.active):hover { background: none; color: var(--amber); }
  /* chevron instead of the desktop underline */
  #nav.menu-open .nav-links a::after,
  #nav.menu-open .nav-links a.active::after,
  #nav.menu-open .nav-links a.active:hover::after {
    content: "";
    position: static;
    width: 8px; height: 8px; margin: 0 6px 0 0;
    border: 0; border-top: 2px solid currentColor; border-right: 2px solid currentColor;
    border-radius: 0;
    background: none;
    transform: rotate(45deg);
    opacity: .4;
    animation: none;
  }
  #nav.menu-open .nav-links a.active { color: var(--amber); }
}

@media (prefers-reduced-motion: reduce) {
  #nav, #nav::before, .nav-links a { transition: none; }
  .nav-links a.active::after { animation: none; }
}
@media (prefers-reduced-transparency: reduce) {
  #nav::before { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg); }
}
