/* ============================================================
   CRS — staas.fund/crs/
   Standalone CSS — dark editorial design, CRS yellow accent
   DM Serif Display headings, Inter body, Manrope subheadings
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: hidden; }
img { max-width: 100%; height: auto; }

:root {
  --bg:         #0d0d0f;
  --bg-2:       #141416;
  --bg-3:       #1a1a1e;
  --bg-4:       #222228;
  --border:     #2a2a30;
  --accent:     #f5c518;
  --accent-dim: #d4a810;
  --text:       #eeeef2;
  --text-muted: #8888a0;
  --text-dim:   #4a4a60;
  --radius:     14px;
  --radius-sm:  8px;
  --font:       'Inter', -apple-system, sans-serif;
  --font-serif: 'DM Serif Display', 'Georgia', serif;
  --font-heading: 'Manrope', var(--font);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #6ea4ff; }


/* ── Header ──────────────────────────────────────────────────── */

.blog-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 16px 32px;
  background: rgba(13, 13, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.blog-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.blog-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.blog-logo-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.blog-header-label {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}


/* ── Hub: Hero ───────────────────────────────────────────────── */

.blog-hero {
  text-align: center;
  padding: 80px 32px 48px;
  border-bottom: 1px solid var(--border);
}

.blog-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 16px;
}

.blog-hero-sub {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}


/* ── Hub: Tag filter nav ─────────────────────────────────────── */

.blog-tag-nav {
  position: sticky;
  top: 57px;
  z-index: 90;
  background: rgba(13, 13, 15, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 32px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.blog-tag-nav::-webkit-scrollbar { display: none; }

.blog-tag-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
}

.blog-filter-pill {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.blog-filter-pill:hover,
.blog-filter-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}


/* ── Hub: Post grid ──────────────────────────────────────────── */

.blog-grid-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 32px 64px;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.25s, border-color 0.25s;
  color: var(--text);
}

.blog-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-dim);
}

.blog-card-cover {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-3), var(--bg-4));
}

.blog-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.blog-card:hover .blog-card-cover img {
  transform: scale(1.04);
}

.blog-card-body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.blog-card-cat {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.blog-card-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: auto;
}

.blog-card-meta {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-dim);
}


/* ── Individual post page ────────────────────────────────────── */

.blog-page-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 32px 64px;
}

.blog-cover {
  margin-bottom: 32px;
  border-radius: var(--radius);
  overflow: hidden;
}

.blog-cover img {
  width: 100%;
  display: block;
}

.blog-post-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.blog-tag-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 16px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.2s;
}

.blog-tag-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.blog-post-title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: 12px;
}

.blog-post-subtitle {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

.blog-post-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 32px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

.blog-post-meta a {
  font-size: 13px;
}


/* ── Substack body_html overrides ────────────────────────────── */

.post-body {
  font-size: 17px;
  line-height: 1.85;
  color: var(--text-muted);
  margin-bottom: 48px;
}

.post-body p {
  margin-bottom: 1.4em;
}

.post-body h1,
.post-body h2,
.post-body h3 {
  font-family: var(--font-serif);
  color: var(--text);
  margin: 2em 0 0.6em;
  line-height: 1.2;
  font-weight: 400;
}

.post-body h2 {
  font-size: clamp(20px, 2.5vw, 28px);
}

.post-body h3 {
  font-size: clamp(16px, 2vw, 22px);
}

.post-body a {
  color: var(--accent);
}

.post-body a:hover {
  text-decoration: underline;
}

.post-body img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin: 1.5em 0;
  height: auto;
}

.post-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 2em 0;
  padding: 12px 24px;
  background: var(--bg-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text);
  font-size: 18px;
  font-style: italic;
}

.post-body blockquote p {
  margin-bottom: 0.5em;
}

.post-body blockquote p:last-child {
  margin-bottom: 0;
}

.post-body ul,
.post-body ol {
  margin: 1em 0 1.5em 1.5em;
}

.post-body li {
  margin-bottom: 0.5em;
}

.post-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5em 0;
}

.post-body pre {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  overflow-x: auto;
  margin: 1.5em 0;
}

.post-body code {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  background: var(--bg-3);
  padding: 2px 6px;
  border-radius: 4px;
}

