/* Root variables for theming and consistency */
:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #f59e0b; /* Adding a warm accent color */
  --text-primary: #111827; /* Darker, crisper text for better contrast */
  --text-secondary: #4b5563;
  --bg-primary: #ffffff;
  --bg-secondary: #f3f4f6; /* Slightly deeper background for sections */
  --bg-tertiary: #f8fafc;
  --border-color: #e5e7eb;
  --font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --border-radius-sm: 8px; /* Slightly rounder for modern feel */
  --border-radius-md: 12px;
  --border-radius-lg: 20px;
  --transition-speed: 0.3s;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
  --shadow-hover: 0 20px 25px -5px rgba(37, 99, 235, 0.1), 0 10px 10px -5px rgba(37, 99, 235, 0.04);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  flex: 1;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: all var(--transition-speed) ease;
}

a:hover {
  color: var(--primary-hover);
}

img {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.page-spacing {
  padding-top: 60px;
  padding-bottom: 80px;
}

/* Typography Enhancements */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.025em; /* Tighter letter spacing for headings looks more modern */
}

h1 {
  font-size: 3rem;
  margin-bottom: 1.25rem;
}

h2 {
  font-size: 2.25rem;
  margin-bottom: 1.25rem;
  margin-top: 2.5rem;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  margin-top: 2rem;
  font-weight: 700;
}

p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* Navigation - Glassmorphism Effect */
.navbar {
  background-color: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.5);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all var(--transition-speed);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
}

.brand {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-color);
  letter-spacing: -0.05em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand::before {
  content: '✦';
  color: var(--secondary-color);
  font-size: 1.2rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
}

.nav-links a:not(.btn)::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--primary-color);
  transition: width var(--transition-speed) ease;
}

.nav-links a:not(.btn):hover::after {
  width: 100%;
}

.nav-links a:hover {
  color: var(--text-primary);
}

.menu-toggle {
  display: none;
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  transition: transform var(--transition-speed);
}

.menu-toggle:hover {
  transform: scale(1.1);
}

/* Buttons - Premium Feel */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  letter-spacing: 0.025em;
  border: 2px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), #3b82f6);
  color: #ffffff !important;
  box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.39);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-hover), #2563eb);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-large {
  padding: 16px 36px;
  font-size: 1.1rem;
  border-radius: var(--border-radius-md);
}

/* Hero Section - Dynamic & Modern */
.hero {
  background: linear-gradient(to bottom, var(--bg-tertiary), #ffffff);
  padding: 100px 20px 120px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.05) 0%, rgba(255,255,255,0) 50%);
  z-index: 0;
  pointer-events: none;
}

.hero-content {
  max-width: 850px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: 4rem;
  font-weight: 800;
  background: linear-gradient(to right, var(--text-primary), var(--primary-color));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 24px;
  line-height: 1.1;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Categories Section */
.section-title {
  text-align: center;
  font-size: 2.25rem;
  margin-bottom: 50px;
  margin-top: 80px;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background-color: var(--primary-color);
  border-radius: 2px;
}

.grid {
  display: grid;
  gap: 30px;
}

.categories-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.category-card {
  background-color: var(--bg-primary);
  border: 1px solid rgba(229, 231, 235, 0.8);
  border-radius: var(--border-radius-lg);
  padding: 30px 24px;
  text-align: center;
  transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(255,255,255,0) 100%);
  z-index: -1;
  opacity: 0;
  transition: opacity var(--transition-speed);
}

.category-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(37, 99, 235, 0.2);
}

.category-card:hover::before {
  opacity: 1;
}

.category-card h3 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.3rem;
  color: var(--text-primary);
}

.category-card p {
  font-size: 0.95rem;
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Articles Section / Cards - Premium Layout */
.articles-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin-bottom: 80px;
}

