:root {
  /* Typography */
  --font-body: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: Georgia, serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;

  /* Colors - Light Theme */
  --bg: #ffffff;
  --fg: #111111;
  --muted: #666666;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  
  /* Surfaces */
  --surface: rgba(0, 0, 0, 0.03);
  --surface-hover: rgba(0, 0, 0, 0.05);
  --surface-border: rgba(0, 0, 0, 0.08);
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 28px rgba(0, 0, 0, 0.12);
  
  /* Layout */
  --max-width: 900px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  
  /* Spacing scale */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
}

.theme-dark {
  --bg: #0e0e0e;
  --fg: #eaeaea;
  --muted: #a0a0a0;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --surface-border: rgba(255, 255, 255, 0.12);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 28px rgba(0, 0, 0, 0.5);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-base), color var(--transition-base);
}

/* Layout */
.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg) var(--space-3xl);
}

section {
  margin-bottom: var(--space-3xl);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.2;
}

h1 {
  font-size: clamp(1.8rem, 5vw, 2.2rem);
  margin-bottom: 0.25rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.2rem, 3vw, 1.4rem);
  margin: var(--space-2xl) 0 var(--space-md);
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
  letter-spacing: -0.01em;
}

p {
  margin: 0.4rem 0;
}

/* Links */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Lists */
ul, ol {
  padding-left: 1.2rem;
}

li {
  margin-bottom: var(--space-xs);
}

/* Form Elements */
input,
textarea,
button {
  font-family: inherit;
}

input,
textarea {
  border-radius: var(--radius-sm);
  border: 1px solid var(--surface-border);
  background: var(--bg);
  color: var(--fg);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* Utilities */
.visually-hidden {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Media Queries */
@media (max-width: 768px) {
  .page {
    padding: var(--space-xl) var(--space-md) var(--space-2xl);
  }
  
  section {
    margin-bottom: var(--space-2xl);
  }
  
  h2 {
    margin-top: var(--space-xl);
  }
}