@font-face {
  font-family: "Tralalero Sans";
  src: url("/assets/assets/fonts/Pretendard-Regular.otf") format("opentype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Tralalero Sans";
  src: url("/assets/assets/fonts/Pretendard-SemiBold.otf") format("opentype");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Tralalero Sans";
  src: url("/assets/assets/fonts/Pretendard-ExtraBold.otf") format("opentype");
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: "Tralalero Ledger";
  src: url("/assets/assets/fonts/IBMPlexMono-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #1b1d22;
  --graphite: #565b63;
  --mist: #6f757d;
  --line: #d9dce0;
  --paper: #fffef9;
  --canvas: #f3f6fa;
  --cobalt: #2f70b4;
  --seal: #c03a32;
  --measure: 47rem;
  --gutter: clamp(1rem, 3vw, 3rem);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--canvas);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 0 31px, rgba(27, 29, 34, 0.035) 31px 32px, transparent 32px),
    var(--canvas);
  font-family: "Tralalero Sans", "Apple SD Gothic Neo", "Noto Sans CJK KR", sans-serif;
  font-size: 1rem;
  line-height: 1.72;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--cobalt);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--ink);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--cobalt);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 50;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  color: var(--paper);
  background: var(--ink);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) auto auto;
  align-items: center;
  gap: clamp(1rem, 3vw, 3rem);
  min-height: 5.25rem;
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 94%, transparent);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  width: fit-content;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
}

/* 헤더 마크는 40px 남짓으로만 그려진다. 앱 번들의 원본 로고(640×640 · PNG 126KB /
 * WebP 90KB)를 여기에 실으면 픽셀 대부분을 버리려고 100KB 안팎을 받게 되므로, 전용
 * 축소본(/icons/logo-120.png · 120×120 · 3.9KB) 한 장만 쓴다 — 120/40 = 정확히 3배
 * DPR까지(여유 없음, 상자를 키우면 축소본도 다시 굽는다). 한 장이면 <picture> 분기도
 * 필요 없다 — PNG는 전 브라우저가 디코드한다. */
.wordmark img {
  width: 2.475rem;
  height: 2.475rem;
  object-fit: contain;
}

/* 제목의 음수 자간은 한글 전용 조판이다. release.js가 <html lang>에 ko·en·ja 셋을
 * 모두 쓰므로 리셋도 en·ja 양쪽을 덮어야 한다(디자인 정본 §2: 영문·일본어는 0px).
 * ja가 빠지면 일본어 제목이 한글용 -0.07em을 받아 글리프가 서로 붙는다. */
html[lang="en"] h1,
html[lang="en"] h2,
html[lang="en"] h3,
html[lang="ja"] h1,
html[lang="ja"] h2,
html[lang="ja"] h3 {
  letter-spacing: 0;
}

.primary-nav,
.language-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.83rem;
  font-weight: 600;
}

.primary-nav a,
.language-nav a {
  color: var(--graphite);
  text-decoration: none;
}

.primary-nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--seal);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.45rem;
}

.language-nav {
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.language-nav a {
  min-width: 2.8rem;
  padding: 0.42rem 0.65rem;
  text-align: center;
}

.language-nav a + a {
  border-left: 1px solid var(--line);
}

.language-nav a[aria-current="true"] {
  color: var(--paper);
  background: var(--ink);
}

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(13rem, 21rem);
  gap: clamp(2rem, 8vw, 9rem);
  align-items: end;
  padding: clamp(3.75rem, 8vw, 8rem) var(--gutter) clamp(3rem, 7vw, 6rem);
  border-bottom: 1px solid var(--ink);
  background:
    radial-gradient(circle at 78% 28%, rgba(213, 69, 60, 0.055) 0 8rem, transparent 8.1rem),
    var(--paper);
}

.eyebrow,
.section-number,
.meta-label,
.seal,
.toc-title,
th {
  font-family: "Tralalero Ledger", ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--seal);
}

h1 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(2.75rem, 7vw, 6.8rem);
  line-height: 0.96;
  letter-spacing: -0.07em;
  text-wrap: balance;
}

.dek {
  max-width: 32rem;
  margin: 0;
  color: var(--graphite);
  font-size: clamp(1.05rem, 1.7vw, 1.3rem);
  line-height: 1.55;
}

.seal {
  display: inline-grid;
  place-items: center;
  width: 7.4rem;
  height: 7.4rem;
  margin-top: 2rem;
  color: var(--seal);
  border: 2px solid var(--seal);
  border-radius: 50%;
  line-height: 1.35;
  text-align: center;
  transform: rotate(-5deg);
}

.document-shell {
  display: grid;
  grid-template-columns: minmax(13rem, 17rem) minmax(0, var(--measure));
  gap: clamp(3rem, 8vw, 8rem);
  justify-content: center;
  padding: clamp(3rem, 7vw, 7rem) var(--gutter) 8rem;
}

.toc {
  align-self: start;
  position: sticky;
  top: 2rem;
  padding-top: 0.75rem;
  border-top: 3px solid var(--ink);
}

