/* UDL — udl.kr — v3
   Hand-written stylesheet. No external fonts, no trackers. */

:root {
  --ink: #171a1f;
  --ink-soft: #414852;
  --ink-muted: #6d7480;
  --paper: #fcfbf7;
  --paper-2: #f4f1e9;
  --line: #e2ddd1;
  --line-strong: #cfc7b6;
  --accent: #0b6b64;
  --accent-dark: #084c47;
  --accent-wash: #e6f1ef;
  --clay: #b4623c;
  --clay-wash: #f7ebe3;
  --radius: 14px;
  --radius-sm: 8px;
  --wrap: 1120px;
  --measure: 38rem;
  --serif: "AppleMyungjo", "Nanum Myeongjo", "Noto Serif KR", Batang, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR",
    "Malgun Gothic", "맑은 고딕", Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.78;
  letter-spacing: -0.005em;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
a { color: var(--accent-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--clay); }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 22px;
}

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

.skip-link {
  position: absolute; left: 12px; top: -60px;
  background: var(--ink); color: #fff; padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm); z-index: 100;
  text-decoration: none; font-size: 14px;
}
.skip-link:focus { top: 0; color: #fff; }

/* ------------------------------- header ------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(140%) blur(10px);
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 66px;
}

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink);
}
.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent); color: #fff;
  font-family: var(--serif); font-size: 20px; line-height: 1;
  padding-bottom: 2px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 700; letter-spacing: 0.14em; font-size: 15px; }
.brand-sub { font-size: 11px; color: var(--ink-muted); letter-spacing: 0.08em; }

.site-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  display: inline-block; padding: 7px 11px; border-radius: 999px;
  color: var(--ink-soft); text-decoration: none; font-size: 14.5px; white-space: nowrap;
}
.site-nav a:hover { background: var(--paper-2); color: var(--ink); }
.site-nav a.is-active { background: var(--accent-wash); color: var(--accent-dark); font-weight: 600; }

.nav-toggle { display: none; }

@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; height: 38px; border: 1px solid var(--line-strong);
    border-radius: 10px; background: #fff; cursor: pointer;
  }
  .nav-toggle-bar,
  .nav-toggle-bar::before,
  .nav-toggle-bar::after {
    display: block; width: 18px; height: 2px; background: var(--ink);
    position: relative; content: ""; transition: transform .2s ease;
  }
  .nav-toggle-bar::before { position: absolute; top: -6px; }
  .nav-toggle-bar::after { position: absolute; top: 6px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-6px) rotate(-45deg); }

  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 10px 22px 18px; background: var(--paper);
    border-bottom: 1px solid var(--line);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 11px 6px; border-radius: var(--radius-sm); font-size: 16px; }
}

/* -------------------------------- home -------------------------------- */
.hero { padding: 64px 0 44px; border-bottom: 1px solid var(--line); }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent-dark); font-weight: 600; margin-bottom: 18px;
}
.hero-kicker::before {
  content: ""; width: 26px; height: 1px; background: var(--accent);
}
.hero h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(30px, 5.4vw, 52px); line-height: 1.28;
  letter-spacing: -0.02em; margin: 0 0 20px; max-width: 21em;
  text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--accent-dark); box-shadow: inset 0 -0.42em 0 var(--accent-wash); }
.hero-lede { max-width: 40rem; font-size: 18px; color: var(--ink-soft); margin: 0 0 26px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--paper-2); border: 1px solid var(--line);
  font-size: 13px; color: var(--ink-soft); text-decoration: none;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }

.section { padding: 54px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 26px; flex-wrap: wrap;
}
.section-head h2 {
  font-family: var(--serif); font-size: 25px; font-weight: 600;
  margin: 0; letter-spacing: -0.01em;
}
.section-head p { margin: 0; color: var(--ink-muted); font-size: 14.5px; }

.cat-grid {
  display: grid; gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 720px) {
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.cat-card {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  padding: 22px 22px 20px; border: 1px solid var(--line);
  border-radius: var(--radius); background: #fff; color: inherit;
  text-decoration: none; transition: border-color .18s ease, transform .18s ease;
}
.cat-card:hover { border-color: var(--accent); transform: translateY(-2px); color: inherit; }
.cat-card .cat-num {
  font-family: var(--mono); font-size: 12px; color: var(--ink-muted); letter-spacing: 0.1em;
}
.cat-card h3 { margin: 0; font-family: var(--serif); font-size: 21px; font-weight: 600; }
.cat-card .cat-en { font-size: 12.5px; letter-spacing: 0.06em; color: var(--accent-dark); }
.cat-card p { margin: 4px 0 0; font-size: 15px; color: var(--ink-soft); }
.cat-card .cat-foot {
  margin-top: auto; padding-top: 12px; font-size: 13px; color: var(--ink-muted);
}

.post-list { display: grid; gap: 14px; }
.post-list.cols { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.post-card {
  display: flex; flex-direction: column; gap: 9px;
  padding: 22px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; color: inherit; text-decoration: none;
  transition: border-color .18s ease;
}
.post-card:hover { border-color: var(--accent); color: inherit; }
.card-tag {
  align-self: flex-start; font-size: 11.5px; letter-spacing: 0.1em;
  color: var(--accent-dark); background: var(--accent-wash);
  padding: 3px 9px; border-radius: 999px; font-weight: 600;
}
.post-card h3 { margin: 0; font-size: 19px; line-height: 1.5; font-family: var(--serif); font-weight: 600; }
.post-card p { margin: 0; font-size: 15px; color: var(--ink-soft); }
.card-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: auto; padding-top: 12px; font-size: 13px; color: var(--ink-muted);
}
.card-foot .go { color: var(--accent-dark); font-weight: 600; }

.note-strip {
  display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  padding: 24px; border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, var(--paper-2));
}
.note-strip div h3 {
  margin: 0 0 6px; font-size: 15px; letter-spacing: 0.01em;
}
.note-strip div p { margin: 0; font-size: 14.5px; color: var(--ink-soft); }

