/* ============================================================
   Bada International · Base Layer
   Version : 3.0.0 — Apple DS alignment
   Purpose : global reset, Apple SF Pro typography scale, link +
             selection styling, accessibility primitives.
             Depends on tokens.css. No component styles here.
   Rationale:
     - SF Pro 시스템 스택 (웹폰트 로드 없음, OS가 자동 선택)
     - h1~h3 weight 600 (Apple 스펙, 기존 700에서 하향)
     - body 17px / tracking -0.022em
     - link: inherit color + premium easing, underline 없음
     - focus: Apple Blue outline
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
img, svg, video, canvas { max-width: 100%; height: auto; display: block; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-body-l);       /* 17px — Apple body */
  line-height: 1.47;
  letter-spacing: var(--tracking-body);
  color: var(--neutral-ink);
  background: var(--neutral-stage);    /* #F5F5F7 — Apple Light Gray */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-variant-ligatures: common-ligatures contextual;
}

/* ---------- Typography scale ----------
   Apple 스타일 sans 계층. 모든 display는 600 (Semibold). */
h1, h2, h3, h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--neutral-ink);
  margin: 0 0 var(--space-2);
  line-height: 1.08;
}
h1 { font-size: var(--text-display-xl); letter-spacing: var(--tracking-tight); line-height: 1.07; }
h2 { font-size: var(--text-display-l);  letter-spacing: 0; line-height: 1.10; }
h3 { font-size: var(--text-display-m);  letter-spacing: var(--tracking-h3); line-height: 1.14; }
h4 { font-size: var(--text-subhead);    letter-spacing: 0; line-height: 1.2; }

p {
  margin: 0 0 var(--space-2);
  font-size: var(--text-body-l);
  line-height: 1.47;
  letter-spacing: var(--tracking-body);
}

/* Apple "Tile Heading" — 카드/타일 라벨용 (weight 400 정상) */
.tile-heading {
  font-weight: 400;
  letter-spacing: var(--tracking-h3);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.subtitle {
  font-size: 1.05rem;
  color: var(--neutral-ink-80);
  letter-spacing: var(--tracking-body);
}

/* ---------- Links ----------
   Apple 패턴: inherit color + premium easing, underline 없음. */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-base) var(--ease-premium),
              opacity var(--dur-base) var(--ease-premium);
}
a:hover { color: var(--brand-primary); }

/* ---------- Accessibility ---------- */
:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 3px;
  border-radius: var(--radius-micro);
}

::selection {
  background: var(--brand-primary);
  color: var(--neutral-off);
}

/* ---------- Layout utilities ---------- */
.bd-container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter-md);
}

.bd-sr-only,
.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;
}
