:root {
  --bg: #ffffff;
  --bg-soft: #f8f7fc;
  --fg: #0a0a0a;
  --muted: #737373;
  --border: #ece9f3;
  --accent: #7c3aed;
  --accent-2: #ec4899;
  --gradient: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; transition: color .2s; }
img { max-width: 100%; display: block; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.narrow { max-width: 720px; }

/* ============== Navbar ============== */
nav.top {
  position: sticky; top: 0; z-index: 50;
  padding: 1.1rem 0;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
nav.top .container { display: flex; align-items: center; justify-content: space-between; }
nav.top .brand {
  display: flex; align-items: center; gap: .65rem;
  font-weight: 800; letter-spacing: -.02em; font-size: 1.05rem;
}
nav.top .brand-dot {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--gradient);
}
nav.top .nav-links {
  display: flex; gap: 1.5rem;
  font-size: .9rem; color: var(--muted);
}
nav.top .nav-links a:hover { color: var(--fg); }

/* ============== Hero ============== */
.hero { padding: 5rem 0 3rem; }
.hero-title {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 600; letter-spacing: -.03em; line-height: 1.05;
}
.hero-title .gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.hero-lead {
  font-size: 1.15rem; color: var(--muted);
  margin-top: 1rem; max-width: 580px;
}

/* ============== Badges ============== */
.badge {
  display: inline-block;
  padding: .25rem .7rem;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  color: #525252;
}
.badge-featured {
  background: var(--gradient);
  color: white; border: none;
}

/* ============== Featured card ============== */
.featured-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  margin: 2rem 0 3rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: white;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s, border-color .3s;
}
.featured-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 20px 40px -20px rgba(124, 58, 237, .25);
}
.featured-image {
  aspect-ratio: 4/3;
  background-size: cover; background-position: center;
  transition: transform .8s;
}
.featured-card:hover .featured-image { transform: scale(1.03); }
.featured-body {
  padding: 2.5rem;
  display: flex; flex-direction: column; justify-content: center;
}
.featured-title {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 2rem; font-weight: 600;
  letter-spacing: -.02em; line-height: 1.15;
  margin: 1rem 0 .75rem;
}
.featured-desc { color: var(--muted); font-size: 1rem; }
.featured-meta {
  margin-top: 1.25rem; font-size: .85rem; color: var(--muted);
}
.featured-meta strong { color: var(--fg); font-weight: 600; }

/* ============== Section title ============== */
.section-title {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.5rem; font-weight: 600;
  color: var(--muted);
  margin: 3rem 0 1.5rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}

/* ============== Post grid ============== */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2.5rem 2rem;
  padding-bottom: 4rem;
}
.post-card {
  display: flex; flex-direction: column;
  transition: transform .3s;
}
.post-card:hover { transform: translateY(-4px); }
.post-image {
  aspect-ratio: 16/10;
  background-size: cover; background-position: center;
  border-radius: 12px; margin-bottom: 1rem;
  transition: transform .5s;
  background-color: #ddd;
}
.post-card:hover .post-image { transform: scale(1.02); }
.post-card .badge { align-self: flex-start; margin-bottom: .5rem; }
.post-card-title {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.4rem; font-weight: 600;
  letter-spacing: -.01em; line-height: 1.2;
  margin: .35rem 0 .5rem;
}
.post-card-desc { color: var(--muted); font-size: .95rem; flex: 1; }
.post-card-meta { margin-top: .75rem; font-size: .8rem; color: var(--muted); }

/* ============== Single post ============== */
.hero-image {
  position: relative;
  height: 52vh; min-height: 380px; max-height: 520px;
  background-size: cover; background-position: center;
  margin-bottom: -4rem;
  filter: brightness(.92);
}
.hero-fade {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 30%, rgba(255,255,255,1) 100%);
}
.post-head {
  position: relative;
  padding: 1rem 1.5rem 2.5rem;
}
.post-title {
  font-family: 'Newsreader', Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.1;
  margin: .75rem 0 1rem;
}
.post-desc {
  font-size: 1.2rem; color: var(--muted);
  margin-bottom: 1.5rem;
}
.post-meta {
  display: flex; gap: .65rem; flex-wrap: wrap; align-items: center;
  padding-top: 1.5rem; border-top: 1px solid var(--border);
  font-size: .9rem; color: var(--muted);
}
.post-meta strong { color: var(--fg); font-weight: 600; }

/* ============== Prose ============== */
.prose {
  padding: 0 1.5rem;
  font-size: 1.08rem; line-height: 1.78;
}
.prose h2 {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 1.7rem; font-weight: 600;
  margin: 2.5rem 0 1rem;
}
.prose h3 {
  font-size: 1.2rem; margin: 2rem 0 .75rem; font-weight: 700;
}
.prose p { margin: 1rem 0; }
.prose ul, .prose ol { margin: 1rem 0 1rem 1.5rem; }
.prose li { margin: .35rem 0; }
.prose a {
  color: var(--accent);
  border-bottom: 1px solid #ddd6fe;
}
.prose a:hover { border-bottom-color: var(--accent); }
.prose blockquote {
  border-left: 3px solid var(--accent);
  padding: .5rem 1.25rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: #404040;
  background: #f5f3ff;
  border-radius: 0 12px 12px 0;
}
.prose pre {
  background: #0a0a0a; color: #fafafa;
  padding: 1.25rem; border-radius: 12px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .9rem;
  margin: 1.5rem 0;
}
.prose code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .92em;
}
.prose :not(pre) > code {
  background: var(--bg-soft);
  padding: .12rem .4rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--accent);
}
.prose pre code {
  background: transparent; padding: 0; border: none; color: inherit;
}

.back-link { margin: 4rem 0 0; }
.back-link a {
  color: var(--accent);
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.back-link a:hover { border-bottom-color: var(--accent); }

/* ============== Footer ============== */
footer.site {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  margin-top: 6rem;
  color: var(--muted); font-size: .85rem;
}
footer.site .container {
  display: flex; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
}

/* ============== Responsive ============== */
@media (max-width: 768px) {
  .featured-card { grid-template-columns: 1fr; }
  .featured-body { padding: 1.75rem; }
  .featured-title { font-size: 1.5rem; }
  nav.top .nav-links { gap: 1rem; font-size: .85rem; }
}
