/* Base Reset */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #e0e0e0;
  background-color: transparent;
  overflow-x: hidden;
}

/* Star background base — transparent so canvas starfield shows through */
body {
  background: transparent;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Accessible focus indicators - space themed */
:focus-visible {
  outline: 2px solid #ffd700;
  outline-offset: 3px;
  border-radius: 4px;
}

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  padding: 0.75rem 1.5rem;
  background: #ffd700;
  color: #0a0a2e;
  font-weight: 700;
  border-radius: 0 0 8px 8px;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
  outline: none;
}

/* Navigation Bar */
.nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 60px;
  background: rgba(10, 10, 46, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffd700;
  letter-spacing: 1px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: #b0b0cc;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.nav-links a.active {
  color: #ffd700;
  background: rgba(255, 215, 0, 0.1);
}

/* Star counter and mute toggle in nav */
.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-stars {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #ffd700;
  font-weight: 600;
  font-size: 0.95rem;
}

.nav-stars .star-icon {
  font-size: 1.1rem;
}

.mute-toggle {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #b0b0cc;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem 0.45rem;
  line-height: 1;
  transition: background 0.2s, border-color 0.2s;
}

.mute-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
}

@keyframes starPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); color: #fff; }
  100% { transform: scale(1); }
}

.star-pulse {
  display: inline-block;
  animation: starPulse 0.4s ease;
}

/* Page transition entrance animation */
@keyframes pageEnter {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Screen reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  white-space: nowrap;
}

/* Keyboard-selected state for drag-and-drop */
.kbd-selected {
  outline: 2px solid #ffd700 !important;
  outline-offset: 2px;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.5) !important;
}

/* Page Content */
.page-content {
  padding-top: 80px;
  padding-bottom: 2rem;
  min-height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

/* Headings */
h1 {
  font-size: 2.5rem;
  color: #ffffff;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.8rem;
  color: #ffd700;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.3rem;
  color: #e0e0e0;
  margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, #6a3de8, #3d7be8);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(106, 61, 232, 0.4);
}

.btn-primary {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #0a0a2e;
}

.btn-primary:hover {
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

/* Hamburger menu toggle (hidden on desktop) */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: #e0e0e0;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

/* Minimum 44px touch targets for interactive elements */
@media (max-width: 1024px) {
  .btn, .btn-primary, .mute-toggle, .nav-links a {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* Responsive nav: hamburger below 768px */
@media (max-width: 768px) {
  .hamburger-btn {
    display: flex;
  }

  .nav-bar {
    flex-wrap: wrap;
    height: auto;
    min-height: 60px;
    padding: 0.5rem 1rem;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    order: 3;
    padding: 0.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 0.75rem 1rem;
    width: 100%;
    font-size: 1rem;
    border-radius: 0;
  }

  .nav-links a:hover,
  .nav-links a.active {
    background: rgba(255, 255, 255, 0.06);
  }

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

  .nav-right {
    margin-left: auto;
    margin-right: 0.5rem;
  }

  .page-content {
    padding-top: 70px;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.4rem;
  }
}

/* General tablet adjustments */
@media (max-width: 1024px) {
  .page-content {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* Reduced motion: disable all animations and transitions for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .star-pulse {
    animation: none !important;
  }
}
