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

:root {
  --gap: 24px;
  --content-gap: 20px;
  --nav-width: 1200px;
  --main-width: 860px;
  --header-height: 70px;
  --footer-height: 60px;
  --radius: 12px;
  --radius-sm: 8px;

  --bg-primary: #0a0e17;
  --bg-secondary: #0f1420;
  --bg-card: rgba(15, 20, 35, 0.6);
  --bg-card-hover: rgba(20, 28, 50, 0.8);
  --bg-glass: rgba(15, 20, 35, 0.4);

  --text-primary: #e2e8f0;
  --text-secondary: #8892a4;
  --text-muted: #4a5568;

  --accent-cyan: #00d4ff;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-red: #ef4444;
  --accent-green: #10b981;

  --gradient-accent: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue), var(--accent-purple));
  --gradient-card: linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(139, 92, 246, 0.05));

  --border-color: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(0, 212, 255, 0.2);

  --code-bg: rgba(0, 212, 255, 0.06);
  --code-block-bg: #0c111c;
  --code-text: #00d4ff;

  --shadow-glow: 0 0 30px rgba(0, 212, 255, 0.1);
  --shadow-glow-strong: 0 0 60px rgba(0, 212, 255, 0.15), 0 0 120px rgba(139, 92, 246, 0.08);

  color-scheme: dark;
}

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

html {
  -webkit-tap-highlight-color: transparent;
  overflow-y: scroll;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  word-break: break-word;
  margin: 0;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { text-decoration: none; color: var(--text-primary); transition: all 0.3s ease; }
img { display: block; max-width: 100%; }
ul { padding: 0; margin: 0; }
h1, h2, h3, h4, h5, h6, p { margin: 0; }
button, input, textarea { padding: 0; font: inherit; background: none; border: 0; }
button { cursor: pointer; }

::selection {
  background: rgba(0, 212, 255, 0.3);
  color: #fff;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--accent-cyan), var(--accent-purple));
  border-radius: 3px;
}

/* ===== HEADER / NAV ===== */
.nav-wrapper {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: rgba(10, 14, 23, 0.8);
  border-bottom: 1px solid var(--border-color);
  transition: all 0.3s ease;
}
.nav-wrapper.scrolled {
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
  border-bottom-color: var(--border-glow);
}
.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  max-width: calc(var(--nav-width) + var(--gap) * 2);
  margin: auto;
  height: var(--header-height);
  padding: 0 var(--gap);
}
.nav a { display: block; }
.logo a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}
.logo-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--gradient-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #0a0e17;
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}
.logo a:hover { color: var(--accent-cyan); }
.logo a:hover .logo-icon { box-shadow: 0 0 30px rgba(0, 212, 255, 0.5); }

.menu {
  display: flex;
  list-style: none;
  gap: 8px;
  align-items: center;
}
.menu li { list-style: none; }
.menu a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 16px;
  border-radius: 8px;
  transition: all 0.3s ease;
}
.menu a:hover {
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.08);
}

/* ===== MAIN ===== */
.main {
  position: relative;
  min-height: calc(100vh - var(--header-height) - var(--footer-height));
  max-width: calc(var(--main-width) + var(--gap) * 2);
  margin: auto;
  padding: calc(var(--header-height) + var(--gap)) var(--gap) var(--gap);
}
.main.wide { max-width: calc(var(--nav-width) + var(--gap) * 2); }

