/* ─── Design tokens ─────────────────────────────────────────────────── */
:root {
  --violet: #7C3AED;
  --violet-light: #A78BFA;
  --violet-tint: #EDE9FE;
  --violet-dark: #6D28D9;
  --bg: #FFFFFF;
  --surface: #F9FAFB;
  --code-bg: #F3F4F6;
  --code-block-bg: #0B1120;
  --code-block-text: #F8FAFC;
  --border: #E5E7EB;
  --border-strong: #D1D5DB;
  --text-primary: #0F172A;
  --text-secondary: #4B5563;
  --text-tertiary: #9CA3AF;
  --dark-bg: #0B1120;
  --dark-surface: #1E293B;
  --dark-border: #334155;
  --text-on-dark: #F8FAFC;
  --text-on-dark-muted: #94A3B8;
}

/* ─── Reset ─────────────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.55;
  font-size: 16px;
}
a { color: inherit; text-decoration: none; }

/* ─── Layout ─────────────────────────────────────────────────────────── */
.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 720px; margin: 0 auto; padding: 0 24px; }

/* ─── Header ─────────────────────────────────────────────────────────── */
header {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--violet);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px; letter-spacing: 0.01em;
}
.brand-name { font-weight: 500; font-size: 15px; color: var(--text-primary); }
.header-nav { display: flex; gap: 24px; font-size: 14px; color: var(--text-secondary); }
.header-nav a:hover { color: var(--violet-dark); }

/* ─── Footer ─────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  background: var(--surface);
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 24px; font-size: 14px; color: var(--text-secondary); }
.footer-links a:hover { color: var(--violet-dark); }
.footer-copyright { font-size: 13px; color: var(--text-tertiary); }

/* ─── Home: Hero ─────────────────────────────────────────────────────── */
.hero { padding: 96px 0 72px; text-align: left; }
.accent-bar { width: 64px; height: 4px; background: var(--violet); margin-bottom: 28px; border-radius: 2px; }
.hero h1 {
  font-size: clamp(36px, 6vw, 56px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin-bottom: 20px;
  max-width: 780px;
}
.hero h1 span { color: var(--text-secondary); }
.hero-sub { font-size: 18px; color: var(--text-secondary); max-width: 620px; margin-bottom: 36px; line-height: 1.6; }

/* ─── Home: Email signup ─────────────────────────────────────────────── */
.signup {
  max-width: 520px;
  margin-bottom: 16px;
  min-height: 200px;
  scroll-margin-top: 90px;
}
.signup-form { display: flex; gap: 8px; flex-wrap: wrap; }
.signup-form input[type="email"] {
  flex: 1; min-width: 220px; height: 48px; padding: 0 16px;
  border: 1px solid var(--border-strong); border-radius: 8px;
  font-size: 15px; font-family: inherit;
  background: var(--bg); color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.signup-form input[type="email"]:focus {
  outline: none; border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-tint);
}
.signup-form button {
  height: 48px; padding: 0 22px; background: var(--violet); color: white;
  border: none; border-radius: 8px; font-size: 15px; font-weight: 500;
  font-family: inherit; cursor: pointer; transition: background 0.15s, transform 0.05s;
}
.signup-form button:hover { background: var(--violet-dark); }
.signup-form button:active { transform: scale(0.98); }
.signup-fineprint { font-size: 13px; color: var(--text-tertiary); margin-top: 12px; line-height: 1.5; }

/* ─── Home: Sections ─────────────────────────────────────────────────── */
section.section { padding: 80px 0; border-top: 1px solid var(--border); }
.section-label { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--violet-dark); margin-bottom: 12px; }
.section h2 { font-size: clamp(26px, 4vw, 36px); font-weight: 500; letter-spacing: -0.01em; margin-bottom: 12px; line-height: 1.15; }
.section-intro { font-size: 17px; color: var(--text-secondary); max-width: 620px; margin-bottom: 40px; line-height: 1.6; }

