/* ==========================================================================
   base.css — 웹폰트 로드 · 리셋 · 기본 타이포 · 접근성 유틸
   tokens.css 다음에 로드한다.
   ========================================================================== */

/* ---------- 웹폰트 (CDN 링크) ----------
   @import 는 파일 최상단에 있어야 한다.
   - Pretendard: 본문 (OFL)
   - Wanted Sans Variable: 헤드라인·Home 영문 소제목 (OFL, 굵기 400–1000 — Light 없음)
   - IBM Plex Mono: 수치·코드성 표기 */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css");
@import url("https://cdn.jsdelivr.net/npm/wanted-sans@1.0.3/fonts/webfonts/variable/split/WantedSansVariable.min.css");
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&display=swap");

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

* {
  margin: 0;
}

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

body {
  min-height: 100vh;
  min-height: 100dvh;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

nav ul,
nav ol {
  list-style: none;
  padding: 0;
}

table {
  border-collapse: collapse;
}

[hidden] {
  display: none !important;
}

/* ---------- 기본 타이포 ---------- */
html {
  font-family: var(--font-sans);
}

body {
  background-color: var(--space); /* 다크 기본 */
  color: var(--paper);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  word-break: keep-all;           /* 국문 어절 단위 줄바꿈 */
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  text-wrap: balance;
}

h1 { font-size: var(--fs-display); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl);  line-height: var(--lh-snug); }
h4 { font-size: var(--fs-lg);  line-height: var(--lh-snug); }

p {
  text-wrap: pretty;
}

a {
  color: var(--cyan);
  text-underline-offset: 0.2em;
}

code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
  font-size: 0.9375em;
}

small {
  font-size: var(--fs-sm);
}

/* ---------- 접근성 유틸 ---------- */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

/* 프로그램으로 포커스를 받는 요소(main 등)는 마우스 포커스 시 외곽선 생략 */
[tabindex="-1"]:focus:not(:focus-visible) {
  outline: none;
}

/* 화면에서 숨기되 스크린리더에는 읽힘 */
.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;
}

/* 본문 바로가기: 키보드 포커스 시에만 노출 */
.skip-link {
  position: absolute;
  top: var(--sp-4);
  left: var(--sp-4);
  z-index: 1000;
  padding: var(--sp-2) var(--sp-4);
  background-color: var(--paper);
  color: var(--ink);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

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