/* =========================================================
   nslabs — platform navigation
========================================================= */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { height: 100%; }
body {
  min-height: 100%;
  font-family: 'Sora', sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

:root {
  --bg-deep: #0a0e1a;
  --bg-surface: #111728;
  --bg-elevated: #161d33;
  --bg-elevated-2: #1a2342;

  --accent: #4f7df5;
  --accent-2: #22d3a7;
  --accent-glow: rgba(79, 125, 245, 0.35);

  --text-primary: #e8ecf4;
  --text-secondary: #8a93ad;
  --text-dim: #5b6480;

  --border: rgba(140, 160, 220, 0.10);
  --border-strong: rgba(140, 160, 220, 0.18);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --shadow-lg: 0 24px 60px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 0 1px rgba(79,125,245,0.35), 0 8px 28px rgba(79,125,245,0.25);
}

/* =========================
   NAV SHELL
========================= */
.ns-nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: 68px;
  padding: 0 clamp(14px, 3vw, 40px);

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  background: rgba(10, 14, 26, 0.55);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);

  border-bottom: 1px solid var(--border);
  z-index: 1000;

  transition: background .3s ease, border-color .3s ease, box-shadow .3s ease, height .3s ease;
}

.ns-nav.scrolled {
  height: 60px;
  background: rgba(10, 14, 26, 0.88);
  border-bottom-color: var(--border-strong);
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
}

/* =========================
   LOGO
========================= */
.ns-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.ns-logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0a0e1a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 6px 18px rgba(79,125,245,0.35), inset 0 1px 0 rgba(255,255,255,0.25);
}

.ns-logo-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
}

.ns-logo-tag {
  font-style: normal;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-2);
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 167, 0.3);
  background: rgba(34, 211, 167, 0.08);
}

/* =========================
   CENTER LINKS
========================= */
.ns-nav-center {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.ns-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 2px;
  padding: 4px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.ns-links > li > a {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 999px;
  transition: color .2s ease, background .2s ease;
  white-space: nowrap;
}

.ns-links > li > a:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.04);
}

.ns-links > li.active > a {
  color: var(--text-primary);
  background: linear-gradient(180deg, rgba(79,125,245,0.18), rgba(79,125,245,0.08));
  box-shadow: inset 0 0 0 1px rgba(79,125,245,0.35), 0 4px 14px rgba(79,125,245,0.18);
}

/* =========================
   DROPDOWN ARROW
========================= */
.ns-dropdown-arrow {
  display: inline-block;
  margin-left: 6px;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.6;
  transition: transform .25s ease, opacity .2s ease;
}

.ns-dropdown:hover .ns-dropdown-arrow {
  transform: rotate(180deg);
  opacity: 1;
}

/* =========================
   DROPDOWN (simple)
========================= */
.ns-dropdown { position: relative; }

.ns-dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);

  min-width: 200px;
  padding: 8px;

  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

.ns-dropdown:hover .ns-dropdown-menu,
.ns-dropdown:focus-within .ns-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.ns-dropdown-menu > a {
  display: block;
  padding: 10px 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background .15s ease, color .15s ease;
}

.ns-dropdown-menu > a:hover {
  background: rgba(79,125,245,0.12);
  color: var(--text-primary);
}

/* =========================
   MEGA — single product card (Linkup)
========================= */
.ns-mega {
  min-width: 340px;
  padding: 10px;
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(79,125,245,0.18), transparent 60%),
    radial-gradient(120% 100% at 100% 100%, rgba(34,211,167,0.14), transparent 60%),
    var(--bg-elevated);
}

.ns-mega-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  transition: transform .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.ns-mega-card:hover {
  transform: translateY(-1px);
  border-color: rgba(79,125,245,0.45);
  background: linear-gradient(180deg, rgba(79,125,245,0.10), rgba(34,211,167,0.06));
  box-shadow: 0 10px 30px rgba(79,125,245,0.18);
}

.ns-mega-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0a0e1a;
  box-shadow: 0 6px 18px rgba(79,125,245,0.35), inset 0 1px 0 rgba(255,255,255,0.3);
}

