:root {
  /* Color Palette - 2025 Modern Clean */
  --color-primary: #2563eb; /* Accessible blue */
  --color-primary-hover: #1d4ed8;
  
  --bg-body: #ffffff;
  --bg-secondary: #f3f4f6;
  --bg-code: #f1f5f9;
  
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --text-code: #0f172a;
  
  --border-light: #e5e7eb;
  
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  --font-mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  
  --spacing-unit: 1rem;
  --container-width: 768px; /* Optimized for reading */
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-primary: #60a5fa;
    --color-primary-hover: #93c5fd;
    
    --bg-body: #0f172a; /* Deep slate/navy for a modern dark feel, not just black */
    --bg-secondary: #1e293b;
    --bg-code: #1e293b;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-code: #e2e8f0;
    
    --border-light: #334155;
  }
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.125rem; /* 18px base text */
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--bg-body);
  transition: color 0.3s ease, background-color 0.3s ease;
}

/* Layout */
.layout-container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--spacing-unit);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.site-header {
  padding: 2rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--bg-secondary);
  margin-bottom: 3rem;
}

.site-title {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text-main);
  text-decoration: none;
  letter-spacing: -0.025em;
}

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

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}

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

/* Main Content */
.page-content {
  flex: 1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin-top: 2em;
  margin-bottom: 0.75em;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--text-main);
}

h1 { font-size: 2.25rem; margin-top: 0; }
h2 { font-size: 1.75rem; border-bottom: 1px solid var(--border-light); padding-bottom: 0.3em; }
h3 { font-size: 1.5rem; }

p { margin-bottom: 1.5rem; }

a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--color-primary-hover);
  text-decoration-thickness: 0.15em;
}

blockquote {
  border-left: 4px solid var(--color-primary);
  margin: 1.5rem 0;
  padding-left: 1.5rem;
  color: var(--text-muted);
  font-style: italic;
  background: var(--bg-secondary);
  padding: 1rem 1rem 1rem 1.5rem;
  border-radius: 0 0.5rem 0.5rem 0;
}

/* Code */
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background-color: var(--bg-code);
  color: var(--text-code);
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
}

pre {
  background-color: var(--bg-code);
  padding: 1rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  color: var(--text-code);
  border: 1px solid var(--border-light);
}

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

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

/* Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Mobile Tweaks */
@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
  
  .site-nav {
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  h1 { font-size: 1.875rem; }
}
