@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300..700&display=swap');

/* Reset & base */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  background: rgba(224, 224, 224, 0.449);
  color: #212529;
  min-height: 100vh;
}

/* Toggle Button (Hamburger) */
#sidebar-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  background: #1e293b;
  color: #f8fafc;
  border: none;
  padding: 0.5rem 0.75rem;
  font-size: 1.5rem;
  z-index: 1001;
  border-radius: 4px;
  cursor: pointer;
}

/* Overlay for sidebar */
#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(30, 41, 59, 0.6);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
#overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Sidebar navigation */
nav#sidebar {
  width: 250px;
  background: #1e293b;
  color: #f8fafc;
  padding: 2rem 1.5rem;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  box-shadow: 2px 0 5px rgb(0 0 0 / 0.1);
  z-index: 1000;
  transition: transform 0.3s ease;
  transform: translateX(0); /* Desktop default */
}
nav#sidebar h1 {
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #334155;
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}
nav#sidebar a {
  display: block;
  color: #cbd5e1;
  margin: 0.75rem 0;
  font-weight: 500;
  text-decoration: none;
  border-left: 3px solid transparent;
  padding-left: 0.75rem;
  transition: all 0.3s ease;
}
nav#sidebar a:hover,
nav#sidebar a:focus {
  color: #60a5fa;
  border-left-color: #60a5fa;
  outline: none;
}

/* Main content area */
main {
  margin-left: 250px;
  padding: 2rem 3rem;
  max-width: 800px;
  flex-grow: 1;
}

/* Typography */
h2 {
  color: #1e293b;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid #60a5fa;
  padding-bottom: 0.3rem;
  font-weight: 700;
  font-size: 1.6rem;
}
h3 {
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  color: #334155;
  font-weight: 600;
  font-size: 1.2rem;
}
p {
  line-height: 1.6;
  margin-top: 0;
}
ul {
  padding-left: 1.25rem;
  color: #475569;
}
code {
  padding: 2px 6px;
  border-radius: 5px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.95rem;
}
pre {
  background: #f1f5f9;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9rem;
  color: #334155;
  box-shadow: inset 0 0 8px #cbd5e1;
  margin-top: 0.75rem;
  margin-bottom: 1.5rem;
}
a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}
a:hover,
a:focus {
  text-decoration: underline;
  outline: none;
}
footer {
  text-align: center;
  font-size: 0.9rem;
  color: #94a3b8;
  padding: 2rem 1rem;
  margin-top: 4rem;
  border-top: 1px solid #e2e8f0;
  user-select: none;
}

/* Responsive: Slide-in sidebar for mobile */
@media (max-width: 768px) {
  #sidebar-toggle {
    display: block;
  }

  nav#sidebar {
    transform: translateX(-100%);
  }

  nav#sidebar.open {
    transform: translateX(0);
  }

  main {
    margin-left: 0;
    padding: 2rem 1rem;
  }
}
