/* ==========================================================================
   Base — reset + 국문 타이포그래피
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  font-family: var(--font-kr);
  font-size: var(--fs-base);
  line-height: 1.8;
  letter-spacing: -0.005em;
  color: var(--ink-800);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 한글 줄바꿈 — 어절 단위 */
:where(h1, h2, h3, h4, h5, p, li, dt, dd, figcaption, blockquote, th, td, a,
  button, label, summary) {
  word-break: keep-all;
  overflow-wrap: break-word;
}

h1,
h2,
h3,
h4,
h5 {
  margin: 0;
  font-weight: 700;
  color: var(--ink-900);
  letter-spacing: -0.025em;
  line-height: 1.34;
}

h1 {
  font-size: var(--fs-h1);
  line-height: 1.3;
}
h2 {
  font-size: var(--fs-h2);
  line-height: 1.36;
}
h3 {
  font-size: var(--fs-h3);
  line-height: 1.5;
  letter-spacing: -0.015em;
}

p {
  margin: 0;
}

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

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

img {
  height: auto;
}

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

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

table {
  border-collapse: collapse;
  width: 100%;
}

.tnum,
time,
.hours-table td {
  font-variant-numeric: tabular-nums;
}

/* ---- Focus ---- */
:focus-visible {
  outline: 2px solid var(--green-600);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: var(--sp-3) var(--sp-5);
  background: var(--green-900);
  color: #fff;
  font-size: var(--fs-sm);
  border-radius: 0 0 var(--r-md) 0;
}
.skip-link:focus {
  left: 0;
  top: 0;
}

/* ---- Layout helpers ---- */
.container {
  width: min(var(--container), 100% - var(--gutter) * 2);
  margin-inline: auto;
}

.container-text {
  width: min(var(--container-text), 100% - var(--gutter) * 2);
  margin-inline: auto;
}

.section {
  padding-block: var(--section-y);
}

.section--tight {
  padding-block: clamp(40px, 4.5vw, 64px);
}

/* 섹션 배경: 크림 톤 교차 */
.section--soft {
  background: var(--bg-soft);
}

.section--tint {
  background: var(--bg-tint);
}

.section--white {
  background: var(--surface-0);
}

/* 딥그린 반전 섹션 (레퍼런스의 강조 블록) */
.section--green {
  background: var(--green-900);
  color: rgba(255, 255, 255, 0.82);
}
.section--green h1,
.section--green h2,
.section--green h3 {
  color: #fff;
}

.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;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Keep Korean prose together and avoid short trailing lines. */
:where(p, li, dd, figcaption, blockquote, .page-hero__lead, .section-head__lead) {
  text-wrap: pretty;
}
:where(h1, h2, h3, h4, h5) {
  text-wrap: balance;
}
