:root {
  --primary-blue: #3B82F6;
  --primary-purple: #8B5CF6;
  --primary-black: #0F172A;
  --bg-overlay: rgba(0, 0, 0, 0.75);
  --accent-color: #FF6F61;
  --text-color: #E2E8F0;
  --transition-speed: 0.3s;
}

/* 기본 리셋 및 타이포그래피 */
body {
  font-family: 'Inter', sans-serif;
  background: var(--primary-black);
  color: var(--text-color);
  margin: 0;
  padding: 60px 0 0 0;
  overflow-x: hidden;
  line-height: 1.6;
}
h1, h2, h3, h4, h5, h6 { margin: 0 0 1rem; line-height: 1.2; }
p { margin-bottom: 1rem; }
a { color: var(--primary-blue); text-decoration: none; transition: color var(--transition-speed) ease; }
a:hover { color: var(--primary-purple); }

/* 네비게이션 */
nav {
  backdrop-filter: blur(10px);
  background: linear-gradient(90deg, rgba(15,23,42,0.9), rgba(15,23,42,0.95));
  border-bottom: 1px solid rgba(226,232,240,0.1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
nav.fixed {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px; /* nav 바 높이 */
  z-index: 1000;
}

/* .container 클래스에 h-full 추가하여 부모(nav)의 높이를 상속받음 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 100%;
}

/* nav 내부의 링크들이 수직 중앙에 오도록 */
nav .menu a {
  line-height: 60px; /* nav 높이와 동일하게 설정 */
}

/* 모바일 메뉴 버튼도 중앙에 정렬 */
#mobile-menu-button {
  line-height: 60px;
}

/* 언어 스위처 */
.language-switcher {
  position: fixed; top: 70px; right: 20px; z-index: 1100;
}
.language-switcher button {
  background: linear-gradient(45deg, var(--primary-blue), var(--primary-purple));
  border: none; color: var(--text-color); padding: 0.5rem 1rem; margin: 0.25rem;
  border-radius: 6px; cursor: pointer;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.language-switcher button:hover {
  box-shadow: 0 0 10px var(--primary-purple); transform: scale(1.05);
}
.section-header h2 {
  font-size: 2.5rem;
  color: #3B82F6; /* var(--primary-blue) */
}
.section-header p {
  font-size: 1rem;
  color: #ccc;
}



/* 파티클, 배경 그리드, 오버레이 */
#particles-js { position: fixed; width: 100%; height: 100%; top: 0; left: 0; z-index: -3; }
.cyber-grid {
  background-image: linear-gradient(to right, rgba(59,130,246,0.2) 2px, transparent 2px),
    linear-gradient(to bottom, rgba(139,92,246,0.2) 2px, transparent 2px),
    linear-gradient(45deg, rgba(59,130,246,0.05) 1px, transparent 1px);
  background-size: 30px 30px; animation: gridMove 40s linear infinite;
  position: fixed; inset: 0; z-index: -2;
}
@keyframes gridMove { 0% { background-position: 0 0, 0 0, 0 0; } 100% { background-position: 20px 20px, 20px 20px, 40px 40px; } }
.background-overlay { position: fixed; inset: 0; background: radial-gradient(circle at center, var(--bg-overlay) 0%, rgba(0,0,0,0.9) 100%); z-index: -1; }
#threejs-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.content-layer { position: relative; z-index: 2; }
#transition-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--primary-black); opacity: 0; pointer-events: none; z-index: 900; }

/* 프리로더 */
#preloader {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  z-index: 2000; animation: preloaderFadeOut 0.5s forwards;
}
#preloader.fade-out { opacity: 0; pointer-events: none; }
.preloader-content { text-align: center; color: #fff; animation: contentRise 1s ease-out; }
.preloader-content h1 { font-size: 2.8rem; margin-bottom: 1rem; text-shadow: 0 2px 10px rgba(0,0,0,0.3); }
.preloader-content span { font-size: 1.5rem; display: block; margin-bottom: 1rem; }
.spinner {
  border: 4px solid rgba(255,255,255,0.3); border-top: 4px solid #fff;
  border-radius: 50%; width: 50px; height: 50px; animation: spin 1s linear infinite; margin-top: 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes contentRise { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes preloaderFadeOut { from { opacity: 1; } to { opacity: 0; } }

/* 홈 섹션 */
#home {
  min-height: 70vh;
  display: flex;
  flex-direction: column; /* 섹션 내부 요소를 세로로 정렬 */
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 2rem 1rem;
  padding-top: 2rem; /* 섹션 상단 패딩 조정 */
}

.section-header {
  text-align: center;
  margin-bottom: 2rem; /* 헤더와 컨텐츠 사이의 간격 조정 */
}

.home-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
  text-align: center;
  padding: 2rem;
  background: rgba(15,23,42,0.8);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.7);
}

@media (min-width: 768px) {
  .home-container {
    flex-direction: row;
    text-align: left;
    justify-content: space-between;
  }
}
.home-text {
  max-width: 600px; padding: 2rem; border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.7); border: 1px solid rgba(59,130,246,0.4);
  transition: box-shadow 0.3s ease, transform 0.3s ease; background: rgba(15,23,42,0.85);
  position: relative; will-change: transform, opacity;
}
.home-text::after {
  content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.05), transparent);
  pointer-events: none;
}
.home-text:hover { box-shadow: 0 12px 30px rgba(0,0,0,0.9); transform: translateY(-5px); }
.home-text h1 { font-size: 3rem; margin-bottom: 1rem; }
.home-text p { font-size: 1.2rem; }
.cta-button {
  background: var(--accent-color); color: var(--text-color); padding: 1rem 2rem;
  border: none; border-radius: 8px; font-size: 1.2rem; cursor: pointer;
  transition: transform 0.3s ease, background 0.3s ease; margin-top: 1.5rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.cta-button:hover { transform: translateY(-3px); background: #e65c57; }
#typed-extra { font-size: 1.5rem; color: var(--primary-blue); margin-top: 1rem; min-height: 40px; }
.profile-pic-wrapper { flex-shrink: 0; transition: transform 0.3s ease; }
.profile-pic {
  width: 300px; height: 300px; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--primary-blue); box-shadow: 0 6px 20px rgba(0,0,0,0.7);
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}
.profile-pic:hover { transform: scale(1.05); box-shadow: 0 10px 30px rgba(0,0,0,0.8); }
@media (max-width: 640px) { .profile-pic { width: 200px; height: 200px; } }

/* 공통 스타일 (GitHub, Email, Discord) */
.copyable, .github-link {
  transition: color 0.3s ease-in-out, text-shadow 0.3s ease-in-out;
  cursor: pointer; /* 클릭 가능하게 */
  color: #E2E8F0; /* 기본 텍스트 색상 */
  text-decoration: none;
}

/* 마우스를 올리면 색상 변화 */
.copyable:hover, .github-link:hover {
  color: #3B82F6; /* 주황색 */
  text-shadow: 0 0 10px #3B82F6;
}

/* 클릭하면 순간적으로 색이 바뀜 */
.copyable:active, .github-link:active {
  color: #3B82F6; /* 오렌지색 */
  text-shadow: 0 0 15px #3B82F6;
}




/* 프로젝트 카드 */
.quantum-card {
  position: relative; background-color: #1a1a1a; border-radius: 20px; overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease; box-shadow: 0 4px 15px rgba(0,0,0,0.6);
  border: 2px solid #3B82F6; margin: 0 auto; will-change: transform, opacity;
}
.quantum-card:hover { transform: translateY(-5px) scale(1.02); box-shadow: 0 12px 24px rgba(0,0,0,0.8); }
.card-content { padding: 1.8rem; }
.image-container { height: 12rem; overflow: hidden; border-radius: 0.75rem; }
.image-container img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.image-container img:hover { transform: scale(1.03); }
.text-container { margin-top: 1rem; }
.text-container h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.text-container p { font-size: 0.95rem; margin-bottom: 0.75rem; color: #ccc; }
.details-button,
.project-link-button {
  background: var(--primary-blue); border: none; padding: 0.75rem 1.5rem;
  border-radius: 8px; cursor: pointer; font-weight: 600;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3); color: var(--text-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.details-button:hover,
.project-link-button:hover {
  background: var(--primary-purple); transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.4); color: #ffffff;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}

/* 연락처 박스 */
.contact-box {
  background: #1a1a1a; border-radius: 12px; padding: 1.5rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.6); border: 2px solid #3B82F6;
  transition: transform 0.3s ease, box-shadow 0.3s ease; margin: 0 auto;
  max-width: 500px;
}
.contact-box:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 8px 16px rgba(0,0,0,0.8); }

/* Nexus 섹션 */
.nexus-container {
  background: rgba(15,23,42,0.95); border-radius: 20px;
  border: 1px solid rgba(99,102,241,0.3); box-shadow: 0 0 40px rgba(99,102,241,0.1);
  backdrop-filter: blur(12px); overflow: hidden; position: relative;
  margin: 2rem auto; max-width: 1200px;
}
.nexus-tabs {
  display: flex; justify-content: center;
  border-bottom: 1px solid rgba(99,102,241,0.2);
  background: linear-gradient(90deg, rgba(99,102,241,0.1) 0%, rgba(199,210,254,0.05) 50%, rgba(99,102,241,0.1) 100%);
}
.nexus-tab {
  position: relative; padding: 1.5rem 4rem; border: none; background: none;
  color: #E0E7FF; cursor: pointer; transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.nexus-tab.active { background: linear-gradient(90deg, rgba(99,102,241,0.2), rgba(99,102,241,0.1)); }
.tab-glow {
  position: absolute; inset: 0;
  background: radial-gradient(circle at center, rgba(99,102,241,0.4) 0%, transparent 70%);
  opacity: 0; transition: opacity 0.3s ease;
}
.nexus-tab:hover .tab-glow { opacity: 1; }

/* 퀀텀 그리드 */
.quantum-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem; padding: 2rem; position: relative;
}
.quantum-grid::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(45deg, transparent 48%, rgba(99,102,241,0.1) 50%, transparent 52%);
  background-size: 4px 4px; pointer-events: none;
}

/* 기술 스택 매트릭스 */
.tech-matrix {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1.5rem; padding: 1rem 2rem;
}
.tech-cell {
  position: relative; padding: 1.5rem; border-radius: 12px;
  background: rgba(15,23,42,0.8); border: 1px solid rgba(99,102,241,0.3);
  transition: all 0.3s ease;
}
.tech-orb {
  width: 80px; height: 80px; margin: 0 auto; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(99,102,241,0.4), transparent 70%);
  display: grid; place-items: center;
}
.tech-icon {
  width: 50px; height: 50px; filter: drop-shadow(0 0 8px rgba(99,102,241,0.3));
  transition: transform 0.3s ease;
}
.tech-cell:hover .tech-icon { transform: scale(1.1) rotate(15deg); }
.tech-progress {
  height: 4px; background: rgba(199,210,254,0.1);
  border-radius: 2px; margin: 1rem 0; overflow: hidden;
}
.tech-bar { height: 100%; background: linear-gradient(90deg, #6366F1, #8B5CF6); transition: width 0.8s ease; }

/* 모달 */
.project-modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.95); display: flex; justify-content: center; align-items: center;
  z-index: 1000; opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.project-modal.active { opacity: 1; pointer-events: all; }
.project-modal-content {
  position: relative; background: linear-gradient(135deg, rgba(10,10,10,0.95), rgba(5,5,5,0.95));
  border: 2px solid transparent;
  border-image: linear-gradient(45deg, var(--primary-blue), var(--primary-purple)) 1;
  border-radius: 12px; padding: 2rem; max-width: 800px; width: 90%;
  max-height: 90vh; overflow-y: auto; animation: zoomIn 0.5s ease-out forwards;
  box-shadow: 0 0 30px rgba(59,130,246,0.5), 0 0 50px rgba(139,92,246,0.3);
}
@keyframes zoomIn {
  from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; }
}
.project-modal-close {
  position: absolute; top: 1rem; right: 1rem;
  background: rgba(0,0,0,0.8); border: none; font-size: 1.5rem; color: var(--text-color);
  cursor: pointer; padding: 0.25rem 0.5rem; border-radius: 4px;
  transition: background var(--transition-speed) ease;
}
.project-modal-close:hover { background: var(--primary-purple); }

/* Footer */
.footer-time {
  position: fixed; bottom: 20px; left: 20px; z-index: 1100;
  background: linear-gradient(45deg, var(--primary-blue), var(--primary-purple));
  color: var(--text-color); padding: 0.5rem 1rem; border-radius: 12px;
  font-size: 1rem; box-shadow: 0 0 15px rgba(59,130,246,0.5);
  transition: transform 0.3s ease;
}
.footer-time:hover { transform: scale(1.05); }

/* 커스텀 스크롤바 */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--primary-black); }
::-webkit-scrollbar-thumb { background: var(--primary-purple); border-radius: 4px; }
html { scrollbar-width: thin; scrollbar-color: var(--primary-purple) var(--primary-black); }

/* 신규 디자인 요소 예시 */
.cyber-border { position: relative; }
.cyber-border::before {
  content: ''; position: absolute; inset: 0;
  border: 2px solid; border-image: linear-gradient(45deg, #3B82F6, #c0f65c) 1;
  filter: drop-shadow(0 0 10px rgba(59,130,246,0.5));
}

/* prefers-reduced-motion (애니메이션 최적화) */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
