:root {
  --max-width: 800px;
  --sidebar-width: 200px;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

  --color-primary: #00a001;
  --color-bg: #27272a;
  --color-bg-dark: #18181b;
  --color-bg-light: #3f3f46;
  --color-text: #f4f4f5;
  --color-text-muted: #a1a1aa;
  --color-border: #52525b;
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 300;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  color: var(--color-text);
  background: var(--color-bg);
  overflow: hidden;
}

h1, h2, h3, h4 {
  margin-top: 2em;
  margin-bottom: 0.5em;
  font-weight: 400;
}

h1 {
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 0.3em;
}

h2 {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.3em;
}

h3 {
  margin-top: 2em;
}

ol, ul {
  margin: 0;
  padding: 0.1em 0 1em 1.2em;
}

li {
  margin: 0;
  padding: 0 0 0.1em;
}

code {
  font-family: var(--font-mono);
  background: var(--color-bg-light);
  padding: 0.2em 0.4em;
  border-radius: 6px;
  font-size: 0.85em;
}

pre {
  overflow-x: auto;
}

pre code {
  background: none;
  padding: 0.5em;
  font-size: 0.85em;
}

.code-block {
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

.code-block:hover .copy-btn {
  opacity: 1;
}

.copy-btn:hover {
  color: var(--color-text);
  background: var(--color-bg-light);
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

blockquote {
  border-left: 4px solid var(--color-primary);
  margin: 1em 0;
  padding: 0 1em;
  color: var(--color-text-muted);
  font-style: italic;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
}

th, td {
  border: 1px solid var(--color-border);
  padding: 0.5em 1em;
  text-align: left;
}

th {
  background: var(--color-bg-light);
  font-weight: 400;
}

img {
  max-width: 100%;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--color-bg-dark);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 3rem 10% 2rem;
  z-index: 100;
}

.sidebar-title {
  font-size: 1rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
  padding: 0 0.75rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.nav-btn:hover {
  color: var(--color-text);
  background: var(--color-bg-light);
}

.nav-btn.active {
  color: var(--color-primary);
  background: var(--color-bg-light);
}

.github-link {
  display: flex;
  align-items: center;
  margin-top: 0.5rem;
  text-decoration: none;
}

.github-link:hover {
  text-decoration: none;
  background: transparent;
}

/* Content Sections */
main {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  bottom: 0;
  overflow: hidden;
}

.content-section {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  opacity: 0;
  transform: translateY(15px);
  pointer-events: none;
  transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
              transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 4% 3% max(3%, 3rem);
}

.content-section.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.content-section.above {
  transform: translateY(-15px);
}

.content-section.tall {
  justify-content: flex-start;
}

.content-section.tall .section-inner {
  padding-top: 1rem;
  padding-bottom: 10%;
}

.section-inner {
  flex-shrink: 0;
  max-width: var(--max-width);
  margin: -2rem auto 0;
  width: 100%;
}

@media (max-width: 600px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    display: none;
  }

  .content-section {
    padding-left: 3%;
  }

  .section-inner {
    padding: 1rem;
  }
}
