/* ============================================
   pwnd.blog — Underground Cyberpunk Zine Theme
   Optimized for mobile performance
   ============================================ */

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

:root {
  --neon-fuchsia: #d946ef;
  --neon-purple: #9333ea;
  --neon-blue: #06b6d4;
  --terminal-green: #22c55e;
  --bg-dark: #050505;
  --bg-card: #0a050f;
  --text-main: #e5e7eb;
  --text-dim: #6b7280;
}

* { box-sizing: border-box; }

html { font-size: 14px; }

html, body {
  background-color: var(--bg-dark);
  margin: 0;
  padding: 0;
  color: var(--text-main);
  font-family: 'Fira Code', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  scrollbar-width: thin;
  scrollbar-color: var(--neon-purple) #0f0518;
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: #0a0510; }
::-webkit-scrollbar-thumb { background: var(--neon-purple); }
::-webkit-scrollbar-thumb:hover { background: var(--neon-fuchsia); }

body.light-theme ::-webkit-scrollbar-track { background: #e5e5e5; }
body.light-theme ::-webkit-scrollbar-thumb { background: var(--neon-purple); }

/* ==================== FONTS ==================== */
.font-vt323 { font-family: 'VT323', monospace; }
.font-tech { font-family: 'Share Tech Mono', monospace; }
.font-mono { font-family: 'Fira Code', monospace; }

/* ==================== LIGHT THEME — user palette ==================== */
body.light-theme {
  --neon-fuchsia: #7c3aed;
  --neon-purple: #6d28d9;
  --neon-blue: #2563eb;
  --bg-dark: #ffffff;
  --bg-card: #f8fafc;
  --text-main: #111827;
  --text-dim: #4b5563;
  background-color: var(--bg-dark) !important;
  color: var(--text-main) !important;
}
body.light-theme ::selection { background: #ddd6fe !important; }
body.light-theme .bg-grid-pattern { background-image: linear-gradient(to right, rgba(124,58,237,0.03) 1px, transparent 1px), linear-gradient(to bottom, rgba(124,58,237,0.03) 1px, transparent 1px); }
body.light-theme .article-card { background: #f8fafc !important; border-color: #d1d5db !important; }
body.light-theme .article-card:hover { border-color: #7c3aed !important; background: #e5e7eb !important; }
body.light-theme .article-header-card { background: #f8fafc !important; border-color: #d1d5db !important; }
body.light-theme .article-body-card { background: #f8fafc !important; border-color: #d1d5db !important; }
body.light-theme .author-profile-card { background: #f8fafc !important; border-color: #d1d5db !important; }
body.light-theme .site-header { background: rgba(255,255,255,0.95) !important; border-color: #d1d5db !important; }
body.light-theme .site-footer { background: #f8fafc !important; }

/* Readability overrides for Tailwind colors on Light background */
body.light-theme .text-fuchsia-400,
body.light-theme .text-fuchsia-500 {
  color: #7c3aed !important; /* deep high-contrast purple/fuchsia */
}
body.light-theme .hover\:text-fuchsia-300:hover,
body.light-theme .group:hover .group-hover\:text-fuchsia-300,
body.light-theme .group-hover\:text-fuchsia-300:hover,
body.light-theme .hover\:text-fuchsia-400:hover,
body.light-theme .group:hover .group-hover\:text-fuchsia-400 {
  color: #4c1d95 !important; /* purple-900 on hover */
}
body.light-theme .text-cyan-400,
body.light-theme .text-cyan-500 {
  color: #0e7490 !important; /* deep high-contrast cyan/teal */
}
body.light-theme .hover\:text-cyan-300:hover,
body.light-theme .group:hover .group-hover\:text-cyan-300 {
  color: #115e59 !important;
}
body.light-theme .text-gray-300 {
  color: #24292e !important;
}
body.light-theme .text-gray-400,
body.light-theme .text-slate-400,
body.light-theme .text-zinc-400 {
  color: #4b5563 !important; /* gray-600 */
}
body.light-theme .text-gray-500,
body.light-theme .text-slate-500,
body.light-theme .text-zinc-500 {
  color: #374151 !important; /* gray-700 */
}
body.light-theme .text-gray-600 {
  color: #1f2937 !important; /* gray-800 */
}
body.light-theme .text-green-400,
body.light-theme .text-green-500,
body.light-theme .text-emerald-400 {
  color: #166534 !important; /* dark green */
}
body.light-theme .text-yellow-400,
body.light-theme .text-yellow-500,
body.light-theme .text-amber-400,
body.light-theme .text-orange-400,
body.light-theme .text-orange-500 {
  color: #92400e !important; /* dark amber/orange */
}
body.light-theme .text-red-400,
body.light-theme .text-red-500 {
  color: #991b1b !important; /* dark red */
}
body.light-theme .text-white {
  color: #111827 !important; /* dark text, especially for {text}(highlight) */
}

/* Opacity utilities overrides */
body.light-theme .text-purple-600\/60,
body.light-theme .text-fuchsia-500\/40,
body.light-theme .text-fuchsia-500\/30 {
  color: rgba(109, 40, 217, 0.6) !important;
}
body.light-theme .border-fuchsia-500\/30,
body.light-theme .border-fuchsia-500\/40 {
  border-color: rgba(124, 58, 237, 0.3) !important;
}
body.light-theme .bg-fuchsia-500\/10,
body.light-theme .bg-fuchsia-500\/5 {
  background-color: rgba(124, 58, 237, 0.06) !important;
}
body.light-theme .group-hover\:border-fuchsia-500:hover,
body.light-theme .group:hover .group-hover\:border-fuchsia-500 {
  border-color: rgba(124, 58, 237, 0.8) !important;
}
body.light-theme .group-hover\:bg-fuchsia-500\/20:hover,
body.light-theme .group:hover .group-hover\:bg-fuchsia-500\/20 {
  background-color: rgba(124, 58, 237, 0.15) !important;
}
body.light-theme .border-purple-500\/20 {
  border-color: rgba(109, 40, 217, 0.25) !important;
}
body.light-theme .bg-purple-500\/5 {
  background-color: rgba(109, 40, 217, 0.05) !important;
}
body.light-theme .text-purple-400 {
  color: #6d28d9 !important;
}
body.light-theme .border-cyan-500\/20 {
  border-color: rgba(14, 116, 144, 0.25) !important;
}
body.light-theme .bg-cyan-500\/5 {
  background-color: rgba(14, 116, 144, 0.05) !important;
}

/* Markdown overrides */
body.light-theme .markdown-body p,
body.light-theme .markdown-body li {
  color: #24292e !important;
}
body.light-theme .markdown-body strong {
  color: #111827 !important;
}
body.light-theme .markdown-body em {
  color: #6d28d9 !important;
  font-style: italic;
}
body.light-theme .markdown-body h1,
body.light-theme .markdown-body h2,
body.light-theme .markdown-body h3,
body.light-theme .markdown-body h4 {
  color: #6d28d9 !important;
  text-shadow: none !important;
}
body.light-theme .markdown-body h2 {
  border-bottom-color: #e1e4e8 !important;
}
body.light-theme .markdown-body h3 {
  color: #7c3aed !important;
}
body.light-theme .markdown-body a {
  color: #0366d6 !important;
  border-bottom-color: rgba(3, 102, 214, 0.3) !important;
}
body.light-theme .markdown-body a:hover {
  color: #005cc5 !important;
  border-bottom-color: #005cc5 !important;
}
body.light-theme .markdown-body pre {
  background: #f6f8fa !important;
  border-color: #d1d5db !important;
}
body.light-theme .markdown-body code {
  background: rgba(27, 31, 35, 0.05) !important;
  color: #d73a49 !important;
  border: 1px solid rgba(27, 31, 35, 0.08) !important;
}
body.light-theme .markdown-body pre code {
  background: transparent !important;
  color: inherit !important;
  border: none !important;
}
body.light-theme .markdown-body blockquote {
  background: #f6f8fa !important;
  color: #4b5563 !important;
  border-left-color: #7c3aed !important;
}
body.light-theme .markdown-body tr:nth-child(even) {
  background: #f6f8fa !important;
}
body.light-theme .markdown-body th {
  background: #eaecef !important;
  color: #111827 !important;
  border-color: #d1d5db !important;
}
body.light-theme .markdown-body td {
  border-color: #e1e4e8 !important;
}

/* HighlightJS light theme overrides */
body.light-theme .hljs {
  color: #24292e !important;
  background: #f6f8fa !important;
}
body.light-theme .hljs-comment,
body.light-theme .hljs-quote {
  color: #6a737d !important;
  font-style: italic;
}
body.light-theme .hljs-keyword,
body.light-theme .hljs-selector-tag,
body.light-theme .hljs-subst {
  color: #d73a49 !important;
  font-weight: 600;
}
body.light-theme .hljs-number,
body.light-theme .hljs-literal,
body.light-theme .hljs-variable,
body.light-theme .hljs-template-variable,
body.light-theme .hljs-tag .hljs-attr {
  color: #005cc5 !important;
}
body.light-theme .hljs-string,
body.light-theme .hljs-regexp,
body.light-theme .hljs-addition,
body.light-theme .hljs-meta .hljs-string {
  color: #032f62 !important;
}
body.light-theme .hljs-title,
body.light-theme .hljs-section,
body.light-theme .hljs-name,
body.light-theme .hljs-selector-id,
body.light-theme .hljs-selector-class {
  color: #6f42c1 !important;
}
body.light-theme .hljs-doctag,
body.light-theme .hljs-type,
body.light-theme .hljs-built_in,
body.light-theme .hljs-bullet,
body.light-theme .hljs-symbol,
body.light-theme .hljs-link,
body.light-theme .hljs-meta {
  color: #e36209 !important;
}
body.light-theme .hljs-params {
  color: #24292e !important;
}
body.light-theme .hljs-attr {
  color: #6f42c1 !important;
}
body.light-theme .hljs-class .hljs-title {
  color: #6f42c1 !important;
}

/* Write page editor & preview styling for light theme */
body.light-theme .write-editor {
  background: #ffffff !important;
  border-color: #d1d5db !important;
  color: #111827 !important;
}
body.light-theme .write-editor:focus {
  border-color: #7c3aed !important;
  box-shadow: 0 0 10px rgba(124, 58, 237, 0.1) !important;
}
body.light-theme .write-editor::placeholder {
  color: #9ca3af !important;
}
body.light-theme .write-preview {
  background: #ffffff !important;
  border-color: #d1d5db !important;
}
body.light-theme .write-label {
  color: #4b5563 !important;
}
body.light-theme .resize-controls {
  background: #f1f5f9 !important;
  border-color: #d1d5db !important;
}
body.light-theme .resize-hint .resize-bar {
  background: #cbd5e1 !important;
}
body.light-theme .resize-hint:active .resize-bar {
  background: #7c3aed !important;
}
body.light-theme .resize-hint .resize-label {
  color: #6b7280 !important;
}
body.light-theme .resize-btn {
  border-color: #d1d5db !important;
  background: #e5e7eb !important;
  color: #374151 !important;
}
body.light-theme .resize-btn:active {
  background: #cbd5e1 !important;
}
body.light-theme .resize-size {
  color: #4b5563 !important;
}

body.light-theme .stats-bar {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #374151 !important;
}
body.light-theme .corner-accent::before, body.light-theme .corner-accent::after { border-color: #d1d5db !important; }
body.light-theme .logo-text { color: #7c3aed !important; }
body.light-theme .nav-scroll-container a { color: #6b7280 !important; }
body.light-theme .nav-scroll-container a:hover { color: #7c3aed !important; }
body.light-theme .terminal-divider span { color: #7c3aed !important; }
body.light-theme .share-btn { background: #f8fafc !important; border-color: #d1d5db !important; color: #4b5563 !important; }
body.light-theme .share-btn:hover { border-color: #7c3aed !important; color: #7c3aed !important; background: #e5e7eb !important; }
body.light-theme .text-glow { text-shadow: none !important; }
body.light-theme .about-content p { color: #111827 !important; }
body.light-theme .code-copy-btn { background: #e5e7eb !important; color: #6b7280 !important; }
body.light-theme .code-copy-btn:hover { background: #d1d5db !important; }
body.light-theme ::-webkit-scrollbar-track { background: #f1f5f9; }
body.light-theme ::-webkit-scrollbar-thumb { background: #d1d5db; }
body.light-theme .theme-toggle { border-color: #d1d5db !important; color: #4b5563 !important; }
body.light-theme .theme-toggle:hover { background: #f1f5f9 !important; border-color: #7c3aed !important; color: #7c3aed !important; }

/* Light theme — tricks sidebar */
body.light-theme .tk-sidebar, body.light-theme .tk-drawer {
  background: #f1f5f9 !important;
  border-color: #d1d5db !important;
}
body.light-theme .tk-sidebar-header h2 { color: #7c3aed !important; text-shadow: none !important; }
body.light-theme .tk-sidebar-header-sub { color: #6b7280 !important; }
body.light-theme .tk-tree-cat-name { color: #4b5563 !important; }
body.light-theme .tk-tree-cat-name:hover { color: #111827 !important; background: #e5e7eb !important; }
body.light-theme .tk-tree-cat-name.active { color: #7c3aed !important; background: #ddd6fe !important; border-left-color: #7c3aed !important; }
body.light-theme .tk-tree-arrow { color: #6b7280 !important; }
body.light-theme .tk-tree-cat.expanded .tk-tree-arrow { color: #7c3aed !important; }
body.light-theme .tk-tree-count { color: #6b7280 !important; }
body.light-theme .tk-tree-trick-link { color: #6b7280 !important; }
body.light-theme .tk-tree-trick-link:hover { color: #111827 !important; background: #e5e7eb !important; border-left-color: #7c3aed !important; }
body.light-theme .tk-tree-trick-link.active { color: #7c3aed !important; background: #ddd6fe !important; border-left-color: #7c3aed !important; }
body.light-theme .tk-sidebar-search input { background: #ffffff !important; border-color: #d1d5db !important; color: #111827 !important; }
body.light-theme .tk-sidebar-search input::placeholder { color: #6b7280 !important; }
body.light-theme .tk-sidebar-search input:focus { border-color: #7c3aed !important; }
body.light-theme .tk-sidebar-search::before { color: #6b7280 !important; }

/* Light theme — tricks content */
body.light-theme .tk-content-header { border-color: #d1d5db !important; }
body.light-theme .tk-breadcrumb { color: #6b7280 !important; }
body.light-theme .tk-breadcrumb a { color: #4b5563 !important; }
body.light-theme .tk-breadcrumb a:hover { color: #7c3aed !important; }
body.light-theme .tk-content-title { color: #7c3aed !important; text-shadow: none !important; }
body.light-theme .tk-content-meta-item { color: #4b5563 !important; }
body.light-theme .tk-content-meta-item b { color: #2563eb !important; }
body.light-theme .tk-content-tag { color: #6b7280 !important; }
body.light-theme .tk-body p { color: #111827 !important; }
body.light-theme .tk-body h3 { color: #7c3aed !important; }
body.light-theme .tk-body h3::before { background: #7c3aed !important; }
body.light-theme .tk-body pre {
  background: #f6f8fa !important;
  color: #24292e !important;
  border-color: #d1d5db !important;
  border-left-color: #7c3aed !important;
}
body.light-theme .tk-body pre code { color: #24292e !important; }
body.light-theme .tk-welcome-glyph { color: rgba(124,58,237,0.15) !important; }
body.light-theme .tk-welcome-text { color: #6b7280 !important; }
body.light-theme .tk-welcome-sub { color: #6b7280 !important; }
body.light-theme .tk-drawer-btn { background: #7c3aed !important; color: #fff !important; }
body.light-theme .tk-drawer-btn:hover { background: #6d28d9 !important; }
body.light-theme .tk-drawer-overlay { background: rgba(0,0,0,0.3) !important; }

/* Light theme — tricks extras (nav, top btn, search, tables, anchors) */
body.light-theme .tk-nav { border-color: #d1d5db !important; }
body.light-theme .tk-nav-link { color: #6b7280 !important; }
body.light-theme .tk-nav-link:hover { color: #7c3aed !important; }
body.light-theme .tk-nav-label { color: #9ca3af !important; }
body.light-theme .tk-top-btn { background: rgba(124,58,237,0.85) !important; color: #fff !important; }
body.light-theme .tk-top-btn:hover { background: #6d28d9 !important; }
body.light-theme .tk-search-result { background: #f8fafc !important; border-color: #d1d5db !important; }
body.light-theme .tk-search-result:hover { border-color: #7c3aed !important; background: #f1f5f9 !important; }
body.light-theme .tk-search-result-title { color: #7c3aed !important; }
body.light-theme .tk-search-result-excerpt { color: #4b5563 !important; }
body.light-theme .tk-search-result-cat { color: #0e7490 !important; }
body.light-theme .tk-body table th { background: rgba(124,58,237,0.06) !important; color: #7c3aed !important; border-color: #d1d5db !important; }
body.light-theme .tk-body table td { border-color: #e5e7eb !important; color: #374151 !important; }
body.light-theme .tk-body strong { color: #111827 !important; }
body.light-theme .tk-body code { background: rgba(124,58,237,0.08) !important; color: #6d28d9 !important; }
body.light-theme .tk-body ul, body.light-theme .tk-body ol { color: #374151 !important; }
body.light-theme .tk-body li { color: #374151 !important; }

/* Light theme — honeypot */
body.light-theme .hp-stat-card { background: #f8fafc !important; border-color: #d1d5db !important; }
body.light-theme .hp-section { background: #f8fafc !important; border-color: #d1d5db !important; }
body.light-theme .hp-table th { color: #6b7280 !important; border-color: #d1d5db !important; }
body.light-theme .hp-table td { border-color: #e5e7eb !important; }
body.light-theme .hp-table tr:hover td { background: #e5e7eb !important; }
body.light-theme .hp-section-title { color: #7c3aed !important; border-color: #d1d5db !important; }

/* ==================== SCROLL PROGRESS BAR ==================== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--neon-purple), var(--neon-fuchsia));
  z-index: 9999;
  width: 0%;
  transition: width 0.05s linear;
  box-shadow: 0 0 8px rgba(217, 70, 239, 0.4);
}

/* ==================== CRT EFFECTS (desktop only) ==================== */
@media (min-width: 769px) {
  body:not(.light-theme) .crt::before {
    content: " ";
    display: block;
    position: fixed;
    inset: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%);
    z-index: 10;
    background-size: 100% 2px;
    pointer-events: none;
  }

  body:not(.light-theme) .crt::after {
    content: " ";
    display: block;
    position: fixed;
    inset: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(217, 70, 239, 0.03) 50%, transparent 100%);
    background-size: 100% 4px;
    z-index: 12;
    pointer-events: none;
    animation: scanline 10s linear infinite;
  }

  @keyframes scanline {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
  }
}

/* ==================== BG GRID ==================== */
.bg-grid-pattern {
  background-size: 40px 40px;
  background-image:
    linear-gradient(to right, rgba(147, 51, 234, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(147, 51, 234, 0.03) 1px, transparent 1px);
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s ease-out backwards; }

@keyframes glitch {
  0% { text-shadow: 2px 0 0 rgba(217,70,239,0.7), -2px 0 0 rgba(6,182,212,0.7); }
  2% { text-shadow: -2px 0 0 rgba(217,70,239,0.7), 2px 0 0 rgba(6,182,212,0.7); }
  4% { text-shadow: 2px 0 0 rgba(217,70,239,0.7), -2px 0 0 rgba(6,182,212,0.7); }
  5% { text-shadow: none; }
  100% { text-shadow: none; }
}
.glitch-hover:hover { animation: glitch 0.4s steps(2) infinite; }

.text-glow { text-shadow: 0 0 8px rgba(217, 70, 239, 0.6); }

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ==================== HEADER ==================== */
.site-header {
  border-bottom: 1px solid rgba(147, 51, 234, 0.2);
  background: rgba(3, 2, 8, 0.95);
  backdrop-filter: blur(8px);
  position: relative;
}

body.light-theme .site-header {
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: rgba(147, 51, 234, 0.15) !important;
}

.site-header::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-fuchsia), transparent);
  opacity: 0.4;
}

.logo-text {
  font-size: 1.1rem;
}
.logo-text::after {
  content: "";
}

/* Nav scroll indicator */
.nav-scroll-hint {
  color: rgba(217, 70, 239, 0.5);
  font-size: 10px;
  flex-shrink: 0;
  animation: nudgeRight 1.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes nudgeRight {
  0%, 100% { transform: translateX(0); opacity: 0.5; }
  50% { transform: translateX(3px); opacity: 1; }
}
.nav-scroll-container.scrolled .nav-scroll-hint {
  opacity: 0;
  transition: opacity 0.3s;
}

/* ==================== THEME TOGGLE ==================== */
.theme-toggle {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(147, 51, 234, 0.3);
  background: transparent;
  color: var(--neon-fuchsia);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}
.theme-toggle:hover {
  background: rgba(217, 70, 239, 0.1);
  border-color: var(--neon-fuchsia);
}

/* ==================== HERO ==================== */
.hero-section {
  position: relative;
  padding: 30px 0 20px;
  text-align: center;
}

@media (min-width: 769px) {
  .hero-section { padding: 40px 0 30px; }

  .hero-glitch { position: relative; display: inline-block; }
  .hero-glitch::before, .hero-glitch::after {
    content: attr(data-text);
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
  }
  .hero-glitch::before { color: rgba(6,182,212,0.4); z-index: -1; animation: glitchShift1 3s infinite; }
  .hero-glitch::after { color: rgba(236,72,153,0.4); z-index: -2; animation: glitchShift2 3s infinite; }
  @keyframes glitchShift1 { 0%,90%,100%{transform:translate(0)} 92%{transform:translate(-2px,1px)} 94%{transform:translate(2px,-1px)} 96%{transform:translate(-1px,2px)} }
  @keyframes glitchShift2 { 0%,90%,100%{transform:translate(0)} 92%{transform:translate(2px,-1px)} 94%{transform:translate(-2px,1px)} 96%{transform:translate(1px,-2px)} }
}

/* ==================== FILTER BAR ==================== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
  padding-bottom: 16px;
}

.filter-chip {
  padding: 3px 12px;
  font-size: 10px;
  font-family: 'Share Tech Mono', monospace;
  border: 1px solid rgba(147, 51, 234, 0.2);
  color: rgba(147, 51, 234, 0.6);
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.5px;
  text-decoration: none;
  display: inline-block;
}
.filter-chip:hover {
  border-color: rgba(217, 70, 239, 0.4);
  color: var(--neon-fuchsia);
}
.filter-chip.active {
  border-color: var(--neon-fuchsia);
  color: var(--neon-fuchsia);
  background: rgba(217, 70, 239, 0.1);
}

/* ==================== ARTICLE CARDS ==================== */
.article-card {
  background: rgba(8, 4, 14, 0.7);
  border: 1px solid rgba(147, 51, 234, 0.15);
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  overflow: hidden;
}

.article-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 2px; height: 100%;
  background: linear-gradient(180deg, transparent, var(--neon-fuchsia), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.article-card:hover {
  border-color: rgba(217, 70, 239, 0.4);
  background: rgba(12, 6, 20, 0.8);
}

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

/* ==================== MARKDOWN BODY ==================== */
.markdown-body {
  line-height: 1.7;
  font-size: 0.875rem;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
  color: var(--neon-fuchsia);
  font-family: 'Share Tech Mono', monospace;
  margin-top: 2em;
  margin-bottom: 0.6em;
  text-shadow: 0 0 4px rgba(217, 70, 239, 0.15);
  letter-spacing: 0.5px;
}

.markdown-body h1 { font-size: 1.6em; }
.markdown-body h2 { font-size: 1.35em; border-bottom: 1px solid rgba(147, 51, 234, 0.2); padding-bottom: 0.2em; }
.markdown-body h3 { font-size: 1.15em; color: #c026d3; }
.markdown-body h4 { font-size: 1em; color: var(--neon-purple); }

.markdown-body p { margin-bottom: 1em; color: #d1d5db; }

.markdown-body a {
  color: var(--neon-fuchsia);
  text-decoration: none;
  border-bottom: 1px solid rgba(217, 70, 239, 0.3);
}
.markdown-body a:hover { border-bottom-color: var(--neon-fuchsia); }

.markdown-body ul, .markdown-body ol { margin-left: 1.3em; margin-bottom: 1em; }
.markdown-body li { margin-bottom: 0.4em; color: #d1d5db; }
.markdown-body strong { color: #f0f0f0; font-weight: 600; }
.markdown-body em { color: #c4b5fd; }

.markdown-body code {
  font-family: 'Fira Code', monospace;
  background: rgba(147, 51, 234, 0.12);
  padding: 1px 5px;
  border-radius: 2px;
  font-size: 0.82em;
  color: var(--neon-fuchsia);
  border: 1px solid rgba(147, 51, 234, 0.15);
}

/* ==================== CODE BLOCK WITH COPY ==================== */
.markdown-body pre {
  background: #0a0a0a !important;
  border: 1px solid rgba(147, 51, 234, 0.2);
  border-radius: 2px;
  padding: 1em;
  padding-top: 2.2em;
  overflow-x: auto;
  margin-bottom: 1.2em;
  font-size: 0.75rem;
  line-height: 1.5;
  position: relative;
}

.markdown-body pre code {
  background: none; border: none; padding: 0; color: #e5e7eb; font-size: 0.75rem;
}

.code-copy-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 10px;
  font-size: 10px;
  font-family: 'Share Tech Mono', monospace;
  color: rgba(147, 51, 234, 0.5);
  background: rgba(10, 5, 15, 0.8);
  border: 1px solid rgba(147, 51, 234, 0.2);
  cursor: pointer;
  transition: all 0.15s;
  opacity: 0;
}
.markdown-body pre:hover .code-copy-btn { opacity: 1; }
.code-copy-btn:hover { color: var(--neon-fuchsia); border-color: var(--neon-fuchsia); }
.code-copy-btn.copied { color: var(--terminal-green); border-color: var(--terminal-green); }

/* ==================== LANGUAGE TABS ==================== */
.lang-tabs {
  margin: 1.5em 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(217, 70, 239, 0.2);
}

.lang-tabs-bar {
  display: flex;
  gap: 0;
  background: rgba(10, 10, 15, 0.6);
  border-bottom: 1px solid rgba(217, 70, 239, 0.15);
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--neon-fuchsia) transparent;
}
.lang-tabs-bar::-webkit-scrollbar { height: 2px; }
.lang-tabs-bar::-webkit-scrollbar-thumb { background: var(--neon-fuchsia); }

.lang-tab {
  padding: 6px 14px;
  font-family: var(--font-tech), monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #888;
  background: transparent;
  border: none;
  border-right: 1px solid rgba(217, 70, 239, 0.1);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.lang-tab:hover {
  color: var(--neon-fuchsia);
  background: rgba(217, 70, 239, 0.08);
}

.lang-tab.active {
  color: var(--neon-fuchsia);
  background: rgba(217, 70, 239, 0.12);
  border-bottom: 2px solid var(--neon-fuchsia);
  margin-bottom: -1px;
}

.lang-tabs-content {
  position: relative;
}

.lang-panel > pre {
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
}

.lang-panel-hidden {
  display: none !important;
}

/* ==================== BLOCKQUOTE ==================== */
.markdown-body blockquote {
  border-left: 3px solid var(--neon-fuchsia);
  padding: 0.5em 1.2em;
  margin: 1.5em 0;
  background: rgba(217, 70, 239, 0.04);
  color: #b0b0b0;
  font-style: italic;
}

/* ==================== TABLE ==================== */
.markdown-body table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 1.5em;
  font-size: 0.9em;
  display: block;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.markdown-body table::-webkit-scrollbar { height: 4px; }
.markdown-body table::-webkit-scrollbar-thumb { background: var(--neon-purple); }
.markdown-body th, .markdown-body td { border: 1px solid rgba(147, 51, 234, 0.25); padding: 8px 14px; text-align: left; }
.markdown-body th { background: rgba(147, 51, 234, 0.08); color: var(--neon-fuchsia); font-family: 'Share Tech Mono', monospace; font-size: 0.85em; }
.markdown-body tr:nth-child(even) { background: rgba(8, 4, 14, 0.5); }

.markdown-body hr { border: none; border-top: 1px solid rgba(147, 51, 234, 0.2); margin: 2.5em 0; }

/* ==================== TAGS & BADGES ==================== */
.tag-badge {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(147, 51, 234, 0.15);
  color: #a855f7;
  font-size: 10px;
  font-family: 'Share Tech Mono', monospace;
  border: 1px solid rgba(147, 51, 234, 0.2);
  letter-spacing: 0.5px;
}

.category-badge {
  display: inline-block;
  padding: 3px 12px;
  background: rgba(217, 70, 239, 0.12);
  color: var(--neon-fuchsia);
  font-size: 11px;
  font-family: 'Share Tech Mono', monospace;
  border: 1px solid rgba(217, 70, 239, 0.25);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ==================== ARTICLE CARDS (containers) ==================== */
.article-header-card {
  background: linear-gradient(135deg, rgba(8,4,14,0.9), rgba(3,2,8,0.95));
  border: 1px solid rgba(147, 51, 234, 0.25);
  position: relative;
  overflow: hidden;
}

.article-header-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-fuchsia), transparent);
  opacity: 0.6;
}

.article-body-card {
  background: rgba(5, 3, 10, 0.6);
  border: 1px solid rgba(147, 51, 234, 0.15);
}

/* ==================== CORNER ACCENTS ==================== */
.corner-accent { position: relative; }
.corner-accent::before, .corner-accent::after {
  content: "";
  position: absolute;
  width: 10px; height: 10px;
  border-color: rgba(217, 70, 239, 0.35);
  border-style: solid;
  border-width: 0;
}
.corner-accent::before { top: -1px; left: -1px; border-top-width: 1px; border-left-width: 1px; }
.corner-accent::after { bottom: -1px; right: -1px; border-bottom-width: 1px; border-right-width: 1px; }

/* ==================== FOOTER ==================== */
.site-footer {
  border-top: 1px solid rgba(147, 51, 234, 0.15);
  background: rgba(3, 2, 8, 0.9);
}

/* ==================== DIVIDER ==================== */
.terminal-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 25px 0;
  color: rgba(147, 51, 234, 0.3);
  font-size: 10px;
  font-family: 'Share Tech Mono', monospace;
}
.terminal-divider::before, .terminal-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(147, 51, 234, 0.15), transparent);
}

/* ==================== STATS BAR ==================== */
.stats-bar {
  display: inline-flex;
  gap: 16px;
  font-size: 10px;
  font-family: 'Share Tech Mono', monospace;
  color: rgba(147, 51, 234, 0.4);
  border: 1px solid rgba(147, 51, 234, 0.15);
  padding: 4px 16px;
  background: rgba(8, 4, 14, 0.6);
  letter-spacing: 1px;
}
.stats-bar .stat-value { color: var(--neon-fuchsia); }

/* ==================== SHARE BUTTONS ==================== */
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  font-size: 10px;
  font-family: 'Share Tech Mono', monospace;
  border: 1px solid rgba(147, 51, 234, 0.2);
  color: rgba(147, 51, 234, 0.7);
  text-decoration: none;
  transition: all 0.15s;
  letter-spacing: 0.5px;
  cursor: pointer;
  background: transparent;
}
.share-btn:hover {
  border-color: var(--neon-fuchsia);
  color: var(--neon-fuchsia);
  background: rgba(217, 70, 239, 0.05);
}

/* ==================== AUTHOR PAGE ==================== */
.author-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 30px 0;
}

/* Skeleton shimmer for loading states */
.shimmer {
  background: linear-gradient(90deg,
    rgba(217, 70, 239, 0.05) 0%,
    rgba(217, 70, 239, 0.15) 50%,
    rgba(217, 70, 239, 0.05) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  html { font-size: 13px; }
  .markdown-body { font-size: 0.82rem; }
  .markdown-body pre { font-size: 0.7rem; padding: 0.8em; padding-top: 2.2em; }
  .hero-section { padding: 20px 0 15px; }
}

/* ==================== DESKTOP ENHANCEMENTS ==================== */
@media (min-width: 769px) {
  /* Base font bigger on desktop */
  html { font-size: 16px; }

  /* More breathing room in main container */
  .max-w-4xl { max-width: 52rem; }

  /* Markdown body — readable typography */
  .markdown-body {
    font-size: 1rem;
    line-height: 1.8;
  }

  /* Constrain article text width for readability ~720px */
  .markdown-body p,
  .markdown-body ul,
  .markdown-body ol,
  .markdown-body blockquote {
    max-width: 720px;
  }

  /* Headings — bigger and more dramatic */
  .markdown-body h1 { font-size: 2em; margin-top: 2.5em; }
  .markdown-body h2 { font-size: 1.6em; margin-top: 2.2em; }
  .markdown-body h3 { font-size: 1.3em; margin-top: 2em; }
  .markdown-body h4 { font-size: 1.1em; margin-top: 1.5em; }

  /* Code blocks — readable size */
  .markdown-body pre {
    font-size: 0.875rem;
    line-height: 1.65;
    padding: 1.2em 1.5em;
    padding-top: 2.5em;
  }
  .markdown-body pre code { font-size: 0.875rem; }

  /* Inline code slightly bigger */
  .markdown-body code { font-size: 0.88em; padding: 2px 6px; }

  /* Tables — proper formatting on desktop */
  .markdown-body table {
    font-size: 0.95em;
    display: table;
    white-space: normal;
  }
  .markdown-body th, .markdown-body td { padding: 10px 18px; }

  /* Blockquote — more padding */
  .markdown-body blockquote { padding: 0.8em 1.8em; margin: 2em 0; }

  /* Article cards — more padding */
  .article-header-card { padding: 2rem !important; }
  .article-body-card { padding: 2rem !important; }

  /* Hero — bigger */
  .hero-section { padding: 60px 0 40px; }

  /* Filter chips — slightly bigger */
  .filter-chip { padding: 5px 16px; font-size: 11px; }

  /* Tags & badges bigger */
  .tag-badge { font-size: 11px; padding: 3px 10px; }
  .category-badge { font-size: 12px; padding: 4px 14px; }

  /* Share buttons bigger */
  .share-btn { padding: 6px 16px; font-size: 11px; }

  /* Stats bar */
  .stats-bar { font-size: 11px; padding: 6px 20px; }

  /* TOC sidebar wider */
  .toc-link { font-size: 11px !important; padding-left: 12px !important; }

  /* Lang tabs bigger */
  .lang-tab { padding: 8px 18px; font-size: 12px; }

  /* Mini article cards */
  .mini-article-card { padding: 14px 18px; }
  .mini-article-card h4 { font-size: 0.9rem; }
  .mini-article-card span { font-size: 0.7rem; }

  /* Terminal divider more spaced */
  .terminal-divider { margin: 35px 0; font-size: 11px; }

  /* Code copy button bigger */
  .code-copy-btn { padding: 3px 12px; font-size: 11px; }

  /* Reading time */
  .reading-time { font-size: 0.7rem; }

  /* About content wider */
  .about-content { max-width: 760px; }
  .about-content p { font-size: 1rem; line-height: 1.8; }
  .about-content h2 { font-size: 1.3rem; }

  /* Author header */


  /* Write editor bigger */
  .write-editor { font-size: 0.9rem; height: 500px; }
  .write-preview { min-height: 500px; }
}

/* ==================== ABOUT PAGE ==================== */
.about-content { max-width: 700px; margin: 0 auto; }
.about-content p { margin-bottom: 1.2em; line-height: 1.7; color: #d1d5db; }
body.light-theme .about-content p { color: #374151 !important; }
.about-content h2 { color: var(--neon-fuchsia); font-family: 'Share Tech Mono', monospace; margin-top: 1.8em; margin-bottom: 0.6em; font-size: 1.1rem; }

/* ==================== READING TIME ==================== */
.reading-time {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.65rem;
  font-family: 'Share Tech Mono', monospace;
  color: rgba(147, 51, 234, 0.4);
}

/* ==================== AUTHOR MINI CARD ==================== */
.mini-article-card {
  background: rgba(8, 4, 14, 0.5);
  border: 1px solid rgba(147, 51, 234, 0.1);
  padding: 10px 14px;
  transition: border-color 0.2s;
  text-decoration: none;
  display: block;
}
.mini-article-card:hover { border-color: rgba(217, 70, 239, 0.3); }
.mini-article-card h4 { color: var(--neon-fuchsia); font-size: 0.8rem; font-family: 'Share Tech Mono', monospace; margin: 0 0 3px 0; }
.mini-article-card span { font-size: 0.65rem; color: var(--text-dim); font-family: 'Share Tech Mono', monospace; }

/* ==================== TOC ==================== */
.toc-link {
  border-left: 1px solid rgba(147, 51, 234, 0.15);
  padding-left: 8px !important;
}
.toc-link:hover {
  border-left-color: var(--neon-fuchsia);
}

/* ==================== WRITE EDITOR ==================== */
.write-container {
  display: flex;
  gap: 16px;
  align-items: stretch;
}
@media (max-width: 768px) {
  .write-container { flex-direction: column; }
}

.write-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.write-editor {
  flex: none;
  background: rgba(8, 4, 14, 0.8);
  border: 1px solid rgba(147, 51, 234, 0.2);
  color: #e5e7eb;
  font-family: 'Fira Code', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  padding: 16px;
  resize: none;
  overflow: auto;
  outline: none;
  width: 100%;
  height: 400px;
  border-radius: 2px;
  transition: border-color 0.2s;
}
.write-editor:focus {
  border-color: var(--neon-fuchsia);
  box-shadow: 0 0 10px rgba(217, 70, 239, 0.1);
}
.write-editor::placeholder {
  color: rgba(147, 51, 234, 0.3);
}

.write-preview {
  flex: 1;
  background: rgba(5, 3, 10, 0.6);
  border: 1px solid rgba(147, 51, 234, 0.15);
  padding: 16px;
  overflow-y: auto;
  min-height: 400px;
  border-radius: 2px;
}

.write-label {
  font-size: 0.65rem;
  font-family: 'Share Tech Mono', monospace;
  color: rgba(147, 51, 234, 0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.write-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* Mobile resize controls */
.resize-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 1px solid rgba(147, 51, 234, 0.15);
  border-bottom: 1px solid rgba(147, 51, 234, 0.15);
  background: rgba(8, 4, 14, 0.5);
  padding: 6px 8px;
}

.resize-hint {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: ns-resize;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  padding: 4px 0;
}
.resize-bar {
  display: block;
  width: 36px;
  height: 4px;
  background: rgba(217, 70, 239, 0.3);
  border-radius: 2px;
}
.resize-label {
  font-size: 8px;
  font-family: 'Share Tech Mono', monospace;
  color: rgba(147, 51, 234, 0.3);
  margin-top: 3px;
}
.resize-hint:active .resize-bar { background: var(--neon-fuchsia); }

.resize-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.resize-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(147, 51, 234, 0.25);
  background: rgba(147, 51, 234, 0.08);
  color: var(--neon-fuchsia);
  font-size: 18px;
  font-family: 'Share Tech Mono', monospace;
  cursor: pointer;
  border-radius: 2px;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.resize-btn:active {
  background: rgba(217, 70, 239, 0.2);
}
.resize-size {
  font-size: 9px;
  font-family: 'Share Tech Mono', monospace;
  color: rgba(147, 51, 234, 0.5);
  min-width: 48px;
  text-align: center;
}