/* ===== HERO / PROFILE SECTION ===== */
.hero {
  position: relative;
  padding: 60px 0 50px;
  text-align: center;
}
.hero-glow {
  position: absolute;
  top: -60px; left: 50%;
  transform: translateX(-50%);
  width: 500px; height: 300px;
  background: radial-gradient(ellipse, rgba(0, 212, 255, 0.08) 0%, rgba(139, 92, 246, 0.04) 40%, transparent 70%);
  pointer-events: none;
  filter: blur(40px);
}
.hero-avatar {
  position: relative;
  width: 110px; height: 110px;
  margin: 0 auto 24px;
}
.hero-avatar-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--gradient-accent);
  animation: ring-spin 8s linear infinite;
}
@keyframes ring-spin {
  0% { background: linear-gradient(0deg, var(--accent-cyan), var(--accent-blue), var(--accent-purple)); }
  33% { background: linear-gradient(120deg, var(--accent-cyan), var(--accent-blue), var(--accent-purple)); }
  66% { background: linear-gradient(240deg, var(--accent-cyan), var(--accent-blue), var(--accent-purple)); }
  100% { background: linear-gradient(360deg, var(--accent-cyan), var(--accent-blue), var(--accent-purple)); }
}
.hero-avatar-inner {
  position: relative;
  width: 110px; height: 110px;
  border-radius: 50%;
  background: var(--bg-primary);
  display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent-cyan);
  z-index: 1;
}
.hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #fff 0%, #c7d2fe 50%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--accent-cyan);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 24px;
  opacity: 0.8;
}
.hero-subtitle::before { content: '> '; opacity: 0.5; }

.hero-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  color: var(--text-secondary);
}
.hero-link svg { width: 16px; height: 16px; }
.hero-link:hover {
  border-color: var(--border-glow);
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.06);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

/* ===== STATS BAR ===== */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 24px 0;
  margin-bottom: 16px;
}
.stat-item { text-align: center; }
.stat-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.8rem;
  font-weight: 800;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 2px;
}

/* ===== SECTION HEADER ===== */
.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}
.section-header h2 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 2px;
  white-space: nowrap;
}
.section-header .line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-glow), transparent);
}

/* ===== SEARCH BAR ===== */
.search-container {
  margin-bottom: 24px;
  position: relative;
}
.search-input {
  width: 100%;
  padding: 14px 20px 14px 48px;
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  transition: all 0.3s ease;
  outline: none;
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus {
  border-color: var(--border-glow);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.08);
}
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 28px;
}
.filter-btn {
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 16px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.filter-btn:hover {
  border-color: var(--border-glow);
  color: var(--text-secondary);
  background: rgba(0, 212, 255, 0.04);
}
.filter-btn.active {
  background: rgba(0, 212, 255, 0.1);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.15);
}

/* ===== POST CARDS GRID ===== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.post-entry {
  position: relative;
  padding: 24px;
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px);
  animation: card-appear 0.5s ease forwards;
}
.post-entry::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-card);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.post-entry::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.post-entry:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
  transform: translateY(-4px);
  background: var(--bg-card-hover);
}
.post-entry:hover::before { opacity: 1; }
.post-entry:hover::after { transform: scaleX(1); }

@keyframes card-appear {
  to { opacity: 1; transform: translateY(0); }
}

.post-entry .entry-link {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.entry-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  position: relative;
}
.entry-category {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 212, 255, 0.2);
}
.entry-date {
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.entry-header h2 {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  transition: color 0.3s ease;
}
.post-entry:hover .entry-header h2 { color: #fff; }

.entry-content {
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.entry-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}
.entry-tag {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}
.entry-arrow {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 14px;
  transition: all 0.3s ease;
}
.post-entry:hover .entry-arrow {
  color: var(--accent-cyan);
  transform: translateX(4px);
}

/* ===== ARTICLE PAGE ===== */
.post-single { padding-bottom: var(--gap); }

.reading-progress {
  position: fixed;
  top: var(--header-height);
  left: 0; right: 0;
  height: 2px;
  z-index: 99;
  background: var(--bg-primary);
}
.reading-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--gradient-accent);
  transition: width 0.1s linear;
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.breadcrumb {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: var(--content-gap);
  letter-spacing: 0.5px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent-cyan); }
.breadcrumb .sep { margin: 0 8px; opacity: 0.3; }