.toc-title {
  display: block;
  margin-bottom: 1rem;
  color: var(--graphite);
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.toc li {
  counter-increment: toc;
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}

.toc li::before {
  content: counter(toc, decimal-leading-zero);
  color: var(--mist);
  font-family: "Tralalero Ledger", ui-monospace, monospace;
  font-size: 0.72rem;
}

.toc a {
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.4;
  text-decoration: none;
}

.document {
  min-width: 0;
}

.document section {
  scroll-margin-top: 2rem;
  padding: 0 0 clamp(3rem, 6vw, 5rem);
}

.document section + section {
  padding-top: clamp(3rem, 6vw, 5rem);
  border-top: 1px solid var(--ink);
}

.section-number {
  display: block;
  margin-bottom: 0.6rem;
  color: var(--seal);
}

h2 {
  margin: 0 0 1.25rem;
  font-size: clamp(1.75rem, 3.8vw, 2.8rem);
  line-height: 1.12;
  letter-spacing: -0.045em;
}

h3 {
  margin: 2.25rem 0 0.65rem;
  font-size: 1.12rem;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

p,
ul,
ol,
dl,
table {
  margin-top: 0;
  margin-bottom: 1.15rem;
}

ul,
ol {
  padding-left: 1.25rem;
}

li + li {
  margin-top: 0.45rem;
}

.lead {
  font-size: clamp(1.08rem, 1.8vw, 1.27rem);
  line-height: 1.65;
}

.notice {
  margin: 2rem 0;
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--ink);
  background: #eef2f6;
}

.notice strong {
  display: block;
  margin-bottom: 0.35rem;
}

.notice.danger {
  border-color: var(--seal);
  background: #fcf0ed;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 2rem 0;
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
}

.fact-grid > div {
  min-width: 0;
  padding: 1.1rem;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.fact-grid dt {
  margin-bottom: 0.25rem;
  color: var(--graphite);
  font-size: 0.78rem;
}

.fact-grid dd {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.table-wrap {
  width: 100%;
  margin: 1.5rem 0 2rem;
  overflow-x: auto;
  border: 1px solid var(--line);
}

table {
  width: 100%;
  min-width: 38rem;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--graphite);
  background: #eef2f6;
}

tr:last-child td {
  border-bottom: 0;
}

.steps {
  margin: 2rem 0;
  padding: 0;
  list-style: none;
  counter-reset: steps;
}

.steps li {
  counter-increment: steps;
  position: relative;
  min-height: 4rem;
  padding: 0 0 1.5rem 4rem;
  border-left: 1px solid var(--line);
}

.steps li::before {
  content: counter(steps);
  position: absolute;
  top: -0.2rem;
  left: -1.4rem;
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  color: var(--paper);
  border-radius: 50%;
  background: var(--ink);
  font-family: "Tralalero Ledger", ui-monospace, monospace;
}

.steps li:last-child {
  border-left-color: transparent;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.7rem 1.1rem;
  color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 0.65rem;
  background: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  color: var(--ink);
  background: transparent;
}

.button.secondary {
  color: var(--ink);
  background: transparent;
}

.button.secondary:hover {
  color: var(--paper);
  background: var(--ink);
}

.contact-card {
  margin-top: 2.5rem;
  padding: clamp(1.5rem, 5vw, 3rem);
  color: var(--paper);
  background: var(--ink);
}

.contact-card a {
  color: #a8cef5;
}

.contact-card h3 {
  margin-top: 0;
  color: var(--paper);
  font-size: 1.5rem;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  padding: 2.5rem var(--gutter);
  color: var(--graphite);
  border-top: 1px solid var(--ink);
  background: var(--paper);
  font-size: 0.82rem;
}

.site-footer p {
  margin: 0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

[data-lang-panel][hidden] {
  display: none !important;
}

@media (max-width: 880px) {
  .site-header {
    grid-template-columns: 1fr auto;
    padding-block: 0.9rem;
  }

  .primary-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-top: 0.65rem;
    border-top: 1px solid var(--line);
    overflow-x: auto;
  }

  .masthead {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .document-shell {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .toc {
    position: static;
    columns: 2;
  }

  .toc-title {
    column-span: all;
  }

  .toc li {
    break-inside: avoid;
  }
}

@media (max-width: 560px) {
  body {
    background: var(--canvas);
  }

  .site-header {
    gap: 0.75rem;
  }

  .wordmark img {
    width: 2.2rem;
    height: 2.2rem;
  }

  .primary-nav {
    gap: 1.1rem;
    padding-bottom: 0.2rem;
  }

  .masthead {
    padding-top: 3.25rem;
  }

  h1 {
    font-size: clamp(2.65rem, 16vw, 4.5rem);
  }

  .seal {
    width: 6.3rem;
    height: 6.3rem;
  }

  .toc {
    columns: 1;
  }

  .fact-grid {
    grid-template-columns: 1fr;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }
}

@media print {
  .site-header,
  .toc,
  .action-row,
  .skip-link {
    display: none;
  }

  body,
  .masthead,
  .site-footer {
    background: #fff;
  }

  .masthead,
  .document-shell,
  .site-footer {
    display: block;
    padding: 1.5rem 0;
  }

  .document section {
    break-inside: avoid;
  }

  a {
    color: inherit;
  }
}

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