/* Scale the root font-size with viewport width so all rem-based text
   grows on 2K/4K monitors. Clamps: 14px at ≤1280px, 16px at 1920px,
   22px at 3840px (4K), 24px ceiling at 5K+. */
html {
  font-size: clamp(14px, 10px + 0.3125vw, 24px);
}

:root {
  --bg: #0e0e10;
  --text: #efeff1;
  --accent: #9146ff;
  --accent-text: #a970ff;
  --muted: #adadb8;
  --card: #18181b;
  --border: #26262c;
  --danger: #e53935;
  --green: #43b581;
}

#site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: center;
  height: 52px;
  font-family: 'Segoe UI', system-ui, sans-serif;
  font-size: 0.875rem;
}

#site-nav .nav-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  width: 100%;
  height: 100%;
}

#site-nav .nav-brand {
  text-decoration: none;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

#site-nav .nav-brand-icon {
  height: 32px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

#site-nav .nav-spacer {
  flex: 1;
}

#site-nav .nav-link {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

#site-nav .nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

#site-nav .nav-link.active {
  color: var(--accent-text);
}

#site-nav .nav-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
  white-space: nowrap;
}

#site-nav .nav-btn:hover {
  opacity: 0.85;
}

#site-nav .nav-username {
  color: var(--text);
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

@media (max-width: 640px) {
  #site-nav {
    height: auto;
    min-height: 52px;
  }

  #site-nav .nav-inner {
    flex-wrap: wrap;
    padding: 8px 12px;
    gap: 4px;
    row-gap: 4px;
    height: auto;
    min-height: 52px;
  }

  #site-nav .nav-brand-icon {
    height: 28px;
  }

  #site-nav .nav-link {
    font-size: 0.8rem;
    padding: 5px 7px;
  }

  #site-nav .nav-btn {
    font-size: 0.78rem;
    padding: 5px 10px;
  }

  #site-nav .nav-username {
    font-size: 0.8rem;
    padding: 5px 7px;
  }
}

/* ── Chat unread dot ── */

.nav-chat-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: 5px;
  flex-shrink: 0;
  vertical-align: middle;
  cursor: default;
}

/* Background-only unreads: diagonal half-circle indicates "not here, elsewhere" */
.nav-chat-dot.background {
  background: linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  border: 1.5px solid var(--accent);
  box-sizing: border-box;
}

/* ── Channel picker ── */

.nav-channel-picker {
  position: relative;
  flex-shrink: 0;
}

.nav-channel-label {
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 6px 10px;
  white-space: nowrap;
}

.nav-channel-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  font-family: inherit;
}

.nav-channel-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.nav-channel-btn::after {
  content: '\25BE';
  font-size: 0.65rem;
  opacity: 0.5;
  margin-left: 2px;
}

.nav-channel-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 180px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  z-index: 200;
  overflow: hidden;
}

.nav-channel-dropdown.open {
  display: block;
}

.nav-channel-dropdown a {
  display: block;
  padding: 9px 14px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  transition: background 0.1s, color 0.1s;
}

.nav-channel-dropdown a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.nav-channel-dropdown a.current-channel {
  color: var(--accent-text);
  font-weight: 600;
}

.nav-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  flex-shrink: 0;
  margin: 0 2px;
}

.hidden { display: none; }

/* ── Footer ── */
.footer { border-top: 1px solid var(--border); padding: 48px 28px 24px; font-family: 'Segoe UI', system-ui, sans-serif; }
.footer-nav { max-width: 800px; margin: 0 auto 32px; display: flex; gap: 48px; justify-content: center; }
.footer-col { display: flex; flex-direction: column; gap: 10px; min-width: 120px; }
.footer-col h4 { font-size: 0.7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 4px; }
.footer-col a { font-size: 0.82rem; color: var(--text); text-decoration: none; transition: color .15s; }
.footer-col a:hover { color: var(--accent-text); }
.footer-copy { text-align: center; font-size: 0.75rem; color: var(--muted); }

@media (max-width: 640px) {
  .footer-nav { flex-direction: column; align-items: center; gap: 28px; }
  .footer-col { align-items: center; text-align: center; }
}
