:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --accent: #e07a1f;
  --accent-soft: #fdf3ea;
  --border: #eeece6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 0.75rem; }
.logo { font-size: 1.75rem; }
header h1 { font-size: 1.1rem; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
header p { margin: 0; font-size: 0.85rem; color: var(--muted); }

nav { display: flex; gap: 1.25rem; }
nav a { font-size: 0.95rem; font-weight: 500; }

main { max-width: 720px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }

.hero { margin-bottom: 2.5rem; }
.hero h2 { font-size: 1.75rem; margin: 0 0 0.5rem; letter-spacing: -0.02em; }
.hero p { color: var(--muted); margin: 0; font-size: 1.05rem; }

.posts { display: flex; flex-direction: column; gap: 1.5rem; }

.post {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  transition: box-shadow 0.15s ease;
}
.post:hover { box-shadow: 0 6px 18px rgba(0,0,0,0.05); }

.post-meta { display: flex; gap: 0.75rem; align-items: center; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.5rem; }
.tag {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.75rem;
}
.post h3 { margin: 0 0 0.4rem; font-size: 1.15rem; }
.post h3 a { color: var(--text); }
.post p { margin: 0 0 0.75rem; color: var(--muted); font-size: 0.95rem; }
.read-more { font-size: 0.9rem; font-weight: 600; }

.post-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem 2rem 1.5rem;
  margin-bottom: 2rem;
}
.post-detail h2 { font-size: 1.6rem; margin: 0 0 0.75rem; letter-spacing: -0.02em; }
.post-detail p { margin: 0 0 1rem; color: var(--text); }
.back { display: inline-block; margin-top: 1rem; font-size: 0.9rem; }

.about, .subscribe {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
}
.about h2, .subscribe h2 { font-size: 1.2rem; margin: 0 0 0.5rem; }
.about p, .subscribe p { color: var(--muted); margin: 0; }

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

@media (max-width: 600px) {
  header { flex-direction: column; align-items: flex-start; gap: 1rem; }
  main { padding: 2rem 1rem 3rem; }
  .post, .post-detail { padding: 1.25rem; }
  .post-detail { padding: 1.5rem; }
}

/* Post pages */
.post-page {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem 2rem 1.5rem;
  margin-bottom: 2rem;
}
.post-header { margin-bottom: 1.5rem; }
.post-header h1 {
  font-size: 1.8rem;
  margin: 0.5rem 0 0;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.post-body p { margin: 0 0 1.1rem; color: var(--text); }
.post-body p:last-child { margin-bottom: 0; }
.post-body code {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.9em;
}
.post-footer { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.back { display: inline-block; font-size: 0.9rem; font-weight: 600; }

/* Comments */
.comments-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.comments-section h2 {
  font-size: 1.15rem;
  margin: 0 0 0.25rem;
  letter-spacing: -0.01em;
}
.comments-count {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.comments-empty {
  color: var(--muted);
  font-style: italic;
  margin: 0 0 1rem;
}

.comment {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.comment:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.comment:first-child {
  padding-top: 0;
}
.comment-meta {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  margin-bottom: 0.4rem;
}
.comment-author {
  font-weight: 600;
  font-size: 0.9rem;
}
.comment-date {
  font-size: 0.8rem;
  color: var(--muted);
}
.comment-body {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text);
}

.comment-form {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.comment-form label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}
.comment-form input[type="text"],
.comment-form textarea {
  font: inherit;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  width: 100%;
}
.comment-form textarea {
  min-height: 80px;
  resize: vertical;
}
.comment-form button {
  align-self: flex-start;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.comment-form button:hover {
  opacity: 0.9;
  text-decoration: none;
}
.comment-form .hint {
  font-size: 0.8rem;
  color: var(--muted);
}
.comment-status {
  font-size: 0.9rem;
  margin-top: 0.5rem;
}
.comment-status.success {
  color: #2e7d32;
}
.comment-status.error {
  color: #c62828;
}

@media (max-width: 600px) {
  .comment-form button { width: 100%; }
}
