/* css/main.css - 전역 변수, 리셋, 레이아웃 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;600;700;800&display=swap');

/* ===== CSS 변수 ===== */
:root {
  /* 컬러 팔레트 */
  --bg-primary: #0a0a14;
  --bg-secondary: #111128;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(139, 92, 246, 0.4);

  /* 브랜드 컬러 */
  --purple-primary: #8b5cf6;
  --purple-light: #a78bfa;
  --purple-dark: #6d28d9;
  --indigo: #6366f1;
  --pink: #ec4899;

  /* 그라디언트 */
  --grad-primary: linear-gradient(135deg, #8b5cf6 0%, #6366f1 50%, #ec4899 100%);
  --grad-card: linear-gradient(135deg, rgba(139,92,246,0.1) 0%, rgba(99,102,241,0.05) 100%);
  --grad-text: linear-gradient(135deg, #a78bfa, #818cf8, #f472b6);

  /* 텍스트 */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* 폰트 */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* 간격 */
  --container-max: 1200px;
  --container-pad: clamp(1rem, 4vw, 2rem);
  --section-pad: clamp(3rem, 8vw, 6rem);

  /* 효과 */
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.15);
  --radius-card: 16px;
  --radius-btn: 50px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== 리셋 ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; outline: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ===== 레이아웃 ===== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.section {
  padding: var(--section-pad) 0;
}

/* ===== 배경 효과 ===== */
body::before {
  content: '';
  position: fixed;
  top: -30%;
  left: -20%;
  width: 60%;
  height: 60%;
  background: radial-gradient(circle, rgba(139,92,246,0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -20%;
  right: -10%;
  width: 50%;
  height: 50%;
  background: radial-gradient(circle, rgba(99,102,241,0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
}

/* ===== 메인 콘텐츠 ===== */
#page-content {
  min-height: calc(100vh - 80px);
}

/* ===== 반응형 그리드 ===== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ===== 유틸리티 ===== */
.text-center { text-align: center; }
.text-gradient {
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
}

/* ===== 페이지 전환 애니메이션 ===== */
.page-enter {
  animation: pageEnter 0.4s ease forwards;
}

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

/* ===== 로딩 스피너 ===== */
.spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4rem;
}

.spinner::after {
  content: '';
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--purple-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== 스크롤바 ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--purple-dark); border-radius: 3px; }
