:root {
  color-scheme: light;
  --bg-main: #ffffff;
  --bg-sidebar: #f7f9fc;
  --bg-code: #f4f6f8;
  --text-primary: #0a2540;
  --text-secondary: #425466;
  --text-muted: #8792a2;
  --border: #e6e6e6;
  --border-light: #f0f0f0;
  --accent: #635bff;
  --accent-hover: #5851de;
  --code-text: #1d2522;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  margin: 0;
  background: var(--bg-main);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  line-height: 1.7;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.brand {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.1rem;
}

.top-nav {
  display: flex;
  gap: 1.5rem;
}

.top-nav a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.top-nav a:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.page-shell {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  align-items: flex-start;
}

.sidebar {
  position: sticky;
  top: 65px; /* height of header */
  width: 250px;
  flex-shrink: 0;
  height: calc(100vh - 65px);
  overflow-y: auto;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  padding: 2rem 1.5rem;
}

.nav-group {
  margin-bottom: 1.5rem;
}

.nav-heading {
  margin: 0 0 0.5rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar a {
  display: block;
  padding: 0.4rem 0.5rem;
  margin-bottom: 0.2rem;
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.sidebar a:hover {
  background: #edf1f7;
  text-decoration: none;
}

.content {
  flex-grow: 1;
  min-width: 0;
  padding: 2.5rem 3rem 4rem;
  max-width: 800px;
}

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

h1, h2, h3, h4 {
  color: var(--text-primary);
  line-height: 1.3;
  font-weight: 600;
}

h1 { margin: 0 0 1.5rem; font-size: 2.2rem; letter-spacing: -0.02em; }
h2 { margin: 2.5rem 0 1rem; font-size: 1.5rem; border-bottom: 1px solid var(--border-light); padding-bottom: 0.5rem; }
h3 { margin: 2rem 0 1rem; font-size: 1.25rem; }

ul, ol { padding-left: 1.25rem; }
li + li { margin-top: 0.3rem; }

pre, code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

code {
  padding: 0.2em 0.4em;
  background: var(--bg-code);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  color: #d13264;
  font-size: 0.85em;
}

pre {
  margin: 1.5rem 0;
  padding: 1rem;
  background: #0d1117;
  border-radius: 6px;
  overflow-x: auto;
}

pre code {
  padding: 0;
  background: transparent;
  border: none;
  color: #e6edf3;
  font-size: 0.85em;
}

blockquote {
  margin: 1.5rem 0;
  padding: 0.5rem 1rem;
  border-left: 3px solid var(--accent);
  background: var(--bg-sidebar);
  color: var(--text-secondary);
  border-radius: 0 4px 4px 0;
}

table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

th, td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-light);
  text-align: left;
}

th {
  background: var(--bg-sidebar);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.9rem;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1.25rem 0;
}

.doc-card {
  display: block;
  min-height: 7.5rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-sidebar);
  text-decoration: none;
}

.doc-card strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.doc-card span {
  display: block;
  color: var(--text-muted);
  font-size: 0.94rem;
}

.language-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.language-panel a {
  display: inline-flex;
  align-items: center;
  min-height: 2.4rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-sidebar);
  color: var(--text-primary);
  text-decoration: none;
}

.site-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

@media (max-width: 900px) {
  .page-shell {
    flex-direction: column;
  }
  
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    padding: 1.5rem;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2rem;
  }
  
  .content {
    padding: 2rem 1.5rem;
  }

  .doc-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .top-nav {
    display: none; /* Hide on very small screens or implement a hamburger menu later */
  }
}
