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

:root {
  --bg: #ffffff;
  --bg-alt: #f8f9fa;
  --ink: #1a1a2e;
  --ink-mid: #4a4a5a;
  --ink-light: #6b7280;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --rule: #e5e7eb;
  --rule-light: #f3f4f6;
  --max-width: 720px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

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

/* Header */
header {
  border-bottom: 1px solid var(--rule);
  padding: 1.25rem 1.5rem;
  background: var(--bg);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-name {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--bg);
  text-decoration: none;
  font-family: var(--font-sans);
  background: var(--ink);
  padding: 0.3rem 0.6rem 0.35rem;
  display: inline-block;
}

.site-name:hover {
  background: var(--accent);
}

.site-tagline {
  font-size: 0.8125rem;
  color: var(--ink-light);
  font-weight: 400;
}

/* Nav */
nav {
  background-color: var(--bg-alt);
  border-bottom: 1px solid var(--rule);
  padding: 0.625rem 1.5rem;
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  gap: 1.75rem;
}

nav a {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-mid);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.075em;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}

nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Breadcrumb */
.breadcrumb {
  max-width: var(--max-width);
  margin: 1.25rem auto 0;
  padding: 0 1.5rem;
  font-size: 0.8125rem;
  color: var(--ink-light);
}

.breadcrumb a {
  color: var(--ink-light);
  text-decoration: none;
}

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

.breadcrumb-sep {
  margin: 0 0.5rem;
  opacity: 0.5;
}

/* Main */
main {
  max-width: var(--max-width);
  margin: 2.5rem auto;
  padding: 0 1.5rem;
}

main.article {
  margin-top: 2rem;
}

/* Section heading */
.section-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-heading h2 {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-light);
  white-space: nowrap;
}

.section-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--rule);
}

/* Article list */
.article-list {
  list-style: none;
}

.article-list li {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--rule-light);
}

.article-list li:first-child {
  padding-top: 0;
}

.article-list li:last-child {
  border-bottom: none;
}

.article-list a {
  display: block;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ink);
  text-decoration: none;
  margin-bottom: 0.375rem;
  transition: color 0.15s ease;
}

.article-list a:hover {
  color: var(--accent);
}

/* Category label */
.category-label {
  display: inline-block;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  margin-bottom: 0.5rem;
}

/* Date */
.date {
  font-size: 0.8125rem;
  color: var(--ink-light);
}

/* Article page */
.article-header {
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}

.article-header .category-label {
  margin-bottom: 0.75rem;
}

.article-header h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
  color: var(--ink);
}

.article-header .article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.article-hero {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 2rem;
  border-radius: 6px;
}

/* Article body */
.article-content h2 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.article-content p {
  margin-bottom: 1.25rem;
  color: var(--ink-mid);
}

.article-content p:last-child {
  margin-bottom: 0;
}

.article-content a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(37, 99, 235, 0.3);
  transition: border-color 0.15s ease;
}

.article-content a:hover {
  border-bottom-color: var(--accent);
}

.article-content em {
  font-style: italic;
}

.article-content strong {
  font-weight: 600;
  color: var(--ink);
}

.article-content code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-alt);
  padding: 0.125em 0.375em;
  border-radius: 3px;
}

/* Source link */
.article-content p:last-of-type em {
  display: block;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--ink-light);
}

/* Related */
.related {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.related h3 {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 1rem;
}

.related ul {
  list-style: none;
}

.related ul li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule-light);
}

.related ul li:first-child {
  padding-top: 0;
}

.related ul li:last-child {
  border-bottom: none;
}

.related ul li a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.15s ease;
}

.related ul li a:hover {
  color: var(--accent);
}

/* Footer */
footer {
  border-top: 1px solid var(--rule);
  padding: 1.5rem;
  margin-top: 4rem;
  background: var(--bg-alt);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.footer-copyright {
  font-size: 0.8125rem;
  color: var(--ink-light);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-links a {
  font-size: 0.8125rem;
  color: var(--ink-light);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

/* Pagination */
.pagination {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  display: flex;
  gap: 1rem;
}

.pagination a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.pagination a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 640px) {
  body { font-size: 15px; }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .site-name { font-size: 1rem; }
  .site-tagline { font-size: 0.8125rem; }

  .article-header h1 { font-size: 1.5rem; }
  .article-list a { font-size: 1rem; }

  .nav-inner { gap: 1.25rem; }
  nav a { font-size: 0.6875rem; }
}
