/* ==========================================================================
   base.css — reset + 기본 요소 스타일
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  line-height: var(--leading-normal);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: var(--tracking-normal);
  word-break: keep-all;
  overflow-wrap: break-word;
}

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

/* 기본은 stroke 기반 아이콘 친화 (Lucide). fill이 필요한 SVG는 개별 지정 */

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

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

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--color-link-hover);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
  border-radius: 2px;
}

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

p {
  margin: 0 0 var(--space-4);
}

p:last-child {
  margin-bottom: 0;
}

dl,
dt,
dd {
  margin: 0;
}

/* ── 헤딩 스케일 ───────────────────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
}

h1 {
  font-size: clamp(var(--text-4xl), 4vw + 1rem, var(--text-6xl));
  letter-spacing: var(--tracking-tighter);
}

h2 {
  font-size: clamp(var(--text-3xl), 3vw + 0.5rem, var(--text-5xl));
}

h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

h5 {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
}

h6 {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

/* ── 선택 / 스크롤바 ───────────────────────────────────────────────── */
::selection {
  background: var(--color-primary-200);
  color: var(--color-primary-900);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-neutral-300) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-thumb {
  background: var(--color-neutral-300);
  border-radius: var(--radius-full);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--color-neutral-400);
}

/* ── 접근성 유틸 ───────────────────────────────────────────────────── */
.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;
  left: -9999px;
  top: 0;
  padding: var(--space-3) var(--space-5);
  background: var(--color-primary-600);
  color: var(--color-white);
  z-index: var(--z-toast);
  border-radius: 0 0 var(--radius-md) 0;
}

.skip-link:focus {
  left: 0;
}
