/*
 * Base CSS — Reset + Typography
 */

/* modern-normalize / reset */
*, *::before, *::after {
    box-sizing: border-box;
}
html {
    line-height: 1.15;
    -webkit-text-size-adjust: 100%;
}
body {
    margin: 0;
    font-family: var(--font-body);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color var(--duration-base), color var(--duration-base);
    line-height: 1.7; /* 한글 고려 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6, p {
    margin: 0;
    padding: 0;
}
a {
    color: inherit;
    text-decoration: none;
    transition: color var(--duration-fast);
}
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Typography Scale */
h1, .h1, h2, .h2, h3, .h3, h4, .h4 {
    font-family: var(--font-heading);
}

.h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-weight: 700;
    text-wrap: balance;
}
.h2 {
    font-size: 2.5rem;
    line-height: 1.15;
    letter-spacing: -0.015em;
    font-weight: 700;
    text-wrap: balance;
}
.h3 {
    font-size: 1.75rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
    font-weight: 600;
}
.h4 {
    font-size: 1.25rem;
    line-height: 1.35;
    font-weight: 600;
}
.body-lg {
    font-size: 1.125rem;
    line-height: 1.7;
    font-weight: 400;
}
.caption {
    font-size: 0.875rem;
    line-height: 1.5;
    font-weight: 400;
}
.label {
    font-size: 0.75rem;
    line-height: 1.4;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }

.bg-surface {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

/* Additional Typography */
.body-md {
    font-size: 1rem;
    line-height: 1.7;
    font-weight: 400;
}
.body-sm {
    font-size: 0.875rem;
    line-height: 1.6;
    font-weight: 400;
}

/* ==========================================================================
   Korean Word-Break (M-1)
   ========================================================================== */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4,
.body-lg, .hero-title, .hero-subtitle {
    word-break: keep-all;
    overflow-wrap: break-word;
}

/* ==========================================================================
   Mobile Typography Scale (M-2)
   ========================================================================== */
@media (max-width: 767px) {
    .h1 {
        font-size: 2.25rem;
        letter-spacing: -0.015em;
    }
    .h2 {
        font-size: 1.75rem;
    }
    .h3 {
        font-size: 1.375rem;
    }
    .body-lg {
        font-size: 1rem;
    }
}

/* ==========================================================================
   Scroll Reveal Animations (전체 페이지 공통)
   ========================================================================== */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--duration-reveal) var(--easing-out),
                transform var(--duration-reveal) var(--easing-out);
}
.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Accessibility (P3-12, P3-13)
   ========================================================================== */
/* 키보드 포커스 인디케이터 */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--rounded-sm);
}
:focus:not(:focus-visible) {
    outline: none;
}

/* 스킵 내비게이션 */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--accent);
    color: var(--on-accent);
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 999;
    transition: top 0.2s;
    border-radius: 0 0 var(--rounded-md) 0;
}
.skip-link:focus {
    top: 0;
}

/* ==========================================================================
   Custom Cursor (P3-14)
   ========================================================================== */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--text-primary);
    mix-blend-mode: difference;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
    will-change: transform;
}
.custom-cursor.is-hovering {
    width: 48px;
    height: 48px;
    background-color: rgba(255, 255, 255, 0.8);
}
@media (hover: none) {
    .custom-cursor {
        display: none;
    }
}
