:root {
  --font-sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", Consolas, monospace;
  --color-bg: #fafafa;
  --color-text: #1a1a1a;
  --color-text-muted: #666;
  --color-link: #2563eb;
  --color-link-hover: #1d4ed8;
  --color-border: #e5e5e5;
  --color-code-bg: #1e1e1e;
}

@import url("https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;600;700&display=swap");

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

html {
  font-size: 18px;
}

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

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

a:hover {
  color: var(--color-link-hover);
}

/* Layout */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4rem;
}

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

.logo:hover {
  color: var(--color-text);
}

nav {
  display: flex;
  gap: 1.5rem;
}

nav a {
  color: var(--color-text);
  font-weight: 500;
}

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

/* Homepage - Post lists */
.category {
  margin-bottom: 3rem;
}

.category h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.post-list {
  list-style: none;
}

.post-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.5rem 0;
}

.post-list a {
  color: var(--color-text);
  font-weight: 500;
}

.post-list a:hover {
  color: var(--color-link);
}

.post-list time {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  flex-shrink: 0;
}

/* Prose content (articles) */
.prose h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.prose h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

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

.prose p {
  margin-bottom: 1.25rem;
}

.prose ul,
.prose ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

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

.prose blockquote {
  border-left: 3px solid var(--color-border);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--color-text-muted);
  font-style: italic;
}

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

.prose img {
  max-width: 100%;
  border-radius: 8px;
}

/* Tables */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

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

.prose th {
  background: #f0f0f0;
  font-weight: 600;
}

.prose tr:nth-child(even) {
  background: #f8f8f8;
}

.prose tr:hover {
  background: #f0f0f0;
}

/* Post header */
.post-header {
  margin-bottom: 2.5rem;
}

.post-header time {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* Code blocks */
pre {
  background: var(--color-code-bg) !important;
  padding: 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

pre code {
  font-family: var(--font-mono);
  background: none !important;
  padding: 0;
  color: #e5e5e5;
}

code {
  font-family: var(--font-mono);
  background: rgba(255, 160, 100, 0.2);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

/* Copy button */
.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-family: var(--font-sans);
  background: rgba(255, 255, 255, 0.1);
  color: #999;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Math */
.katex-display {
  margin: 1.5rem 0;
  overflow-x: auto;
  overflow-y: hidden;
}

/* Responsive */
@media (max-width: 600px) {
  html {
    font-size: 16px;
  }

  header {
    margin-bottom: 3rem;
  }

  .post-list li {
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-start;
  }
}