/* ─── Home: Pillars ─────────────────────────────────────────────────── */
.pillars-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.pillar-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 28px;
  transition: border-color 0.15s;
}
.pillar-card:hover { border-color: var(--violet-light); }
.pillar-num { font-size: 12px; font-weight: 500; color: var(--violet-dark); margin-bottom: 8px; }
.pillar-card h3 { font-size: 18px; font-weight: 500; color: var(--text-primary); margin-bottom: 10px; line-height: 1.3; }
.pillar-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

/* ─── Home: About ────────────────────────────────────────────────────── */
.about-content { max-width: 720px; }
.about-content p { font-size: 17px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 16px; }
.about-content p:last-child { margin-bottom: 0; }

/* ─── Posts index ────────────────────────────────────────────────────── */
.posts { padding: 24px 0 96px; }
.post-list { list-style: none; padding: 0; border-top: 1px solid var(--border); }
.post-list li { border-bottom: 1px solid var(--border); }
.post-link { display: block; padding: 24px 0; transition: background 0.15s; }
.post-link:hover { background: var(--surface); }
.post-link:hover h2 { color: var(--violet-dark); }
.post-meta { font-size: 13px; color: var(--text-tertiary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.06em; }
.post-list h2 { font-size: 22px; font-weight: 500; line-height: 1.3; margin-bottom: 8px; transition: color 0.15s; }
.post-list p { font-size: 15px; color: var(--text-secondary); line-height: 1.6; }

/* ─── Post page ──────────────────────────────────────────────────────── */
.article { padding: 56px 0 64px; }
.article-back { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; display: inline-block; }
.article-back:hover { color: var(--violet-dark); }
.article-meta { font-size: 13px; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 16px; }
.article h1 {
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 500; letter-spacing: -0.02em; line-height: 1.15;
  margin-bottom: 32px; color: var(--text-primary);
}

/* ─── Prose ──────────────────────────────────────────────────────────── */
.prose { font-size: 17px; line-height: 1.75; color: var(--text-primary); }
.prose > * + * { margin-top: 1.25em; }
.prose h2 { font-size: 26px; font-weight: 500; line-height: 1.25; letter-spacing: -0.01em; margin-top: 2em; margin-bottom: 0.5em; }
.prose h3 { font-size: 20px; font-weight: 500; line-height: 1.3; margin-top: 1.75em; margin-bottom: 0.5em; }
.prose strong { font-weight: 600; }
.prose em { font-style: italic; }
.prose a { color: var(--violet-dark); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--violet-light); transition: text-decoration-color 0.15s; }
.prose a:hover { text-decoration-color: var(--violet-dark); }
.prose ul, .prose ol { padding-left: 1.5em; }
.prose li { margin-top: 0.4em; }
.prose blockquote { border-left: 3px solid var(--violet); padding-left: 18px; color: var(--text-secondary); font-style: italic; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }
.prose code { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; font-size: 0.92em; background: var(--code-bg); padding: 2px 6px; border-radius: 4px; }
.prose pre { background: var(--code-block-bg); color: var(--code-block-text); padding: 18px 20px; border-radius: 10px; overflow-x: auto; font-size: 14px; line-height: 1.6; }
.prose pre code { background: transparent; padding: 0; color: inherit; font-size: inherit; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.prose th { font-weight: 600; border-bottom-color: var(--border-strong); }

/* ─── Lead magnet aside ──────────────────────────────────────────────── */
.magnet { margin-top: 64px; padding: 32px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.magnet-tag { display: inline-block; font-size: 12px; font-weight: 500; color: var(--violet-dark); background: var(--violet-tint); padding: 4px 10px; border-radius: 6px; margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.06em; }
.magnet h3 { font-size: 20px; font-weight: 500; margin-bottom: 10px; line-height: 1.3; }
.magnet p { font-size: 15px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 16px; }
.magnet a { display: inline-block; padding: 10px 20px; background: var(--violet); color: white; border-radius: 8px; font-size: 14px; font-weight: 500; transition: background 0.15s; }
.magnet a:hover { background: var(--violet-dark); }

/* ─── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .header-nav { display: none; }
  .hero { padding: 56px 0 48px; }
  .article { padding: 32px 0 48px; }
  section.section { padding: 56px 0; }
  .pillars-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
}
