/* ============================================================
   SV Tech Innovations — Navbar (Premium Frosted Glass)
   ============================================================ */

#nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000;
  /* Strong frosted glass */
  background: var(--nav-bg);
  backdrop-filter: var(--nav-blur);
  -webkit-backdrop-filter: var(--nav-blur);
  border-bottom: 1px solid var(--nav-border);
  box-shadow: var(--nav-shadow);
  transition: background var(--base) var(--ease),
              box-shadow var(--base) var(--ease),
              border-color var(--base) var(--ease);
}

/* Even deeper glass when scrolled */
#nav.scrolled {
  background: rgba(255,255,255,.65);
  box-shadow: 0 4px 40px rgba(124,58,237,.13), 0 1px 0 rgba(255,255,255,.95) inset;
  border-bottom-color: rgba(124,58,237,.22);
}
[data-theme="dark"] #nav.scrolled {
  background: rgba(13,6,24,.72);
  box-shadow: 0 4px 40px rgba(0,0,0,.6), 0 1px 0 rgba(167,139,250,.10) inset;
}

/* Subtle top accent line */
#nav::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad);
  opacity: .7;
}

.nav-wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; gap: 1rem;
}

/* ── LOGO ── */
.nav-logo {
  display: inline-flex; align-items: center;
  font-family: var(--font); font-size: 1.35rem; font-weight: 900;
  text-decoration: none; gap: 0;
  transition: transform var(--spring), filter var(--fast);
  white-space: nowrap;
}
.nav-logo:hover { transform: scale(1.04); filter: brightness(1.1); }

.logo-sv {
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo-tech { color: var(--text); }
.logo-dot  { color: var(--orange); }

.nav-logo-img {
  height: 38px;
  width: auto;
  object-fit: contain;
  display: block;
}

/* ── NAV LINKS ── */
.nav-menu { display: flex; align-items: center; gap: .1rem; list-style: none; margin: 0; padding: 0; }
.nav-menu li { position: relative; }
.nav-menu li a {
  display: block; padding: .48rem .95rem;
  border-radius: var(--radius-full);
  font-size: .9rem; font-weight: 600;
  color: var(--text2);
  transition: all var(--fast) var(--ease);
  position: relative;
}
.nav-menu li a:hover {
  color: var(--purple);
  background: rgba(124,58,237,.08);
}
.nav-menu li a.active {
  color: var(--purple);
  background: rgba(124,58,237,.10);
  font-weight: 700;
}
[data-theme="dark"] .nav-menu li a:hover,
[data-theme="dark"] .nav-menu li a.active {
  background: rgba(167,139,250,.12);
  color: var(--purple);
}

/* ── NAV CTA BUTTON ── */
.nav-cta {
  padding: .52rem 1.35rem !important;
  font-size: .86rem !important;
  font-weight: 700 !important;
  background: var(--grad) !important;
  color: #fff !important;
  border: none !important;
  border-radius: var(--radius-full) !important;
  box-shadow: 0 2px 14px rgba(124,58,237,.28) !important;
  transition: transform var(--spring), box-shadow var(--fast) !important;
}
.nav-cta:hover {
  transform: translateY(-1px) scale(1.02) !important;
  box-shadow: 0 4px 22px rgba(124,58,237,.42) !important;
  background: var(--grad) !important;
  color: #fff !important;
}

/* ── NAV ACTIONS ── */
.nav-actions { display: flex; align-items: center; gap: .55rem; }

/* ── THEME TOGGLE ── */
.theme-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border2);
  /* Glass pill style */
  background: rgba(255,255,255,.6);
  backdrop-filter: blur(8px);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
  transition: all var(--spring);
  position: relative; overflow: hidden;
  flex-shrink: 0;
}
.theme-btn:hover {
  background: var(--purple-light);
  border-color: var(--purple);
  transform: scale(1.1) rotate(15deg);
  box-shadow: 0 0 0 4px rgba(124,58,237,.12);
}
[data-theme="dark"] .theme-btn {
  background: rgba(22,11,34,.6);
}
[data-theme="dark"] .theme-btn:hover {
  background: rgba(124,58,237,.2);
}
.ti { position: absolute; transition: all var(--spring); }
.ti-moon { transform: translateY(40px); opacity: 0; }
[data-theme="dark"] .ti-sun  { transform: translateY(-40px); opacity: 0; }
[data-theme="dark"] .ti-moon { transform: translateY(0); opacity: 1; }

