/* ── CSS Variables ── */
:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --bg-card: #161b22;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #484f58;
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --accent-green: #3fb950;
  --accent-orange: #d29922;
  --accent-red: #f85149;
  --accent-purple: #bc8cff;
  --border: #30363d;
  --border-light: #21262d;
  --shadow: 0 3px 12px rgba(0,0,0,0.4);
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
  --header-h: 60px;
  --sidebar-w: 240px;
  --font-main: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-code: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --transition: 0.2s ease;
}

[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f6f8fa;
  --bg-tertiary: #eaeef2;
  --bg-card: #ffffff;
  --text-primary: #1f2328;
  --text-secondary: #656d76;
  --text-muted: #8b949e;
  --accent: #0969da;
  --accent-hover: #0550ae;
  --accent-green: #1a7f37;
  --accent-orange: #9a6700;
  --accent-red: #cf222e;
  --accent-purple: #8250df;
  --border: #d0d7de;
  --border-light: #eaeef2;
  --shadow: 0 3px 12px rgba(0,0,0,0.08);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }
code { font-family: var(--font-code); }

/* ── Header ── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  padding: 0 24px;
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo span { color: var(--accent); }
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Navigation ── */
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav a {
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
}
.nav a:hover, .nav a.active {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}
.nav a.active { color: var(--accent); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition);
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 18px;
  transition: all var(--transition);
}
.btn-icon:hover { background: var(--bg-tertiary); color: var(--text-primary); }

/* ── Lang Switch ── */
.lang-switch {
  display: flex;
  gap: 2px;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  padding: 2px;
}
.lang-switch a {
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  color: var(--text-muted);
  transition: all var(--transition);
}
.lang-switch a:hover { color: var(--text-primary); }
.lang-switch a.active {
  background: var(--accent);
  color: #fff;
}

/* ── Layout ── */
.main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 24px;
  min-height: calc(100vh - var(--header-h) - 80px);
}

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 80px 0 60px;
}
.hero-avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  margin: 0 auto 24px;
  overflow: hidden;
}
.hero-avatar img { width: 100%; height: 100%; object-fit: cover; }
.hero h1 {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 20px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ── Featured Banner ── */
.featured-banner {
  display: block;
  margin: 0 0 40px;
  padding: 36px 40px;
  background: linear-gradient(135deg, #161b22 0%, #1a2332 50%, #161b22 100%);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  color: var(--text-primary);
}
.featured-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, rgba(88,166,255,0.06) 0%, rgba(188,140,255,0.06) 100%);
  pointer-events: none;
}
.featured-banner:hover {
  border-color: var(--accent-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(88,166,255,0.15);
}
.featured-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  border-radius: 20px;
  margin-bottom: 14px;
}
.featured-banner h2 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.featured-banner p {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.featured-cta {
  display: inline-block;
  padding: 8px 20px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius);
  transition: all 0.2s;
}
.featured-banner:hover .featured-cta {
  background: var(--accent-hover);
}
.featured-banner-gold {
  border-color: #D4AF37;
  background: linear-gradient(135deg, #161b22 0%, #1f1c14 50%, #161b22 100%);
}
.featured-banner-gold::before {
  background: linear-gradient(135deg, rgba(212,175,55,0.06) 0%, rgba(232,197,71,0.04) 100%);
}
.featured-banner-gold:hover {
  border-color: #E8C547;
  box-shadow: 0 8px 32px rgba(212,175,55,0.15);
}
.featured-banner-gold h2 {
  background: linear-gradient(135deg, #D4AF37, #E8C547);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.featured-badge-gold { background: #D4AF37; }
.featured-cta-gold { background: #D4AF37; }
.featured-banner-gold:hover .featured-cta-gold { background: #E8C547; }

/* ── Stats Bar ── */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 32px 0;
  margin-bottom: 48px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat-item { text-align: center; }
.stat-num {
  display: block;
  font-size: 36px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
}
.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Tech Stack ── */
.tech-stack-section {
  margin-bottom: 48px;
  text-align: center;
}
.tech-stack-section h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
}
.tech-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.tech-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  transition: all var(--transition);
}
.tech-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.tech-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-purple));
  color: #fff;
}

