@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&display=swap');

:root {
  --bg-color: #fff;
  --text-color: #000;
  --text-secondary: #333;
  --border-color: #e5e5e5;
  --sidebar-bg: #fafafa;
  --code-bg: #f5f5f5;
  --transition: all 0.2s ease;
}

[data-theme="dark"] {
  --bg-color: #0a0a0a;
  --text-color: #e5e5e5;
  --text-secondary: #b3b3b3;
  --border-color: #333;
  --sidebar-bg: #111;
  --code-bg: #1a1a1a;
}

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

html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  transition: var(--transition);
}

body {
  font-weight: 300;
  min-height: 100vh;
}

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

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 200px;
  height: 100vh;
  background-color: var(--sidebar-bg);
  border-right: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.sidebar-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-nav {
  flex: 1;
}

.nav-link {
  display: block;
  color: var(--text-color);
  text-decoration: none;
  margin-bottom: 1rem;
  font-weight: 400;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--text-secondary);
}

.theme-toggle {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  cursor: pointer;
  padding: 0.6rem;
  border-radius: 8px;
  transition: var(--transition);
  margin-top: auto;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.theme-toggle:hover {
  background-color: var(--code-bg);
  border-color: var(--text-secondary);
}

.theme-icon {
  position: absolute;
  transition: all 0.3s ease;
}

.sun-icon {
  opacity: 0;
  transform: rotate(-90deg) scale(0);
}

.moon-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

[data-theme="dark"] .sun-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

[data-theme="dark"] .moon-icon {
  opacity: 0;
  transform: rotate(90deg) scale(0);
}

[data-theme="dark"] .theme-toggle:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.main-content {
  margin-left: 200px;
  flex: 1;
  max-width: 600px;
  margin-left: 240px;
  padding: 2rem 1rem;
}

h1 {
  font-size: 1.8rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--text-color);
}

h2 {
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 1rem;
  margin-top: 2rem;
  color: var(--text-color);
}

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

a {
  color: var(--text-color);
  text-decoration: underline;
  transition: var(--transition);
}

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

ul, ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

blockquote {
  border-left: 2px solid var(--border-color);
  padding-left: 1rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--text-secondary);
}

code {
  background-color: var(--code-bg);
  color: var(--text-color);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: 'Menlo', monospace;
  font-size: 0.9rem;
}

pre {
  background-color: var(--code-bg);
  color: var(--text-color);
  padding: 1rem;
  border-radius: 5px;
  overflow-x: auto;
  margin: 1rem 0;
}

.mobile-nav-toggle {
  display: none;
}

/* Mobile styles */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 1000;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
    padding: 1rem 0.75rem;
    max-width: 100%;
  }
  
  .mobile-nav-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: var(--sidebar-bg);
    border: none;
    color: var(--text-color);
    padding: 0.75rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  
  h1 {
    font-size: 1.5rem;
    margin-top: 3rem;
  }
}

/* Article styles */
article {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

article:last-child {
  border-bottom: none;
}

/* Code block improvements */
pre code {
  background: none;
  padding: 0;
}

/* Home page sections */
.intro {
  margin: 2rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.intro p {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 0;
}

.quick-links {
  margin-top: 2rem;
}

.quick-links h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.quick-links ul {
  list-style: none;
  margin-left: 0;
  padding-left: 0;
}

.quick-links li {
  margin-bottom: 1rem;
  line-height: 1.5;
}

.quick-links li a {
  font-weight: 400;
  text-decoration: none;
}

.quick-links li a:hover {
  text-decoration: underline;
}