:root {
  --bg: #f8fafc;
  --bg-soft: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #3baea0;
  --accent-soft: rgba(59, 174, 160, 0.12);
  --radius: 14px;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: linear-gradient(to bottom, var(--bg), #ffffff);
  color: var(--text);
  line-height: 1.65;
  background: radial-gradient(
      circle at top left,
      rgba(59, 174, 160, 0.08),
      transparent 40%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(99, 102, 241, 0.06),
      transparent 40%
    ),
    linear-gradient(to bottom, #f8fafc, #ffffff);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.post-link {
  display: block;
  padding: 1.2rem 1.4rem;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  line-height: 1.4;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.post-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.post-section {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}

.section-header {
  margin-bottom: 1.5rem;
}

.section-header h2 {
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.section-header .muted {
  color: var(--muted);
  margin-top: 0.25rem;
}

article.post {
  background: #ffffff;
  padding: 2.5rem 2.5rem;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

/* Diagrams/figures in posts */
.post figure {
  margin: 2.5rem 0;
  text-align: center;
}

.post figure img {
  width: min(100%, 680px); /* caps size so it doesn't overpower text */
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.post figure figcaption {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.post figure img.diagram-lg {
  width: min(100%, 740px);
}
.post figure img.diagram-md {
  width: min(100%, 660px);
}
.post figure img.diagram-sm {
  width: min(100%, 600px);
}

.ad-slot {
  margin: 3rem 0;
  padding: 1.5rem;
  text-align: center;
  background: var(--bg-soft);
  border-radius: 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

main {
  max-width: 760px; /* slightly narrower for readability */
  margin: 0 auto;
  padding: 4rem 2.5rem; /* more horizontal padding */
}

.site-header {
  display: flex;
  justify-content: space-between;
  padding: 1.2rem 2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.brand-logo {
  width: 32px;
  height: 32px;
}

.brand-name {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

@media (max-width: 480px) {
  .brand-name {
    display: none;
  }
}

nav a {
  margin-left: 1rem;
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s ease;
}

nav a:hover {
  color: var(--accent);
}

nav i {
  width: 16px;
  height: 16px;
  stroke-width: 1.75;
}

.icon-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1;
}

.icon-label i {
  width: 16px;
  height: 16px;
  stroke-width: 1.75;
  color: var(--muted);
  flex-shrink: 0;
}

.hero {
  text-align: center;
  margin-bottom: 4rem;
}

.hero h1 {
  font-size: 2.6rem;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, var(--accent), #6366f1);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.4rem;
  margin-bottom: 3rem;
}

.grid a {
  background: white;
  padding: 2.2rem 1.8rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.grid a:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08), inset 0 -3px 0 var(--accent);
}

article.post {
  font-family: "Source Serif 4", serif;
  font-size: 1.05rem;
}

.post-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

footer {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
}

/* Animations */
.fade-in {
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.6s ease forwards;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: none;
  }
}
