:root {
  --red: #d9302b;
  --red-dark: #bc211d;
  --red-pale: #fff2f1;
  --ink: #232323;
  --muted: #6c6c6c;
  --line: #dedede;
  --soft: #f6f6f4;
  --white: #fff;
  --max: 1080px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--white); font-family: Pretendard, "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.6; }
a { color: inherit; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
::selection { color: var(--ink); background: #ffd8d6; }

.skip-link { position: fixed; z-index: 100; left: 16px; top: -80px; padding: 10px 14px; background: var(--red); color: #fff; }
.skip-link:focus { top: 16px; }

.site-header { border-top: 4px solid var(--red); border-bottom: 1px solid var(--line); background: #fff; }
.header-inner { width: min(calc(100% - 40px), var(--max)); min-height: 88px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.brand { display: inline-flex; align-items: center; min-height: 48px; }
.brand img { display: block; width: 154px; height: auto; }
.main-nav { display: flex; align-items: center; gap: 26px; font-size: 14px; font-weight: 600; }
.main-nav a { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a:focus-visible, .main-nav .is-current { color: var(--red); border-color: var(--red); }

main { width: min(calc(100% - 40px), var(--max)); margin: auto; }
.opening { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(260px, .55fr); column-gap: 72px; padding: 72px 0 56px; border-bottom: 1px solid var(--ink); }
.opening h1 { margin: 0; font-family: "Gowun Batang", serif; font-size: clamp(42px, 5.3vw, 70px); line-height: 1.16; letter-spacing: -.045em; font-weight: 700; }
.opening h1 span { color: var(--red); }
.opening-copy { align-self: end; padding-bottom: 7px; }
.opening-copy p { margin: 0; font-size: 17px; }
.opening-copy .opening-note { margin-top: 24px; color: var(--muted); font-size: 13px; }
.site-search { grid-column: 1 / -1; margin-top: 46px; padding: 28px 30px 24px; color: #fff; background: var(--red); }
.site-search label { display: block; margin-bottom: 10px; font-size: 14px; font-weight: 700; }
.search-row { display: grid; grid-template-columns: 1fr 92px; min-height: 58px; background: #fff; border: 2px solid #fff; }
.search-row:focus-within { border-color: var(--ink); }
.search-row input { min-width: 0; padding: 0 18px; border: 0; outline: 0; color: var(--ink); background: #fff; font-size: 17px; }
.search-row button { border: 0; border-left: 1px solid #ddd; color: var(--red); background: #fff; font-weight: 800; cursor: pointer; }
.search-suggestions { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 15px; margin-top: 12px; font-size: 13px; }
.search-suggestions span { opacity: .75; }
.search-suggestions button { min-width: 44px; min-height: 44px; padding: 0; border: 0; color: #fff; background: none; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding-bottom: 16px; border-bottom: 2px solid var(--ink); }
.section-head h2, .method h2 { margin: 0; font-family: "Gowun Batang", serif; font-size: 29px; letter-spacing: -.025em; }
.section-head p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.section-head > a, .method-title a { min-height: 44px; display: inline-flex; flex: 0 0 auto; align-items: center; color: var(--red); font-size: 14px; font-weight: 700; text-underline-offset: 4px; white-space: nowrap; }

.definition { padding: 68px 0 64px; border-bottom: 1px solid var(--ink); }
.definition-head { display: grid; grid-template-columns: 390px minmax(0, 1fr); gap: 48px; align-items: end; margin-bottom: 28px; }
.definition-head h2 { margin: 0; font-family: "Gowun Batang", serif; font-size: 31px; letter-spacing: -.025em; }
.definition-head p { margin: 0; color: var(--muted); font-size: 15px; }
.definition-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.definition-grid article { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 24px; padding: 26px 28px 26px 0; }
.definition-grid article + article { padding-left: 28px; border-left: 1px solid var(--line); }
.definition-grid h3 { margin: 0; color: var(--red); font-size: 17px; }
.definition-grid p, .definition-note { margin: 0; color: var(--muted); font-size: 14px; word-break: keep-all; }
.definition-note { max-width: 820px; padding-top: 18px; color: var(--ink); }

.essential { padding: 64px 0 72px; }
.essential-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.essential-item { min-height: 112px; display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 20px; padding: 16px 24px 16px 0; border-bottom: 1px solid var(--line); }
.essential-item:nth-child(even) { padding-left: 24px; border-left: 1px solid var(--line); }
.essential-item:first-child { grid-row: auto; }
.essential-item:first-child .essential-name { font-size: 17px; font-family: inherit; }
.essential-name { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; color: var(--ink); font-size: 17px; font-weight: 800; text-decoration: none; }
.essential-name:hover, .essential-name:focus-visible { color: var(--red); text-decoration: underline; text-underline-offset: 4px; }
.essential-item p { margin: 0; color: var(--muted); font-size: 14px; }
.essential-item small { display: block; margin-top: 5px; color: #999; font-size: 12px; }

.chapter-nav { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); background: rgba(255,255,255,.97); }
.chapter-nav a { min-height: 64px; display: flex; flex-direction: column; gap: 3px; align-items: center; justify-content: center; padding: 8px; border-right: 1px solid var(--line); font-size: 13px; font-weight: 700; text-align: center; text-decoration: none; }
.chapter-nav small { color: var(--muted); font-size: 11px; font-weight: 500; }
.chapter-nav a:last-child { border-right: 0; }
.chapter-nav a:hover, .chapter-nav a:focus-visible { color: var(--red); background: var(--red-pale); }

.chapter { padding: 82px 0; border-bottom: 1px solid var(--ink); scroll-margin-top: 72px; }
.chapter-intro { display: grid; grid-template-columns: 390px minmax(0, 1fr); gap: 48px; align-items: end; margin-bottom: 42px; }
.chapter-number { color: var(--red); font-size: 13px; font-weight: 800; }
.chapter h2 { margin: 10px 0 0; font-family: "Gowun Batang", serif; font-size: 34px; line-height: 1.3; letter-spacing: -.025em; word-break: keep-all; white-space: nowrap; }
.chapter-intro p { max-width: 570px; margin: 0; color: var(--muted); font-size: 16px; word-break: keep-all; }
.chapter-groups { display: grid; gap: 42px; }
.link-group { min-width: 0; }
.group-head { display: flex; justify-content: space-between; align-items: end; padding-bottom: 10px; border-bottom: 1px solid var(--ink); }
.group-head h3 { margin: 0; font-size: 16px; }
.group-head span { color: var(--muted); font-size: 12px; }
.editorial-links { display: grid; grid-template-columns: repeat(2, 1fr); }
.editorial-link { min-height: 90px; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 20px; align-items: center; padding: 15px 20px 15px 0; border-bottom: 1px solid var(--line); }
.editorial-link:nth-child(even) { padding-left: 22px; border-left: 1px solid var(--line); }
.editorial-link a { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; font-weight: 800; text-decoration: none; }
.editorial-link a:hover, .editorial-link a:focus-visible { color: var(--red); text-decoration: underline; text-underline-offset: 4px; }
.editorial-link p { margin: 0; color: var(--muted); font-size: 13px; }
.editorial-link small { color: #999; font-size: 11px; }

.chapter[data-layout="index"] .chapter-groups { grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--ink); }
.chapter[data-layout="index"] .link-group { padding: 22px 24px 24px 0; border-bottom: 1px solid var(--line); }
.chapter[data-layout="index"] .link-group + .link-group { padding-left: 24px; border-left: 1px solid var(--line); }
.chapter[data-layout="index"] .editorial-links { display: block; }
.chapter[data-layout="index"] .editorial-link { min-height: 62px; display: block; padding: 8px 0; border-left: 0; }
.chapter[data-layout="index"] .editorial-link p { display: none; }
.chapter[data-layout="index"] .editorial-link small { display: block; }

.chapter[data-layout="split"] .chapter-groups { grid-template-columns: repeat(3, 1fr); gap: 24px; }
.chapter[data-layout="split"] .link-group { height: 100%; padding: 24px; background: var(--soft); }
.chapter[data-layout="split"] .editorial-links { display: block; }
.chapter[data-layout="split"] .editorial-link { display: block; min-height: 0; padding: 12px 0; border-left: 0; }

.chapter[data-layout="columns"] .chapter-groups { grid-template-columns: repeat(2, 1fr); gap: 48px; }
.chapter[data-layout="columns"] .editorial-links { display: block; }
.chapter[data-layout="columns"] .editorial-link { grid-template-columns: 170px 1fr; padding: 14px 0; border-left: 0; }

.chapter[data-layout="compact"] .chapter-groups { grid-template-columns: repeat(3, 1fr); gap: 24px; }
.chapter[data-layout="compact"] .link-group { height: 100%; border-top: 4px solid var(--red); }
.chapter[data-layout="compact"] .group-head { padding-top: 14px; }
.chapter[data-layout="compact"] .editorial-links { display: block; }
.chapter[data-layout="compact"] .editorial-link { display: block; min-height: 0; padding: 10px 0; border-left: 0; }
.chapter[data-layout="compact"] .editorial-link p { display: none; }

.change-desk { padding: 82px 0; }
.change-list { margin: 0; padding: 0; list-style: none; }
.change-list li { min-height: 68px; display: grid; grid-template-columns: 110px 180px 1fr; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); }
.change-list time { color: var(--red); font-size: 13px; font-weight: 700; }
.change-list strong { font-size: 15px; }
.change-list strong em { display: inline-flex; min-width: 48px; min-height: 28px; align-items: center; justify-content: center; margin-right: 10px; border: 1px solid var(--red); color: var(--red); font-size: 11px; font-style: normal; font-weight: 800; }
.change-list span { color: var(--muted); font-size: 14px; }

.method { display: grid; grid-template-columns: 280px 1fr; gap: 60px; margin-bottom: 90px; padding: 48px; color: #fff; background: var(--red); }
.method-title a { color: #fff; }
.method ol { margin: 0; padding: 0; list-style: none; counter-reset: method; }
.method li { counter-increment: method; display: grid; grid-template-columns: 36px 150px 1fr; gap: 18px; padding: 15px 0; border-bottom: 1px solid rgba(255,255,255,.35); }
.method li::before { content: "0" counter(method); font-size: 12px; opacity: .75; }
.method li span { font-size: 14px; opacity: .85; }

.home-guide, .home-faq { padding: 0 0 82px; }
.guide-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.guide-list article { min-width: 0; padding: 26px 28px 28px 0; }
.guide-list article + article { padding-left: 28px; border-left: 1px solid var(--line); }
.guide-list span { color: var(--red); font-size: 12px; font-weight: 800; }
.guide-list h3 { min-height: 52px; margin: 10px 0 8px; font-family: "Gowun Batang", serif; font-size: 20px; line-height: 1.35; word-break: keep-all; }
.guide-list p { min-height: 72px; margin: 0 0 12px; color: var(--muted); font-size: 14px; word-break: keep-all; }
.guide-list a { min-height: 44px; display: inline-flex; align-items: center; color: var(--red); font-size: 13px; font-weight: 700; text-underline-offset: 4px; }

.faq-list { border-bottom: 1px solid var(--ink); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { position: relative; min-height: 62px; display: flex; align-items: center; padding: 10px 52px 10px 0; font-weight: 700; cursor: pointer; list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; position: absolute; right: 8px; top: 50%; translate: 0 -50%; color: var(--red); font-size: 24px; font-weight: 400; }
.faq-list details[open] summary::after { content: "−"; }
.faq-list details p { max-width: 800px; margin: -2px 0 0; padding: 0 52px 22px 0; color: var(--muted); font-size: 14px; }

.report-callout { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px; align-items: center; margin-bottom: 82px; padding: 34px 38px; border-top: 4px solid var(--red); background: var(--soft); }
.report-callout h2 { margin: 0 0 7px; font-family: "Gowun Batang", serif; font-size: 25px; }
.report-callout p { margin: 0; color: var(--muted); font-size: 14px; }
.report-callout a { min-width: 180px; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; color: #fff; background: var(--red); font-size: 14px; font-weight: 800; text-decoration: none; }
.report-callout a:hover, .report-callout a:focus-visible { background: var(--red-dark); }

.search-results { position: fixed; z-index: 50; inset: 0; overflow: auto; padding: 60px max(30px, calc((100vw - var(--max)) / 2)); background: rgba(255,255,255,.98); }
.search-results .section-head button { min-width: 80px; min-height: 44px; border: 1px solid var(--red); color: var(--red); background: #fff; cursor: pointer; }
.search-results ul { margin: 0; padding: 0; list-style: none; }
.search-results li { display: grid; grid-template-columns: 180px 1fr 180px; gap: 24px; align-items: center; min-height: 72px; border-bottom: 1px solid var(--line); }
.search-results li a { min-height: 44px; display: inline-flex; align-items: center; font-weight: 800; text-decoration: none; }
.search-results li a:hover { color: var(--red); }
.search-results li p, .search-results li small { color: var(--muted); }

.site-footer { width: min(calc(100% - 40px), var(--max)); margin: auto; padding: 40px 0 54px; border-top: 1px solid var(--ink); display: grid; grid-template-columns: 1fr auto; gap: 24px; font-size: 13px; color: var(--muted); }
.site-footer img { width: 130px; height: auto; }
.site-footer p { margin: 6px 0 0; }
.site-footer nav { display: flex; gap: 22px; }
.site-footer nav a { min-height: 44px; display: inline-flex; align-items: center; }
.footer-review { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 20px; padding-top: 4px; border-top: 1px solid var(--line); }

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

@media (max-width: 820px) {
  .header-inner { align-items: flex-start; flex-direction: column; gap: 4px; padding: 16px 0 10px; }
  .brand img { width: 142px; }
  .main-nav { width: 100%; gap: 0; justify-content: space-between; font-size: 12px; }
  .main-nav a { padding: 0 5px; }
  .opening { grid-template-columns: 1fr; gap: 24px; padding: 50px 0 38px; }
  .opening h1 { font-size: clamp(38px, 11vw, 53px); }
  .opening-copy { padding: 0; }
  .site-search { margin-top: 16px; padding: 22px 18px 18px; }
  .search-row { grid-template-columns: 1fr 72px; }
  .section-head { align-items: flex-start; }
  .definition { padding: 50px 0; }
  .definition-head { grid-template-columns: 1fr; gap: 8px; margin-bottom: 24px; }
  .definition-grid { grid-template-columns: 1fr; }
  .definition-grid article, .definition-grid article + article { grid-template-columns: 105px minmax(0, 1fr); padding: 22px 0; border-left: 0; }
  .definition-grid article + article { border-top: 1px solid var(--line); }
  .essential { padding: 48px 0 54px; }
  .essential-list { display: block; }
  .essential-item, .essential-item:nth-child(even), .essential-item:first-child { grid-row: auto; grid-template-columns: 120px 1fr; min-height: 78px; padding: 12px 0; border-left: 0; }
  .essential-item:first-child .essential-name { font-size: 18px; font-family: inherit; }
  .chapter-nav { position: static; grid-template-columns: 1fr; border-bottom: 0; }
  .chapter-nav a { flex-direction: row; justify-content: space-between; min-height: 48px; padding: 0; border-right: 0; border-bottom: 1px solid var(--line); text-align: left; }
  .chapter { padding: 58px 0; }
  .chapter-intro { grid-template-columns: 1fr; gap: 16px; margin-bottom: 30px; }
  .chapter h2 { font-size: 31px; white-space: normal; }
  .chapter-groups, .chapter[data-layout] .chapter-groups { grid-template-columns: 1fr; gap: 34px; }
  .chapter[data-layout] .link-group, .chapter[data-layout] .link-group + .link-group { padding: 0; border-left: 0; background: transparent; }
  .editorial-links { display: block; }
  .editorial-link, .editorial-link:nth-child(even), .chapter[data-layout] .editorial-link { grid-template-columns: 120px 1fr; min-height: 76px; display: grid; padding: 12px 0; border-left: 0; }
  .chapter[data-layout="index"] .editorial-link p, .chapter[data-layout="compact"] .editorial-link p { display: block; }
  .change-list li { grid-template-columns: 84px 1fr; gap: 6px 16px; padding: 14px 0; }
  .change-list span { grid-column: 2; }
  .change-list strong em { min-width: 44px; margin-right: 7px; }
  .method { grid-template-columns: 1fr; gap: 30px; padding: 32px 24px; }
  .method li { grid-template-columns: 28px 1fr; }
  .method li span { grid-column: 2; }
  .search-results { padding: 30px 20px; }
  .search-results li { grid-template-columns: 120px 1fr; gap: 8px 14px; padding: 12px 0; }
  .search-results li small { grid-column: 2; }
  .home-guide, .home-faq { padding-bottom: 58px; }
  .guide-list { grid-template-columns: 1fr; }
  .guide-list article, .guide-list article + article { padding: 22px 0; border-left: 0; }
  .guide-list article + article { border-top: 1px solid var(--line); }
  .guide-list h3, .guide-list p { min-height: 0; }
  .report-callout { grid-template-columns: 1fr; gap: 24px; margin-bottom: 58px; padding: 28px 24px; }
  .report-callout a { justify-self: start; }
  .site-footer { grid-template-columns: 1fr; }
  .site-footer nav { flex-wrap: wrap; gap: 6px 20px; }
  .footer-review { grid-column: auto; }
}

@media (max-width: 420px) {
  main, .header-inner, .site-footer { width: min(calc(100% - 28px), var(--max)); }
  .opening h1 { font-size: 39px; }
  .opening-copy p { font-size: 15px; }
  .search-suggestions span { width: 100%; }
  .section-head h2, .method h2 { font-size: 25px; }
  .section-head > a { font-size: 12px; }
  .essential-item, .essential-item:nth-child(even), .editorial-link, .editorial-link:nth-child(even), .chapter[data-layout] .editorial-link { grid-template-columns: 105px 1fr; gap: 12px; }
}