/* ── HAMBURGER ── */
.ham {
  display: none; flex-direction: column; gap: 5px;
  width: 40px; height: 40px; align-items: center; justify-content: center;
  border: 1.5px solid var(--border2);
  background: rgba(255,255,255,.6);
  backdrop-filter: blur(8px);
  cursor: pointer; border-radius: var(--radius-md); padding: 4px;
  transition: all var(--fast);
}
.ham:hover { background: var(--purple-light); border-color: var(--purple); }
[data-theme="dark"] .ham { background: rgba(22,11,34,.6); }
[data-theme="dark"] .ham:hover { background: rgba(124,58,237,.15); }
.ham span { display: block; width: 18px; height: 2px; background: var(--text2); border-radius: 2px; transition: all var(--base); }
.ham.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ham.open span:nth-child(2) { opacity: 0; transform: translateX(-8px); }
.ham.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── MOBILE MENU ── */
.mob-menu {
  display: none; flex-direction: column; gap: .25rem;
  padding: 1.25rem 1.25rem 1.5rem;
  /* Stronger frosted glass */
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border-top: 1px solid rgba(124,58,237,.12);
}
[data-theme="dark"] .mob-menu {
  background: rgba(13,6,24,.88);
  backdrop-filter: blur(28px) saturate(180%);
  border-top-color: rgba(167,139,250,.12);
}
.mob-menu.open { display: flex; }
.mob-menu a {
  display: block; padding: .72rem 1rem; border-radius: var(--radius-md);
  font-weight: 600; font-size: .92rem; color: var(--text2);
  transition: all var(--fast);
}
.mob-menu a:hover { background: rgba(124,58,237,.08); color: var(--purple); }

/* ── TICKER ── */
.ticker {
  background: var(--purple-pale);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden; padding: .72rem 0;
}
[data-theme="dark"] .ticker { background: var(--bg2); }

.ticker-track {
  display: flex; gap: 0; white-space: nowrap;
  animation: ticker 30s linear infinite;
}
.ticker-track span {
  display: inline-flex; align-items: center;
  padding: 0 2.5rem;
  font-size: .76rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--purple-dark);
  opacity: .7;
}
[data-theme="dark"] .ticker-track span { color: var(--purple-mid); }
.ticker-track span::before { content: '◆'; margin-right: .8rem; color: var(--purple); font-size: .48rem; opacity: .8; }

@keyframes ticker { from { transform: translateX(0) } to { transform: translateX(-50%) } }
.ticker:hover .ticker-track { animation-play-state: paused; }

/* ── LIVE BADGE ── */
.live-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .3rem .85rem;
  background: rgba(34,197,94,.1);
  border: 1px solid rgba(34,197,94,.25);
  border-radius: var(--radius-full);
  font-size: .73rem; font-weight: 700; color: #16a34a;
}
[data-theme="dark"] .live-badge { color: #4ade80; background: rgba(34,197,94,.12); }
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34,197,94,.4);
  animation: pulse-dot 1.8s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse-dot {
  0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,.4); }
  50%      { box-shadow: 0 0 0 5px rgba(34,197,94,.0); }
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .nav-menu { display: none; }
  .ham { display: flex; }
}

@media (max-width: 360px) {
  .nav-logo {
    font-size: 1.15rem;
  }
  .nav-logo-img {
    height: 32px;
    margin-right: 0.25rem !important;
  }
  .theme-btn, .ham {
    width: 36px;
    height: 36px;
  }
  .nav-wrap {
    height: 60px;
  }
}
