/* ═══════════════════════════════════════════════════════════
   MLK Blog — Premium Dark Theme
   ═══════════════════════════════════════════════════════════ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:          #06080d;
  --bg-2:        #0c1018;
  --surface:     #111827;
  --surface-2:   #1a2236;
  --border:      #1e293b;
  --border-hover:#334155;
  --primary:     #818cf8;
  --primary-dark:#6366f1;
  --primary-glow: rgba(99,102,241,.25);
  --accent:      #22d3ee;
  --accent-glow: rgba(34,211,238,.2);
  --green:       #34d399;
  --orange:      #fb923c;
  --pink:        #f472b6;
  --text:        #f1f5f9;
  --text-2:      #94a3b8;
  --text-3:      #64748b;
  --mono:        'JetBrains Mono', monospace;
  --sans:        'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius:      16px;
  --radius-sm:   10px;
  --transition:  .25s cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }

/* ─── Animated BG ─────────────────────────────────────── */
.bg-grid {
  position: fixed; inset: 0; z-index: -2;
  background-image:
    linear-gradient(rgba(99,102,241,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,.03) 1px, transparent 1px);
  background-size: 60px 60px;
}

.bg-glow {
  position: fixed; z-index: -1;
  border-radius: 50%;
  filter: blur(120px);
  opacity: .4;
  pointer-events: none;
  animation: glowFloat 12s ease-in-out infinite alternate;
}
.bg-glow--1 { width: 500px; height: 500px; background: var(--primary-dark); top: -100px; right: -100px; }
.bg-glow--2 { width: 400px; height: 400px; background: #0ea5e9; bottom: -50px; left: -100px; animation-delay: -6s; }

@keyframes glowFloat {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, 30px) scale(1.15); }
}

/* ─── Header ──────────────────────────────────────────── */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  padding: 1rem 0;
  transition: background var(--transition), box-shadow var(--transition);
}
.header.scrolled {
  background: rgba(6,8,13,.85);
  backdrop-filter: blur(20px) saturate(1.5);
  box-shadow: 0 1px 0 var(--border);
}

.header-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}

.logo {
  font-size: 1.6rem; font-weight: 900; color: var(--text); letter-spacing: -1px;
}
.logo span { color: var(--primary); }

.nav { display: flex; gap: .5rem; }
.nav a {
  color: var(--text-2); font-size: .88rem; font-weight: 500;
  padding: .5rem 1rem; border-radius: 8px;
  transition: all var(--transition);
}
.nav a:hover { color: var(--text); background: rgba(255,255,255,.05); }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: .5rem; }
.nav-toggle span {
  display: block; width: 22px; height: 2px; background: var(--text);
  margin: 5px 0; transition: all .3s; border-radius: 2px;
}

/* ─── Hero ────────────────────────────────────────────── */
.hero {
  max-width: 1100px; margin: 0 auto;
  padding: 10rem 1.5rem 5rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 4rem; min-height: 100vh;
}

.hero-content { flex: 1; max-width: 600px; }

.hero-badge {
  display: inline-block;
  background: rgba(99,102,241,.1);
  border: 1px solid rgba(99,102,241,.2);
  color: var(--primary);
  font-size: .85rem; font-weight: 600;
  padding: .4rem 1rem; border-radius: 50px;
  margin-bottom: 1.5rem;
  animation: fadeInUp .6s ease-out;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900; letter-spacing: -2px;
  line-height: 1.1; margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--primary) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp .6s ease-out .1s both;
}

.hero-subtitle {
  font-size: 1.25rem; color: var(--accent);
  font-family: var(--mono); font-weight: 500;
  margin-bottom: .75rem;
  animation: fadeInUp .6s ease-out .2s both;
}
.hero-subtitle::before { content: '> '; opacity: .5; }

.hero-bio {
  font-size: 1.05rem; color: var(--text-2);
  line-height: 1.8; margin-bottom: 2rem;
  animation: fadeInUp .6s ease-out .3s both;
}

.hero-actions {
  display: flex; gap: 1rem; margin-bottom: 2.5rem;
  animation: fadeInUp .6s ease-out .4s both;
}

.hero-social {
  display: flex; gap: .75rem;
  animation: fadeInUp .6s ease-out .5s both;
}
.hero-social a {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text-2); font-size: .85rem;
  transition: all var(--transition);
}
.hero-social a:hover {
  border-color: var(--primary); color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--primary-glow);
}

/* Hero Visual */
.hero-visual {
  position: relative; flex-shrink: 0;
  width: 280px; height: 280px;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 1s ease-out .3s both;
}

