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

:root {
  --bg: #0a0a0f;
  --bg-alt: #111118;
  --surface: #1a1a24;
  --border: #2a2a3a;
  --text: #e4e4ef;
  --text-muted: #8888a0;
  --primary: #6366f1;
  --primary-light: #818cf8;
  --accent: #22d3ee;
  --gradient: linear-gradient(135deg, #6366f1, #22d3ee);
  --font: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

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

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}

.nav.scrolled {
  border-bottom-color: var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -1px;
}

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

.nav-links a {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-muted);
  transition: color var(--transition);
  position: relative;
}

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

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient);
  transition: width var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: var(--transition);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(34, 211, 238, 0.1) 0%, transparent 50%);
}

.hero-content {
  position: relative;
  padding: 120px 24px 80px;
}

.hero-greeting {
  font-size: 1.1rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 12px;
  font-family: var(--mono);
}

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

.hero-title {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 300;
  color: var(--text-muted);
  margin-bottom: 24px;
  font-family: var(--mono);
}

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

.hero-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 60px;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 14px 32px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 24px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
}

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

.btn-outline:hover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.hero-stats {
  display: flex;
  gap: 48px;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--mono);
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
}

.scroll-arrow {
  width: 24px;
  height: 24px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
}

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

/* ===== Sections ===== */
.section {
  padding: 100px 0;
}

.section-alt {
  background: var(--bg-alt);
}

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

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--gradient);
  border-radius: 2px;
}

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 48px;
  align-items: start;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 20px;
  font-size: 1.02rem;
}

.about-text strong {
  color: var(--text);
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.info-value {
  font-weight: 500;
  font-size: 0.95rem;
}

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.skill-category {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color var(--transition);
}

.skill-category:hover {
  border-color: var(--primary);
}

.skill-category-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.skill-icon {
  font-size: 1.2rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.skill-tag {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid;
}

.tag-primary {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  color: var(--primary-light);
}

.tag-secondary {
  background: rgba(34, 211, 238, 0.1);
  border-color: rgba(34, 211, 238, 0.2);
  color: var(--accent);
}

.tag-accent {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
  color: var(--text-muted);
}

/* ===== Timeline (Career) ===== */
.timeline {
  position: relative;
  padding-left: 32px;
}

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

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

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -32px;
  top: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--primary);
  z-index: 1;
}

.timeline-item:first-child .timeline-dot {
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.timeline-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

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

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

.timeline-period {
  font-size: 0.85rem;
  color: var(--accent);
  font-family: var(--mono);
}

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

.timeline-details {
  list-style: none;
}

.timeline-details li {
  position: relative;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-bottom: 8px;
}

.timeline-details li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary-light);
}

/* ===== Projects ===== */
.project-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 20px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}

.filter-btn:hover,
.filter-btn.active {
  border-color: var(--primary);
  color: var(--primary-light);
  background: rgba(99, 102, 241, 0.1);
}

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

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.project-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.project-card:hover::before {
  transform: scaleX(1);
}

.project-card.hidden {
  display: none;
}

.project-period {
  font-size: 0.8rem;
  color: var(--accent);
  font-family: var(--mono);
  margin-bottom: 8px;
}

.project-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.project-role {
  font-size: 0.88rem;
  color: var(--primary-light);
  font-weight: 500;
  margin-bottom: 12px;
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.6;
}

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

.project-tags span {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ===== Education ===== */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.edu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  transition: border-color var(--transition);
}

.edu-card:hover {
  border-color: var(--primary);
}

.edu-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.edu-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.edu-detail {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.edu-period {
  font-size: 0.85rem;
  color: var(--accent);
  font-family: var(--mono);
  margin-bottom: 4px;
}

.edu-extra {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ===== Contact ===== */
.contact-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

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

.contact-cards {
  display: flex;
  justify-content: center;
  gap: 24px;
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
  font-weight: 500;
}

.contact-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.contact-icon {
  color: var(--primary-light);
}

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

/* ===== Animations ===== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 24px;
    gap: 20px;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition);
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .nav-toggle {
    display: flex;
  }

  .hero-content {
    padding: 100px 24px 60px;
  }

  .hero-name {
    font-size: 2.8rem;
  }

  .hero-desc br {
    display: none;
  }

  .hero-actions {
    flex-direction: column;
    gap: 12px;
  }

  .btn {
    justify-content: center;
  }

  .hero-stats {
    gap: 24px;
  }

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

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

  .timeline-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

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

  .contact-cards {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 480px) {
  .section {
    padding: 64px 0;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .hero-stats {
    flex-direction: column;
    gap: 16px;
  }
}
