/* tokens.css — 웹디자인 소스 공통 토큰
   모든 부품이 이 변수만 씁니다. 값을 바꾸면 부품 전체가 같이 바뀝니다.
   강조색은 --color-accent 하나만 바꾸면 눌림 · 옅은 바탕 색이 따라 바뀝니다(:root에서 바꿀 때). */

:root {
  /* ── 색: 바탕 ───────────────────────── */
  --color-bg: #f4f7fb;
  --color-surface: #ffffff;
  --color-surface-2: #f4f7fb;
  --color-surface-3: #e8eef6;

  /* ── 색: 글자 ───────────────────────── */
  --color-text: #0f1f38;
  --color-text-2: #46566f;
  --color-text-3: #5c6b82;
  --color-text-disabled: #8792a3;
  --color-text-inverse: #ffffff;

  /* ── 색: 선 ─────────────────────────── */
  --color-border: #d6deea;
  --color-border-strong: #a7b4c6;

  /* ── 색: 강조 (하나만 바꾸면 파생 색이 따라감) ── */
  --color-accent: #2a78d6;
  --color-accent-hover: color-mix(in oklab, var(--color-accent), #000 12%);
  --color-accent-pressed: color-mix(in oklab, var(--color-accent), #000 24%);
  --color-accent-soft: color-mix(in oklab, var(--color-accent), #fff 89%);
  --color-accent-soft-2: color-mix(in oklab, var(--color-accent), #fff 76%);
  --color-accent-text: color-mix(in oklab, var(--color-accent), #000 18%);
  --color-on-accent: #ffffff;

  /* ── 색: 상태 ───────────────────────── */
  --color-success: #12805a;
  --color-success-hover: #0e6b4b;
  --color-success-soft: #e2f4ec;
  --color-danger: #c93636;
  --color-danger-hover: #ad2b2b;
  --color-danger-soft: #fdebeb;
  --color-warning: #9a5b00;
  --color-warning-soft: #fff3dc;
  --color-on-status: #ffffff;

  /* ── 색: 덮개 · 뼈대 · 어두운 띠 ─────── */
  --color-overlay: rgb(15 31 56 / 0.48);
  --color-skeleton: #e3e9f2;
  --color-skeleton-shine: #f5f8fb;
  --color-inverse: #15233a;

  /* ── 초점 ───────────────────────────── */
  --color-focus: var(--color-accent);
  --focus-ring-width: 3px;
  --focus-ring-offset: 2px;

  /* ── 글꼴 (파일을 넣지 않음 · 설치된 글꼴 순서로 씀) ── */
  --font-sans: Pretendard, "Pretendard Variable", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "D2Coding", monospace;

  /* ── 글자 크기 단계 (코드 13 · 그 밖 14 이상) ── */
  --text-code: 13px;
  --text-sm: 14px;
  --text-md: 15px;
  --text-lg: 17px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 30px;
  --text-4xl: 40px;
  --leading-tight: 1.3;
  --leading-normal: 1.55;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* ── 간격 ───────────────────────────── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* ── 모서리 ─────────────────────────── */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* ── 그림자 ─────────────────────────── */
  --shadow-sm: 0 1px 2px rgb(15 31 56 / 0.06);
  --shadow-md: 0 1px 2px rgb(15 31 56 / 0.05), 0 6px 18px rgb(15 31 56 / 0.07);
  --shadow-lg: 0 12px 32px rgb(15 31 56 / 0.16);

  /* ── 크기 ───────────────────────────── */
  --control-h: 44px;
  --control-h-sm: 36px;
  --icon-sm: 20px;
  --icon-md: 24px;
  --icon-lg: 32px;
  --content-max: 720px;

  /* ── 움직임: 시간 ───────────────────── */
  --duration-instant: 80ms;
  --duration-fast: 140ms;
  --duration-base: 220ms;
  --duration-slow: 360ms;
  --duration-slower: 600ms;
  --duration-spring: 700ms;

  /* ── 움직임: 이징 ───────────────────── */
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-linear: linear;
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ── 겹침 순서 ──────────────────────── */
  --z-sticky: 10;
  --z-banner: 20;
  --z-dropdown: 30;
  --z-overlay: 40;
  --z-modal: 50;
  --z-toast: 60;
}

/* 스프링: linear()를 읽는 브라우저는 실제 감쇠 진동 곡선(넘침 약 16%)을 씀 */
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --ease-spring: linear(0, 0.047, 0.166, 0.327, 0.503, 0.675, 0.828, 0.954, 1.049, 1.114, 1.15, 1.163, 1.158, 1.14, 1.114, 1.086, 1.057, 1.032, 1.01, 0.994, 0.983, 0.976, 0.974, 0.974, 0.977, 0.981, 0.985, 0.99, 0.994, 0.998, 1.001, 1.003, 1.004, 1.004, 1.004, 1.004, 1.003, 1.003, 1.002, 1.001, 1);
  }
}

/* 움직임 줄이기를 켠 사용자: 시간 토큰을 거의 0으로 */
@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-instant: 1ms;
    --duration-fast: 1ms;
    --duration-base: 1ms;
    --duration-slow: 1ms;
    --duration-slower: 1ms;
    --duration-spring: 1ms;
  }
}
