/* 폰트 및 CSS 변수 설정 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #667eea;
  --primary-light: #7c3aed;
  --primary-dark: #5a67d8;
  --secondary: #48bb78;
  --accent: #ed8936;
  --bg-light: #f7fafc;
  --bg-white: #ffffff;
  --text-dark: #2d3748;
  --text-gray: #718096;
  --border-color: #e2e8f0;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.07);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* 기본 스타일 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main {
  flex-grow: 1;
}

/* 스크롤바 커스텀 */
::-webkit-scrollbar {
  width: 12px;
}
::-webkit-scrollbar-track {
  background: var(--bg-light);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary), var(--primary-light));
  border-radius: 6px;
}

/* 네비게이션 */
nav {
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}
.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: glow 3s ease-in-out infinite;
}
@keyframes glow {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.2);
  }
}
.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}
.nav-links a {
  text-decoration: none;
  color: var(--text-gray);
  font-weight: 500;
  position: relative;
  transition: color 0.3s ease;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}
.nav-links a:hover {
  color: var(--primary);
}
.nav-links a:hover::after {
  width: 100%;
}

/* 히어로 섹션 */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 6rem 2rem 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="50" height="50" patternUnits="userSpaceOnUse"><path d="M 50 0 L 0 0 0 50" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}
.hero-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero-content h1 {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1rem;
  color: white;
  animation: slideInLeft 1s ease-out;
}
.hero-content h2 {
  font-size: 2rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2rem;
  animation: slideInLeft 1s ease-out 0.2s both;
}
.hero-content p {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 2rem;
  animation: slideInLeft 1s ease-out 0.4s both;
}
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.hero-buttons {
  display: flex;
  gap: 1rem;
  animation: slideInLeft 1s ease-out 0.6s both;
}
.btn {
  padding: 1rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  border: none;
  font-size: 1rem;
}
.btn-primary {
  background: white;
  color: var(--primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.5);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: white;
}
.hero-image {
  position: relative;
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}
.hero-image img {
  width: 100%;
  max-width: 500px;
  height: auto;
  border-radius: 20px;
  box-shadow: var(--shadow-xl);
}

/* 공통 섹션 스타일 */
.section {
  padding: 5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}
.section-title {
  font-size: 3rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 4rem;
  position: relative;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 소개 섹션 */
.about-content {
  background: white;
  padding: 3rem;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  font-size: 1.2rem;
  line-height: 1.8;
  position: relative;
  overflow: hidden;
  max-width: 800px;
  margin: 0 auto;
}
.about-content::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(102, 126, 234, 0.1),
    transparent
  );
  transform: rotate(45deg);
  transition: all 0.5s ease;
}
.about-content:hover::before {
  top: -100%;
  right: -100%;
}

/* 자격증 섹션 */
#certifications {
  background-color: var(--bg-white);
}
.certifications-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}
.cert-item {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background-color: var(--bg-light);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}
.cert-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  border-color: var(--primary);
}
.cert-icon {
  font-size: 2.5rem;
  color: var(--primary);
  flex-shrink: 0;
}
.cert-text h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.1rem;
  color: var(--text-dark);
}
.cert-text p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-gray);
}

/* 기술 스택 섹션 */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
}
.skill-card {
  background: white;
  padding: 2rem;
  border-radius: 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.skill-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 0;
}
.skill-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-xl);
  color: white;
}
.skill-card:hover::before {
  transform: translateY(0);
}
.skill-card i,
.skill-card h3 {
  position: relative;
  z-index: 1;
}
.skill-card i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--primary);
  transition: color 0.3s ease;
}
.skill-card:hover i {
  color: white;
}

/* 프로젝트 섹션 */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}
.project-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}
.project-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: var(--shadow-xl);
}
.project-image {
  position: relative;
  overflow: hidden;
  height: 250px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
}
.project-image i {
  font-size: 4rem;
  color: white;
  opacity: 0.8;
}
.project-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.project-card:hover .project-overlay {
  opacity: 1;
}
.view-project {
  color: white;
  font-size: 1.2rem;
  font-weight: 600;
  padding: 0.8rem 2rem;
  border: 2px solid white;
  border-radius: 50px;
  background: transparent;
  transition: all 0.3s ease;
}
.view-project:hover {
  background: white;
  color: var(--text-dark);
}
.project-content {
  padding: 2rem;
}
.project-content h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-dark);
}
.project-content p {
  color: var(--text-gray);
  margin-bottom: 1.5rem;
}
.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tech-tag {
  padding: 0.5rem 1rem;
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.1),
    rgba(124, 58, 237, 0.1)
  );
  color: var(--primary);
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 500;
}

