:root {
  --bg: #0d1117;
  --bg2: #161b22;
  --bg3: #21262d;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #58a6ff;
  --accent2: #3fb950;
  --danger: #f85149;
  --purple: #a371f7;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
}

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

/* NAV */
nav {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-brand .blink {
  animation: blink 1s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a { color: var(--muted); font-size: 0.9rem; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-cta {
  background: var(--accent);
  color: #000 !important;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  transition: opacity 0.2s !important;
}
.nav-cta:hover { opacity: 0.85; }

/* HERO */
.hero {
  padding: 5rem 2rem 4rem;
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.hero-tag {
  display: inline-block;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--accent2);
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.2rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 2rem;
}

.hero-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.btn-primary {
  background: var(--accent);
  color: #000;
  padding: 0.7rem 1.6rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.85; text-decoration: none; }

.btn-secondary {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.7rem 1.6rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}
.btn-secondary:hover { border-color: var(--accent); text-decoration: none; }

/* STATS BAR */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 3rem;
  padding: 2rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-wrap: wrap;
}

.stat { text-align: center; }
.stat-num { font-size: 1.8rem; font-weight: 800; color: var(--accent); font-family: var(--mono); }
.stat-label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* MAIN CONTENT */
main { max-width: 1100px; margin: 0 auto; padding: 3rem 2rem; }

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.section-sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

/* ARTICLES GRID */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.2s;
}

.card:hover { border-color: var(--accent); transform: translateY(-2px); }

.card-tag {
  font-size: 0.72rem;
  font-family: var(--mono);
  color: var(--purple);
  background: rgba(163,113,247,0.1);
  border: 1px solid rgba(163,113,247,0.3);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-tag.security { color: var(--danger); background: rgba(248,81,73,0.1); border-color: rgba(248,81,73,0.3); }
.card-tag.tutorial { color: var(--accent2); background: rgba(63,185,80,0.1); border-color: rgba(63,185,80,0.3); }
.card-tag.research { color: var(--accent); background: rgba(88,166,255,0.1); border-color: rgba(88,166,255,0.3); }

.card h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.6rem; line-height: 1.3; }
.card h2 a { color: var(--text); }
.card h2 a:hover { color: var(--accent); text-decoration: none; }
.card p { color: var(--muted); font-size: 0.88rem; line-height: 1.5; margin-bottom: 1rem; }

.card-meta { display: flex; align-items: center; gap: 1rem; font-size: 0.78rem; color: var(--muted); font-family: var(--mono); }
.card-meta .read-time { color: var(--accent2); }

/* FEATURED */
.featured-card {
  background: var(--bg2);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 4rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
}

@media (max-width: 640px) {
  .featured-card { grid-template-columns: 1fr; }
}

.featured-badge {
  font-size: 0.72rem;
  font-family: var(--mono);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.featured-card h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 0.75rem; }
.featured-card p { color: var(--muted); margin-bottom: 1.2rem; }

.featured-code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent2);
  overflow-x: auto;
}

.featured-code .comment { color: var(--muted); }
.featured-code .keyword { color: var(--purple); }
.featured-code .string { color: #e3b341; }

/* SERVICES CTA */
.services-section {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem;
  margin-bottom: 4rem;
  text-align: center;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  text-align: left;
}

.service-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
}

.service-icon { font-size: 1.8rem; margin-bottom: 0.75rem; }
.service-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.service-card p { color: var(--muted); font-size: 0.85rem; margin-bottom: 1rem; }
.service-price { font-family: var(--mono); color: var(--accent2); font-size: 0.9rem; font-weight: 700; margin-bottom: 0.75rem; }
.service-btn {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--bg2);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.5rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.2s;
}
.service-btn:hover { background: var(--accent); color: #000; text-decoration: none; }

/* ABOUT */
.about-section {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  margin-bottom: 4rem;
  align-items: start;
}

@media (max-width: 640px) {
  .about-section { grid-template-columns: 1fr; }
}

.about-avatar {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
}

.avatar-ring {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin: 0 auto 1rem;
}

.about-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.25rem; }
.about-role { color: var(--accent); font-size: 0.85rem; font-family: var(--mono); }

.about-content h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 1rem; }
.about-content p { color: var(--muted); margin-bottom: 1rem; line-height: 1.7; }

.skill-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.skill-tag {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
}

/* ARTICLE PAGE */
.article-container { max-width: 720px; margin: 0 auto; padding: 3rem 2rem; }
.article-header { margin-bottom: 2rem; }
.article-header .tag { margin-bottom: 1rem; }
.article-header h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 800; margin-bottom: 1rem; }
.article-meta { display: flex; gap: 1.5rem; color: var(--muted); font-size: 0.85rem; font-family: var(--mono); flex-wrap: wrap; }
.article-divider { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

.article-body { color: var(--text); line-height: 1.8; }
.article-body h2 { font-size: 1.3rem; font-weight: 700; margin: 2rem 0 1rem; color: var(--text); }
.article-body h3 { font-size: 1.1rem; font-weight: 600; margin: 1.5rem 0 0.75rem; color: var(--accent); }
.article-body p { margin-bottom: 1.2rem; color: var(--muted); }
.article-body ul, .article-body ol { padding-left: 1.5rem; margin-bottom: 1.2rem; color: var(--muted); }
.article-body li { margin-bottom: 0.4rem; }
.article-body code {
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--accent2);
}
.article-body pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}
.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  color: var(--text);
}
.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.2rem;
  margin: 1.5rem 0;
  color: var(--muted);
  font-style: italic;
}
.article-body strong { color: var(--text); font-weight: 600; }

/* CTA BOX */
.cta-box {
  background: linear-gradient(135deg, rgba(88,166,255,0.1), rgba(163,113,247,0.1));
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  margin: 3rem 0;
}
.cta-box h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.5rem; }
.cta-box p { color: var(--muted); margin-bottom: 1.2rem; }

/* FOOTER */
footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  font-family: var(--mono);
}

footer a { color: var(--accent); }

/* RESPONSIVE */
@media (max-width: 768px) {
  nav { padding: 0 1rem; }
  .nav-links { gap: 1rem; }
  main { padding: 2rem 1rem; }
  .stats-bar { gap: 1.5rem; }
}
