/* ============================================================
   CSS 변수 — 모든 색상은 여기서만 관리
   ============================================================ */
:root {
  /* 포인트 컬러: Deep Blue */
  --accent-color: #2E86AB;
  --accent-soft: rgba(46, 134, 171, 0.07);

  /* 라이트 테마 */
  --bg-primary: #F5F9FC;
  --bg-card: #FFFFFF;
  --text-primary: #1A2332;
  --text-secondary: #5A6578;
  --text-muted: #8B95A5;
  --border-color: #E2E8F0;
  --nav-bg: transparent;
  --nav-bg-scrolled: rgba(245, 249, 252, 0.92);
  --shadow-sm: 0 1px 3px rgba(26, 35, 50, 0.06);
  --shadow-md: 0 8px 24px rgba(26, 35, 50, 0.08);
  --shadow-lg: 0 16px 40px rgba(26, 35, 50, 0.12);
  --hero-bg-text: rgba(46, 134, 171, 0.07);
  --tag-bg: rgba(46, 134, 171, 0.08);
  --tag-text: #2E86AB;
  --timeline-line: #D1DCE6;
  --transition: 0.3s ease;
}

/* 다크 테마 변수 세트 */
[data-theme="dark"] {
  --bg-primary: #0F1419;
  --bg-card: #1A2332;
  --text-primary: #E8EDF2;
  --text-secondary: #A0AAB8;
  --text-muted: #6B7789;
  --border-color: #2A3544;
  --nav-bg-scrolled: rgba(15, 20, 25, 0.92);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);
  --hero-bg-text: rgba(46, 134, 171, 0.08);
  --tag-bg: rgba(46, 134, 171, 0.15);
  --tag-text: #6BB8D9;
  --timeline-line: #2A3544;
}


/* ============================================================
   기본 리셋 & 타이포그래피
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--transition), color var(--transition);
}

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

ul {
  list-style: none;
}

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

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


/* ============================================================
   등장 애니메이션 (IntersectionObserver로 활성화)
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* ============================================================
   상단 고정 내비게이션
   ============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: var(--nav-bg);
  transition: background-color var(--transition), box-shadow var(--transition);
}

.nav.is-scrolled {
  background-color: var(--nav-bg-scrolled);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav__logo {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent-color);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav__link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition);
}

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

/* 다크모드 토글 버튼 */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-card);
  cursor: pointer;
  color: var(--text-secondary);
  transition: border-color var(--transition), color var(--transition);
  margin-left: 16px;
}

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

.theme-toggle__icon {
  font-size: 0.9rem;
}

/* 라이트 모드: 달 아이콘 표시 / 다크 모드: 해 아이콘 표시 */
.theme-toggle__icon--light { display: none; }
.theme-toggle__icon--dark { display: block; }

[data-theme="dark"] .theme-toggle__icon--light { display: block; }
[data-theme="dark"] .theme-toggle__icon--dark { display: none; }

/* 모바일 메뉴 버튼 (데스크톱에서 숨김) */
.nav__menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-card);
  cursor: pointer;
  color: var(--text-secondary);
  margin-left: 8px;
}


/* ============================================================
   히어로 섹션
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: 64px;
}

/* 배경 영문 구절 — 포인트 컬러 7% 투명도 */
.hero__bg-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(4rem, 14vw, 11rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--hero-bg-text);
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
  line-height: 1;
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.hero__name {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 20px;
}

.hero__headline {
  font-size: clamp(1.125rem, 2.5vw, 1.375rem);
  font-weight: 600;
  color: var(--accent-color);
  margin-bottom: 24px;
  letter-spacing: -0.01em;
}

.hero__desc {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 560px;
}


/* ============================================================
   공통 섹션 스타일
   ============================================================ */
.section {
  padding: 100px 0;
}

.section__header {
  margin-bottom: 48px;
}

.section__label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-color);
  margin-bottom: 8px;
}

.section__title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}


/* ============================================================
   카드 공통 스타일
   ============================================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}


/* ============================================================
   About 섹션
   ============================================================ */
.about-card {
  padding: 40px 48px;
}

.about-card p {
  color: var(--text-secondary);
  font-size: 1.0625rem;
  line-height: 1.85;
}

.about-card p + p {
  margin-top: 20px;
}


/* ============================================================
   Education 타임라인
   ============================================================ */
.timeline {
  position: relative;
  padding-left: 32px;
}

/* 세로선 */
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--timeline-line);
}

.timeline__item {
  position: relative;
  padding-bottom: 48px;
}

.timeline__item:last-child {
  padding-bottom: 0;
}

/* 타임라인 점 */
.timeline__marker {
  position: absolute;
  left: -32px;
  top: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 3px solid var(--accent-color);
  z-index: 1;
}

.timeline__badge {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-color);
  background: var(--tag-bg);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.timeline__org {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  line-height: 1.4;
}

.timeline__list {
  list-style: disc;
  padding-left: 20px;
}

.timeline__list li {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.75;
  margin-bottom: 4px;
}


/* ============================================================
   Experiences 카드 그리드
   ============================================================ */
