/*
 * 기본 스타일
 * 브라우저 기본값 정리, 본문 글꼴, 공용 배치 도구.
 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* 고정 헤더에 섹션 제목이 가려지지 않게 한다 */
  scroll-padding-top: var(--header-height);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html.menu-open {
  overflow: hidden;
}

body {
  margin: 0;
  min-width: 20rem;
  background: var(--color-background) var(--texture-grain);
  color: var(--color-text);
  font-family: var(--font-family-body);
  font-size: var(--font-size-body);
  line-height: 1.6;
  /* 한글이 단어 중간에서 끊기지 않게 한다 */
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

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

a {
  color: inherit;
  text-decoration: none;
}

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

[hidden] {
  display: none !important;
}

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

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* 본문 폭 */
.container {
  width: min(100% - 2 * var(--page-gutter), var(--content-width));
  margin-inline: auto;
}

/* 화면에는 숨기고 화면 낭독기에만 읽힌다 */
.visually-hidden {
  position: absolute;
  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;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-weight: 700;
  transform: translateY(-200%);
}

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

.noscript-notice {
  padding: 4rem var(--page-gutter);
  text-align: center;
}

/*
 * 스크롤 등장 효과
 * 스크립트가 html에 motion-enabled를 붙였을 때만 숨긴다.
 * 움직임 줄이기를 켠 사용자나 스크립트가 실패한 경우에는 내용이 그대로 보인다.
 */
.motion-enabled [data-reveal] {
  opacity: 0;
}

.motion-enabled [data-reveal].revealed {
  opacity: 1;
  animation: reveal-rise var(--duration-slow) var(--easing-standard) backwards;
  animation-delay: calc(var(--reveal-order, 0) * 90ms);
}

@keyframes reveal-rise {
  from {
    opacity: 0;
    transform: translateY(1.75rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
