/* ==========================================================================
   김준한 (Kim Junhan) - 개인 소개 웹페이지 스타일시트
   * 외부 라이브러리 없이 순수 CSS로 구현된 모던 & 반응형 디자인
   * 색상/스타일을 변경하고 싶다면 아래 :root 의 CSS 변수를 수정하세요.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 색상 테마 및 디자인 토큰 (CSS Variables)
   -------------------------------------------------------------------------- */
:root {
  /* 라이트 모드 (기본값) */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --border-color: #e2e8f0;
  --border-subtle: #cbd5e1;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  /* 포인트 컬러 (기계공학/첨단기술을 상징하는 정교한 딥블루 & 인디고) */
  --accent-primary: #2563eb;
  --accent-primary-hover: #1d4ed8;
  --accent-secondary: #0284c7;
  --accent-glow: rgba(37, 99, 235, 0.12);
  --tag-bg: #eff6ff;
  --tag-text: #1d4ed8;
  --tag-border: #bfdbfe;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 16px 24px -4px rgba(37, 99, 235, 0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --nav-height: 64px;
  --max-width: 960px;
  --transition-fast: 0.18s ease;
  --transition-normal: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 다크 모드 토큰 */
[data-theme="dark"] {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-tertiary: #1e293b;
  --bg-card: #151e32;
  --bg-card-hover: #1c2742;
  --border-color: #1e293b;
  --border-subtle: #334155;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --accent-primary: #3b82f6;
  --accent-primary-hover: #60a5fa;
  --accent-secondary: #38bdf8;
  --accent-glow: rgba(59, 130, 246, 0.22);
  --tag-bg: rgba(59, 130, 246, 0.15);
  --tag-text: #93c5fd;
  --tag-border: rgba(147, 197, 253, 0.3);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 16px 28px rgba(0, 0, 0, 0.6), 0 0 20px rgba(59, 130, 246, 0.2);
}

/* --------------------------------------------------------------------------
   2. 초기화 및 기본 스타일
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard Variable", Pretendard,
               "Apple SD Gothic Neo", "Segoe UI", Roboto, "Helvetica Neue",
               "Noto Sans KR", "Malgun Gothic", sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  letter-spacing: -0.01em;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* --------------------------------------------------------------------------
   3. 내비게이션 바 (상단 고정)
   -------------------------------------------------------------------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

[data-theme="dark"] .navbar {
  background: rgba(11, 15, 25, 0.85);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
}

.brand-badge {
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--tag-bg);
  color: var(--tag-text);
  border: 1px solid var(--tag-border);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
}

.nav-link {
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.nav-link:hover {
  color: var(--accent-primary);
  background-color: var(--bg-tertiary);
}

/* 테마 토글 버튼 */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.theme-toggle-btn:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

.theme-toggle-btn svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.icon-sun {
  display: none;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: block;
}

/* --------------------------------------------------------------------------
   4. 메인 컨테이너 레이아웃
   -------------------------------------------------------------------------- */
.main-wrapper {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* --------------------------------------------------------------------------
   5. Hero / 프로필 헤더 섹션
   -------------------------------------------------------------------------- */
.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-normal);
}

/* 상단 은은한 그라데이션 장식 라인 */
.hero-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary), #06b6d4);
}

.hero-layout {
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* 프로필 아바타 */
.hero-avatar-wrapper {
  flex-shrink: 0;
}

.avatar-badge {
  width: 104px;
  height: 104px;
  border-radius: 24px;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #0284c7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
  border: 3px solid rgba(255, 255, 255, 0.2);
  user-select: none;
  transition: transform var(--transition-normal);
}

.avatar-badge:hover {
  transform: rotate(3deg) scale(1.03);
}

/* 사용자가 실제 사진 img를 넣을 때의 스타일 */
.avatar-img {
  width: 104px;
  height: 104px;
  border-radius: 24px;
  object-fit: cover;
  border: 3px solid var(--border-color);
  box-shadow: var(--shadow-md);
}

.hero-info {
  flex: 1;
}

.hero-name-row {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.hero-name {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.2;
}

.hero-name-en {
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text-muted);
}

.hero-affiliation {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 0.85rem;
}

.hero-affiliation svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex-shrink: 0;
}

.hero-bio {
  font-size: 1.025rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.35rem;
}

/* 연락처 및 소셜 링크 버튼 행 */
.hero-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  color: #ffffff;
}

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

.btn-outline:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--bg-tertiary);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   6. 섹션 공통 스타일
   -------------------------------------------------------------------------- */
.section {
  margin-bottom: 2.75rem;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--border-color);
}

.section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--tag-bg);
  color: var(--accent-primary);
}

.section-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* --------------------------------------------------------------------------
   7. 관심 분야 (Research & Interests) 섹션
   -------------------------------------------------------------------------- */
.interests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1.25rem;
}

.interest-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
  position: relative;
}

.interest-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-hover);
}

.interest-card-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.interest-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--tag-bg);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.interest-icon-circle svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.interest-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.interest-desc {
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 1rem;
  flex: 1;
}

.interest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--tag-bg);
  color: var(--tag-text);
  border: 1px solid var(--tag-border);
}

/* --------------------------------------------------------------------------
   8. 학업 및 소속 상세 (Education & Overview)
   -------------------------------------------------------------------------- */
.timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  transition: all var(--transition-fast);
}

.timeline-card:hover {
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-md);
}

.timeline-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.timeline-logo svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.timeline-content {
  flex: 1;
}

.timeline-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.timeline-org {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.timeline-badge {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.timeline-major {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 0.4rem;
}

.timeline-notes {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   9. 프로젝트 / 활동 (자리표시자 템플릿)
   -------------------------------------------------------------------------- */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.project-item:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.project-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.project-date {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.project-desc {
  font-size: 0.925rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 0.6rem;
}

/* --------------------------------------------------------------------------
   10. 연락처 (Contact & Links) 섹션
   -------------------------------------------------------------------------- */
.contact-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.15rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  gap: 1rem;
  transition: all var(--transition-fast);
}

.contact-item:hover {
  border-color: var(--accent-primary);
}

.contact-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.contact-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

.contact-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.contact-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.contact-val {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-all;
}

.copy-btn {
  font-size: 0.825rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.copy-btn:hover {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

/* --------------------------------------------------------------------------
   11. 푸터 (Footer)
   -------------------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
  padding: 2rem 1.5rem;
  margin-top: auto;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.footer-links a:hover {
  color: var(--accent-primary);
}

/* --------------------------------------------------------------------------
   12. 토스트 알림 (복사 완료 피드백 등)
   -------------------------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  pointer-events: none;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1000;
}

[data-theme="dark"] .toast {
  background: #ffffff;
  color: #0f172a;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* --------------------------------------------------------------------------
   13. 모바일 반응형 미디어 쿼리
   -------------------------------------------------------------------------- */
@media (max-width: 680px) {
  .hero-layout {
    flex-direction: column;
    text-align: center;
    gap: 1.25rem;
  }

  .hero-name-row {
    justify-content: center;
  }

  .hero-affiliation {
    justify-content: center;
  }

  .hero-links {
    justify-content: center;
  }

  .nav-menu {
    gap: 0.75rem;
  }

  .nav-link {
    font-size: 0.85rem;
    padding: 0.25rem 0.4rem;
  }

  .contact-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .copy-btn {
    align-self: flex-end;
  }

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