/* ===== CSS Variables ===== */
:root {
  --bg-primary: #0a0a1a;
  --bg-secondary: #12122a;
  --bg-card: #1a1a3e;
  --bg-card-hover: #22224a;
  --accent: #7c5cfc;
  --accent-light: #9d85fd;
  --accent-glow: rgba(124, 92, 252, 0.3);
  --text-primary: #e8e8f0;
  --text-secondary: #a0a0c0;
  --text-dim: #666680;
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
  --info: #60a5fa;
  --border: #2a2a50;
  --font-main: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Fira Code', 'JetBrains Mono', monospace;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(0,0,0,0.3);
}

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

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

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
}

a { color: var(--accent-light); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ===== Header / Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 10, 26, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.navbar .logo {
  font-size: 1.3rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.navbar nav { display: flex; gap: 1.5rem; }
.navbar nav a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.navbar nav a:hover, .navbar nav a.active {
  color: var(--accent-light);
  border-bottom-color: var(--accent);
}
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ===== Hero ===== */
.hero {
  padding: 120px 2rem 60px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(124,92,252,0.15) 0%, transparent 60%);
}
.hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #fff, var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto 2rem;
}
.hero-badges {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.badge {
  padding: 0.35rem 0.9rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid;
}
.badge.csharp { background: rgba(104,33,122,0.2); color: #c49bff; border-color: rgba(104,33,122,0.4); }
.badge.node { background: rgba(51,153,51,0.2); color: #6fcf6f; border-color: rgba(51,153,51,0.4); }
.badge.mysql { background: rgba(0,120,215,0.2); color: #60a5fa; border-color: rgba(0,120,215,0.4); }
.badge.linux { background: rgba(255,165,0,0.2); color: #fbbf24; border-color: rgba(255,165,0,0.4); }
.badge.game { background: rgba(252,92,92,0.2); color: #f87171; border-color: rgba(252,92,92,0.4); }

/* ===== Section ===== */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2rem;
}
.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 50px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}
.section-desc {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 1rem;
}

/* ===== Roadmap ===== */
.roadmap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.2rem;
  margin-bottom: 3rem;
}
.roadmap-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.roadmap-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
}
.roadmap-item:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 8px 30px var(--accent-glow);
}
.roadmap-step {
  display: inline-block;
  width: 36px;
  height: 36px;
  line-height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.8rem;
}
.roadmap-item h3 {
  font-size: 1rem;
  margin-bottom: 0.3rem;
}
.roadmap-item p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ===== Card Grid ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

/* ===== Topic Card ===== */
.topic-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s;
}
.topic-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 30px var(--accent-glow);
  transform: translateY(-2px);
}
.topic-header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
}
.topic-icon {
  font-size: 2rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(124,92,252,0.1);
  border-radius: 10px;
  flex-shrink: 0;
}
.topic-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}
.topic-header .difficulty {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  margin-left: auto;
  font-weight: 600;
}
.difficulty.easy { background: rgba(74,222,128,0.2); color: var(--success); }
.difficulty.medium { background: rgba(251,191,36,0.2); color: var(--warning); }
.difficulty.hard { background: rgba(248,113,113,0.2); color: var(--danger); }

.topic-body {
  padding: 1.5rem;
  display: none;
}
.topic-card.open .topic-body {
  display: block;
}
.topic-body p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

/* ===== Code Block ===== */
.code-block {
  background: #0d0d20;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 1rem 0;
}
.code-header {
  background: rgba(255,255,255,0.03);
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.code-lang {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
}
.copy-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.2s;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent-light); }
.code-block pre {
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-primary);
}
.code-block code { font-family: inherit; }