/* ── Section ── */
.section { margin-bottom: 48px; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.section-header h2 {
  font-size: 22px;
  font-weight: 700;
}

/* ── Cards Grid ── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition);
  cursor: pointer;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.card-featured {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(88,166,255,0.04) 100%);
}
.card-thumbnail {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 16px;
  background: var(--bg-tertiary);
}
.card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
}
.card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-muted);
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

/* ── Tags ── */
.tag {
  display: inline-block;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 20px;
  background: rgba(88, 166, 255, 0.1);
  color: var(--accent);
  border: 1px solid rgba(88, 166, 255, 0.2);
}

/* ── Article Content ── */
.article-content {
  max-width: 800px;
  margin: 0 auto;
  line-height: 1.8;
  font-size: 16px;
}
.article-content h1 { font-size: 36px; margin: 32px 0 16px; }
.article-content h2 { font-size: 28px; margin: 28px 0 14px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.article-content h3 { font-size: 22px; margin: 24px 0 12px; }
.article-content p { margin-bottom: 16px; }
.article-content ul, .article-content ol { margin: 16px 0; padding-left: 24px; }
.article-content li { margin-bottom: 8px; }
.article-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 20px;
  margin: 16px 0;
  background: var(--bg-secondary);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-secondary);
}
.article-content img { border-radius: var(--radius); margin: 16px 0; }
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}
.article-content th, .article-content td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}
.article-content th { background: var(--bg-secondary); font-weight: 600; }

/* ── Code Blocks ── */
.article-content pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  overflow-x: auto;
  margin: 16px 0;
  position: relative;
}
.article-content pre code {
  font-size: 13px;
  line-height: 1.6;
}
.article-content code:not(pre code) {
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}
.code-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
}
.code-copy:hover { color: var(--accent); border-color: var(--accent); }

/* ── Thread / QnA List ── */
.thread-list, .qna-list { list-style: none; }
.thread-item, .qna-item {
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  background: var(--bg-card);
  transition: all var(--transition);
}
.thread-item:hover, .qna-item:hover {
  border-color: var(--accent);
}
.thread-item h3, .qna-item h3 { font-size: 16px; margin-bottom: 6px; }
.thread-meta, .qna-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}
.solved-badge {
  background: var(--accent-green);
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

/* ── About ── */
.about-hero {
  text-align: center;
  padding: 60px 0;
}
.about-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  margin: 0 auto 20px;
  background: var(--bg-tertiary);
  overflow: hidden;
}
.about-avatar img { width: 100%; height: 100%; object-fit: cover; }
.about-hero h1 { font-size: 32px; margin-bottom: 8px; }
.about-hero .role { color: var(--accent); font-size: 18px; font-weight: 600; }
.about-hero .bio { color: var(--text-secondary); margin-top: 12px; }

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 32px;
}
.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.skill-card h3 { font-size: 16px; margin-bottom: 12px; color: var(--accent); }
.skill-bar {
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}
.skill-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-purple));
  transition: width 1s ease;
}

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* ── 404 ── */
.page-404 {
  text-align: center;
  padding: 120px 0;
}
.page-404 h1 { font-size: 80px; color: var(--text-muted); }
.page-404 p { color: var(--text-secondary); margin: 16px 0 32px; }

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 16px; }

/* ── Mobile ── */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 16px; }
  .stats-bar { gap: 24px; flex-wrap: wrap; }
  .stat-num { font-size: 28px; }
  .cards { grid-template-columns: 1fr; }
  .nav { display: none; position: fixed; top: var(--header-h); left: 0; right: 0;
    background: var(--bg-secondary); flex-direction: column; padding: 16px;
    border-bottom: 1px solid var(--border); z-index: 99; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 16px; }
  .mobile-toggle { display: block; }
  .header-actions .lang-switch { display: none; }
  .main { padding: 20px 16px; }
  .skill-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 26px; }
  .section-header h2 { font-size: 18px; }
}

/* ── Featured Banner Green (Production Guide) ── */
.featured-banner-green {
  border-color: #7ee787;
  background: linear-gradient(135deg, #161b22 0%, #141f1a 50%, #161b22 100%);
}
.featured-banner-green::before {
  background: linear-gradient(135deg, rgba(126,231,135,0.06) 0%, rgba(88,166,255,0.04) 100%);
}
.featured-banner-green:hover {
  border-color: #9bf0a1;
  box-shadow: 0 8px 32px rgba(126,231,135,0.15);
}
.featured-banner-green h2 {
  background: linear-gradient(135deg, #7ee787, #58a6ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.featured-badge-green { background: #238636; }
.featured-cta-green { background: #238636; }
.featured-banner-green:hover .featured-cta-green { background: #2ea043; }