.hero-avatar {
  width: 140px; height: 140px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-dark), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; font-weight: 900; color: #fff;
  position: relative; z-index: 2;
  box-shadow: 0 0 60px var(--primary-glow);
}

.hero-ring {
  position: absolute; border-radius: 50%;
  border: 1px solid rgba(99,102,241,.15);
  animation: ringPulse 4s ease-in-out infinite;
}
.hero-ring--1 { width: 180px; height: 180px; animation-delay: 0s; }
.hero-ring--2 { width: 230px; height: 230px; animation-delay: .8s; border-color: rgba(34,211,238,.1); }
.hero-ring--3 { width: 280px; height: 280px; animation-delay: 1.6s; }

@keyframes ringPulse {
  0%, 100% { transform: scale(1); opacity: .5; }
  50%      { transform: scale(1.08); opacity: 1; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--sans); font-size: .9rem; font-weight: 600;
  padding: .75rem 1.8rem; border-radius: 12px;
  border: none; cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn--primary {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  box-shadow: 0 4px 20px var(--primary-glow);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--primary-glow);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
}
.btn--ghost:hover {
  border-color: var(--primary); color: var(--primary);
  background: rgba(99,102,241,.05);
}

.btn--back { margin-bottom: 2rem; }

/* ─── Stats ───────────────────────────────────────────── */
.stats {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  padding: 3rem 0;
}
.stats-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 1.5rem;
  display: flex; justify-content: center; gap: 5rem;
}
.stat { text-align: center; }
.stat-num {
  display: block;
  font-size: 2.5rem; font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}
.stat-label { font-size: .85rem; color: var(--text-3); font-weight: 500; }

/* ─── Section ─────────────────────────────────────────── */
.section { padding: 6rem 0; }
.section--alt { background: var(--bg-2); }
.section-inner { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

.section-header { text-align: center; margin-bottom: 3.5rem; }
.section-badge {
  display: inline-block;
  font-family: var(--mono); font-size: .78rem; font-weight: 500;
  color: var(--accent); text-transform: uppercase; letter-spacing: 2px;
  margin-bottom: .75rem;
}
.section-title {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 800; letter-spacing: -1px;
  margin-bottom: .5rem;
}
.section-desc { color: var(--text-2); font-size: 1rem; max-width: 500px; margin: 0 auto; }

/* ─── Blog Cards ──────────────────────────────────────── */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px,1fr)); gap: 1.5rem; }

.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.blog-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary-dark), var(--accent));
  opacity: 0; transition: opacity var(--transition);
}
.blog-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,.3);
}
.blog-card:hover::before { opacity: 1; }

.blog-card .tag {
  display: inline-block;
  font-family: var(--mono); font-size: .72rem; font-weight: 600;
  padding: .3rem .75rem; border-radius: 6px;
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 1rem;
}
.tag--fl    { background: rgba(99,102,241,.12); color: var(--primary); }
.tag--backend { background: rgba(34,211,238,.12); color: var(--accent); }
.tag--ml    { background: rgba(244,114,182,.12); color: var(--pink); }
.tag--devops { background: rgba(251,146,60,.12); color: var(--orange); }
.tag--default { background: rgba(52,211,153,.12); color: var(--green); }

.blog-card h3 {
  font-size: 1.15rem; font-weight: 700;
  margin-bottom: .6rem; line-height: 1.4;
}
.blog-card p { color: var(--text-2); font-size: .9rem; line-height: 1.65; margin-bottom: 1rem; }
.blog-card .meta { color: var(--text-3); font-size: .78rem; font-family: var(--mono); }

/* ─── Post View ───────────────────────────────────────── */
.post-view { padding-top: 8rem; }
.post-full { max-width: 760px; margin: 0 auto; }
.post-full-tag {
  display: inline-block;
  font-family: var(--mono); font-size: .78rem; font-weight: 600;
  padding: .3rem .75rem; border-radius: 6px;
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 1rem;
}
.post-full-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800; letter-spacing: -1px;
  line-height: 1.2; margin-bottom: 1rem;
}
.post-full-meta {
  color: var(--text-3); font-size: .85rem;
  font-family: var(--mono); margin-bottom: 3rem;
  padding-bottom: 2rem; border-bottom: 1px solid var(--border);
}
.post-full-content { font-size: 1.05rem; line-height: 1.9; }
.post-full-content h2 {
  font-size: 1.5rem; font-weight: 700; margin: 2.5rem 0 1rem;
  letter-spacing: -.5px;
}
.post-full-content h3 {
  font-size: 1.2rem; font-weight: 700; margin: 2rem 0 .75rem;
  color: var(--primary);
}
.post-full-content p { margin-bottom: 1.2rem; color: var(--text-2); }
.post-full-content ul, .post-full-content ol {
  margin: 1rem 0 1.5rem 1.5rem; color: var(--text-2);
}
.post-full-content li { margin-bottom: .4rem; }
.post-full-content code {
  font-family: var(--mono); font-size: .88em;
  background: var(--surface-2); padding: .15rem .4rem;
  border-radius: 4px; color: var(--accent);
}
.post-full-content pre {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1.5rem;
  overflow-x: auto; margin: 1.5rem 0;
  font-family: var(--mono); font-size: .88rem;
  line-height: 1.6; color: var(--text-2);
}
.post-full-content pre code {
  background: none; padding: 0; color: inherit;
}
.post-full-content strong { color: var(--text); font-weight: 600; }

