/* ---------------------------
   Topbar / Nav
---------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--topbar);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logoText {
  display: flex;
  align-items: center;
}

.logoName {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.12em;
  font-size: 28px;
  line-height: 34px;
  text-transform: uppercase;
  height: 34px;
  display: flex;
  align-items: center;
}

.mark {
  width: 34px;
  height: 34px;
  border-radius: 8px; /* noticeably squarer */
  background: linear-gradient(
    180deg,
    rgba(208, 122, 92, 0.95),
    rgba(185, 107, 82, 0.95)
  );
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.95);
  font-family: "Nunito", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-weight: 800;
  font-size: 18px;
  line-height: 0.85;
}

.mark span {
  display: inline-block;
  transform: scaleX(1.15);
  letter-spacing: 0.02em;
}

.links {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
}

.navLink {
  padding: 8px 16px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
  font-size: 14px;
  transition: var(--t);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
}

.navLink:hover {
  color: var(--text);
}

.navLink.active {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-weight: 600;
}

html[data-theme="dark"] .navLink.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.95);
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.actions .search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  min-width: 220px;
  height: 36px; /* visually matches navLink height */
  background: var(--surface-2);
  cursor: text;
}

.actions .search span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

/* Header search input inside the pill */
.searchInput {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 0;
  outline: none;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--text);
}

.searchInput::placeholder {
  color: var(--muted);
}

.kbd {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--chip);
}

.btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: 10px 12px;
  border-radius: 10px; /* squarer */
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: var(--t);
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn:hover {
  background: var(--chip-hover);
}

/* Theme toggle icons */
#themeToggle {
  width: 36px;
  height: 36px;
  padding: 0;
  position: relative;
}

#themeToggle svg {
  width: 18px;
  height: 18px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: var(--t);
}

/* Show sun icon in dark mode (to switch to light) */
html[data-theme="dark"] #themeToggle .theme-icon-sun {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0deg);
}

html[data-theme="dark"] #themeToggle .theme-icon-moon {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-90deg);
}

/* Show moon icon in light mode (to switch to dark) */
html[data-theme="light"] #themeToggle .theme-icon-sun {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(90deg);
}

html[data-theme="light"] #themeToggle .theme-icon-moon {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(0deg);
}

.btn.subtle {
  font-weight: 500;
  color: var(--muted);
}
.btn.subtle:hover {
  color: var(--text);
}
.btn.subtle.active {
  color: var(--text);
  background: var(--surface);
  border-color: rgba(208, 122, 92, 0.4);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

html[data-theme="dark"] .btn.subtle.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(208, 122, 92, 0.5);
  color: rgba(255, 255, 255, 0.95);
}

