/* ==========================================================================
   기본 — 초기화 · 글자 · 레이아웃 원칙 · 접근성 (토큰만 쓴다)
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
.prose a, .field__help a, .flow-side__note a, .note a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, h5, p, ul, ol, dl, figure, blockquote { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
hr { border: 0; border-top: var(--bw) solid var(--line); margin: var(--sp-8) 0; }
[hidden] { display: none !important; }
::selection { background: var(--c-crimson-600); color: #fff; }

:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
.skip-link { position: absolute; left: var(--sp-4); top: -60px; z-index: 100; padding: var(--sp-3) var(--sp-4); background: var(--c-white); color: var(--c-ink-900); font-weight: var(--fw-bold); }
.skip-link:focus { top: var(--sp-4); }
.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; }

/* ── 레이아웃 ── */
.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: calc(var(--wrap-narrow) + var(--gutter) * 2); }
.section { position: relative; padding-block: var(--section-y); }
.stack > * + * { margin-top: var(--stack, var(--sp-4)); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cluster, var(--sp-3)); }
.split { display: grid; grid-template-columns: minmax(0, var(--split-a, 5fr)) minmax(0, var(--split-b, 7fr)); gap: var(--split-gap, var(--sp-18)); align-items: var(--split-align, start); }
@media (max-width: 820px) { .split { grid-template-columns: minmax(0, 1fr); gap: var(--sp-8); } }

/* ── 글자 규격 ── 화면 어디서든 아래 클래스만 쓴다 */
.x { font-family: var(--font-wide); font-stretch: var(--wide-stretch); text-transform: uppercase; letter-spacing: var(--ls-wide); }
.ty-mega { font-size: var(--fs-mega); line-height: .86; font-weight: var(--fw-black); letter-spacing: -.01em; }
.ty-display { font-size: var(--fs-display); line-height: var(--lh-tight); font-weight: var(--fw-black); letter-spacing: var(--ls-display); }
.ty-h1 { font-size: var(--fs-h1); line-height: var(--lh-title); font-weight: var(--fw-black); letter-spacing: var(--ls-title); }
.ty-h2 { font-size: var(--fs-h2); line-height: 1.35; font-weight: var(--fw-black); letter-spacing: var(--ls-tight); }
.ty-h3 { font-size: var(--fs-h3); line-height: 1.35; font-weight: var(--fw-bold); letter-spacing: -.02em; }
.ty-h4 { font-size: var(--fs-h4); line-height: 1.45; font-weight: var(--fw-bold); }
.ty-quote { font-family: var(--font-serif); font-size: var(--fs-quote); line-height: 1.4; font-weight: var(--fw-bold); letter-spacing: -.02em; }
.ty-lede { font-size: var(--fs-lede); line-height: 1.8; font-weight: var(--fw-light); color: var(--fg-muted); max-width: 36em; }
.ty-body { font-size: var(--fs-body); line-height: var(--lh-body); }
.ty-sm { font-size: var(--fs-sm); line-height: 1.7; }
.ty-xs { font-size: var(--fs-xs); line-height: 1.6; }
.ty-cap { font-size: var(--fs-2xs); font-weight: var(--fw-bold); letter-spacing: var(--ls-wide); }
.ty-muted { color: var(--fg-muted); }
.ty-accent, .ty-display em, .ty-h1 em, .ty-quote em { color: var(--accent-text); font-style: normal; }
.ty-num { font-variant-numeric: tabular-nums; }
.ty-serif { font-family: var(--font-serif); }
.prose { max-width: 46em; font-size: var(--fs-body); line-height: var(--lh-loose); }
.prose h2 { margin: var(--sp-12) 0 var(--sp-4); font-size: var(--fs-h3); line-height: 1.4; letter-spacing: -.02em; }
.prose p, .prose ul { margin: 0 0 var(--sp-4); }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: var(--sp-2); }
.prose li::marker { color: var(--accent-text); }

/* ── 등장 효과 — 짧고 약하게, 움직임 줄이기면 끈다 ── */
.rv { opacity: 0; transform: translateY(24px); transition: opacity var(--dur-slow) ease, transform var(--dur-slow) var(--ease-out); }
.rv.in, .no-io .rv { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .rv { opacity: 1; transform: none; }
}

/* ── 간격 유틸리티 — 인라인 style 대신 이것만 쓴다 (토큰 단계와 같다) ── */
.mt-0 { margin-top: 0 !important; }
.mt-2 { margin-top: var(--sp-2) !important; }
.mt-3 { margin-top: var(--sp-3) !important; }
.mt-4 { margin-top: var(--sp-4) !important; }
.mt-6 { margin-top: var(--sp-6) !important; }
.mt-8 { margin-top: var(--sp-8) !important; }
.mt-10 { margin-top: var(--sp-10) !important; }
.mt-12 { margin-top: var(--sp-12) !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-4 { margin-bottom: var(--sp-4) !important; }
.mb-6 { margin-bottom: var(--sp-6) !important; }

/* 프로그램이 옮긴 포커스(단계 제목 등)에는 테두리를 그리지 않는다 — 키보드 포커스는 :focus-visible 그대로 */
[tabindex="-1"]:focus { outline: none; }