/* ─── Project Cards ───────────────────────────────────── */
.project-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 1.5rem;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: all var(--transition);
  position: relative;
}
.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,.25);
}
.project-card .icon { font-size: 2.5rem; margin-bottom: 1rem; }
.project-card h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: .5rem; }
.project-card p { color: var(--text-2); font-size: .9rem; line-height: 1.6; margin-bottom: 1.2rem; }
.project-card .tech { display: flex; flex-wrap: wrap; gap: .4rem; }
.project-card .tech span {
  font-family: var(--mono); font-size: .72rem; font-weight: 500;
  background: rgba(34,211,238,.08); color: var(--accent);
  padding: .25rem .6rem; border-radius: 6px;
}
.project-card .links { display: flex; gap: .75rem; margin-top: 1rem; }
.project-card .links a {
  font-size: .82rem; font-weight: 500; color: var(--text-3);
  transition: color var(--transition);
}
.project-card .links a:hover { color: var(--primary); }

/* ─── About ───────────────────────────────────────────── */
.about-layout {
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem;
  align-items: start;
}
.about-text {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2.5rem;
}
.about-text p { color: var(--text-2); font-size: 1rem; line-height: 1.9; }

.about-skills h3 {
  font-size: 1rem; font-weight: 700; margin-bottom: 1.2rem;
  color: var(--text-3); text-transform: uppercase; letter-spacing: 1px;
  font-family: var(--mono); font-size: .82rem;
}
.skills-grid { display: flex; flex-wrap: wrap; gap: .6rem; }
.skill-tag {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .55rem 1.1rem;
  font-size: .85rem; font-weight: 500;
  color: var(--text-2);
  transition: all var(--transition);
}
.skill-tag:hover {
  border-color: var(--primary); color: var(--primary);
  background: rgba(99,102,241,.05);
  transform: translateY(-2px);
}

/* ─── Contact ─────────────────────────────────────────── */
.contact-cards { display: flex; gap: 1.5rem; justify-content: center; flex-wrap: wrap; }
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.5rem;
  text-align: center;
  min-width: 200px;
  transition: all var(--transition);
}
.contact-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(0,0,0,.2);
}
.contact-card .contact-icon {
  font-size: 2rem; margin-bottom: .75rem; display: block;
}
.contact-card .contact-label {
  font-size: .82rem; color: var(--text-3);
  font-family: var(--mono); text-transform: uppercase;
  letter-spacing: 1px; margin-bottom: .3rem;
}
.contact-card .contact-value {
  font-size: .95rem; font-weight: 600; color: var(--text);
}

/* ─── Footer ──────────────────────────────────────────── */
.footer {
  padding: 3rem 0; border-top: 1px solid var(--border);
  background: var(--bg);
}
.footer-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.footer p { color: var(--text-3); font-size: .82rem; }

/* ─── Animations ──────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(25px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.reveal {
  opacity: 0; transform: translateY(30px);
  transition: opacity .6s ease-out, transform .6s ease-out;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ─── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  .hero {
    flex-direction: column-reverse; text-align: center;
    padding: 8rem 1.5rem 3rem; gap: 2rem; min-height: auto;
  }
  .hero-content { max-width: 100%; }
  .hero-actions { justify-content: center; }
  .hero-social { justify-content: center; }
  .hero-visual { width: 200px; height: 200px; }
  .hero-avatar { width: 100px; height: 100px; font-size: 2rem; }
  .hero-ring--1 { width: 130px; height: 130px; }
  .hero-ring--2 { width: 165px; height: 165px; }
  .hero-ring--3 { width: 200px; height: 200px; }
  .stats-inner { gap: 2.5rem; }
  .stat-num { font-size: 2rem; }
  .about-layout { grid-template-columns: 1fr; }
  .blog-grid, .project-grid { grid-template-columns: 1fr; }

  .nav { 
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(6,8,13,.95); backdrop-filter: blur(20px);
    flex-direction: column; padding: 1rem;
    border-bottom: 1px solid var(--border);
  }
  .nav.open { display: flex; }
  .nav-toggle { display: block; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 2rem; }
  .section { padding: 4rem 0; }
  .blog-card, .project-card { padding: 1.5rem; }
  .contact-cards { flex-direction: column; align-items: stretch; }
}

/* ─── Reading Progress Bar ────────────────────────────── */
.progress-bar {
  position: fixed; top: 0; left: 0; height: 3px; z-index: 2000;
  background: linear-gradient(90deg, var(--primary-dark), var(--accent));
  width: 0%; transition: width 60ms linear;
  box-shadow: 0 0 10px var(--primary-glow);
}

