/* 디자인 토큰의 유일한 정의 위치. 값은 docs/design-system.md 표와 같다. */
/* 글꼴 파일은 자체 호스팅한다(외부 요청 없음). 라이선스는 fonts/ 안에 있다. */
@font-face {
  font-family: "Pretendard Variable";
  src: url("/theme/fonts/PretendardVariable.woff2") format("woff2-variations");
  font-weight: 45 920;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/theme/fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* 글꼴 */
  --font-body: "Pretendard Variable", -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
  --font-code: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --text-caption: 0.75rem;
  --text-label: 0.8125rem;
  --text-body: 0.875rem;
  --text-title: 1.125rem;
  --text-heading: 1.5rem;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-bold: 600;
  --leading-body: 1.5;
  --leading-tight: 1.25;

  /* 모서리, 간격(4pt 격자, 조밀) */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --space-1: 2px;
  --space-2: 4px;
  --space-3: 8px;
  --space-4: 12px;
  --space-5: 16px;
  --space-6: 24px;

  /* 틀 */
  --header-height: 48px;
  --dialog-width-s: 360px;
  --dialog-width-m: 480px;
  --dialog-width-l: 640px;
  --form-max-width: 640px;
  --content-max-width: 960px;
  --hit-target: 24px;

  /* 움직임 */
  --motion-fast: 120ms;
  --motion-base: 200ms;
  --motion-ease: cubic-bezier(0.2, 0, 0, 1);

  /* 강조 */
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --on-accent: #ffffff;
  --focus-ring: #2563eb;

  /* 상태 */
  --success: #15803d;
  --warning: #9a4a0a;
  --danger: #b91c1c;
  --danger-hover: #991b1b;
  --on-danger: #ffffff;

  /* 바탕, 선, 글자, 유리 */
  --bg: #f8fafc;
  --orb-a: rgba(37, 99, 235, 0.26);
  --orb-b: rgba(139, 92, 246, 0.2);
  --orb-c: rgba(14, 165, 233, 0.18);
  --surface: rgba(255, 255, 255, 0.62);
  --surface-strong: rgba(255, 255, 255, 0.82);
  --surface-tint-success: rgba(21, 128, 61, 0.1);
  --surface-tint-warning: rgba(180, 83, 9, 0.12);
  --surface-tint-danger: rgba(185, 28, 28, 0.1);
  --surface-tint-accent: rgba(37, 99, 235, 0.12);
  --overlay: rgba(15, 23, 42, 0.4);
  --border: rgba(15, 23, 42, 0.12);
  --border-control: #7b8799;
  --border-glass: rgba(255, 255, 255, 0.7);
  --text: #0f172a;
  --text-muted: #475569;
  --shadow-glass: 0 8px 32px rgba(15, 23, 42, 0.12);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --blur-glass: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --on-accent: #0b1220;
    --focus-ring: #93c5fd;
    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #f87171;
    --danger-hover: #fca5a5;
    --on-danger: #1a0505;
    --bg: #0b1220;
    --orb-a: rgba(96, 165, 250, 0.22);
    --orb-b: rgba(167, 139, 250, 0.18);
    --orb-c: rgba(34, 211, 238, 0.12);
    --surface: rgba(30, 41, 59, 0.55);
    --surface-strong: rgba(30, 41, 59, 0.82);
    --surface-tint-success: rgba(74, 222, 128, 0.14);
    --surface-tint-warning: rgba(251, 191, 36, 0.14);
    --surface-tint-danger: rgba(248, 113, 113, 0.14);
    --surface-tint-accent: rgba(96, 165, 250, 0.18);
    --overlay: rgba(0, 0, 0, 0.55);
    --border: rgba(226, 232, 240, 0.16);
    --border-control: #6b7a90;
    --border-glass: rgba(255, 255, 255, 0.12);
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.45);
    --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  }
}

@media (pointer: coarse) {
  :root { --hit-target: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  :root { --motion-fast: 0ms; --motion-base: 0ms; }
}