.experience-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.experience-card {
  padding: 32px;
  display: flex;
  flex-direction: column;
}

.experience-card__title {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  line-height: 1.4;
}

.experience-card__meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.experience-card__divider {
  margin: 0 6px;
}

.experience-card__list {
  list-style: disc;
  padding-left: 18px;
  flex: 1;
  margin-bottom: 24px;
}

.experience-card__list li {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: 6px;
}


/* ============================================================
   태그 칩 (알약 모양)
   ============================================================ */
.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--tag-text);
  background: var(--tag-bg);
  padding: 5px 14px;
  border-radius: 20px;
  letter-spacing: 0.01em;
}


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

.skills-category__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}


/* ============================================================
   Contact 섹션
   ============================================================ */
.section--contact {
  padding-bottom: 60px;
}

.contact-quote {
  font-size: clamp(1.25rem, 3vw, 1.625rem);
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.6;
  letter-spacing: -0.02em;
  border-left: 3px solid var(--accent-color);
  padding-left: 24px;
  font-style: normal;
}


/* ============================================================
   푸터
   ============================================================ */
.footer {
  padding: 32px 0 40px;
  border-top: 1px solid var(--border-color);
}

.footer__copy {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
}


/* ============================================================
   모바일 반응형
   ============================================================ */
@media (max-width: 768px) {
  .nav__links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--nav-bg-scrolled);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 24px 20px;
  }

  .nav__links.is-open {
    display: flex;
  }

  .nav__link {
    padding: 12px 0;
    width: 100%;
    border-bottom: 1px solid var(--border-color);
  }

  .nav__link:last-child {
    border-bottom: none;
  }

  .nav__menu-btn {
    display: flex;
  }

  .nav__inner {
    position: relative;
  }

  .section {
    padding: 80px 0;
  }

  .about-card {
    padding: 28px 24px;
  }

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

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

  .hero__bg-text {
    font-size: clamp(3rem, 18vw, 6rem);
    white-space: normal;
    text-align: center;
    width: 90%;
  }
}

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

  .theme-toggle {
    margin-left: auto;
  }
}


/* ============================================================
   챗봇 위젯
   ============================================================ */
.chatbot {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 200;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

/* 플로팅 토글 버튼 */
.chatbot__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: var(--accent-color);
  color: #FFFFFF;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition);
}

.chatbot__toggle:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.chatbot__toggle-icon {
  font-size: 1.25rem;
  position: absolute;
  transition: opacity var(--transition), transform var(--transition);
}

.chatbot__toggle-icon--close {
  opacity: 0;
  transform: rotate(-90deg);
}

.chatbot.is-open .chatbot__toggle-icon--open {
  opacity: 0;
  transform: rotate(90deg);
}

.chatbot.is-open .chatbot__toggle-icon--close {
  opacity: 1;
  transform: rotate(0);
}

/* 채팅 패널 */
.chatbot__panel {
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 380px;
  max-height: 520px;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.chatbot__panel[hidden] {
  display: none;
}

/* 패널 헤더 */
.chatbot__header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-color);
  background: var(--accent-soft);
}

.chatbot__header-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chatbot__status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-color);
  flex-shrink: 0;
}

.chatbot__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.chatbot__subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  padding-left: 16px;
}

/* 메시지 영역 */
.chatbot__messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 280px;
  max-height: 340px;
}

.chatbot__message {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.65;
  word-break: break-word;
}

.chatbot__message p {
  margin: 0;
}

.chatbot__message--bot {
  align-self: flex-start;
  background: var(--accent-soft);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.chatbot__message--user {
  align-self: flex-end;
  background: var(--accent-color);
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}

.chatbot__message--error {
  align-self: center;
  max-width: 100%;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8125rem;
  text-align: center;
  padding: 4px 0;
}

/* 로딩 점 애니메이션 */
.chatbot__loading {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 16px 12px;
}

.chatbot__loading[hidden] {
  display: none;
}

.chatbot__loading-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-color);
  opacity: 0.4;
  animation: chatbot-bounce 1.2s infinite ease-in-out;
}

.chatbot__loading-dot:nth-child(2) { animation-delay: 0.15s; }
.chatbot__loading-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes chatbot-bounce {
  0%, 80%, 100% { opacity: 0.4; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}

/* 입력 폼 */
.chatbot__form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border-color);
}

.chatbot__input {
  flex: 1;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--bg-primary);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition);
}

.chatbot__input:focus {
  border-color: var(--accent-color);
}

.chatbot__input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chatbot__send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: var(--accent-color);
  color: #FFFFFF;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity var(--transition);
}

.chatbot__send:hover:not(:disabled) {
  opacity: 0.85;
}

.chatbot__send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* 챗봇 모바일 반응형 */
@media (max-width: 480px) {
  .chatbot {
    bottom: 16px;
    right: 16px;
    left: 16px;
  }

  .chatbot__panel {
    width: 100%;
    max-height: 70vh;
  }

  .chatbot__toggle {
    position: fixed;
    bottom: 16px;
    right: 16px;
  }
}
