header {
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 2rem;
    font-weight: 600;
    top: 0;
    position: sticky;
}
header h1 a {
  color: inherit;
  text-decoration: none;
}

/* Sidebar Menu */
.sidebar {
  position: fixed;
  top: 0;
  left: -1%;
  height: 100%;
  width: 220px;
  background: var(--accent);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-top: 7rem;
  padding-left: 3rem;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 1000;
}
.sidebar a {
  text-decoration: none;
  color: var(--text);
  font-size: 1.2rem;
  margin: 0.75rem 0;
  padding: 0.2rem;
  transition: 150ms ease;
}
.sidebar a:hover {
  transform: scale(1.05);
}
.sidebar.active {
  transform: translateX(0);
}
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 900;
}
.overlay.active {
  opacity: 1;
  pointer-events: auto;
}
/* Menu Icon */
.menu {
  font-size: 2.6rem;
  user-select: none;
  z-index: 1100;
  transition: 150ms ease;
}
.menu:hover {
  transform: scale(1.1);
}
.menu:active {
  transform: scale(0.95);
}
/* Theme Toggle */
.theme-toggle img {
  --theme-toggle-size: 30px;
  width: var(--theme-toggle-size);
  height: var(--theme-toggle-size);
  display: block;
  transition: transform 150ms ease;
}
.theme-toggle img:hover {
  transform: scale(1.1);
}
.theme-toggle img:active {
  transform: scale(0.95);
}

/* Dark theme: toggle by setting data-theme="dark" on the body */
body[data-theme="dark"] {
  --bg: var(--bg-dark);
  --accent: var(--accent-dark);
  --text: var(--text-light);
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  .theme-toggle img {
    transform: none !important;
  }
}
