/* ========================================
   HCODX Blog — Modern Design System
   Light theme default · Dark theme toggle
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,500;12..96,600;12..96,700;12..96,800&family=Lora:ital,wght@0,400;0,500;0,600;1,400;1,500&family=JetBrains+Mono:wght@400;500&display=swap');

/* =============================================
   LIGHT THEME (default)
   ============================================= */
:root {
  --bg:            #f7f8fc;
  --surface:       #ffffff;
  --card:          #ffffff;
  --card-hover:    #f1f3fb;
  --border:        #e2e6f0;
  --border-bright: #c8cfe6;
  --text:          #0f1523;
  --text-muted:    #5a6480;
  --text-dim:      #9ba3be;
  --accent:        #4c6ef5;
  --accent-glow:   rgba(76, 110, 245, 0.14);
  --accent-soft:   #3557d8;
  --green:         #1e9e6a;
  --pink:          #d93f72;
  --amber:         #d48f09;
  --teal:          #0891b2;

  /* shadows */
  --shadow-sm:  0 1px 3px rgba(15,21,35,0.08), 0 1px 2px rgba(15,21,35,0.05);
  --shadow-md:  0 4px 16px rgba(15,21,35,0.1);
  --shadow-lg:  0 8px 32px rgba(15,21,35,0.12);
  --glow-accent:0 0 40px rgba(76, 110, 245, 0.1);

  /* article body text */
  --prose-p:    #2e3a52;
  --prose-li:   #3a4a66;
  --code-bg:    rgba(76, 110, 245, 0.07);
  --code-border:rgba(76, 110, 245, 0.18);
  --code-color: #3147b8;
  --pre-bg:     #f0f2f9;
  --pre-border: #dde1ef;
  --blockquote-bg: rgba(76,110,245,0.05);
  --infobox-bg: rgba(30,158,106,0.06);
  --infobox-border: rgba(30,158,106,0.2);
  --infobox-text: #1a6b4a;
  --cta-bg:     linear-gradient(135deg, #eef1ff 0%, #e6ecff 100%);
  --cta-border: rgba(76,110,245,0.2);
  --related-bg: #f4f6fc;
  --internal-bg:rgba(76,110,245,0.04);
  --internal-border:rgba(76,110,245,0.12);
  --banner-bg:  #fff;
  --banner-border:#e2e6f0;
  --nav-bg:     rgba(247,248,252,0.95);
  --footer-bg:  #fff;
  --toggle-bg:  #e2e6f0;
  --toggle-knob:#fff;
}

/* =============================================
   DARK THEME — applied via [data-theme="dark"]
   ============================================= */
[data-theme="dark"] {
  --bg:            #09090f;
  --surface:       #0f1118;
  --card:          #13161f;
  --card-hover:    #181c28;
  --border:        #1e2235;
  --border-bright: #2a3050;
  --text:          #e8ecf7;
  --text-muted:    #6b778f;
  --text-dim:      #3d4560;
  --accent:        #5c7cfa;
  --accent-glow:   rgba(92, 124, 250, 0.18);
  --accent-soft:   #8fa7ff;
  --green:         #3ecf8e;
  --pink:          #f06292;
  --amber:         #fbbf24;
  --teal:          #22d3ee;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.6);
  --glow-accent:0 0 40px rgba(92, 124, 250, 0.15);

  --prose-p:    #c8d0e0;
  --prose-li:   #b8c4d8;
  --code-bg:    rgba(92,124,250,0.1);
  --code-border:rgba(92,124,250,0.2);
  --code-color: #8fa7ff;
  --pre-bg:     #0e1017;
  --pre-border: #1e2235;
  --blockquote-bg:rgba(92,124,250,0.06);
  --infobox-bg: rgba(62,207,142,0.06);
  --infobox-border:rgba(62,207,142,0.18);
  --infobox-text:#a0c8b0;
  --cta-bg:     linear-gradient(135deg,#1a2040 0%,#0f1630 100%);
  --cta-border: rgba(92,124,250,0.25);
  --related-bg: #13161f;
  --internal-bg:rgba(92,124,250,0.05);
  --internal-border:rgba(92,124,250,0.15);
  --banner-bg:  #0f1118;
  --banner-border:#1e2235;
  --nav-bg:     rgba(9,9,15,0.92);
  --footer-bg:  #0f1118;
  --toggle-bg:  #2a3050;
  --toggle-knob:#e8ecf7;
}

/* =============================================
   CATEGORY BADGES — light & dark aware
   ============================================= */
.article-category[data-cat="Tutorial"]      { background:rgba(76,110,245,0.1); color:#3147b8; border-color:rgba(76,110,245,0.22); }
.article-category[data-cat="Guide"]         { background:rgba(30,158,106,0.1); color:#1a7a52; border-color:rgba(30,158,106,0.22); }
.article-category[data-cat="Comparison"]    { background:rgba(217,63,114,0.1); color:#b02d5e; border-color:rgba(217,63,114,0.22); }
.article-category[data-cat="Technical"]     { background:rgba(8,145,178,0.1);  color:#0670a0; border-color:rgba(8,145,178,0.22); }
.article-category[data-cat="Beginner"]      { background:rgba(124,94,230,0.1); color:#6338c7; border-color:rgba(124,94,230,0.22); }
.article-category[data-cat="Advanced"]      { background:rgba(217,104,0,0.1);  color:#b85500; border-color:rgba(217,104,0,0.22); }
.article-category[data-cat="SEO"]           { background:rgba(180,130,0,0.1);  color:#8c6500; border-color:rgba(180,130,0,0.22); }
.article-category[data-cat="Productivity"]  { background:rgba(20,160,120,0.1); color:#0e8a66; border-color:rgba(20,160,120,0.22); }
.article-category[data-cat="Collaboration"] { background:rgba(37,99,235,0.1);  color:#1d5db8; border-color:rgba(37,99,235,0.22); }
.article-category[data-cat="Opinion"]       { background:rgba(200,64,160,0.1); color:#a0288a; border-color:rgba(200,64,160,0.22); }
.article-category[data-cat="Features"]      { background:rgba(99,102,241,0.1); color:#4f46e0; border-color:rgba(99,102,241,0.22); }
.article-category[data-cat="Best Practices"]{ background:rgba(22,163,74,0.1);  color:#15803d; border-color:rgba(22,163,74,0.22); }

[data-theme="dark"] .article-category[data-cat="Tutorial"]      { background:rgba(92,124,250,0.12); color:#8fa7ff; border-color:rgba(92,124,250,0.25); }
[data-theme="dark"] .article-category[data-cat="Guide"]         { background:rgba(62,207,142,0.12); color:#6ee9b0; border-color:rgba(62,207,142,0.25); }
[data-theme="dark"] .article-category[data-cat="Comparison"]    { background:rgba(240,98,146,0.12); color:#f9a8d4; border-color:rgba(240,98,146,0.25); }
[data-theme="dark"] .article-category[data-cat="Technical"]     { background:rgba(34,211,238,0.12); color:#67e8f9; border-color:rgba(34,211,238,0.25); }
[data-theme="dark"] .article-category[data-cat="Beginner"]      { background:rgba(167,139,250,0.12);color:#c4b5fd; border-color:rgba(167,139,250,0.25); }
[data-theme="dark"] .article-category[data-cat="Advanced"]      { background:rgba(251,146,60,0.12); color:#fdba74; border-color:rgba(251,146,60,0.25); }
[data-theme="dark"] .article-category[data-cat="SEO"]           { background:rgba(250,204,21,0.12); color:#fde68a; border-color:rgba(250,204,21,0.25); }
[data-theme="dark"] .article-category[data-cat="Productivity"]  { background:rgba(52,211,153,0.12); color:#6ee7b7; border-color:rgba(52,211,153,0.25); }
[data-theme="dark"] .article-category[data-cat="Collaboration"] { background:rgba(96,165,250,0.12); color:#bfdbfe; border-color:rgba(96,165,250,0.25); }
[data-theme="dark"] .article-category[data-cat="Opinion"]       { background:rgba(244,114,182,0.12);color:#fbcfe8; border-color:rgba(244,114,182,0.25); }
[data-theme="dark"] .article-category[data-cat="Features"]      { background:rgba(129,140,248,0.12);color:#c7d2fe; border-color:rgba(129,140,248,0.25); }
[data-theme="dark"] .article-category[data-cat="Best Practices"]{ background:rgba(74,222,128,0.12); color:#bbf7d0; border-color:rgba(74,222,128,0.25); }

/* =============================================
   TYPOGRAPHY & FONT VARS
   ============================================= */
:root {
  --font-heading: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body:    'Lora', Georgia, serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;
  --nav-h:    64px;
  --banner-h: 52px;
  --radius:    12px;
  --radius-sm:  8px;
  --radius-lg: 20px;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration:.01ms !important; transition-duration:.01ms !important; }
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  font-size: 1.05rem;
  transition: background 0.25s ease, color 0.25s ease;
}

/* =============================================
   THEME TOGGLE BUTTON
   ============================================= */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 5px 12px 5px 8px;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.01em;
}

.theme-toggle:hover {
  border-color: var(--border-bright);
  color: var(--text);
  background: var(--card);
}

.theme-toggle-track {
  width: 34px;
  height: 20px;
  background: var(--toggle-bg);
  border-radius: 50px;
  position: relative;
  transition: background 0.25s ease;
  flex-shrink: 0;
}

.theme-toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  background: var(--toggle-knob);
  border-radius: 50%;
  transition: transform 0.25s ease, background 0.25s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

[data-theme="dark"] .theme-toggle-knob {
  transform: translateX(14px);
}

[data-theme="dark"] .theme-toggle-track {
  background: var(--accent);
}

.toggle-icon { font-size: 0.9rem; line-height: 1; }

/* =============================================
   HCODX MAIN PAGE BANNER
   ============================================= */
/* =============================================
   HCODX BANNER — Professional redesign
   ============================================= */
.hcodx-banner {
  background: var(--banner-bg);
  border-bottom: 1px solid var(--banner-border);
  height: var(--banner-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
  padding: 0 24px;
  transition: background 0.25s ease, border-color 0.25s ease;
  gap: 16px;
}

/* Left: branding mark */
.hcodx-banner-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.hcodx-banner-brand-icon {
  width: 28px;
  height: 28px;
  background: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hcodx-banner-brand-icon svg {
  width: 16px;
  height: 16px;
  color: #fff;
}

.hcodx-banner-brand-name {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* Center: message */
.hcodx-banner-center {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: center;
  min-width: 0;
}

.hcodx-banner-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-heading);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  padding: 3px 10px;
  border-radius: 4px;
  flex-shrink: 0;
}

.hcodx-banner-badge svg {
  width: 10px;
  height: 10px;
}

.hcodx-banner-text {
  font-family: var(--font-heading);
  font-size: 0.825rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hcodx-banner-text strong {
  color: var(--text);
  font-weight: 600;
}

/* Right: CTA */
.hcodx-banner-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--code-border);
  background: var(--code-bg);
  padding: 6px 14px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
  letter-spacing: 0.01em;
}

.hcodx-banner-cta svg {
  width: 13px;
  height: 13px;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.hcodx-banner-cta:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

.hcodx-banner-cta:hover svg {
  transform: translate(1px, -1px);
}

.hcodx-banner-cta:active {
  transform: translateY(0);
}

/* =============================================
   NAVIGATION
   ============================================= */
.blog-nav {
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  position: sticky;
  top: var(--banner-h);
  z-index: 100;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.blog-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 16px;
}

.blog-nav .logo {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.logo-dot {
  display: inline-block;
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 7px var(--accent);
}

.blog-nav nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.blog-nav nav a {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
  letter-spacing: 0.01em;
}

.blog-nav nav a:hover  { color: var(--text); background: var(--card); }
.blog-nav nav a.active { color: var(--accent-soft); background: var(--code-bg); }

[data-theme="dark"] .blog-nav nav a.active { color: var(--accent-soft); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* =============================================
   CONTAINER
   ============================================= */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* =============================================
   BLOG INDEX — HERO HEADER
   ============================================= */
.blog-header {
  position: relative;
  padding: 100px 20px 80px;
  text-align: center;
  overflow: hidden;
  min-height: 320px;
  display: flex; align-items: center; justify-content: center;
}

.blog-header-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(76,110,245,0.1) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 80% 60%, rgba(30,158,106,0.06) 0%, transparent 60%),
    var(--bg);
  transition: background 0.25s ease;
}

[data-theme="dark"] .blog-header-bg {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(92,124,250,0.14) 0%, transparent 70%),
    radial-gradient(ellipse 40% 40% at 80% 60%, rgba(62,207,142,0.07) 0%, transparent 60%),
    var(--bg);
}

.blog-header-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(15,21,35,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,21,35,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 100% 80% at 50% 0%, black 40%, transparent 100%);
}

[data-theme="dark"] .blog-header-grid {
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
}

.blog-header-content { position: relative; z-index: 1; }

.blog-header-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
  padding: 6px 16px;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 50px;
}

.blog-header h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.blog-header h1 span {
  background: linear-gradient(135deg, var(--accent) 0%, #7c6af5 50%, var(--green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.blog-header p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.65;
  font-family: var(--font-heading);
  font-weight: 400;
}

/* =============================================
   BLOG INDEX — ARTICLES GRID
   ============================================= */
.blog-main { padding: 60px 0 100px; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section-count {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  background: var(--card);
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  min-height: 800px;
}

.article-card:first-child { grid-column: 1 / -1; }
.article-card:first-child .article-content h2 { font-size: 2rem; }

.article-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  position: relative;
  min-height: 220px;
  touch-action: manipulation;
  will-change: transform;
}

.article-card::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent-glow) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.article-card:hover {
  border-color: var(--border-bright);
  background: var(--card-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), var(--glow-accent);
}

.article-card:hover::before { opacity: 1; }
.article-card:active { transform: translateY(-1px); }

.article-card-top {
  padding: 22px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.article-category {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 50px;
  background: var(--code-bg);
  color: var(--accent-soft);
  border: 1px solid var(--code-border);
}

.article-number {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.article-content {
  padding: 16px 24px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-content h2 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.article-content p {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
  flex: 1;
  font-weight: 400;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s, gap 0.15s;
  align-self: flex-start;
  min-height: 36px;
  line-height: 36px;
  touch-action: manipulation;
}

.read-more::after { content: '→'; transition: transform 0.15s ease; }
.read-more:hover { color: var(--text); }
.read-more:hover::after { transform: translateX(4px); }

/* =============================================
   READING PROGRESS BAR
   ============================================= */
.reading-progress {
  position: fixed;
  top: calc(var(--banner-h) + var(--nav-h));
  left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--green) 100%);
  z-index: 300;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px var(--accent-glow);
}

/* =============================================
   ARTICLE PAGE — HEADER
   ============================================= */
.article-header {
  position: relative;
  padding: 72px 20px 60px;
  text-align: center;
  overflow: hidden;
  min-height: 280px;
  display: flex; align-items: center; justify-content: center;
}

.article-header-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 70% at 50% 0%, rgba(76,110,245,0.09) 0%, transparent 70%),
    var(--bg);
  transition: background 0.25s ease;
}

[data-theme="dark"] .article-header-bg {
  background:
    radial-gradient(ellipse 70% 70% at 50% 0%, rgba(92,124,250,0.12) 0%, transparent 70%),
    var(--bg);
}

.article-header-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(15,21,35,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,21,35,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 100% 80% at 50% 0%, black 30%, transparent 100%);
}

[data-theme="dark"] .article-header-grid {
  background-image:
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
}

.article-header-content {
  position: relative; z-index: 1;
  max-width: 800px; margin: 0 auto;
}

.category-badge {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 16px;
  border-radius: 50px;
  background: var(--code-bg);
  color: var(--accent);
  border: 1px solid var(--code-border);
  margin-bottom: 24px;
}

.article-header h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.8rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin-bottom: 20px;
}

.article-meta {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* =============================================
   ARTICLE PAGE — BODY
   ============================================= */
.article-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 60px 72px;
  margin: 48px auto;
  max-width: 860px;
  box-shadow: var(--shadow-md);
  transition: background 0.25s ease, border-color 0.25s ease;
}

.article-body h2 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin: 56px 0 18px;
  letter-spacing: -0.02em;
  line-height: 1.25;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.article-body h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }

.article-body h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 36px 0 14px;
  letter-spacing: -0.01em;
}

.article-body h4 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  margin: 24px 0 10px;
}

.article-body p {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--prose-p);
  margin-bottom: 20px;
}

.article-body ul, .article-body ol {
  margin: 20px 0 24px 28px;
}

.article-body li {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--prose-li);
  margin-bottom: 10px;
  padding-left: 4px;
}

.article-body strong { color: var(--text); font-weight: 600; }

.article-body code {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  color: var(--code-color);
  font-family: var(--font-mono);
  font-size: 0.87em;
  padding: 2px 7px;
  border-radius: 5px;
}

.article-body pre {
  background: var(--pre-bg);
  border: 1px solid var(--pre-border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 28px 32px;
  overflow-x: auto;
  margin: 28px 0;
  position: relative;
}

.article-body pre::before {
  content: 'code';
  position: absolute; top: 10px; right: 14px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.article-body pre code {
  background: none; border: none;
  color: var(--text-muted);
  padding: 0; font-size: 0.9rem; line-height: 1.65;
}

[data-theme="dark"] .article-body pre code { color: #a9c5f0; }

.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 20px 28px;
  margin: 32px 0;
  background: var(--blockquote-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text-muted);
}

/* Info Box */
.info-box {
  background: var(--infobox-bg);
  border: 1px solid var(--infobox-border);
  border-left: 3px solid var(--green);
  padding: 24px 28px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 28px 0;
}

.info-box h4 {
  color: var(--green) !important;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.info-box p {
  color: var(--infobox-text);
  font-size: 0.97rem;
  margin-bottom: 0;
}

/* =============================================
   CTA SECTION
   ============================================= */
.cta-section {
  position: relative;
  background: var(--cta-bg);
  border: 1px solid var(--cta-border);
  border-radius: var(--radius-lg);
  padding: 60px 48px;
  margin: 48px 0;
  text-align: center;
  overflow: hidden;
  transition: background 0.25s ease;
}

.cta-section::before {
  content: '';
  position: absolute; top: -50%; left: 50%;
  transform: translateX(-50%);
  width: 400px; height: 300px;
  background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.cta-section h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: -0.025em;
  position: relative;
  border: none; padding: 0; margin-top: 0;
}

.cta-section p {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  position: relative;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, #6a5af5 100%);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  padding: 14px 36px;
  border-radius: 50px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s;
  box-shadow: 0 4px 24px rgba(76, 110, 245, 0.35);
  position: relative;
  touch-action: manipulation;
}

.cta-button:hover { transform: translateY(-2px); box-shadow: 0 8px 36px rgba(76,110,245,0.5); }
.cta-button:active { transform: translateY(0); opacity: 0.9; }

/* =============================================
   RELATED ARTICLES
   ============================================= */
.related-articles {
  background: var(--related-bg);
  border: 1px solid var(--border);
  padding: 36px;
  border-radius: var(--radius);
  margin: 40px 0;
  transition: background 0.25s ease;
}

.related-articles h3 {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.related-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.related-link {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  transition: border-color 0.15s, color 0.15s, transform 0.15s, background 0.15s;
  min-height: 48px;
  touch-action: manipulation;
}

.related-link::before { content: '→'; color: var(--text-dim); font-size: 0.8rem; flex-shrink: 0; transition: transform 0.15s, color 0.15s; }
.related-link:hover { border-color: var(--border-bright); color: var(--text); background: var(--card); transform: translateX(4px); }
.related-link:hover::before { color: var(--accent); transform: translateX(2px); }
.related-link:active { transform: translateX(2px); }

/* =============================================
   INTERNAL LINKS
   ============================================= */
.internal-links {
  background: var(--internal-bg);
  border: 1px solid var(--internal-border);
  border-left: 3px solid var(--accent);
  padding: 28px 32px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 36px 0;
}

.internal-links h3 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
  border: none; padding: 0;
}

.internal-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.internal-link {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s, border-color 0.15s, transform 0.15s;
  min-height: 44px;
}

.internal-link::before { content: '↗'; color: var(--accent); font-size: 0.8rem; flex-shrink: 0; }
.internal-link:hover { color: var(--text); border-color: var(--code-border); transform: translateX(3px); }
.internal-link:active { transform: translateX(1px); }

/* =============================================
   FOOTER
   ============================================= */
.blog-footer {
  background: var(--footer-bg);
  border-top: 1px solid var(--border);
  padding: 56px 20px 40px;
  margin-top: 80px;
  transition: background 0.25s ease;
}

.blog-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 40px;
}

.footer-brand {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  display: block;
}

.footer-tagline {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 20px;
}

.footer-copyright {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

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

.footer-divider {
  width: 1px; height: 14px;
  background: var(--border);
  display: inline-block;
}

/* =============================================
   UTILS
   ============================================= */
img { max-width: 100%; height: auto; background-color: var(--card); }
img[width][height] { aspect-ratio: attr(width) / attr(height); }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  :root { --banner-h: 48px; --nav-h: 56px; }

  .blog-header { padding: 72px 20px 60px; }
  .blog-header h1 { font-size: 2.2rem; }

  .articles-grid { grid-template-columns: 1fr; }
  .article-card:first-child { grid-column: 1; }
  .article-card:first-child .article-content h2 { font-size: 1.3rem; }

  .article-body { padding: 32px 24px; border-radius: var(--radius); margin: 24px auto; }
  .article-header { padding: 56px 20px 48px; }
  .article-header h1 { font-size: 1.75rem; }

  .blog-nav .container { flex-direction: column; gap: 8px; padding: 8px 24px; }
  .blog-nav { height: auto; min-height: var(--nav-h); }
  .blog-nav nav { gap: 2px; flex-wrap: wrap; justify-content: center; }
  .blog-nav nav a { padding: 4px 10px; font-size: 0.82rem; }
  .nav-right { order: -1; align-self: flex-end; }

  .cta-section { padding: 40px 24px; }
  .cta-section h2 { font-size: 1.6rem; }

  .related-articles { padding: 24px 20px; }
  .related-links { grid-template-columns: 1fr; }
  .internal-links-grid { grid-template-columns: 1fr; }

  .hcodx-banner-brand { display: none; }
  .hcodx-banner-text { display: none; }
  .hcodx-banner-badge { display: none; }
  .hcodx-banner { justify-content: center; padding: 0 16px; }

  .blog-footer-inner { grid-template-columns: 1fr; gap: 24px; }

  .article-body h2 { font-size: 1.4rem; }
  .article-body h3 { font-size: 1.1rem; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .blog-header h1 { font-size: 1.9rem; }
  .article-body { padding: 24px 18px; }
  .article-body pre { padding: 18px 20px; }
  .theme-toggle span:last-child { display: none; }
}
