/* ==========================================================================
   KRUTI DEEPAN PANDA — ENGINEERING BLOG STYLESHEET
   Dark-Mode VLSI Technical Paper & Article Layout
   ========================================================================== */

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

:root {
  --bg-dark: #0a0a0f;
  --bg-card: rgba(22, 22, 30, 0.75);
  --bg-code: #13131c;
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  
  --accent-cyan: #00f2fe;
  --accent-indigo: #6366f1;
  --accent-purple: #8a2be2;
  
  --border-glass: rgba(255, 255, 255, 0.1);
  --border-highlight: rgba(0, 242, 254, 0.4);
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-code: 'Fira Code', monospace;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.8;
  padding: clamp(1rem, 4vw, 3rem) clamp(0.5rem, 3vw, 1.5rem);
  min-height: 100vh;
}

.article-container {
  max-width: clamp(900px, 95vw, 1800px);
  width: 100%;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: clamp(12px, 2.5vw, 20px);
  padding: clamp(1.8rem, 4vw, 4.5rem) clamp(1.2rem, 5vw, 5.5rem);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  position: relative;
}

.article-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: clamp(12px, 2.5vw, 20px) clamp(12px, 2.5vw, 20px) 0 0;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-indigo));
}

/* Navigation Return */
.nav-return {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--accent-cyan);
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: clamp(0.85rem, 1.5vw, 1.05rem);
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  padding: 0.5rem 1.2rem;
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.25);
  border-radius: 50px;
  transition: all 0.3s ease;
}

.nav-return:hover {
  background: rgba(0, 242, 254, 0.2);
  transform: translateX(-4px);
}

/* Article Header */
.article-meta {
  display: flex;
  align-items: center;
  gap: clamp(0.6rem, 2vw, 1.5rem);
  flex-wrap: wrap;
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  color: var(--text-muted);
  margin-bottom: 1.2rem;
}

.category-tag {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
  padding: 0.25rem 0.8rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: clamp(0.75rem, 1.4vw, 0.88rem);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.article-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4.2vw, 3.8rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 1.5rem;
  color: #ffffff;
  word-break: break-word;
}

.article-author {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: clamp(1.5rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--border-glass);
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.author-info h4 {
  font-family: var(--font-heading);
  font-size: clamp(0.95rem, 1.8vw, 1.2rem);
  color: #ffffff;
}

.author-info span {
  font-size: clamp(0.8rem, 1.5vw, 0.95rem);
  color: var(--text-muted);
}

/* Article Typography */
.article-content h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 2.8vw, 2.4rem);
  color: #ffffff;
  margin: clamp(1.8rem, 4vw, 3rem) 0 1.2rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.article-content h3 {
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 2.2vw, 1.7rem);
  color: var(--accent-cyan);
  margin: clamp(1.5rem, 3.5vw, 2.2rem) 0 0.8rem 0;
}

.article-content p {
  margin-bottom: 1.5rem;
  color: #d1d5db;
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  line-height: 1.9;
}

.article-content ul, .article-content ol {
  margin: 0 0 1.5rem clamp(1.2rem, 3vw, 2rem);
  color: #d1d5db;
  font-size: clamp(1rem, 1.4vw, 1.25rem);
}

.article-content li {
  margin-bottom: 0.5rem;
}

/* Code & Callout Box */
pre {
  background: var(--bg-code);
  border: 1px solid var(--border-glass);
  border-left: 4px solid var(--accent-cyan);
  border-radius: 8px;
  padding: clamp(1rem, 2vw, 1.8rem) clamp(1rem, 2.5vw, 2rem);
  margin: 2.5rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  font-family: var(--font-code);
  font-size: clamp(0.85rem, 1.2vw, 1.05rem);
  color: #e2e8f0;
}

code {
  font-family: var(--font-code);
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
  word-break: break-word;
}

pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  word-break: normal;
}

.callout {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-left: 4px solid var(--accent-indigo);
  border-radius: 8px;
  padding: clamp(1rem, 3vw, 1.5rem);
  margin: 2rem 0;
  word-break: break-word;
}

.callout h4 {
  color: #ffffff;
  margin-bottom: 0.5rem;
  font-family: var(--font-heading);
  font-size: clamp(0.95rem, 2.2vw, 1.1rem);
}

/* Responsive KaTeX / Math Equations */
.katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0.5rem 0;
  max-width: 100%;
}

.katex {
  max-width: 100%;
  font-size: clamp(0.9em, 2.2vw, 1.1em);
}

/* Responsive Tables & Images */
.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 2rem auto;
  display: block;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  overflow-x: auto;
  display: block;
  -webkit-overflow-scrolling: touch;
}

.article-content th, .article-content td {
  padding: clamp(0.5rem, 2vw, 0.75rem) clamp(0.6rem, 2.5vw, 1rem);
  border: 1px solid var(--border-glass);
  text-align: left;
  font-size: clamp(0.9rem, 2vw, 1rem);
}

/* Footer */
.article-footer {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: 2rem;
  border-top: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.article-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  font-size: clamp(0.75rem, 1.8vw, 0.8rem);
  color: var(--text-muted);
}

/* Media Queries for Fine-Tuning */
@media (max-width: 768px) {
  .article-container {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: 0.5rem 0.25rem;
  }
  .article-container {
    padding: 1.5rem 1rem;
    border-radius: 12px;
  }
  .article-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