/* 연락처 섹션 */
.contact-container {
  background: white;
  padding: 3rem;
  border-radius: 20px;
  box-shadow: var(--shadow-xl);
  max-width: 800px;
  margin: 0 auto;
}
.form-group {
  margin-bottom: 2rem;
}
.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-dark);
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: var(--bg-light);
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
.form-group textarea {
  resize: vertical;
  min-height: 150px;
}
.submit-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  padding: 1rem 3rem;
  border: none;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  position: relative;
  overflow: hidden;
}
.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}
.submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* 푸터 */
footer {
  background: var(--text-dark);
  color: rgba(255, 255, 255, 0.7);
  padding: 4rem 2rem;
  text-align: center;
}
.social-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}
.social-links a {
  color: white;
  font-size: 1.5rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}
.social-links a:hover {
  background: var(--primary);
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(102, 126, 234, 0.3);
}

/* ----------------------------- */
/* 모달 스타일                   */
/* ----------------------------- */

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}
.modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background-color: #ffffff;
  border-radius: 16px;
  z-index: 2001;
  width: 90%;
  max-width: 950px;
  max-height: 90vh;
  overflow-y: auto;
  opacity: 0;
  transition: all 0.3s ease-in-out;
}
.modal.active,
.modal-backdrop.active {
  display: block;
  opacity: 1;
}
.modal.active {
  transform: translate(-50%, -50%) scale(1);
}
.modal-content {
  padding: 2.5rem;
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2.5rem;
  color: #aaa;
  border: none;
  background: none;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}
.modal-close:hover {
  color: var(--text-dark);
}
.modal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}
.modal-icon {
  font-size: 2.2rem;
  color: var(--primary);
}
#modalProjectTitle {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
}

/* 모달 콘텐츠 스타일 */
.modal-content h4 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-dark);
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.08),
    rgba(124, 58, 237, 0.08)
  );
  padding: 0.8rem 1.2rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
}
.modal-content h4:first-of-type {
  margin-top: 0;
}
.modal-content h4::before {
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  margin-right: 0.8rem;
  color: var(--primary);
  font-size: 1.1rem;
  width: 1.25rem;
}
.icon-arch::before {
  content: '\f542'; /* fa-project-diagram */
}
.icon-desc::before {
  content: '\f15c'; /* fa-file-alt */
}
.icon-video::before {
  content: '\f144'; /* fa-circle-play */
}
.icon-features::before {
  content: '\f005'; /* fa-star */
}

.architecture-image {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin-bottom: 1rem;
}
#modalProjectDescription {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-gray);
  padding-left: 0.5rem;
}
.video-container {
  width: 100%;
}
.video-container video {
  width: 100%;
  height: auto;
  border-radius: 8px;
  background-color: #000;
}
.feature-list {
  list-style: none;
  padding-left: 0;
}
.feature-list li {
  padding: 0.5rem 0.5rem;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.feature-list li::before {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  color: var(--primary);
}

/* 모달 푸터 */
.modal-footer {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-top: 3rem;
  gap: 1.5rem;
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
}
.project-tech {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}
.modal-footer .tech-tag {
  color: var(--primary);
  background-color: #ebf5ff;
}

/* 기타 유틸리티 */
.spinner {
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
  display: inline-block;
  margin-left: 10px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.alert {
  padding: 1rem;
  border-radius: 10px;
  margin-top: 1rem;
  text-align: center;
  font-weight: 500;
  animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}
.alert-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-image {
    margin: 0 auto;
    width: 350px;
    height: 350px;
    object-fit: cover;
  }
  .hero-content h1 {
    font-size: 3rem;
  }
  .hero-buttons {
    justify-content: center;
  }
  .nav-links {
    display: none;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .modal-header {
    flex-direction: column;
    text-align: center;
  }
}
/* =================================
   에러 페이지 스타일
   ================================= */
.error-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  height: 100vh; /* 화면 전체 높이를 차지하도록 설정 */
  padding: 2rem;
  background-color: var(--bg-light);
}

.error-icon {
  font-size: 5rem;
  color: var(--accent);
  margin-bottom: 2rem;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-30px);
  }
  60% {
    transform: translateY(-15px);
  }
}

.error-code {
  font-size: 8rem;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(
    135deg,
    var(--primary-dark),
    var(--primary-light)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.error-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.error-description {
  font-size: 1.2rem;
  color: var(--text-gray);
  margin-bottom: 3rem;
  max-width: 500px;
}