.post-body pre code {
  background: none;
  padding: 0;
}

.post-body strong {
  color: var(--text);
  font-weight: 600;
}

.post-body em {
  font-style: italic;
}

.post-body figure {
  margin: 1.5em 0;
}

.post-body figcaption,
.post-body .image-caption {
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 8px;
}

.post-body .captioned-image-container {
  margin: 1.5em 0;
}

/* Hide Substack-specific elements */
.post-body .paywall,
.post-body .button-wrapper,
.post-body .subscription-widget-wrap,
.post-body .subscription-widget-wrap-editor,
.post-body .subscribe-widget,
.post-body .subscription-widget-subscribe,
.post-body .cta-caption,
.post-body .email-input,
.post-body .fake-button,
.post-body .footer-wrap,
.post-body .post-footer,
.post-body .share-dialog,
.post-body .like-button-container,
.post-body .post-ufi {
  display: none !important;
}


/* ── Prev/Next navigation ────────────────────────────────────── */

.blog-post-nav {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0;
  margin-bottom: 40px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.blog-post-nav a {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
  max-width: 45%;
}

.blog-post-nav a:hover {
  color: var(--accent);
}

.blog-nav-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 4px;
}


/* ── Teaser page (no body_html) ──────────────────────────────── */

.blog-teaser {
  text-align: center;
  padding: 48px 24px;
  background: var(--bg-2);
  border-radius: var(--radius);
  margin-bottom: 40px;
}

.blog-teaser p {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.blog-teaser-btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  transition: background 0.2s;
}

.blog-teaser-btn:hover {
  background: var(--accent-dim);
  color: #fff;
}


/* ── Deep links (reused from videos) ─────────────────────────── */

.deep-links-section {
  margin-top: 40px;
  margin-bottom: 40px;
}

.deep-links-section h2 {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.deep-links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.deep-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 24px;
  color: var(--text);
  font-size: 13px;
  transition: border-color 0.2s, background 0.2s;
}

.deep-link:hover {
  border-color: var(--accent);
  background: var(--bg-3);
  color: var(--text);
}

.deep-link-tag {
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  padding: 2px 8px;
  background: rgba(79, 142, 247, 0.1);
  border-radius: 10px;
}

.deep-link-label {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ── CTA banner ──────────────────────────────────────────────── */

.cta-banner {
  text-align: center;
  padding: 48px 32px;
  background: var(--bg-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 48px;
}

.cta-banner h2 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 400;
  margin-bottom: 10px;
}

.cta-banner p {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 20px;
}

.cta-btn {
  display: inline-block;
  padding: 12px 32px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  transition: background 0.2s;
}

.cta-btn:hover {
  background: var(--accent-dim);
  color: #fff;
}


/* ── Polymath section (reused from videos) ───────────────────── */

.polymath-section {
  padding: 72px 32px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.polymath-section h2 {
  font-family: var(--font-serif);
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 400;
  margin-bottom: 20px;
}

.polymath-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
}

.polymath-pill {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

.polymath-text {
  max-width: 720px;
  margin: 0 auto 32px;
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.85;
}

.polymath-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.polymath-stat {
  text-align: center;
}

.polymath-stat-num {
  font-family: var(--font-serif);
  font-size: 32px;
  color: var(--text);
  display: block;
}

.polymath-stat-label {
  font-size: 13px;
  color: var(--text-dim);
}


/* ── Footer ──────────────────────────────────────────────────── */

.blog-footer {
  text-align: center;
  padding: 32px;
  font-size: 13px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}

.blog-footer a {
  color: var(--text-muted);
}


/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 900px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .blog-post-nav {
    flex-direction: column;
    gap: 16px;
  }
  .blog-post-nav a {
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
  .blog-hero {
    padding: 60px 20px 36px;
  }
  .blog-grid-section {
    padding: 32px 16px 48px;
  }
  .blog-page-main {
    padding: 24px 16px 48px;
  }
  .polymath-section {
    padding: 48px 20px;
  }
  .polymath-stats {
    gap: 24px;
  }
  .blog-header {
    padding: 14px 16px;
  }
  .blog-tag-nav {
    padding: 10px 16px;
  }
}
