/* JANDI base styles. Import after assets/tokens.css when global base styles are desired. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* html의 font-size는 브라우저 기본(보통 16px)을 그대로 둔다 — rem의 기준.
 * 여기에 px를 박으면 사용자 브라우저 폰트 설정이 무시된다. */
html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Pretendard', 'Apple SD Gothic Neo',
    'Noto Sans KR', 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s, color 0.2s;
}

body {
  font-size: 0.8125rem; /* base 13px @ 16px root */
}

/* 앱 폰트 크기 설정 (선택) — 브라우저 설정과 곱으로 합성 */
html[data-font-scale='lg'] { font-size: 107.7%; } /* base 13 → 약 14px */
html[data-font-scale='xl'] { font-size: 115.4%; } /* base 13 → 약 15px */

code,
pre,
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:focus-visible {
  outline: 2px solid var(--p-500);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

@media (hover: hover) {
  ::-webkit-scrollbar-thumb:hover {
    background: var(--p-300);
  }
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* VisuallyHidden — 화면에는 숨기되 스크린리더에는 읽히는 텍스트 */
.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;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
