:root {
  --bg-main: #f8fafc;
  --bg-sidebar: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --accent: #4f46e5;
  --accent-light: #eef2ff;
  --border: #e2e8f0;
  --code-bg: #1e293b;
  --max-width: 65vw;
  --sidebar-width: 280px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family:
    'Inter',
    system-ui,
    -apple-system,
    sans-serif;
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
}

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-main);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

header div {
  margin: auto;
  font-weight: bold;
  width: auto;
}

.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  padding: 2rem 1.5rem;
  z-index: 100;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.active {
  transform: translateX(0);
}

main {
  flex: 1;
  width: auto;
  padding: 5rem 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.prose {
  width: 100%;
  max-width: var(--max-width);
}

@media (min-width: 1024px) {
  .sidebar {
    transform: translateX(0);
  }

  main {
    margin-left: var(--sidebar-width);
    padding: 4rem 3rem;
  }

  .menu-toggle {
    display: none !important;
  }
}

h1 {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 3.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  color: var(--text-primary);
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

p,
ul,
ol {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

li {
  margin-left: 1.25rem;
  margin-bottom: 0.75rem;
}

li strong {
  color: var(--text-primary);
}

.nav-link {
  display: block;
  padding: 0.625rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0.5rem;
  margin-bottom: 0.25rem;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: var(--accent-light);
  color: var(--accent);
}

footer {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

small {
  font-size: small;
}

.link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.link:hover {
  text-decoration: underline;
}

p {
  overflow: auto;
}

.active {
  display: block !important;
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--accent);
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.menu-toggle:hover {
  box-shadow: 0 0 10px var(--accent);
  border-color: var(--accent);
}

.hamburger {
  width: 24px;
  height: 18px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background-color: var(--accent);
  border-radius: 2px;
  transition: all 0.4s cubic-bezier(0.68, -0.6, 0.32, 1.6);
  transform-origin: center;
}

.menu-toggle.is-active .hamburger span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.menu-toggle.is-active .hamburger span:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.menu-toggle.is-active .hamburger span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 768px) {
  :root {
    --max-width: 80vw;
  }

  .sidebar {
    position: fixed;
    left: -280px;
    top: 110px;
    bottom: 0;
    width: 250px;
    z-index: 1000;
    transition: left 0.3s ease;
    background: var(--bg-sidebar);
    color: var(--accent-light);
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  }

  .sidebar.active {
    left: 0;
  }

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
