/*
 * base.css — 전역 리셋 + body + .app-container.
 * 어떤 페이지든 가장 먼저 임포트되는 두 번째 파일 (tokens.css 다음).
 */

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

html {
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
}

body {
    background: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    font-weight: var(--weight-regular);
    line-height: 1.5;

    /* iOS 의 자동 줌인 방지를 위해 입력 폰트가 16px 이상이어야 함 → base 가 15px 이라 입력은 별도 16 강제 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    /* 아이폰 노치 안전 영역 — 모든 페이지에 적용 */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);

    min-height: 100vh;
    /* iOS Safari 의 100vh 부정확 문제 — dvh 가 동적으로 정확 */
    min-height: 100dvh;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    font-size: inherit;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
}

input,
textarea,
select {
    font-family: inherit;
    color: inherit;
}

/* ── 앱 컨테이너 (데스크탑에선 480px 가운데 정렬, 양 옆 검정) ──────── */
.app-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg-base);
    position: relative;
}

/* ── 유틸 ─────────────────────────────────────────────────────── */
.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;
}
