/* =========================
   Toolbar: Desktop + Mobile
========================= */

/* Toolbar container */
#toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
  border-bottom: 1px solid var(--text);
  background-color: var(--bg);
  z-index: 1000;
}

/* Swiji title always top center */
#swijiTitle {
  position: fixed;
  top: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 3.5rem; /* big */
  font-weight: bold;
  color: var(--text);
  pointer-events: none;
  z-index: 1100;
  user-select: none;
  text-align: center;
}

/* Hamburger for mobile */
#menuToggle {
  display: none; /* hidden on desktop */
  cursor: pointer;
  z-index: 1200;
}

/* Hamburger bars */
#menuToggle .bar {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--text);
  margin: 4px 0;
  transition: all 0.3s ease;
}

/* Hamburger X animation */
#menuToggle.active .bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
#menuToggle.active .bar:nth-child(2) { opacity: 0; }
#menuToggle.active .bar:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Desktop nav buttons (cyberpunk panels) */
#navButtons {
  display: flex;
  gap: 1rem;
  flex-wrap: nowrap;
  justify-content: flex-start;
  margin-left: 3.5rem; /* space for hamburger if needed */
}

#navButtons a {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 140px;
  padding: 0.7rem 1.5rem;
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  border-radius: 0.5rem;
  border: 1px solid rgba(255,255,255,0.15);
  background-color: rgba(0,0,0,0.15);
  box-shadow: 0 0 8px rgba(0,255,255,0.1), 0 0 4px rgba(255,0,255,0.05);
  transition: all 0.3s ease;
  flex-direction: column;
  overflow: hidden;
}

/* Hover & active */
#navButtons a:hover {
  background-color: rgba(0,0,0,0.25);
  transform: translateY(-3px) scale(1.02);
  border-color: rgba(255, 0, 0, 0.6);
}

#navButtons a:active {
  animation: glitchPress 0.3s steps(3, end) 1;
  transform: translateY(0) scale(1);
}

#navButtons a[aria-current="page"] {
  font-weight: bold;
  pointer-events: none;
  background-color: rgba(0,0,0,0.35);
  border-color: rgba(255, 0, 0, 0.6);
}

/* Glitch keyframes */
@keyframes glitchPress {
  0%   { text-shadow: 2px 0 var(--glitch-left), -2px 0 var(--glitch-right); }
  20%  { text-shadow: -2px 0 var(--glitch-left), 2px 0 var(--glitch-right); }
  40%  { text-shadow: 1px 0 var(--glitch-left), -1px 0 var(--glitch-right); }
  60%  { text-shadow: -1px 0 var(--glitch-left), 1px 0 var(--glitch-right); }
  80%  { text-shadow: 2px 0 var(--glitch-left), -2px 0 var(--glitch-right); }
  100% { text-shadow: none; }
}

/* =========================
   Mobile adjustments (max-width: 1044px)
========================= */
@media (max-width: 1044px) {
  /* Hamburger visible */
  #menuToggle { display: block; position: fixed; top: 0.5rem; left: 1rem; }

  /* Nav buttons vertical stack */
  #navButtons {
    position: fixed;
    top: 3.5rem;
    left: 1rem;
    flex-direction: column;
    width: 220px;
    max-height: 0;
    overflow: hidden;
    padding: 0;
    gap: 0.5rem;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background-color: var(--bg);
    z-index: 1100;
  }

  #navButtons.show {
    max-height: 1000px;
    padding: 1rem 0;
    border-top: 1px solid var(--text);
  }

  #navButtons a {
    width: 100%;
    min-width: unset;
    padding: 0.5rem 1rem;
    margin-bottom: 0.5rem;
  }

  #navButtons a:last-child { margin-bottom: 0; }
}
