/* --- Fonts --- */
@font-face {
  font-family: "InterVar";
  src: local("Inter"), local("InterVariable");
  font-display: swap;
}

:root {
  /* Clean Light Theme Colors */
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --container: 1200px;

  /* Brand */
  --brand: #2563eb;
  --brand-2: #3b82f6;
  --glow: 0 4px 14px rgba(37, 99, 235, 0.2);

  /* Radii / blur */
  --r-lg: 24px;
  --r-md: 16px;
  --blur: 12px;

  /* Shadows */
  --shadow-1: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-2: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 25px 50px -12px rgba(37, 99, 235, 0.15);
}

/* Base Resets */
* { 
  box-sizing: border-box; 
}

html, body { 
  height: 100%; 
  scroll-behavior: smooth; 
}

body {
  margin: 0; /* Fixes the blank space at the top */
  padding: 0;
  font-family: InterVar, ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased; 
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Utility Classes */
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; }
.pt-0 { padding-top: 0 !important; }
.pb-0 { padding-bottom: 0 !important; }
.text-center { text-align: center; }
.lead { color: var(--muted); font-size: 1.25rem; line-height: 1.6; }

.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}

/* Badges & Buttons */
.badge {
  display: inline-flex; align-items: center; gap: .5rem;
  border: 1px solid var(--border);
  padding: 8px 12px; border-radius: 999px; color: var(--text);
  background: #f1f5f9;
  font-size: 0.875rem;
  font-weight: 600;
}
.badge--floating { 
  background: #ffffff; 
  box-shadow: var(--shadow-1); 
  border: none; 
  color: var(--brand); 
  margin-bottom: 24px; 
}

