/* ===== 변수 & 리셋 ===== */
:root {
  --bg: #0f0f13;
  --bg2: #16161e;
  --surface: #1e1e2a;
  --border: #2a2a3a;
  --text: #e2e2f0;
  --text-muted: #8888aa;
  --accent: #7c6af7;
  --accent2: #a78bfa;
  --accent-glow: rgba(124, 106, 247, 0.15);
  --nav-h: 64px;
}

[data-theme="light"] {
  --bg: #f5f5fa;
  --bg2: #ebebf5;
  --surface: #ffffff;
  --border: #d0d0e0;
  --text: #1a1a2e;
  --text-muted: #6060880;
  --accent: #6b56f0;
  --accent2: #8b6cf0;
  --accent-glow: rgba(107, 86, 240, 0.12);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', 'Apple SD Gothic Neo', sans-serif;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ===== 네비게이션 ===== */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(15, 15, 19, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  transition: background 0.3s;
}

[data-theme="light"] #navbar {
  background: rgba(245, 245, 250, 0.88);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 24px;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent2);
  letter-spacing: 0.04em;
  margin-right: auto;
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
  margin-left: auto;
}

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.theme-toggle:hover { border-color: var(--accent); }

/* ===== 섹션 공통 ===== */
section {
  padding: 100px 24px;
}

#hero { padding-top: calc(var(--nav-h) + 80px); }

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 48px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  display: block;
  margin-top: 8px;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 2px;
}

/* ===== 히어로 ===== */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.hero-inner { max-width: 700px; margin: 0 auto 0 10%; }

.hero-greeting {
  font-size: 1.1rem;
  color: var(--accent2);
  margin-bottom: 8px;
  letter-spacing: 0.06em;
}

.hero-name {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.accent { color: var(--accent); }

.hero-title {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  color: var(--text-muted);
  margin-bottom: 24px;
  font-weight: 500;
}

.hero-desc {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 40px;
  line-height: 1.8;
}

.hero-links { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--accent);
}

.btn-primary:hover {
  background: var(--accent2);
  border-color: var(--accent2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
}

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

.hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-size: 1.4rem;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ===== 기술 스택 ===== */
#skills { background: var(--bg2); }

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
}

.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: border-color 0.2s, transform 0.2s;
}

.skill-group:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}

.skill-group h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.skill-group ul { display: flex; flex-direction: column; gap: 8px; }

.badge {
  display: inline-block;
  background: var(--accent-glow);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 0.88rem;
}

/* ===== 경력 ===== */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 48px;
}

.timeline-dot {
  position: absolute;
  left: -28px;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}

.timeline-dot--edu {
  background: var(--border);
  box-shadow: 0 0 0 2px var(--border);
}

.timeline-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 28px;
  transition: border-color 0.2s;
}

.timeline-content:hover { border-color: var(--accent); }

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 8px;
}

.timeline-header h3 { font-size: 1.2rem; font-weight: 700; }

.timeline-period {
  font-size: 0.85rem;
  color: var(--accent2);
  background: var(--accent-glow);
  padding: 3px 10px;
  border-radius: 20px;
}

.timeline-role {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.timeline-tasks {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timeline-tasks li {
  font-size: 0.92rem;
  color: var(--text);
  padding-left: 16px;
  position: relative;
}

.timeline-tasks li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* ===== 연도 바 ===== */
.year-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
}

.year-bar-labels {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 40px;
  line-height: 1.2;
}

.year-bar {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  width: 0;
  transition: width 1s ease;
}

.year-bar--edu {
  background: linear-gradient(90deg, #6ecf9e, #a0d8b3);
}

/* ===== 프로젝트 ===== */
#projects { background: var(--bg2); }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px var(--accent-glow);
}

.project-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.project-card-top h3 { font-size: 1.05rem; font-weight: 700; }

.project-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.project-badge--work {
  background: rgba(124, 106, 247, 0.2);
  color: var(--accent2);
}

.project-badge--personal {
  background: rgba(100, 200, 150, 0.15);
  color: #6ecf9e;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
}

.project-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  font-size: 0.78rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 3px 10px;
  color: var(--text-muted);
}

.project-private {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.project-link {
  font-size: 0.88rem;
  color: var(--accent2);
  font-weight: 600;
  transition: color 0.2s;
  align-self: flex-start;
}

.project-link:hover { color: var(--accent); }

/* ===== 연락처 ===== */
#contact { text-align: center; }

.contact-desc {
  color: var(--text-muted);
  margin-bottom: 40px;
  font-size: 1.05rem;
}

.contact-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 32px;
  width: 100%;
  max-width: 420px;
  font-size: 0.95rem;
  transition: border-color 0.2s, transform 0.2s;
}

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

.contact-icon {
  font-size: 1.2rem;
  color: var(--accent2);
  width: 24px;
  text-align: center;
}

/* ===== 푸터 ===== */
footer {
  text-align: center;
  padding: 32px 24px;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* ===== 스크롤 애니메이션 ===== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 반응형 ===== */
@media (max-width: 768px) {
  .hero-inner { margin-left: 0; }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    gap: 16px;
  }

  .nav-links.open { display: flex; }

  .nav-toggle { display: block; }

  .nav-logo { margin-right: 0; }

  .skills-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

  .projects-grid { grid-template-columns: 1fr; }
}
