/*
 * ONSOFT DS B — base v0.1 (리셋·타이포·레이아웃 기본)
 * 의존: tokens.css
 */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px; /* sticky 헤더 높이만큼 앵커 보정 */
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
  background-color: var(--bg);
  /* 64px 배경 격자 (목업 시그니처) */
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  word-break: keep-all; /* 한글 어절 단위 줄바꿈 */
  overflow-wrap: anywhere;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure,
pre {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: var(--fw-bold);
  line-height: 1.3;
  letter-spacing: -0.01em;
}
h1 {
  font-size: var(--fs-display);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-display);
}
h2 {
  font-size: var(--fs-h2);
}
h3 {
  font-size: var(--fs-h3);
  font-weight: var(--fw-semibold);
}

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

a {
  color: var(--link);
  text-underline-offset: 3px;
  transition: color var(--dur) var(--ease);
}
a:hover {
  color: var(--link-hover);
}

button {
  font: inherit;
  color: inherit;
}

code,
pre,
kbd {
  font-family: var(--font-mono);
  font-variant-ligatures: none;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

/* 포커스 — 키보드 사용자에게만 표시 */
:focus {
  outline: none;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

/* 본문 바로가기 */
.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -100px;
  z-index: 100;
  padding: var(--sp-3) var(--sp-4);
  background: var(--inverse);
  color: var(--on-inverse);
  border-radius: var(--r-btn);
  font-weight: var(--fw-semibold);
  text-decoration: none;
}
.skip-link:focus-visible {
  top: var(--sp-4);
}

/* 레이아웃 */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section {
  padding-block: var(--section-y);
}
.section--lg {
  padding-block: var(--section-y-lg);
}
.section--band {
  background: var(--surface);
  border-block: 1px solid var(--line);
}
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap, var(--sp-6));
}

/* 보조 */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.mono {
  font-family: var(--font-mono);
}
.muted {
  color: var(--text-muted);
}

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