/* ═══════════════════════════════════════════════════════════
   CBKS77 — Global Nav Bar + ⌘K Overlay · Daylight Industrial
   Host: https://cbks77.com/nav/cbks77-nav.css
   Requires: tokens.css loaded first.
═══════════════════════════════════════════════════════════ */

/* ═══════════════ GLOBAL NAV ═══════════════ */
.gnav {
  position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h); z-index: 800;
  display: flex; align-items: center; gap: 8px; padding: 0 16px;
  background: rgba(244,244,240,.86); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.gnav-logo {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-weight: 700; font-size: 16px;
  letter-spacing: -.02em; color: var(--ink); padding-right: 8px; flex-shrink: 0;
}
.gnav-logo-img { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; }
.gnav-logo span { color: var(--lime-deep); }
.gnav-tabs {
  display: flex; align-items: center; gap: 2px; overflow-x: auto; flex: 1;
  scrollbar-width: none;
  mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
}
.gnav-tabs::-webkit-scrollbar { display: none; }
.gtab {
  display: flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 7px;
  white-space: nowrap; font-family: var(--mono); font-size: 12px; letter-spacing: .02em;
  color: var(--ink-faint); position: relative; transition: color .18s, background .18s;
}
.gtab:hover { color: var(--ink); background: var(--paper-2); }
.gtab .ic { width: 15px; height: 15px; flex-shrink: 0; opacity: .7; }
.gtab.active { color: var(--ink); font-weight: 700; }
.gtab.active .ic { opacity: 1; color: var(--lime-deep); }
.gtab.active::after {
  content: ''; position: absolute; left: 13px; right: 13px; bottom: -1px;
  height: 2px; background: var(--lime); border-radius: 2px 2px 0 0;
}
.gtab .live {
  width: 6px; height: 6px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 0 var(--ok-bd); animation: cbks-pulse 2.4s ease infinite;
}
@keyframes cbks-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.gnav-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; padding-left: 6px; }
.gnav-k {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px; color: var(--ink-soft);
  background: var(--card); border: 1px solid var(--line-2); border-radius: 7px;
  padding: 6px 10px; transition: border-color .18s, color .18s;
}
.gnav-k:hover { border-color: var(--ink); color: var(--ink); }
.gnav-k kbd {
  font-family: var(--mono); font-size: 10px;
  background: var(--paper-2); border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 5px;
}
.gnav-icon {
  width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center;
  color: var(--ink-soft); border: 1px solid transparent; transition: background .18s, color .18s;
}
.gnav-icon:hover { background: var(--paper-2); color: var(--ink); }
.gnav-icon svg { width: 18px; height: 18px; }
.gnav-avatar {
  width: 36px; height: 36px; border-radius: 8px; background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-weight: 700; font-size: 13px; display: grid; place-items: center;
  flex-shrink: 0;
}

/* ═══════════════ CMD+K OVERLAY ═══════════════ */
.kbar {
  position: fixed; inset: 0; z-index: 1000;
  display: none; align-items: flex-start; justify-content: center; padding-top: 14vh;
  background: rgba(21,22,26,.32); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .18s;
}
.kbar.open { display: flex; opacity: 1; }
.kpanel {
  width: min(560px, 92vw); background: var(--card); border: 1px solid var(--line-2);
  border-radius: 16px; box-shadow: 0 40px 90px rgba(20,22,26,.30); overflow: hidden;
  transform: translateY(-10px); transition: transform .2s var(--ease);
}
.kbar.open .kpanel { transform: translateY(0); }
.kinput-row {
  display: flex; align-items: center; gap: 12px; padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.kinput-row .kk {
  font-family: var(--mono); font-size: 10px; color: var(--ink-faint);
  background: var(--paper-2); border: 1px solid var(--line-2); border-radius: 5px; padding: 3px 7px;
}
.kinput {
  flex: 1; font-family: var(--sans); font-size: 16px; color: var(--ink);
  background: none; outline: none; border: none;
}
.kinput::placeholder { color: var(--ink-faint); }
.klist { max-height: 54vh; overflow-y: auto; padding: 8px; }
.kitem {
  display: flex; align-items: center; gap: 13px; padding: 12px 14px;
  border-radius: 10px; cursor: pointer; transition: background .12s;
}
.kitem .ic { width: 18px; height: 18px; color: var(--ink-soft); flex-shrink: 0; }
.kitem.active { background: var(--paper-2); }
.kitem.active .ic { color: var(--lime-deep); }
.kitem .nm { font-family: var(--mono); font-size: 14px; color: var(--ink); font-weight: 700; flex: 1; }
.kitem .st { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.kitem .st.on { background: var(--ok); }
.kitem .alias {
  font-family: var(--mono); font-size: 11px; color: var(--ink-faint);
  background: var(--paper); border: 1px solid var(--line-2); border-radius: 5px; padding: 2px 7px;
}
.kitem.active .alias { border-color: var(--lime-bd); color: var(--lime-ink); }
.kempty {
  padding: 28px; text-align: center; font-family: var(--mono); font-size: 13px; color: var(--ink-faint);
}
.kfoot {
  display: flex; align-items: center; gap: 18px; padding: 11px 18px;
  border-top: 1px solid var(--line); font-family: var(--mono); font-size: 10px; color: var(--ink-faint);
}
.kfoot .kg { display: flex; align-items: center; gap: 6px; }
.kfoot kbd {
  background: var(--paper-2); border: 1px solid var(--line-2); border-radius: 4px; padding: 1px 5px;
}

/* ═══════════════ REVEAL (shared) ═══════════════ */
html.js .rv { opacity: 0; transform: translateY(20px); }
html.js .rv.in { opacity: 1; transform: translateY(0); transition: opacity .6s var(--ease), transform .6s var(--ease); }
@media (prefers-reduced-motion: reduce) { html.js .rv { opacity: 1 !important; transform: none !important; } }
html.js.no-anim .rv { opacity: 1 !important; transform: none !important; transition: none !important; }

/* ═══════════════ RESPONSIVE ═══════════════ */
@media (max-width: 820px) {
  .gnav-k span.lbl { display: none; }
}
@media (max-width: 520px) {
  .gnav-logo { font-size: 15px; }
}