.post-header {
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-color);
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.post-category {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.2);
  padding: 4px 14px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-cyan);
}
.post-date {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  font-size: 12px;
}
.post-title {
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1.5px;
  background: linear-gradient(135deg, #fff 0%, #c7d2fe 50%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== LANGUAGE TABS ===== */
.lang-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 32px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  width: fit-content;
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
}
.lang-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 32px;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.lang-tab:hover { color: var(--text-secondary); background: rgba(255,255,255,0.02); }
.lang-tab.active {
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent-cyan);
  box-shadow: inset 0 -2px 0 var(--accent-cyan);
}

/* ===== POST CONTENT ===== */
.post-content {
  color: var(--text-secondary);
  line-height: 1.85;
  font-size: 16px;
}
.post-content h2 {
  font-size: 1.5rem;
  margin: 48px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  position: relative;
}
.post-content h2::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0;
  width: 60px; height: 2px;
  background: var(--gradient-accent);
}
.post-content h3 {
  font-size: 1.15rem;
  margin: 32px 0 12px;
  color: var(--text-primary);
  font-weight: 600;
}
.post-content p { margin-bottom: 16px; }
.post-content strong { color: var(--text-primary); font-weight: 600; }
.post-content a { color: var(--accent-cyan); }
.post-content a:hover { text-decoration: underline; text-underline-offset: 3px; }

.post-content ul, .post-content ol {
  margin: 8px 0 20px 24px;
  padding: 0;
}
.post-content li { margin-bottom: 6px; list-style: disc; color: var(--text-secondary); }

.post-content code {
  background: var(--code-bg);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  color: var(--code-text);
  border: 1px solid rgba(0, 212, 255, 0.1);
}
.post-content pre {
  background: var(--code-block-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px 24px;
  overflow-x: auto;
  margin: 20px 0 24px;
  line-height: 1.6;
  position: relative;
}
.post-content pre::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--gradient-accent);
  opacity: 0.4;
}
.post-content pre code {
  background: none;
  padding: 0;
  font-size: 13px;
  color: var(--text-primary);
  border: none;
}
.post-content blockquote {
  border-left: 3px solid var(--accent-cyan);
  padding: 12px 20px;
  margin: 20px 0;
  background: rgba(0, 212, 255, 0.03);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-style: italic;
}

/* ===== RTL CONTENT ===== */
.rtl-content {
  direction: rtl;
  text-align: right;
  line-height: 2;
}
.rtl-content code, .rtl-content pre {
  direction: ltr;
  text-align: left;
}

/* ===== ARTICLE IMAGES ===== */
.article-img {
  margin: 24px 0;
  text-align: center;
}
.article-img img {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  display: block;
  margin: 0 auto;
  transition: all 0.4s ease;
  cursor: zoom-in;
}
.article-img img:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 40px;
}
.lightbox-overlay.active { opacity: 1; }
.lightbox-overlay img {
  max-width: 95%;
  max-height: 90vh;
  border-radius: var(--radius);
  box-shadow: var(--shadow-glow-strong);
}

/* ===== POST NAV / BACK LINK ===== */
.post-nav {
  margin-top: 48px;
  padding-top: var(--gap);
  border-top: 1px solid var(--border-color);
}
.post-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}
.post-nav a:hover {
  color: var(--accent-cyan);
  border-color: var(--border-glow);
  background: rgba(0, 212, 255, 0.04);
}

/* ===== TAGS PAGE ===== */
.tags-page { padding: var(--gap) 0; }
.tags-page h1 {
  font-size: 2rem;
  margin-bottom: var(--gap);
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #fff, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tag-group {
  margin-bottom: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px 24px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}