.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  height: 48px; padding: 0 24px; border-radius: 999px; text-decoration: none; font-weight: 600; 
  transition: all .2s ease;
  border: 1px solid transparent;
}
.pill--primary { background: var(--brand); color: #ffffff; box-shadow: var(--glow); }
.pill--primary:hover { transform: translateY(-2px); background: #1d4ed8; box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3); color: #ffffff; }
.pill--secondary { background: #ffffff; border-color: var(--border); color: var(--text); box-shadow: var(--shadow-1); }
.pill--secondary:hover { border-color: var(--brand); color: var(--brand); }
.pill--ghost { background: transparent; border-color: transparent; color: var(--muted); }
.pill--ghost:hover { background: #f1f5f9; color: var(--text); }

/* Navigation */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { font-weight: 900; font-size: 1.25rem; color: var(--text); letter-spacing: -0.5px; }
.menu { display: flex; gap: 28px; align-items: center; }
.menu a:not(.pill) { color: var(--muted); text-decoration: none; font-weight: 500; transition: color 0.2s; }
.menu a:not(.pill):hover { color: var(--brand); }
.menu a.pill--primary { color: #ffffff; }

.hamburger { display: none; width: 44px; height: 44px; border: 1px solid var(--border); background: #fff; border-radius: 8px; position: relative; cursor: pointer; }
.hamburger span { position: absolute; left: 10px; right: 10px; height: 2px; background: var(--text); transition: .2s; }
.hamburger span:nth-child(1) { top: 13px; }
.hamburger span:nth-child(2) { top: 21px; }
.hamburger span:nth-child(3) { top: 29px; }

/* Scroll Reveal */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.reveal.active { opacity: 1; transform: translateY(0); }

/* Ambient Canvas */
#ambient { position: fixed; inset: 0; z-index: -1; opacity: 0.4; }

/* =========================================
   BLOG INDEX (HOMEPAGE) STYLES
   ========================================= */

.blog-index-header {
  padding: 80px 0 40px;
}

.page-title {
  font-size: clamp(48px, 6vw, 72px);
  font-weight: 900;
  letter-spacing: -2px;
  color: var(--text);
  margin: 0 0 16px;
}

.page-subtitle {
  max-width: 600px;
  margin: 0 auto;
}

/* Category Navigation */
.category-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.active-filter { border-color: var(--brand); color: var(--brand); background: #eff6ff; }

/* Featured Article (Asymmetric Layout) */
.featured-post {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: #ffffff;
}

.featured-post:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.featured-image-wrapper {
  width: 100%;
  height: 100%;
  min-height: 400px;
  border-right: 1px solid var(--border);
}

.featured-content {
  padding: 64px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-title {
  font-size: clamp(32px, 3vw, 44px);
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
  margin: 0 0 24px;
  letter-spacing: -1px;
  transition: color 0.2s;
}

.featured-post:hover .featured-title { color: var(--brand); }

.featured-excerpt {
  color: var(--muted);
  font-size: 1.125rem;
  line-height: 1.6;
  margin: 0 0 40px;
}

.featured-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: auto;
}

.author-avatar-small { width: 40px; height: 40px; border-radius: 50%; }
.meta-text { display: flex; flex-direction: column; }
.meta-text strong { color: var(--text); font-size: 0.95rem; }
.meta-text span { color: var(--muted); font-size: 0.85rem; }

/* Premium Grid */
.premium-blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.premium-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: #ffffff;
}

.premium-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.premium-card-img {
  height: 220px;
  width: 100%;
  border-bottom: 1px solid var(--border);
}

.premium-card-body {
  padding: 32px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-tag {
  color: var(--brand);
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 16px;
  line-height: 1.3;
  letter-spacing: -0.5px;
  transition: color 0.2s;
}

.premium-card:hover .card-title { color: var(--brand); }

.card-excerpt {
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 32px;
  flex-grow: 1;
}

.card-read-more {
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
}

/* Inline CTA Banner inside the Grid */
.inline-cta-banner {
  background: linear-gradient(135deg, var(--brand) 0%, #1e40af 100%);
  border-radius: var(--r-lg);
  padding: 40px 32px;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  box-shadow: var(--shadow-2);
}

.inline-cta-banner h3 { font-size: 2rem; margin: 0 0 12px; letter-spacing: -1px; color: white; }
.inline-cta-banner p { color: #bfdbfe; font-size: 1.125rem; line-height: 1.5; margin: 0 0 24px; }

/* =========================================
   BLOG POST (ARTICLE) STYLES
   ========================================= */

.blog-hero-premium {
  padding: 100px 0 80px; 
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.mesh-bg {
  background-color: var(--bg);
  background-image: 
    radial-gradient(at 80% 0%, rgba(37, 99, 235, 0.08) 0px, transparent 50%),
    radial-gradient(at 0% 50%, rgba(59, 130, 246, 0.05) 0px, transparent 50%);
}

.blog-header-container { max-width: 850px; margin: 0 auto; }

.blog-title-premium {
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.05;
  color: var(--text);
  font-weight: 900;
  letter-spacing: -1.5px;
  margin: 0 0 24px;
}

.blog-subtitle-premium {
  font-size: 1.25rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 700px;
  margin: 0 auto;
}

.author-row-premium {
  display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 40px;
}
.author-avatar { width: 48px; height: 48px; border-radius: 50%; box-shadow: var(--shadow-1); }
.author-info { text-align: left; display: flex; flex-direction: column; }
.author-info strong { color: var(--text); font-size: 1rem; }
.author-info span { color: var(--muted); font-size: 0.875rem; }

/* Image Placeholder (Used in both Grid & Article) */
.image-mesh-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #e0e7ff 0%, #dbeafe 100%);
}

/* Article Layout */
.blog-layout-premium { display: grid; grid-template-columns: 1fr 320px; gap: 64px; align-items: start; }

.prose-premium { color: #1e293b; }
.intro-paragraph {
  font-size: 1.35rem !important;
  line-height: 1.7 !important;
  color: var(--text) !important;
  font-weight: 500;
  letter-spacing: -0.2px;
}

.prose-premium p { font-size: 1.1875rem; line-height: 1.8; margin-bottom: 1.8em; }
.prose-premium h2 { font-size: 2rem; font-weight: 800; margin: 2em 0 1em; color: var(--text); letter-spacing: -0.5px; }

.premium-callout {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  padding: 24px 32px;
  border-radius: 0 16px 16px 0;
  margin: 2.5em 0;
  font-size: 1.125rem; line-height: 1.6;
}

.premium-quote {
  font-size: 1.5rem; font-weight: 600; color: var(--brand); line-height: 1.5;
  margin: 3em 0; text-align: center; letter-spacing: -0.5px;
}

.premium-list { list-style: none; padding: 0; margin: 2em 0; }
.premium-list li { position: relative; padding-left: 32px; margin-bottom: 16px; font-size: 1.125rem; line-height: 1.6; }
.premium-list li::before { content: "→"; position: absolute; left: 0; color: var(--brand); font-weight: bold; }

.prose-divider {
  border: none; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 4em 0;
}

/* Article Sidebar & Table of Contents */
.sticky-widget-premium { position: sticky; top: 100px; }
.toc-container { margin-bottom: 40px; }
.toc-title { text-transform: uppercase; font-size: 0.75rem; font-weight: 700; letter-spacing: 1.5px; color: var(--muted); display: block; margin-bottom: 16px; }
.toc-list { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--border); }
.toc-list li a { display: block; padding: 8px 0 8px 20px; color: var(--muted); text-decoration: none; font-size: 0.95rem; transition: all 0.2s; position: relative; left: -2px; border-left: 2px solid transparent; }
.toc-list li a:hover { color: var(--brand); border-left-color: var(--brand); }

/* Sidebar CTA Box */
.sidebar-cta-box {
  background: #ffffff; border: 1px solid var(--border); padding: 32px; border-radius: 20px; box-shadow: var(--shadow-1); position: relative; overflow: hidden;
}
.sidebar-cta-box h3 { font-size: 1.5rem; margin: 0 0 12px; letter-spacing: -0.5px; }
.sidebar-cta-box p { color: var(--muted); margin-bottom: 24px; font-size: 0.95rem; line-height: 1.6; }
.block-btn { width: 100%; }

/* Animation Utils */
@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}
.pulse-dot { width: 10px; height: 10px; background: var(--brand); border-radius: 50%; margin-bottom: 16px; animation: pulse 2s infinite; }

/* FOOTER */
.footer { border-top: 1px solid var(--border); padding: 48px 0; background: #ffffff; margin-top: 64px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px; }
.brand--footer { font-weight: 900; color: var(--text); }
.foot-right { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.foot-right a, .foot-right span { color: var(--muted); text-decoration: none; font-size: 0.875rem; }
.foot-right a:hover { color: var(--brand); }

/* =========================================
   RESPONSIVE QUERIES
   ========================================= */

@media (max-width: 1024px) {
  /* Homepage Grid Adjustments */
  .featured-post { grid-template-columns: 1fr; }
  .featured-image-wrapper { height: 300px; min-height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .premium-blog-grid { grid-template-columns: repeat(2, 1fr); }
  
  /* Article Layout Adjustments */
  .blog-layout-premium { grid-template-columns: 1fr; gap: 40px; }
  .sticky-widget-premium { position: static; }
}

@media (max-width: 760px) {
  /* Mobile Menu */
  .menu { display: none; position: absolute; right: 24px; top: 80px; flex-direction: column; background: #ffffff; padding: 24px; border: 1px solid var(--border); border-radius: var(--r-md); width: min(300px, 88vw); box-shadow: var(--shadow-2); }
  .menu a:not(.pill) { padding: 12px 0; border-bottom: 1px solid var(--border); width: 100%; }
  .menu a:not(.pill):last-child { border-bottom: none; }
  .menu a.pill { margin-top: 16px; width: 100%; text-align: center; } 
  .hamburger { display: block; }

  /* Homepage Adjustments */
  .premium-blog-grid { grid-template-columns: 1fr; }
  .featured-content { padding: 40px 24px; }

  /* Article Adjustments */
  .blog-hero-premium { padding: 80px 24px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  *{ animation: none!important; transition: none!important }
}

/* Blog Category Filter Hide Class */
.filter-item.hidden { display: none !important; }