/* ------------------------------ category ------------------------------ */
.page-head { padding: 52px 0 34px; border-bottom: 1px solid var(--line); }
.page-head h1 {
  font-family: var(--serif); font-weight: 600; font-size: clamp(27px, 4vw, 40px);
  line-height: 1.32; margin: 6px 0 14px; letter-spacing: -0.02em;
}
.page-head .eyebrow {
  font-size: 12.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent-dark); font-weight: 600;
}
.page-head .lede { max-width: 42rem; color: var(--ink-soft); font-size: 17px; margin: 0; }

/* ------------------------------ article ------------------------------ */
.article-shell {
  display: grid; gap: 48px;
  grid-template-columns: minmax(0, 1fr);
  padding: 44px 0 64px;
}
@media (min-width: 1080px) {
  .article-shell { grid-template-columns: 15rem minmax(0, 1fr); align-items: start; }
  .article-shell .toc { position: sticky; top: 90px; }
}

.toc {
  font-size: 13.5px; border-left: 1px solid var(--line); padding-left: 16px;
}
.toc h2 {
  margin: 0 0 10px; font-size: 11.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-muted); font-weight: 600;
}
.toc ol { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; color: var(--ink-muted); }
.toc a { color: var(--ink-soft); text-decoration: none; }
.toc a:hover { color: var(--accent-dark); text-decoration: underline; }
@media (max-width: 1079px) {
  .toc {
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px 20px; background: #fff;
  }
  .toc ol { padding-left: 1.2em; }
}

.post { max-width: var(--measure); }
.post-header { margin-bottom: 30px; }
.post-header .card-tag { margin-bottom: 14px; }
.post h1 {
  font-family: var(--serif); font-weight: 600; font-size: clamp(28px, 4.4vw, 40px);
  line-height: 1.34; letter-spacing: -0.02em; margin: 10px 0 16px;
  text-wrap: balance;
}
.post-meta {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  font-size: 13.5px; color: var(--ink-muted);
  padding-bottom: 20px; border-bottom: 1px solid var(--line);
}
.post-meta span { display: inline-flex; align-items: center; gap: 6px; }
.post-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }

.post .lede {
  font-size: 18.5px; line-height: 1.72; color: var(--ink-soft);
  margin: 26px 0 30px; padding-left: 18px; border-left: 3px solid var(--accent);
}

.post h2 {
  font-family: var(--serif); font-size: 24px; font-weight: 600;
  line-height: 1.42; margin: 46px 0 14px; letter-spacing: -0.01em;
  padding-top: 6px;
}
.post h3 {
  font-size: 18px; font-weight: 700; margin: 32px 0 10px;
  color: var(--ink);
}
.post h2:first-of-type { margin-top: 34px; }
.post p { margin: 0 0 18px; }
.post strong { font-weight: 700; }
.post ul, .post ol { margin: 0 0 20px; padding-left: 1.35em; }
.post li { margin-bottom: 8px; }
.post li::marker { color: var(--accent); }
.post hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.post code {
  font-family: var(--mono); font-size: 0.88em;
  background: var(--paper-2); padding: 2px 6px; border-radius: 5px;
}
.post .en { color: var(--ink-muted); font-size: 0.9em; }

.post blockquote {
  margin: 0 0 22px; padding: 16px 20px;
  background: var(--paper-2); border-radius: var(--radius-sm);
  border-left: 3px solid var(--line-strong); color: var(--ink-soft);
  font-size: 16px;
}
.post blockquote p:last-child { margin-bottom: 0; }

