/* base.css — 리셋·서체·링크·포커스. 부품 모양은 components.css */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  min-width: 320px;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  letter-spacing: var(--tracking-ko);
  color: var(--color-text-body);
  background: var(--color-bg);
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
body.is-locked { overflow: hidden; }

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; letter-spacing: inherit; color: inherit; }
button { cursor: pointer; }
a, button, input, select, textarea, [role="combobox"] { touch-action: manipulation; -webkit-tap-highlight-color: var(--color-primary-soft); }
h1, h2, h3 { text-wrap: balance; }
/* 고정 머리말 아래로 앵커가 숨지 않게 */
[id] { scroll-margin-top: calc(var(--header-h) + 16px); }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--color-primary-text); }

:focus-visible {
  outline: 2px solid var(--color-primary-text);
  outline-offset: 3px;
  border-radius: 4px;
}
main:focus { outline: none; }
::selection { background: var(--color-primary); color: var(--color-on-primary); }

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: var(--space-4);
  top: -100px;
  z-index: calc(var(--z-tooltip) + 1);
  padding: var(--space-3) var(--space-4);
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-radius: var(--r-full);
}
.skip-link:focus { top: var(--space-4); color: var(--color-on-primary); }

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
/* 새 홈 본문(1320) */
.container--wide { max-width: calc(var(--container-home) + var(--gutter) * 2); }

/* ── 스크롤 진입 나타나기(app.js 가 .is-in 을 붙인다) ──
   html.js 는 <head> 의 nonce 스크립트가 붙인다 — JS 가 없으면 처음부터 다 보인다.
   움직임 줄이기 설정이면 숨기지도 움직이지도 않는다. */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--i, 0) * 80ms); }
  .js .reveal.is-in { opacity: 1; transform: none; }
  .reveal[data-d="1"] { --i: 1; }
  .reveal[data-d="2"] { --i: 2; }
  .reveal[data-d="3"] { --i: 3; }
  .reveal[data-d="4"] { --i: 4; }
  .reveal[data-d="5"] { --i: 5; }
}
