/* ====================================
   Global Base Styles
   ==================================== */

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  font-family: 'Inter', 'Noto Sans KR', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 커스텀 스크롤바 (Webkit) */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f3f4f6;
}

.dark ::-webkit-scrollbar-track {
  background: #1f2937;
}

::-webkit-scrollbar-thumb {
  background: #60a5fa;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #2563eb;
}

/* 글로벌 색상 전환 애니메이션 (다크모드) */
*, *::before, *::after {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.15s ease;
}

/* 애니메이션 요소는 색상 전환 제외 */
.reveal,
.floating-circle,
.cursor-blink,
.animate-bounce {
  transition: unset;
}

.reveal {
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* ====================================
   Navigation Bar
   ==================================== */

#navbar {
  background: transparent;
}

#navbar.scrolled {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.08);
  -webkit-backdrop-filter: blur(12px);
}

.dark #navbar.scrolled {
  background: rgba(17, 24, 39, 0.85);
}

/* Active navigation link */
nav a.active-nav-link {
  color: #2563eb;
  border-bottom: 2px solid #2563eb;
  padding-bottom: 2px;
}

.dark nav a.active-nav-link {
  color: #60a5fa;
  border-color: #60a5fa;
}

/* ====================================
   Hero Section
   ==================================== */

/* 배경 부유 원형 */
.floating-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  animation: float 8s ease-in-out infinite;
}

.circle-1 {
  width: 600px;
  height: 600px;
  top: -200px;
  right: -200px;
  animation-delay: 0s;
}

.circle-2 {
  width: 400px;
  height: 400px;
  bottom: -100px;
  left: -100px;
  animation-delay: -4s;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-30px) scale(1.05);
  }
}

/* 타이핑 커서 깜빡임 */
.cursor-blink {
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* ====================================
   Scroll Reveal Animations
   ==================================== */

.reveal {
  opacity: 0;
  transform: translateY(30px);
}

.reveal.reveal-left {
  transform: translateX(-30px);
}

.reveal.reveal-right {
  transform: translateX(30px);
}

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

/* 타임라인 항목 딜레이 */
.timeline-item:nth-child(2) .reveal {
  transition-delay: 0.1s;
}

.timeline-item:nth-child(3) .reveal {
  transition-delay: 0.2s;
}

.timeline-item:nth-child(4) .reveal {
  transition-delay: 0.3s;
}

/* ====================================
   Mobile Menu Animation
   ==================================== */

#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

#mobile-menu:not(.hidden) {
  max-height: 500px;
}

/* ====================================
   Responsive Adjustments
   ==================================== */

@media (max-width: 768px) {
  html {
    scroll-padding-top: 64px;
  }

  .floating-circle {
    animation: float-mobile 10s ease-in-out infinite;
  }

  @keyframes float-mobile {
    0%, 100% {
      transform: translateY(0) scale(0.8);
    }
    50% {
      transform: translateY(-20px) scale(0.85);
    }
  }
}

/* ====================================
   Form Elements
   ==================================== */

input[type="text"],
input[type="email"],
textarea {
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.dark input[type="text"]:focus,
.dark input[type="email"]:focus,
.dark textarea:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* ====================================
   Toast Notification
   ==================================== */

.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ====================================
   Print Styles
   ==================================== */

@media print {
  #navbar,
  #contact-form,
  footer {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .dark {
    background: white;
    color: black;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