.tag-group:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
}
.tag-group h2 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  color: var(--accent-cyan);
}
.tag-group ul { list-style: none; }
.tag-group li { padding: 6px 0; }
.tag-group li a {
  color: var(--text-secondary);
  font-size: 14px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tag-group li a::before {
  content: '>';
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  font-size: 12px;
  transition: all 0.3s ease;
}
.tag-group li a:hover { color: var(--accent-cyan); transform: translateX(4px); }
.tag-group li a:hover::before { color: var(--accent-cyan); }

/* ===== FOOTER ===== */
.footer {
  max-width: calc(var(--nav-width) + var(--gap) * 2);
  margin: auto;
  padding: 24px var(--gap);
  text-align: center;
  border-top: 1px solid var(--border-color);
  position: relative;
  z-index: 1;
}
.footer span {
  color: var(--text-muted);
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
}
.footer a { color: var(--text-muted); }
.footer a:hover { color: var(--accent-cyan); }
.top-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 4px;
  padding: 4px 12px;
  border-radius: 6px;
  transition: all 0.3s ease;
}
.top-link:hover {
  color: var(--accent-cyan);
  background: rgba(0, 212, 255, 0.06);
}

/* ===== NIGHT RAIN BACKGROUND ===== */
body {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(0, 212, 255, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 0%, rgba(139, 92, 246, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(15, 20, 35, 1) 0%, var(--bg-primary) 100%),
    var(--bg-primary);
  background-attachment: fixed;
}

.night-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.cloud {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  animation: cloud-drift linear infinite;
  opacity: 0.03;
}
@keyframes cloud-drift {
  0% { transform: translateX(-10%); }
  100% { transform: translateX(110vw); }
}

.rain-drop {
  position: absolute;
  top: -5%;
  width: 1px;
  border-radius: 0 0 2px 2px;
  background: linear-gradient(transparent, rgba(0, 212, 255, 0.2));
  animation: rain-fall linear infinite;
}
@keyframes rain-fall {
  0% { transform: translateY(-5vh) translateX(0); opacity: 0; }
  5% { opacity: 1; }
  95% { opacity: 0.5; }
  100% { transform: translateY(105vh) translateX(-8px); opacity: 0; }
}

.rain-splash {
  position: fixed;
  bottom: 0; left: 0;
  width: 100%; height: 4px;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(transparent, rgba(0, 212, 255, 0.02));
}

.lightning {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  animation: lightning-flash 20s infinite;
  opacity: 0;
}
@keyframes lightning-flash {
  0%, 100% { opacity: 0; background: transparent; }
  93% { opacity: 0; }
  93.3% { opacity: 1; background: rgba(0, 212, 255, 0.03); }
  93.6% { opacity: 0; }
  94.2% { opacity: 1; background: rgba(139, 92, 246, 0.02); }
  94.5% { opacity: 0; }
}

.particle {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: float-particle linear infinite;
}
@keyframes float-particle {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 0.5; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

.nav-wrapper, .main, .footer, .tags-page {
  position: relative;
  z-index: 1;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  :root {
    --main-width: 100%;
    --gap: 16px;
  }
  .posts-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.7rem; }
  .hero-subtitle { font-size: 12px; }
  .post-title { font-size: 1.6rem; }
  .stats-bar { gap: 24px; }
  .stat-number { font-size: 1.4rem; }
  .nav { height: 60px; }
  .main { padding-top: calc(60px + var(--gap)); }
  .hero { padding: 40px 0 30px; }
}

@media (max-width: 480px) {
  .nav { flex-direction: column; height: auto; padding: 12px var(--gap); gap: 8px; }
  .menu { gap: 4px; }
  .menu a { font-size: 12px; padding: 4px 10px; }
  .hero-links { flex-direction: column; align-items: center; }
  .hero-link { width: 100%; justify-content: center; }
  .stats-bar { flex-direction: column; gap: 12px; }
  .lang-tabs { width: 100%; }
  .lang-tab { flex: 1; text-align: center; padding: 8px 16px; font-size: 11px; }
  .post-entry { padding: 18px; }
  .entry-header h2 { font-size: 15px; }
}
