/* ==========================================================================
   BHARATH DECODES - AI & GENERATIVE TECH BLOG
   Pure Vanilla CSS Design System (Zero JavaScript Required)
   Color Palette: Deep Midnight, Electric Violet, Cyber Teal & Clean Neutrals
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Outfit:wght@400;500;600;700;800&display=swap');

/* --- CSS Variables & Design Tokens --- */
:root {
  /* Color Palette */
  --bg-primary: #070a12;
  --bg-secondary: #0d1322;
  --bg-surface: #121b2d;
  --bg-surface-hover: #18233a;
  --bg-surface-elevated: #1e2c47;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.16);
  --border-glow: rgba(99, 102, 241, 0.35);

  /* Accents */
  --accent-violet: #818cf8;
  --accent-purple: #a855f7;
  --accent-indigo: #6366f1;
  --accent-teal: #14b8a6;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #06b6d4 100%);
  --accent-glow: 0 0 25px rgba(99, 102, 241, 0.25);

  /* Typography Colors */
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Typography Stacks */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Spacing & Sizing */
  --container-max: 1200px;
  --article-max: 760px;
  --header-height: 72px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 40px -8px rgba(0, 0, 0, 0.6);
  --shadow-card-hover: 0 16px 32px -4px rgba(99, 102, 241, 0.18), 0 0 0 1px rgba(99, 102, 241, 0.3);
}

/* --- Reset & Base Styles --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  min-height: 100vh;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.15), transparent 70%),
    radial-gradient(circle at 90% 20%, rgba(6, 182, 212, 0.08), transparent 40%),
    radial-gradient(circle at 10% 80%, rgba(168, 85, 247, 0.06), transparent 50%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent-violet);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

a:hover {
  color: var(--accent-cyan);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Global Layout Container --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Top Navigation Bar --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(7, 10, 18, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.4);
  color: #fff;
  font-size: 1.15rem;
}

.brand-text span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 1.5rem;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-teal);
  background: rgba(20, 184, 166, 0.12);
  border: 1px solid rgba(20, 184, 166, 0.3);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-teal);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-teal);
}

/* --- Hero Banner --- */
.hero {
  padding: 4.5rem 0 3rem;
  text-align: center;
  position: relative;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-violet);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.hero-title .gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  max-width: 680px;
  margin: 0 auto 2.25rem;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  line-height: 1.6;
}

.hero-topics {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.topic-tag {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
}

.topic-tag:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
  background: var(--bg-surface-hover);
  transform: translateY(-1px);
}

/* --- Stats / Highlight Bar --- */
.stats-strip {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  margin: 1rem 0 3.5rem;
}

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

.stat-number {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* --- Section Headers --- */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 24px;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
}

.section-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* --- Blog Post Card Grid --- */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
  margin-bottom: 5rem;
}

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.85rem;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.post-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.post-card:hover {
  transform: translateY(-5px);
  background: var(--bg-surface-hover);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-card-hover);
}

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

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.category-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-violet);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-full);
}

.badge-foundations {
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.3);
}

.badge-prompting {
  color: var(--accent-purple);
  background: rgba(168, 85, 247, 0.12);
  border-color: rgba(168, 85, 247, 0.3);
}

.badge-enterprise {
  color: var(--accent-teal);
  background: rgba(20, 184, 166, 0.12);
  border-color: rgba(20, 184, 166, 0.3);
}

.read-time {
  font-size: 0.8rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin-bottom: 0.85rem;
}

.card-title a {
  color: var(--text-primary);
}

.card-title a:hover {
  color: var(--accent-violet);
}

.card-excerpt {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

.author-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-violet);
}

.author-details {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.publish-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.read-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-violet);
  transition: gap 0.2s ease, color 0.2s ease;
}

.post-card:hover .read-link {
  color: var(--accent-cyan);
  gap: 0.55rem;
}

/* --- Single Post Page Layout --- */
.article-page {
  padding: 3.5rem 0 6rem;
}

.article-container {
  width: 100%;
  max-width: var(--article-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

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

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

.breadcrumb-separator {
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* Article Header */
.article-header {
  margin-bottom: 3rem;
  padding-bottom: 2.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.article-header-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.article-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 3.25rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.article-lead {
  font-size: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.article-byline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.35rem;
}

.byline-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.byline-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
}

.byline-info h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.byline-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.byline-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- Article Content (Markdown Typography) --- */
.prose {
  font-size: 1.08rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.prose p {
  margin-bottom: 1.6rem;
}

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-top: 3rem;
  margin-bottom: 1.15rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.prose h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-top: 2.25rem;
  margin-bottom: 0.85rem;
}

.prose h4 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent-violet);
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

.prose ul,
.prose ol {
  margin-bottom: 1.6rem;
  padding-left: 1.75rem;
}

.prose li {
  margin-bottom: 0.5rem;
}

.prose li::marker {
  color: var(--accent-violet);
}

.prose blockquote {
  margin: 2rem 0;
  padding: 1.25rem 1.75rem;
  background: var(--bg-surface);
  border-left: 4px solid var(--accent-violet);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--text-primary);
}

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

/* Callout Alert Box */
.callout {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.08);
  position: relative;
}

.callout-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-violet);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.callout-content {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.callout-content p:last-child {
  margin-bottom: 0;
}

/* Code & Preformatted */
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-surface-elevated);
  color: #38bdf8;
  padding: 0.2em 0.45em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.prose pre {
  margin: 2rem 0;
  padding: 1.35rem 1.5rem;
  background: #080c16;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow-x: auto;
  box-shadow: var(--shadow-md);
}

.prose pre code {
  background: transparent;
  padding: 0;
  border: none;
  color: #e2e8f0;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Markdown Tables */
.prose table {
  width: 100%;
  margin: 2.25rem 0;
  border-collapse: collapse;
  border-spacing: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.prose th {
  background: var(--bg-surface-elevated);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: left;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border-medium);
  color: var(--text-primary);
}

.prose td {
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.prose tr:last-child td {
  border-bottom: none;
}

.prose tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.015);
}

.prose hr {
  margin: 3.5rem 0;
  border: none;
  border-top: 1px solid var(--border-subtle);
}

/* Article Navigation / Back Button */
.article-nav {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.35rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.2s ease;
}

.btn-back:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-glow);
  transform: translateX(-3px);
  color: var(--accent-violet);
}

/* --- Author Bio Box --- */
.author-box {
  margin-top: 3rem;
  padding: 1.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: flex;
  gap: 1.35rem;
  align-items: center;
}

.author-box-avatar {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.3);
}

.author-box-content h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.author-box-content p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- Site Footer --- */
.site-footer {
  margin-top: auto;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.site-footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

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

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

.footer-credits {
  font-size: 0.82rem;
  color: var(--text-dim);
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
  .site-header {
    height: auto;
    padding: 1rem 0;
  }

  .site-header .container {
    flex-direction: column;
    gap: 0.75rem;
  }

  .hero {
    padding: 3rem 0 2rem;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .posts-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .stats-strip {
    flex-direction: column;
    gap: 1.25rem;
  }

  .article-byline {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .byline-right {
    width: 100%;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-subtle);
  }

  .author-box {
    flex-direction: column;
    text-align: center;
  }
}
