:root {
  --ui-bg: #080d1a;
  --ui-bg-soft: #0f1a2f;
  --ui-surface: #121d33;
  --ui-surface-alt: #1a2742;
  --ui-border: rgba(152, 205, 255, 0.22);
  --ui-text: #e8f2ff;
  --ui-text-muted: #9fb5d2;
  --ui-primary: #4dc4ff;
  --ui-accent: #6b7bff;
  --ui-highlight: #2de1c2;
  --ui-shadow: 0 16px 34px rgba(4, 10, 25, 0.46);
}

:root[data-theme="light"] {
  --ui-bg: #f3f5f8;
  --ui-bg-soft: #fbfcfe;
  --ui-surface: #ffffff;
  --ui-surface-alt: #f5f7fb;
  --ui-border: rgba(23, 43, 73, 0.14);
  --ui-text: #17263d;
  --ui-text-muted: #5d6d84;
  --ui-primary: #234a88;
  --ui-accent: #2f66c5;
  --ui-highlight: #227f71;
  --ui-shadow: 0 10px 24px rgba(18, 36, 63, 0.12);
}

.nav-bar--dark {
  position: sticky;
  top: 0;
  z-index: 120;
  background:
    radial-gradient(circle at 6% -10%, rgba(45, 225, 194, 0.24), transparent 35%),
    radial-gradient(circle at 94% -40%, rgba(77, 196, 255, 0.3), transparent 44%),
    linear-gradient(110deg, rgba(9, 15, 29, 0.94) 0%, rgba(13, 23, 40, 0.92) 42%, rgba(16, 38, 68, 0.9) 100%);
  border-bottom: 1px solid var(--ui-border);
  box-shadow: var(--ui-shadow);
  backdrop-filter: blur(10px);
}

:root[data-theme="light"] .nav-bar--dark {
  background:
    radial-gradient(circle at 5% -20%, rgba(89, 124, 181, 0.08), transparent 34%),
    radial-gradient(circle at 95% -30%, rgba(87, 115, 153, 0.08), transparent 42%),
    linear-gradient(110deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 251, 254, 0.98) 44%, rgba(244, 247, 252, 0.98) 100%);
  border-bottom-color: rgba(20, 39, 68, 0.12);
  box-shadow: 0 10px 24px rgba(17, 35, 59, 0.1);
}

.nav-bar__inner {
  width: min(1680px, 100%);
  margin: 0 auto;
  padding: 12px clamp(12px, 2.6vw, 30px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 640px) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  box-sizing: border-box;
}

.nav-bar__left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-bar__center {
  min-width: 0;
}

.nav-bar__right {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.nav-bar__icon-btn {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
  color: var(--ui-text);
  cursor: pointer;
  transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.nav-bar__icon-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(147, 225, 255, 0.55);
  background: linear-gradient(145deg, rgba(109, 160, 255, 0.28), rgba(84, 227, 205, 0.14));
}

:root[data-theme="light"] .nav-bar__icon-btn {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(242, 246, 252, 0.96));
  border-color: rgba(22, 45, 78, 0.15);
}

.nav-bar__icon-btn svg {
  width: 20px;
  height: 20px;
}

.nav-bar__logo {
  display: inline-flex;
  align-items: center;
  height: clamp(36px, 4.6vw, 50px);
  color: var(--ui-text);
  text-decoration: none;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}

.nav-brand__image {
  max-width: none !important;
  border-radius: 10px;
  object-fit: cover;
  object-position: center;
  display: block;
  flex: 0 0 auto;
  box-shadow: 0 10px 22px rgba(21, 35, 80, 0.32);
}

.nav-brand__mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.08em;
  color: #ffffff;
  background:
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.34), transparent 32%),
    linear-gradient(150deg, #2de1c2 0%, #4a77ff 52%, #6f48f0 100%);
  box-shadow: 0 9px 22px rgba(43, 93, 198, 0.5);
}

.nav-brand__copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.nav-brand__title {
  color: var(--ui-text);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.01em;
}

.nav-brand__tag {
  color: var(--ui-text-muted);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.nav-bar__search-pill {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 0 16px;
  min-height: 48px;
  border-radius: 999px;
  border: 1px solid var(--ui-border);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.04));
  box-shadow: inset 0 0 0 1px rgba(95, 148, 212, 0.1);
  cursor: text;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.nav-bar__search-pill:hover,
.nav-bar__search-pill:focus-within {
  border-color: rgba(142, 232, 255, 0.8);
  box-shadow: inset 0 0 0 1px rgba(132, 230, 255, 0.34), 0 0 0 3px rgba(89, 145, 255, 0.15);
}

:root[data-theme="light"] .nav-bar__search-pill {
  background: #ffffff;
  border-color: rgba(22, 45, 78, 0.15);
  box-shadow: inset 0 0 0 1px rgba(46, 73, 109, 0.05);
}

.nav-search-input {
  width: 100%;
  border: none;
  outline: none;
  background: none;
  color: var(--ui-text);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 600;
}

.nav-search-input::placeholder {
  color: var(--ui-text-muted);
}

.nav-search-input::-webkit-search-cancel-button {
  appearance: none;
}

.nav-bar__search-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ui-text-muted);
  background: rgba(58, 95, 153, 0.24);
}

:root[data-theme="light"] .nav-bar__search-icon {
  background: rgba(31, 55, 89, 0.08);
  color: #546681;
}

:root[data-theme="light"] .nav-bar__link:hover {
  background: rgba(35, 64, 103, 0.08);
  border-color: rgba(35, 64, 103, 0.22);
}

.nav-bar__search-icon svg {
  width: 18px;
  height: 18px;
}

.theme-toggle {
  width: auto;
  padding: 0 10px;
  gap: 6px;
}

.theme-toggle__icon {
  width: 18px;
  height: 18px;
}

.theme-toggle__icon--sun {
  display: none;
}

:root[data-theme="light"] .theme-toggle__icon--moon {
  display: none;
}

:root[data-theme="light"] .theme-toggle__icon--sun {
  display: inline-block;
}

.theme-toggle__label {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-bar__link {
  text-decoration: none;
  color: var(--ui-text);
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 12px;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.nav-bar__link:hover {
  background: rgba(94, 166, 255, 0.16);
  border-color: rgba(123, 199, 255, 0.45);
}

@media (max-width: 1100px) {
  .nav-bar__inner {
    grid-template-columns: minmax(0, 1fr) minmax(200px, 1fr);
    gap: 10px;
  }

  .nav-bar__center {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .nav-bar__right .nav-bar__link {
    display: none;
  }
}

@media (max-width: 760px) {
  .nav-bar__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 10px 12px;
  }

  .nav-brand__image {
    width: 120px !important;
    height: 38px !important;
  }

  .nav-brand__copy {
    display: none;
  }

  .nav-bar__center {
    grid-column: 1 / -1;
  }

  .theme-toggle__label {
    display: none;
  }
}
