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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  width: 100%;
  max-width: 48rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

/* ── Header ── */

.site-header {
  border-bottom: 1px solid var(--color-border);
  padding: 1.25rem 0;
}

.site-header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.02em;
}

.site-logo:hover {
  text-decoration: none;
  color: var(--color-accent);
}

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

.nav-links a {
  color: var(--color-text-light);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--color-accent);
}

/* ── Hero ── */

.hero {
  text-align: center;
  padding: 4rem 0 3rem;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.hero-tagline {
  font-size: 1.15rem;
  color: var(--color-text-light);
  max-width: 32rem;
  margin: 0 auto;
}

/* ── Post List ── */

.posts-section {
  padding-bottom: 4rem;
}

.posts-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-accent);
  display: inline-block;
}

.blog-intro {
  font-size: 0.95rem;
  color: var(--color-text-light);
  margin-bottom: 1.5rem;
}

.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.post-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 1.5rem;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.post-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.post-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 0.35rem;
}

.post-card h3 a {
  color: inherit;
}

.post-card h3 a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.post-card time {
  font-size: 0.85rem;
  color: var(--color-text-light);
  display: block;
  margin-bottom: 0.5rem;
}

.post-card p {
  font-size: 0.95rem;
  color: var(--color-text);
  line-height: 1.6;
}

.empty-state {
  text-align: center;
  color: var(--color-text-light);
  padding: 3rem 0;
  font-size: 1.05rem;
}

/* ── Article / Post ── */

.post-header {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2rem;
}

.post-primary-source {
  margin: -1rem 0 1.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--color-text-light);
  background: var(--color-surface);
  border-left: 3px solid var(--color-accent);
  border-radius: 0 4px 4px 0;
}

.post-primary-source a {
  font-weight: 600;
  color: var(--color-primary);
}

.post-header h1 {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.post-meta {
  font-size: 0.9rem;
  color: var(--color-text-light);
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.post-tags {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.8rem;
  background: var(--color-bg);
  color: var(--color-text-light);
  border: 1px solid var(--color-border);
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
}

.post-content {
  padding-bottom: 4rem;
}

.post-content h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 2.5rem 0 1rem;
}

.post-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-primary);
  margin: 2rem 0 0.75rem;
}

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

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

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

.post-content blockquote {
  border-left: 3px solid var(--color-accent);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  color: var(--color-text-light);
  background: var(--color-surface);
  border-radius: 0 0.25rem 0.25rem 0;
}

.post-content pre {
  background: var(--color-primary);
  color: #e5e7eb;
  padding: 1.25rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.post-content code {
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
}

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

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

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

.post-content th {
  font-weight: 600;
  color: var(--color-primary);
}

/* ── Pages ── */

.page {
  padding: 3rem 0 4rem;
}

.page h1 {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 2rem;
}

.page h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-primary);
  margin: 2rem 0 0.75rem;
}

.page p {
  margin-bottom: 1rem;
}

/* ── Footer ── */

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 2rem 0;
  margin-top: 2rem;
  text-align: center;
}

.site-footer p {
  font-size: 0.85rem;
  color: var(--color-text-light);
}

.social-links {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 0.75rem;
}

.social-links a {
  font-size: 0.85rem;
  color: var(--color-text-light);
}

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

/* ── Responsive ── */

@media (max-width: 640px) {
  .hero h1 {
    font-size: 1.75rem;
  }

  .hero-tagline {
    font-size: 1rem;
  }

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

  .page h1 {
    font-size: 1.6rem;
  }

  .post-content h2 {
    font-size: 1.3rem;
  }
}