/* ===== Syntax Colors ===== */
.kw { color: #c792ea; }   /* keyword */
.fn { color: #82aaff; }   /* function */
.str { color: #c3e88d; }  /* string */
.cm { color: #546e7a; }   /* comment */
.num { color: #f78c6c; }  /* number */
.tp { color: #ffcb6b; }   /* type */
.op { color: #89ddff; }   /* operator */

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.tab {
  padding: 0.7rem 1.2rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.tab:hover { color: var(--text-primary); }
.tab.active {
  color: var(--accent-light);
  border-bottom-color: var(--accent);
}
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== Key Concept Box ===== */
.concept-box {
  background: rgba(124, 92, 252, 0.08);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.2rem;
  border-radius: 0 8px 8px 0;
  margin: 1rem 0;
}
.concept-box h4 {
  font-size: 0.9rem;
  color: var(--accent-light);
  margin-bottom: 0.5rem;
}
.concept-box p, .concept-box li {
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.concept-box ul { padding-left: 1.2rem; }
.concept-box li { margin-bottom: 0.3rem; }

/* ===== Table ===== */
.styled-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}
.styled-table th, .styled-table td {
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.styled-table th {
  background: rgba(124,92,252,0.1);
  color: var(--accent-light);
  font-weight: 600;
  font-size: 0.85rem;
}
.styled-table td { color: var(--text-secondary); }
.styled-table tr:hover td { background: rgba(255,255,255,0.02); }

/* ===== Quiz ===== */
.quiz-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
}
.quiz-question {
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 1rem;
}
.quiz-options { display: flex; flex-direction: column; gap: 0.6rem; }
.quiz-option {
  padding: 0.7rem 1rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.9rem;
}
.quiz-option:hover { border-color: var(--accent); background: rgba(124,92,252,0.05); }
.quiz-option.correct { border-color: var(--success); background: rgba(74,222,128,0.1); }
.quiz-option.wrong { border-color: var(--danger); background: rgba(248,113,113,0.1); }
.quiz-result {
  margin-top: 0.8rem;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  display: none;
}
.quiz-result.show { display: block; }
.quiz-result.correct-result { background: rgba(74,222,128,0.1); color: var(--success); }
.quiz-result.wrong-result { background: rgba(248,113,113,0.1); color: var(--danger); }

/* ===== Progress Bar ===== */
.progress-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 0.8rem 2rem;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-card);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--success));
  border-radius: 4px;
  transition: width 0.5s ease;
  width: 0%;
}
.progress-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ===== Portfolio Page ===== */
.portfolio-hero {
  padding: 120px 2rem 60px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 30%, rgba(124,92,252,0.12) 0%, transparent 60%);
}
.portfolio-hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.portfolio-hero .subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 2rem;
}
.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 700px;
  margin: 0 auto;
  text-align: left;
}
.profile-card h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--accent-light);
}
.profile-card ul { padding-left: 1.2rem; }
.profile-card li {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}
.skill-tag {
  padding: 0.3rem 0.8rem;
  background: rgba(124,92,252,0.1);
  border: 1px solid rgba(124,92,252,0.3);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--accent-light);
}
.project-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.3s;
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px var(--accent-glow);
}
.project-preview {
  height: 180px;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  border-bottom: 1px solid var(--border);
}
.project-info {
  padding: 1.5rem;
}
.project-info h3 { margin-bottom: 0.5rem; font-size: 1.1rem; }
.project-info p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 1rem; }
.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.project-tech span {
  padding: 0.2rem 0.6rem;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text-dim);
}
.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 1rem;
  padding: 0.4rem 0.8rem;
  background: rgba(124,92,252,0.1);
  border: 1px solid rgba(124,92,252,0.3);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--accent-light);
  transition: all 0.2s;
}
.project-link:hover { background: rgba(124,92,252,0.2); }

/* ===== Timeline ===== */
.timeline {
  position: relative;
  padding-left: 2rem;
  margin: 2rem 0;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  margin-bottom: 2rem;
  padding-left: 1.5rem;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 0.5rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-primary);
  transform: translateX(-5px);
}
.timeline-date {
  font-size: 0.8rem;
  color: var(--accent-light);
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.timeline-item h4 { font-size: 1rem; margin-bottom: 0.3rem; }
.timeline-item p { font-size: 0.9rem; color: var(--text-secondary); }

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 3rem 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 60px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .navbar { padding: 0 1rem; }
  .navbar nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 1rem;
    gap: 0.5rem;
  }
  .navbar nav.open { display: flex; }
  .menu-toggle { display: block; }
  .hero h1 { font-size: 1.8rem; }
  .hero p { font-size: 0.95rem; }
  .roadmap { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: 1fr; }
  .section { padding: 2rem 1rem; }
  .progress-container { padding: 0.6rem 1rem; }
}

@media (max-width: 480px) {
  .roadmap { grid-template-columns: 1fr; }
  .hero-badges { gap: 0.5rem; }
}