.ns-mega-body { display: flex; flex-direction: column; gap: 4px; }
.ns-mega-head { display: inline-flex; align-items: center; gap: 8px; }
.ns-mega-head strong {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.ns-mega-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--accent-2);
  border: 1px solid rgba(34,211,167,0.35);
  background: rgba(34,211,167,0.08);
}
.ns-mega-body em {
  font-style: normal;
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.4;
}
.ns-mega-go {
  color: var(--text-dim);
  font-size: 1.1rem;
  transition: transform .2s ease, color .2s ease;
}
.ns-mega-card:hover .ns-mega-go {
  color: var(--accent);
  transform: translateX(3px);
}

/* =========================
   ACTIONS (right)
========================= */
.ns-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ns-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease, border-color .2s ease;
  white-space: nowrap;
}

.ns-btn-ghost {
  color: var(--text-secondary);
  border-color: var(--border-strong);
  background: rgba(255,255,255,0.02);
}
.ns-btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

.ns-btn-primary {
  color: #0a0e1a;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px rgba(79,125,245,0.35), inset 0 1px 0 rgba(255,255,255,0.25);
  font-weight: 600;
}
.ns-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(79,125,245,0.5), inset 0 1px 0 rgba(255,255,255,0.3);
}

/* =========================
   HAMBURGER (hidden on desktop, shown on mobile)
========================= */
.ns-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  cursor: pointer;
  padding: 0 10px;
  flex-shrink: 0;
}

.ns-hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
}

.ns-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ns-hamburger.is-open span:nth-child(2) { opacity: 0; }
.ns-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================
   MOBILE OVERLAY
========================= */
.ns-mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;

  display: flex;
  flex-direction: column;
  padding: 20px;

  background: linear-gradient(180deg, rgba(10,14,26,0.98), rgba(10,14,26,0.96));
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);

  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
  transition: opacity .25s ease, transform .25s ease;
}
.ns-mobile-overlay.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.ns-mobile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.ns-mobile-close {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.ns-mobile-nav {
  display: flex;
  flex-direction: column;
  margin-top: 16px;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
}

.ns-mobile-nav > a,
.ns-mobile-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  list-style: none;
  border: 1px solid transparent;
}

.ns-mobile-group > summary::-webkit-details-marker { display: none; }

.ns-mobile-nav > a:hover,
.ns-mobile-group > summary:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.03);
  border-color: var(--border);
}

.ns-mobile-nav > a.active {
  color: var(--text-primary);
  background: linear-gradient(180deg, rgba(79,125,245,0.18), rgba(79,125,245,0.06));
  border-color: rgba(79,125,245,0.35);
}

.ns-mobile-group[open] > summary .ns-dropdown-arrow { transform: rotate(180deg); }

.ns-mobile-sub {
  display: flex;
  flex-direction: column;
  margin: 4px 0 6px 12px;
  padding-left: 14px;
  border-left: 1px solid var(--border-strong);
}
.ns-mobile-sub > a {
  padding: 11px 12px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
}
.ns-mobile-sub > a:hover {
  color: var(--text-primary);
  background: rgba(79,125,245,0.10);
}

.ns-mobile-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.ns-mobile-actions .ns-btn {
  justify-content: center;
  padding: 14px 16px;
  font-size: 0.95rem;
}

.ns-mobile-foot {
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 14px;
}

/* =========================
   RESPONSIVE BREAKPOINTS
========================= */

/* tighten center pill on medium screens */
@media (max-width: 1180px) {
  .ns-links > li > a { padding: 8px 10px; font-size: 0.8rem; }
}

/* mobile — hide center nav + ghost btn, show hamburger */
@media (max-width: 960px) {
  .ns-nav-center { display: none; }
  .ns-actions .ns-btn-ghost { display: none; }
  .ns-hamburger { display: flex; }
}

@media (max-width: 420px) {
  .ns-logo-tag { display: none; }
  .ns-nav { height: 62px; padding: 0 14px; }
}