.callout {
  margin: 26px 0; padding: 18px 20px; border-radius: var(--radius);
  background: var(--accent-wash); border: 1px solid #cfe3df;
  font-size: 15.5px;
}
.callout p:last-child { margin-bottom: 0; }
.callout .callout-title {
  display: block; font-weight: 700; font-size: 13px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent-dark); margin-bottom: 8px;
}
.callout.warn { background: var(--clay-wash); border-color: #ecd6c8; }
.callout.warn .callout-title { color: #8f4826; }

.table-wrap { overflow-x: auto; margin: 22px 0 26px; }
.post table {
  width: 100%; border-collapse: collapse; font-size: 14.5px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.post th, .post td {
  padding: 11px 13px; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.post th {
  background: var(--paper-2); font-weight: 700; font-size: 13.5px;
  white-space: nowrap; color: var(--ink);
}
.post tbody tr:last-child td { border-bottom: 0; }
.post caption {
  caption-side: top; text-align: left; font-size: 13px; color: var(--ink-muted);
  padding-bottom: 8px;
}

.sources {
  margin-top: 52px; padding-top: 24px; border-top: 1px solid var(--line-strong);
  font-size: 14px; color: var(--ink-soft);
}
.sources h2 { font-size: 16px; margin: 0 0 12px; font-family: var(--sans); letter-spacing: 0; }
.sources ol { padding-left: 1.3em; }
.sources li { margin-bottom: 9px; line-height: 1.6; }
.sources a { word-break: break-all; }

.disclaimer {
  margin-top: 30px; padding: 16px 18px; border-radius: var(--radius-sm);
  background: #fff; border: 1px dashed var(--line-strong);
  font-size: 13.5px; color: var(--ink-muted);
}
.disclaimer p { margin: 0; }

.post-foot {
  margin-top: 40px; display: flex; flex-wrap: wrap; gap: 10px;
  align-items: center; justify-content: space-between;
}
.post-foot .back { font-size: 14.5px; }

.next-read {
  margin-top: 44px; padding: 22px; border-radius: var(--radius);
  border: 1px solid var(--line); background: #fff;
}
.next-read h2 { margin: 0 0 8px; font-size: 15px; font-family: var(--sans); }
.next-read a { font-family: var(--serif); font-size: 19px; font-weight: 600; text-decoration: none; }
.next-read a:hover { text-decoration: underline; }

/* ------------------------------- pages ------------------------------- */
.prose { max-width: var(--measure); padding: 44px 0 64px; }
.prose h1 {
  font-family: var(--serif); font-size: clamp(27px, 4vw, 38px);
  font-weight: 600; line-height: 1.34; margin: 0 0 16px; letter-spacing: -0.02em;
}
.prose h2 { font-family: var(--serif); font-size: 22px; margin: 38px 0 12px; font-weight: 600; }
.prose h3 { font-size: 17px; margin: 26px 0 8px; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { padding-left: 1.35em; margin: 0 0 18px; }
.prose li { margin-bottom: 7px; }
.prose .lede { font-size: 18.5px; color: var(--ink-soft); }
.prose a { text-underline-offset: 3px; }

.dl { display: grid; gap: 0; margin: 22px 0 8px; border-top: 1px solid var(--line); }
.dl div {
  display: grid; grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 15px;
}
.dl dt { color: var(--ink-muted); margin: 0; font-size: 14px; }
.dl dd { margin: 0; }
@media (max-width: 520px) {
  .dl div { grid-template-columns: 1fr; gap: 2px; }
}

/* --------------------------------- 404 -------------------------------- */
.error-page {
  min-height: 62vh; display: grid; place-items: center;
  padding: 70px 0; text-align: center;
}
.error-page .code {
  font-family: var(--serif); font-size: clamp(64px, 16vw, 132px);
  line-height: 1; color: var(--accent-wash); font-weight: 600;
  margin: 0; letter-spacing: -0.03em;
}
.error-page h1 {
  font-family: var(--serif); font-size: clamp(22px, 3.4vw, 30px);
  margin: -18px 0 12px; font-weight: 600;
}
.error-page p { color: var(--ink-soft); max-width: 30rem; margin: 0 auto 26px; }
.error-links { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ------------------------------- footer ------------------------------- */
.site-footer {
  margin-top: 20px; border-top: 1px solid var(--line);
  background: var(--paper-2); font-size: 14.5px;
}
.footer-grid {
  display: grid; gap: 30px; padding: 44px 22px 34px;
  grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr));
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}
.footer-brand .brand { margin-bottom: 12px; }
.footer-note { margin: 0; color: var(--ink-soft); font-size: 14px; max-width: 26rem; }
.footer-heading {
  margin: 0 0 12px; font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-muted); font-weight: 700;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer ul a { color: var(--ink-soft); text-decoration: none; }
.site-footer ul a:hover { color: var(--accent-dark); text-decoration: underline; }
.footer-en { display: block; font-size: 11.5px; color: var(--ink-muted); letter-spacing: 0.03em; }
.footer-legal {
  display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
  padding: 18px 22px 26px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-muted);
}
.footer-legal p { margin: 0; max-width: 46rem; }

/* -------------------------------- misc -------------------------------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-color-scheme: dark) {
  /* keep the site readable if a reader forces dark mode in a browser extension */
}
