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

:root {
  --max-width: 680px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Nav */
header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-logo {
  width: 28px;
  height: 28px;
}

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

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: var(--accent);
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  color: var(--text-muted);
}

.theme-toggle:hover {
  border-color: var(--accent);
}

/* Main */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
  width: 100%;
}

/* Posts list */
.posts-list h1 {
  margin-bottom: 1.5rem;
  font-size: 1.6rem;
}

.post-preview {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}

.post-preview:last-child {
  border-bottom: none;
}

.post-preview h2 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

.post-preview h2 a {
  text-decoration: none;
  color: var(--text);
}

.post-preview h2 a:hover {
  color: var(--accent);
}

.post-preview p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 0.35rem;
}

.post-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  gap: 1rem;
}

.more-link {
  margin-top: 1.5rem;
}

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

/* Single post */
.post-header {
  margin-bottom: 2rem;
}

.post-header h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.post-content h2 {
  font-size: 1.3rem;
  margin: 1.8rem 0 0.75rem;
}

.post-content h3 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.5rem;
}

.post-content p {
  margin-bottom: 1rem;
}

.post-content ul,
.post-content ol {
  margin: 0 0 1rem 1.5rem;
}

.post-content li {
  margin-bottom: 0.25rem;
}

.post-content a {
  color: var(--accent);
}

.post-content pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.post-content code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.9em;
}

.post-content p code {
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--text-muted);
}

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

/* Suggestions */
.suggestions {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.suggestions h2 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--text-muted);
}

.suggestions h3 {
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.suggestions h3 a {
  text-decoration: none;
  color: var(--text);
}

.suggestions h3 a:hover {
  color: var(--accent);
}

/* Footnotes */
.footnote {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.tag {
  display: inline-block;
  background: var(--tag-bg);
  color: var(--tag-text);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.82rem;
  text-decoration: none;
  font-weight: 500;
}

.tag:hover {
  background: var(--accent);
  color: #fff;
}

/* Tag cloud */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.tag-cloud-item {
  font-size: 1rem;
  padding: 0.4rem 0.9rem;
}

.tag-count {
  font-weight: 400;
  opacity: 0.7;
}

/* About */
.about-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.profile-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
}

.about-header h1 {
  margin: 0;
}

.about-content p {
  margin-bottom: 1rem;
}

.about-content a {
  color: var(--accent);
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

footer a {
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 600px) {
  nav {
    flex-direction: column;
    gap: 0.75rem;
  }

  .post-header h1 {
    font-size: 1.4rem;
  }
}
