:root {
  --bg: #fafaf8;
  --text: #1a1a1a;
  --text-secondary: #717171;
  --border: #e5e5e5;
  --surface: #f0f0ee;
  --max-width: 640px;
  --font: 'SF Mono', 'Cascadia Code', 'Fira Code', 'Consolas', 'Liberation Mono', 'Menlo', monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --text: #ededed;
    --text-secondary: #888;
    --border: #262626;
    --surface: #171717;
  }
}

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

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 5rem 1.5rem 3rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--text);
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s;
}

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

/* --- Header --- */

.site-header {
  margin-bottom: 5rem;
}

.site-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.site-title a {
  text-decoration: none;
}

.site-nav {
  margin-top: 0.75rem;
}

.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  margin-right: 1.5rem;
  transition: color 0.15s;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text);
}

/* --- Main --- */

main {
  flex: 1;
}

.intro {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

/* --- Content --- */

.content {
  font-size: 0.95rem;
  line-height: 1.9;
}

.content > p:first-child {
  font-size: 1rem;
  line-height: 1.85;
}

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

.content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

.content h2 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-top: 4rem;
  margin-bottom: 1.25rem;
}

.content h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.content ul,
.content ol {
  margin-bottom: 0;
  padding-left: 0;
  list-style: none;
}

.content li {
  margin-bottom: 0.6rem;
}

.content li::before {
  content: "✱";
  margin-right: 0.6rem;
  color: var(--text-secondary);
  font-size: 0.7em;
  vertical-align: 0.1em;
}

.content li strong {
  font-weight: 600;
}

.content a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.content blockquote {
  border-left: 2px solid var(--border);
  padding-left: 1.25rem;
  color: var(--text-secondary);
  margin: 2rem 0;
}

.content code {
  font-size: 0.9em;
  background: var(--surface);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

.content pre {
  background: var(--surface);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 2rem 0;
  border-radius: 4px;
  font-size: 0.85rem;
  line-height: 1.65;
}

.content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

.content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

/* --- Post List --- */

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

.post-list li {
  margin-bottom: 1rem;
}

.post-list li::before {
  display: none;
}

.post-list a {
  text-decoration: none;
  display: block;
}

.post-date {
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-right: 1.25rem;
}

.post-title {
  font-weight: 500;
}

.post-list a:hover .post-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.list-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* --- Article --- */

article h1 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

article .meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
}

/* --- Footer --- */

.site-footer {
  margin-top: 5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.site-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  margin-right: 1.5rem;
  transition: color 0.15s;
}

.site-footer a:hover {
  color: var(--text);
}

/* --- Responsive --- */

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  body {
    padding: 3rem 1.25rem 2rem;
  }

  .site-header {
    margin-bottom: 3.5rem;
  }

  .post-date {
    display: block;
    margin-bottom: 0.15rem;
  }

  .post-list li {
    margin-bottom: 1.5rem;
  }

  .site-footer {
    margin-top: 4rem;
  }
}