/* ─── Scroll To Top ───────────────────────────────────── */
.scroll-top {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 1500;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; color: var(--text-2);
  cursor: pointer;
  opacity: 0; transform: translateY(16px);
  transition: all var(--transition);
  pointer-events: none;
}
.scroll-top.visible {
  opacity: 1; transform: translateY(0); pointer-events: all;
}
.scroll-top:hover {
  border-color: var(--primary); color: var(--primary);
  box-shadow: 0 4px 20px var(--primary-glow);
  transform: translateY(-2px);
}

/* ─── Particles Canvas ────────────────────────────────── */
.particles {
  position: fixed; inset: 0; z-index: -1;
  pointer-events: none;
  opacity: .6;
}

/* ─── Typing Cursor ───────────────────────────────────── */
.cursor {
  display: inline-block;
  color: var(--accent);
  font-weight: 300;
  margin-left: 2px;
  animation: blink .7s step-end infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}

/* ─── Tag Filter ──────────────────────────────────────── */
.tag-filter {
  display: flex; flex-wrap: wrap; gap: .5rem;
  justify-content: center; margin-bottom: 2.5rem;
}
.tag-pill {
  display: inline-block;
  font-family: var(--mono); font-size: .78rem; font-weight: 500;
  padding: .4rem 1rem; border-radius: 50px;
  border: 1px solid var(--border);
  color: var(--text-3); background: transparent;
  cursor: pointer;
  transition: all var(--transition);
}
.tag-pill:hover { border-color: var(--primary); color: var(--primary); }
.tag-pill.active {
  background: var(--primary-dark); border-color: var(--primary-dark);
  color: #fff;
}

/* ─── Blog Card Read More ─────────────────────────────── */
.blog-card .read-more {
  display: inline-block;
  font-family: var(--mono); font-size: .8rem; font-weight: 500;
  color: var(--primary); opacity: 0;
  transform: translateX(-8px);
  transition: all var(--transition);
}
.blog-card:hover .read-more {
  opacity: 1; transform: translateX(0);
}

/* ─── Staggered Card Animation ────────────────────────── */
.blog-card.reveal:nth-child(1) { transition-delay: 0s; }
.blog-card.reveal:nth-child(2) { transition-delay: .1s; }
.blog-card.reveal:nth-child(3) { transition-delay: .2s; }
.blog-card.reveal:nth-child(4) { transition-delay: .3s; }
.blog-card.reveal:nth-child(5) { transition-delay: .4s; }
.blog-card.reveal:nth-child(6) { transition-delay: .5s; }

.project-card.reveal:nth-child(1) { transition-delay: 0s; }
.project-card.reveal:nth-child(2) { transition-delay: .12s; }
.project-card.reveal:nth-child(3) { transition-delay: .24s; }
.project-card.reveal:nth-child(4) { transition-delay: .36s; }



/* ─── Better Markdown Content ─────────────────────────── */
.post-full-content blockquote {
  border-left: 3px solid var(--primary);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: rgba(99,102,241,.04);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-2);
  font-style: italic;
}
.post-full-content blockquote p { margin: 0; }

.post-full-content hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 2.5rem 0;
}

.post-full-content ol {
  counter-reset: ol-counter;
  list-style: none;
  padding-left: 1.5rem;
}
.post-full-content ol li {
  counter-increment: ol-counter;
  position: relative;
}
.post-full-content ol li::before {
  content: counter(ol-counter) '.';
  position: absolute; left: -1.5rem;
  color: var(--primary); font-weight: 700;
  font-family: var(--mono); font-size: .85rem;
}

/* ─── Page Transition ─────────────────────────────────── */
.page-enter {
  animation: pageIn .4s ease-out both;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Nav Active Link ─────────────────────────────────── */
.nav a.active {
  color: var(--primary);
  background: rgba(99,102,241,.08);
}

/* ─── Stat Counter Animation ──────────────────────────── */
.stat-num {
  transition: transform .3s;
}
.stat-num.counted {
  transform: scale(1.05);
}