.article-card {
  background-color: var(--bg-primary);
  border: 1px solid rgba(229, 231, 235, 0.6);
  border-radius: var(--border-radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.article-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(37, 99, 235, 0.3);
}

.article-card h3 {
  margin-top: 0;
  font-size: 1.4rem;
  line-height: 1.3;
  margin-bottom: 16px;
}

.article-card h3 a {
  color: var(--text-primary);
  text-decoration: none;
}

.article-card h3 a:hover {
  color: var(--primary-color);
}

.article-card p {
  flex-grow: 1;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.read-more {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary-color);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.read-more:hover {
  gap: 10px; /* Slight animation on hover separating the arrow */
}

/* Blog Article Page Refinement */
.article-page {
  max-width: 760px; /* Optimal reading width */
  margin: 0 auto;
}

.markdown-content h1 {
  font-size: 3.2rem;
  margin-top: 0;
  margin-bottom: 24px;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.article-meta {
  margin-bottom: 48px;
  color: var(--text-secondary);
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 24px;
}

.author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.author strong {
  color: var(--text-primary);
}

/* Markdown Specifics - Beautiful Reading Experience */
.markdown-content p {
  font-size: 1.15rem;
  line-height: 1.8;
  margin-bottom: 1.8rem;
  color: #374151;
}

.markdown-content h2 {
  font-size: 2rem;
  margin-top: 3.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.markdown-content h3 {
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.markdown-content ul,
.markdown-content ol {
  margin-bottom: 1.8rem;
  padding-left: 1.5rem;
}

.markdown-content li {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  color: #374151;
  line-height: 1.7;
}

.markdown-content li::marker {
  color: var(--primary-color);
}

.markdown-content blockquote {
  border-left: 5px solid var(--primary-color);
  background: linear-gradient(to right, rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0.02));
  padding: 24px 30px;
  margin: 2.5rem 0;
  border-radius: 0 var(--border-radius-lg) var(--border-radius-lg) 0;
  font-style: normal;
  position: relative;
}

.markdown-content blockquote p {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.6;
}

.markdown-content blockquote::before {
  content: "💡 Expert Insight";
  display: block;
  font-weight: 800;
  color: var(--primary-color);
  margin-bottom: 12px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* CTA Box - High Conversion Design */
.article-cta-box {
  background: linear-gradient(135deg, #1e3a8a, var(--primary-color));
  border-radius: var(--border-radius-lg);
  padding: 50px 40px;
  text-align: center;
  margin-top: 80px;
  color: white;
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
}

.article-cta-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5z' fill='rgba(255,255,255,0.05)' fill-rule='evenodd'/%3E%3C/svg%3E");
  z-index: 0;
}

.article-cta-box h2 {
  margin-top: 0;
  color: white;
  border: none;
  font-size: 2.2rem;
  position: relative;
  z-index: 1;
}

.article-cta-box p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.15rem;
  margin-bottom: 30px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  z-index: 1;
}

.article-cta-box .btn-primary {
  background: white !important;
  color: var(--primary-color) !important;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  position: relative;
  z-index: 1;
}

.article-cta-box .btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}

/* Footer Refinement */
footer {
  background-color: var(--text-primary);
  color: white;
  padding: 80px 20px 30px;
  margin-top: auto;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 50px;
  margin-bottom: 60px;
}

.footer-col h3 {
  font-size: 1.3rem;
  margin-bottom: 20px;
  margin-top: 0;
  color: white;
  letter-spacing: 0.05em;
}

.footer-col p {
  color: #9ca3af;
  font-size: 1.05rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
}

.footer-col ul li {
  margin-bottom: 12px;
}

.footer-col ul li a {
  color: #9ca3af;
  font-size: 1.05rem;
  transition: color var(--transition-speed);
}

.footer-col ul li a:hover {
  color: white;
  padding-left: 5px; /* Slight indent on hover */
}

.footer-bottom {
  text-align: center;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #6b7280;
  font-size: 0.95rem;
}

/* Mobile Responsiveness Fine-tuning */
@media (max-width: 768px) {
  .nav-container {
    padding: 16px 20px;
  }

  .menu-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    position: absolute;
    top: 70px;
    left: 0;
    background-color: var(--bg-primary);
    padding: 20px;
    box-shadow: var(--shadow-md);
    gap: 20px;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-links.active {
    display: flex;
    animation: slideDown 0.3s ease forwards;
  }

  .nav-links .btn {
    width: 100%;
  }

  .hero {
    padding: 60px 20px 80px;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero p {
    font-size: 1.1rem;
  }
  
  .section-title {
    font-size: 1.8rem;
  }

  .markdown-content h1 {
    font-size: 2.2rem;
  }
  
  .markdown-content h2 {
    font-size: 1.6rem;
  }
  
  .markdown-content blockquote {
    padding: 20px;
  }
  
  .article-cta-box {
    padding: 40px 20px;
  }
  
  .article-cta-box h2 {
    font-size: 1.8rem;
  }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
