:root {
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --border: #e2e8f0;
  --accent: #0ea5e9;
  --accent-dark: #0284c7;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.navbar {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.hero {
  background: var(--bg-primary);
  padding: 4rem 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero-container {
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

.main-content {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 3rem;
  padding: 3rem 0;
}

.sidebar {
  position: sticky;
  top: 80px;
  height: fit-content;
  font-size: 0.95rem;
}

.sidebar h3 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: 1rem;
  margin-top: 2rem;
}

.sidebar h3:first-child {
  margin-top: 0;
}

.sidebar ul {
  list-style: none;
}

.sidebar li {
  margin-bottom: 0.5rem;
}

.sidebar a {
  color: var(--text-secondary);
  text-decoration: none;
  display: block;
  padding: 0.5rem 0;
  border-left: 2px solid transparent;
  padding-left: 0.75rem;
  transition: all 0.2s ease;
}

.sidebar a:hover,
.sidebar a.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

.sidebar h3 .sidebar-title-link {
  color: inherit;
  display: inline;
  padding: 0;
  border-left: 0;
}

.sidebar h3 .sidebar-title-link:hover,
.sidebar h3 .sidebar-title-link.active {
  color: var(--accent);
  border-left: 0;
}

.content {
  background: var(--bg-primary);
  border-radius: 12px;
  padding: 3rem;
  border: 1px solid var(--border);
}

.content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
  margin-top: 2.5rem;
}

.content h2:first-child {
  margin-top: 0;
}

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

.content h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.content p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.8;
}

.content img {
  display: block;
  width: min(100%, 980px);
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 1.5rem auto 0.5rem;
}

.content figcaption,
.content .caption {
  color: var(--text-tertiary);
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.section-links {
  margin: 1.5rem 0 2rem;
}

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

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

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

a:hover {
  color: var(--accent-dark);
}

code {
  background: var(--bg-secondary);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
  color: #ef4444;
}

pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.85rem;
  line-height: 1.5;
  border: 1px solid var(--border);
}

pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

table th {
  background: var(--bg-secondary);
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border);
}

table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

table tr:hover {
  background: var(--bg-secondary);
}

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

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.footer {
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
  margin-top: 4rem;
  color: var(--text-tertiary);
  font-size: 0.9rem;
  text-align: center;
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 1.75rem;
  }

  .main-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .sidebar {
    position: static;
  }

  .content {
    padding: 1.5rem;
  }
}
