/* Critical CSS - 초기 렌더링 필수 스타일 */
/* 이 파일은 HTML 내 <style> 태그로 인라인화됩니다 */

/* === 기본 레이아웃 및 폰트 === */
:root {
  /* 시스템 폰트 (웹폰트 로딩 전 사용) */
  --font-system-fallback: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-code-fallback: 'SF Mono', 'Monaco', 'Consolas', monospace;
  
  /* 기본 색상 (다크 테마 고려) */
  --color-text: #2c3e50;
  --color-bg: #ffffff;
  --color-primary: #3498db;
  
  /* 기본 간격 */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  
  /* 반응형 폰트 크기 (최소한) */
  --font-size-base: clamp(1rem, 2vw, 1.25rem);
  --font-size-lg: clamp(1.125rem, 2.5vw, 1.5rem);
  --font-size-xl: clamp(1.25rem, 3vw, 1.75rem);
  --font-size-2xl: clamp(1.5rem, 4vw, 2rem);
}

/* 다크 테마 기본 색상 */
[data-theme="dark"] {
  --color-text: #ecf0f1;
  --color-bg: #2c3e50;
  --color-primary: #3498db;
}

/* === 기본 요소 스타일 === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-system-fallback);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* === 건너뛰기 링크 (접근성) === */
.skip-link {
  position: fixed;
  top: -100px;
  left: 20px;
  background: #000;
  color: #fff;
  padding: 12px 20px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  z-index: 9999;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 20px;
}

/* === 프레젠테이션 컨테이너 기본 === */
.presentation-container {
  width: 100vw;
  height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === 슬라이드 기본 스타일 === */
.slide {
  width: 90vw;
  height: 80vh;
  max-width: 1200px;
  padding: var(--spacing-xl);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: var(--color-bg);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  
  /* 성능 최적화 */
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.slide.active {
  display: flex;
}

/* === 기본 타이포그래피 === */
h1, h2, h3 {
  font-weight: 700;
  margin-bottom: var(--spacing-md);
  line-height: 1.2;
}

h1 {
  font-size: var(--font-size-2xl);
}

h2 {
  font-size: var(--font-size-xl);
}

h3 {
  font-size: var(--font-size-lg);
}

p {
  margin-bottom: var(--spacing-md);
  line-height: 1.6;
}

/* === 스크린 리더 전용 === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* === 로딩 상태 === */
.loading {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.loaded {
  opacity: 1;
  transform: translateY(0);
}

/* === 모바일 최적화 === */
@media (max-width: 768px) {
  .slide {
    width: 95vw;
    height: 85vh;
    padding: var(--spacing-lg);
  }
  
  h1 {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }
  
  h2 {
    font-size: clamp(1.25rem, 5vw, 1.75rem);
  }
}

/* === 애니메이션 감소 모드 === */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01s !important;
    transition-duration: 0.01s !important;
  }
}

/* === 고대비 모드 === */
@media (prefers-contrast: high) {
  :root {
    --color-text: #000;
    --color-bg: #fff;
  }
  
  [data-theme="dark"] {
    --color-text: #fff;
    --color-bg: #000;
  }
}