/*
 * 100년의 편지 공통 디자인 토큰 / 접근성 기본 스타일.
 * - 모든 고객 화면(main, letter, info)이 각 화면 CSS 보다 먼저 불러온다.
 * - 이 파일은 CSS 변수와 포커스·모션 같은 표현 규칙만 정의한다.
 *   레이아웃이나 display/visibility 를 바꾸는 규칙은 두지 않는다.
 */

:root {
    /* ---------- 색상: 브랜드 ---------- */
    --color-primary: #8b4e2f;
    --color-primary-hover: #74401f;
    --color-primary-active: #5f3418;
    --color-on-primary: #fff;

    --color-secondary-bg: #f3e7d7;
    --color-secondary-bg-hover: #eadac4;
    --color-secondary-bg-active: #e0cdb3;
    --color-secondary-text: #5a3d2d;
    --color-secondary-border: #cbb69b;

    /* ---------- 색상: 배경 / 표면 ---------- */
    --color-background: #f5f1e8;
    --color-background-top: #fffdf8;
    --color-background-bottom: #efe6d5;
    --color-surface: #fffdf7;
    --color-surface-muted: #f8f2e7;
    --color-surface-raised: #fff;

    /* ---------- 색상: 텍스트 ---------- */
    --color-text-primary: #252525;
    --color-text-secondary: #5b4b3b;
    --color-text-muted: #6b6257;
    --color-text-inverse: #fff;

    /* ---------- 색상: 경계선 ---------- */
    --color-border: #d9c9aa;
    --color-border-subtle: #eee4d5;
    --color-border-strong: #9d8b76;

    /* ---------- 색상: 상태 ---------- */
    --color-error: #b42318;
    --color-error-bg: #fdf1ef;
    --color-warning: #a15c07;
    --color-success: #2e7d32;
    --color-focus: #8b4e2f;
    --color-overlay: rgba(20, 15, 10, .58);

    /* ---------- 타이포그래피 ---------- */
    --font-sans: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
                 "Malgun Gothic", "맑은 고딕", "Noto Sans KR", sans-serif;
    --font-serif: Georgia, "Noto Serif KR", "Nanum Myeongjo", "AppleMyungjo", serif;

    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-md: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;

    --line-height-tight: 1.4;
    --line-height-base: 1.6;
    --line-height-relaxed: 1.85;

    /* ---------- 간격 ---------- */
    --spacing-2xs: 4px;
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* ---------- 모서리 ---------- */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 999px;

    /* ---------- 그림자 ---------- */
    --shadow-sm: 0 1px 2px rgba(81, 57, 31, .08);
    --shadow-md: 0 8px 24px rgba(81, 57, 31, .10);
    --shadow-lg: 0 18px 50px rgba(81, 57, 31, .14);
    --shadow-modal: 0 20px 70px rgba(0, 0, 0, .28);

    /* ---------- 컨트롤 ---------- */
    --control-height: 48px;
    --touch-target: 44px;
    --focus-ring-width: 3px;
    --focus-ring-offset: 2px;
    --transition-fast: 150ms ease;
}

/* 확대·회전 시 모바일 브라우저가 글자 크기를 임의로 키우지 않도록 한다. */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* 키보드 사용자를 위한 공통 포커스 표시 (마우스 클릭 시에는 표시되지 않는다). */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: var(--focus-ring-width) solid var(--color-focus);
    outline-offset: var(--focus-ring-offset);
}

/* 움직임 줄이기 설정을 존중한다. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}
