/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Core colors */
  --primary: #0f172a;
  --secondary: #64748b;
  --accent: #2563eb;
  --muted: #94a3b8;
  --border: #e2e8f0;
  --bg: #fefefe;
  --surface: #ffffff;

  /* Typography */
  --font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Monaco, monospace;

  /* Spacing */
  --space: 1rem;
  --space-sm: 0.75rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
}

body {
  font-family: var(--font-body);
  line-height: 1.7;
  color: var(--primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 50rem;
  margin: 0 auto;
  padding: 0 var(--space-xl);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  padding: var(--space-3xl) 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-3xl);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-xl);
}

.site-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--primary);
  line-height: 1;
}

.site-title a {
  text-decoration: none;
  color: inherit;
  transition: color 0.3s ease;
}

.site-title a:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: var(--space-xl);
  align-items: baseline;
}

.nav-link {
  text-decoration: none;
  color: var(--secondary);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1;
  transition: color 0.3s ease;
  padding: var(--space-sm);
  border-radius: 0.5rem;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
  background: #f8fafc;
}

/* Main content */
.site-main {
  flex: 1;
}

.page-title {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 600;
  margin-bottom: var(--space-xl);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 1.25rem;
  color: var(--secondary);
  margin-bottom: var(--space-2xl);
  line-height: 1.6;
}

/* Typography */
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--primary);
  line-height: 1.3;
  margin: var(--space-2xl) 0 var(--space) 0;
  letter-spacing: 0em;
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 1.875rem;
}

h3 {
  font-size: 1.5rem;
}

p {
  margin: var(--space) 0;
  color: var(--secondary);
  max-width: 65ch;
}

/* Post content */
.post-header {
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border);
}

.post-content {
  line-height: 1.8;
}

.post-content h1,
.post-content h2,
.post-content h3 {
  margin: var(--space-2xl) 0 var(--space) 0;
}

.post-content ul,
.post-content ol {
  margin: var(--space) 0;
  padding-left: var(--space-xl);
  color: var(--secondary);
}

.post-content li {
  margin: var(--space-sm) 0;
}

/* Post listings */
.utility-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-xl);
}

.utility-item {
  padding: var(--space-xl);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.utility-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: var(--accent);
}

.utility-link {
  display: block;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.25rem;
  margin-bottom: var(--space-sm);
  font-family: var(--font-display);
  transition: color 0.3s ease;
}

.utility-link:hover {
  color: #1d4ed8;
}

/* Post metadata */
.post-meta {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space);
  flex-wrap: wrap;
  font-weight: 500;
}

.post-tags {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.tag {
  background: #f8fafc;
  color: var(--secondary);
  padding: var(--space-sm);
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  border: 1px solid var(--border);
}

/* Code and blockquotes */
code {
  background: #f8fafc;
  color: var(--accent);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.875em;
  border: 1px solid var(--border);
}

pre {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: var(--space-xl);
  overflow-x: auto;
  margin: var(--space-xl) 0;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary);
  font-size: 0.875rem;
}

blockquote {
  border-left: 4px solid var(--accent);
  padding-left: var(--space-xl);
  margin: var(--space-xl) 0;
  font-style: italic;
  color: var(--secondary);
  background: #f8fafc;
  padding: var(--space-xl);
  border-radius: 0 0.5rem 0.5rem 0;
}

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

/* Responsive design */
@media (max-width: 768px) {
  .container {
    padding: 0 var(--space);
  }

  .site-header {
    padding: var(--space-xl) 0;
    margin-bottom: var(--space-xl);
  }

  .header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space);
  }

  .page-title {
    font-size: 2.25rem;
  }

  .nav-links {
    gap: var(--space);
  }

  .post-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  .utility-item {
    padding: var(--space);
  }
}
