/* Navigation */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  pointer-events: none;
}

#nav a {
  pointer-events: auto;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: color 0.2s;
}

#nav a:hover {
  color: #fff;
}

.nav-logo {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: lowercase;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.nav-links a.active {
  color: #fff;
}

/* Static nav (for non-scene pages) */
.nav-static {
  background: rgba(26, 26, 46, 0.95);
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.nav-static a {
  pointer-events: auto;
}

/* Character info panel */
#info-panel {
  position: fixed;
  right: -320px;
  top: 50%;
  transform: translateY(-50%);
  width: 280px;
  background: rgba(26, 26, 46, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 1.5rem;
  z-index: 50;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#info-panel.visible {
  right: 1.5rem;
}

#info-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  transition: color 0.2s;
}

#info-close:hover {
  color: #fff;
}

#info-name {
  font-size: 1.3rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.25rem;
}

.info-domain {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 0.75rem;
}

#info-description {
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 1rem;
}

#info-link {
  display: inline-block;
  font-size: 0.85rem;
  color: #7bed9f;
  text-decoration: none;
  transition: color 0.2s;
}

#info-link:hover {
  color: #2ecc71;
}

/* Controls panel */
#controls {
  position: fixed;
  left: 1.5rem;
  bottom: 1.5rem;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.control-group {
  background: rgba(26, 26, 46, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
}

.control-group label {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 0.4rem;
}

/* Chaos slider */
#chaos-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 140px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  cursor: pointer;
}

#chaos-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  border: none;
  transition: background 0.2s, transform 0.15s;
}

#chaos-slider::-webkit-slider-thumb:hover {
  background: #fff;
  transform: scale(1.2);
}

#chaos-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  border: none;
  cursor: pointer;
}

/* Motion pattern buttons */
#motion-buttons,
#env-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

#motion-buttons button,
#env-buttons button {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.7rem;
  font-family: inherit;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

#motion-buttons button:hover,
#env-buttons button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
}

#motion-buttons button.active,
#env-buttons button.active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

/* Hint */
#hint {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  pointer-events: none;
}

#hint span {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.2);
  letter-spacing: 0.1em;
  animation: hintFade 4s ease-in-out forwards;
  animation-delay: 3s;
  opacity: 0;
}

@keyframes hintFade {
  0% { opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

/* Mobile */
@media (max-width: 768px) {
  #nav {
    padding: 0.75rem 1rem;
  }

  .nav-logo {
    font-size: 0.95rem;
  }

  #info-panel {
    right: 0;
    left: 0;
    top: auto;
    bottom: -100%;
    transform: none;
    width: 100%;
    border-radius: 16px 16px 0 0;
    padding: 1.25rem 1.5rem 2rem;
    transition: bottom 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }

  #info-panel.visible {
    right: 0;
    bottom: 0;
  }

  #hint {
    bottom: 1.5rem;
  }

  #controls {
    left: 0.75rem;
    bottom: 0.75rem;
  }

  #chaos-slider {
    width: 100px;
  }

  #motion-buttons {
    max-width: 180px;
  }
}
