@font-face {
  font-family: "Guide Hand";
  src: url("fonts/NanumPenScript-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #fffdf5;
  --paper-deep: #f8f3e4;
  --ink: #17213d;
  --blue: #2457a7;
  --blue-soft: #e8f1ff;
  --pink: #ff6f9f;
  --pink-soft: #ffe4ed;
  --yellow: #ffe66d;
  --green: #2c8068;
  --line: rgba(52, 102, 165, 0.13);
  --border: #cad6e7;
  --shadow: 0 14px 38px rgba(26, 46, 84, 0.12);
  --radius: 18px;
  --sidebar: 300px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 24px 24px;
  font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.82;
  word-break: keep-all;
}

a { color: var(--blue); text-underline-offset: 3px; }
a:hover { color: #163e80; }
button, input { font: inherit; }
button { color: inherit; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }

.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 1000;
  padding: 10px 16px; border-radius: 10px; color: white; background: var(--ink);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.reading-progress {
  position: fixed; inset: 0 auto auto 0; z-index: 999; height: 5px; width: 0;
  background: linear-gradient(90deg, var(--pink), var(--yellow), var(--blue));
}

.hero {
  position: relative; overflow: hidden;
  padding: 64px max(24px, calc((100vw - 1280px) / 2)) 46px;
  color: white;
  background: linear-gradient(135deg, #173467 0%, #2457a7 65%, #3674ca 100%);
}
.brand-bar { border-bottom: 1px solid #d4deeb; background-color: var(--paper); background-image: linear-gradient(90deg, transparent 23px, rgba(52,102,165,.08) 24px), linear-gradient(transparent 23px, rgba(52,102,165,.08) 24px); background-size: 24px 24px; }
.brand-bar-inner { display: flex; max-width: 1280px; min-height: 92px; align-items: center; gap: 18px; margin: 0 auto; padding: 10px 24px; }
.brand-name { padding-left: 18px; border-left: 1px solid #bdc9d9; color: #1e3a5f; font-size: .92rem; font-weight: 850; letter-spacing: .025em; }
.hub-back-link {
  display: inline-flex; align-items: center; gap: .45em; margin-left: auto; padding: 9px 14px;
  border: 1px solid #bdc9d9; border-radius: 999px; color: #1e3a5f; background: rgba(255,255,255,.88);
  box-shadow: 0 4px 12px rgba(26,46,84,.08); font-size: .88rem; font-weight: 850; line-height: 1.35;
  text-decoration: none; white-space: nowrap; transition: transform .2s, box-shadow .2s;
}
.hub-back-link:hover { color: #163e80; box-shadow: 0 7px 18px rgba(26,46,84,.14); transform: translateY(-2px); }
.service-marks {
  position: absolute; z-index: 2; top: 50%; right: max(24px, calc((100vw - 1280px) / 2));
  width: 336px; height: 294px;
  transform: translateY(-43%);
}
.service-mark {
  position: absolute; display: grid; place-items: center; align-content: center; gap: 2px;
  border: 0; background: transparent;
  color: white;
}
.service-mark:nth-of-type(1) { left: 8px; top: 86px; width: 145px; height: 150px; }
.service-mark:nth-of-type(2) { right: 9px; top: 52px; width: 116px; height: 119px; }
.service-mark:nth-of-type(3) { right: 20px; bottom: 0; width: 130px; height: 135px; }
.service-mark img { display: block; width: 78px; height: 78px; object-fit: contain; filter: drop-shadow(0 10px 12px rgba(5,20,48,.28)); }
.service-mark:nth-of-type(1) img { width: 98px; height: 98px; filter: brightness(0) invert(1) drop-shadow(0 10px 12px rgba(5,20,48,.25)); }
.service-mark:nth-of-type(2) img { width: 72px; height: 72px; }
.service-mark:nth-of-type(3) img { width: 84px; height: 84px; }
.service-mark span { padding: 0 9px 2px; border: 0; background: transparent; color: white; font-family: "Guide Hand", "Malgun Gothic", sans-serif; font-size: 1.24rem; font-weight: 400; line-height: 1; text-shadow: 0 2px 5px rgba(0,0,0,.35); }
.service-mark:nth-of-type(1) span { box-shadow: inset 0 -.36em 0 rgba(70,211,157,.68); transform: rotate(-2deg); }
.service-mark:nth-of-type(2) span { box-shadow: inset 0 -.36em 0 rgba(255,132,90,.72); transform: rotate(2deg); }
.service-mark:nth-of-type(3) span { box-shadow: inset 0 -.36em 0 rgba(135,171,255,.7); transform: rotate(-1deg); }
.doodle-hatch { position: absolute; left: 18px; bottom: 14px; width: 105px; height: 35px; opacity: .65; background: repeating-linear-gradient(90deg, rgba(255,255,255,.85) 0 2px, transparent 2px 8px); transform: skewY(-4deg); }
.doodle-dots { position: absolute; left: 166px; top: 65px; width: 48px; height: 78px; opacity: .8; background-image: radial-gradient(circle, var(--yellow) 0 3px, transparent 3.5px); background-size: 16px 18px; transform: rotate(5deg); }
.doodle-spark { position: absolute; color: var(--yellow); font-family: "Segoe Print", "Comic Sans MS", cursive; line-height: 1; text-shadow: 0 4px 8px rgba(5,20,48,.2); }
.spark-one { left: 145px; top: 150px; font-size: 1.55rem; transform: rotate(-12deg); }
.spark-two { left: 129px; bottom: 47px; color: #ff92b8; font-size: 1.3rem; transform: rotate(9deg); }
.relationship-note {
  position: absolute; left: 10px; top: 0; width: 265px; margin: 0; color: white; text-align: left;
  font-family: "Guide Hand", "Malgun Gothic", sans-serif; font-size: 1.72rem; font-weight: 400; line-height: 1.08; letter-spacing: .01em; transform: rotate(-1.5deg);
}
.relationship-note::after { content: ""; display: block; width: 248px; height: 9px; margin: -7px 0 0; border-radius: 60% 40% 55% 45%; background: rgba(255,230,109,.62); transform: rotate(-1deg); }
.relationship-note span { display: inline-block; margin: 0 5px; color: var(--yellow); font-size: 1.45rem; transform: rotate(-5deg); }
.brand-lockup {
  position: relative; z-index: 2; display: inline-flex; align-items: center; justify-content: center;
  width: 180px; height: 70px; margin: 0; padding: 0;
  background: transparent;
}
.brand-lockup img { display: block; width: 100%; height: 100%; object-fit: contain; }
.eyebrow { margin: 0 0 10px; color: var(--yellow); font-weight: 800; letter-spacing: .08em; }
.hero h1 { max-width: 790px; margin: 0; font-size: clamp(2.25rem, 5vw, 4.6rem); line-height: 1.28; letter-spacing: -.045em; }
.hero h1 span { display: inline-block; padding-bottom: .06em; box-shadow: inset 0 -.24em 0 rgba(255, 111, 159, .55); }
.hero-copy { max-width: 760px; margin: 20px 0; font-size: 1.12rem; color: #eef5ff; }

.mobile-bar { display: none; position: sticky; top: 0; z-index: 50; padding: 10px 14px; background: rgba(255,253,245,.96); border-bottom: 1px solid var(--border); backdrop-filter: blur(12px); }
.menu-button, .utility-button, .copy-button, .chapter-link {
  border: 1px solid var(--border); border-radius: 11px; background: white; cursor: pointer;
}
.menu-button, .utility-button { padding: 9px 12px; font-weight: 760; }

.page-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 850px); gap: 38px; max-width: 1240px; margin: 0 auto; padding: 34px 24px 90px; align-items: start; }
.sidebar {
  position: sticky; top: 22px; max-height: calc(100vh - 44px); overflow: auto;
  padding: 20px; border: 1px solid var(--border); border-radius: var(--radius);
  background: rgba(255,253,245,.96); box-shadow: var(--shadow);
}
.sidebar-title { margin: 0 0 12px; font-size: 1rem; }
.search-wrap { display: block; margin-bottom: 12px; }
.search-wrap span { display: block; margin-bottom: 5px; font-size: .82rem; font-weight: 750; }
.search-wrap input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--ink); background: white; }
.chapter-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 13px 0; }
.chapter-link { padding: 8px 4px; border-width: 2px; text-align: center; text-decoration: none; font-family: "Segoe Print", "Comic Sans MS", "Malgun Gothic", sans-serif; font-size: .78rem; font-weight: 850; }
.chapter-link:nth-child(1) { border-color: #78caa7; border-radius: 48% 52% 45% 55% / 55% 46% 54% 45%; background: #effaf4; transform: rotate(-1deg); }
.chapter-link:nth-child(2) { border-color: #ed9a74; border-radius: 54% 46% 53% 47% / 47% 55% 45% 53%; background: #fff4ed; transform: rotate(1.2deg); }
.chapter-link:nth-child(3) { border-color: #8fb2ec; border-radius: 47% 53% 44% 56% / 55% 48% 52% 45%; background: #f0f5ff; transform: rotate(-.5deg); }
.chapter-link:hover, .chapter-link:focus-visible { transform: translateY(-2px) rotate(0); }
.utility-row { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 12px 0 16px; }
.utility-button { font-size: .78rem; padding: 8px 5px; }
.toc { border-top: 1px dashed var(--border); padding-top: 12px; }
.toc a { display: block; padding: 5px 7px; border-radius: 7px; color: #40506f; text-decoration: none; font-size: .84rem; line-height: 1.45; }
.toc a[data-level="1"] { margin-top: 8px; color: var(--ink); font-weight: 850; }
.toc a[data-level="2"] { padding-left: 15px; }
.toc a:hover, .toc a.active { color: var(--blue); background: var(--blue-soft); }

.guide-content { min-width: 0; }
.guide-content > h1 {
  position: relative; margin: 80px 0 26px; padding: 19px 24px 18px 34px;
  border: 2px solid var(--ink); border-radius: 17px; background: white; box-shadow: 7px 7px 0 var(--yellow);
  font-size: clamp(1.7rem, 4vw, 2.5rem); line-height: 1.25; letter-spacing: -.035em;
}
.guide-content > h1:first-of-type { margin-top: 46px; }
.guide-content > h1::before { content: "✎"; position: absolute; left: -15px; top: -22px; color: var(--pink); font-size: 2rem; transform: rotate(-10deg); }
.guide-content h3 { margin: 28px 0 10px; color: #213d76; font-size: 1.17rem; }
.guide-content h4 { margin: 22px 0 8px; font-size: 1rem; }
.guide-content p, .guide-content li { max-width: 78ch; }
.guide-content hr { margin: 42px 0; border: 0; border-top: 2px dashed #afbdd2; }

.topic-card {
  margin: 18px 0; border: 1px solid var(--border); border-radius: var(--radius);
  background: rgba(255,255,255,.94); box-shadow: 0 8px 22px rgba(34, 62, 107, .08); overflow: clip;
}
.topic-card[hidden] { display: none; }
.topic-title { margin: 0; font-size: 1.22rem; line-height: 1.35; }
.topic-toggle {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 18px;
  padding: 17px 20px; border: 0; cursor: pointer; text-align: left; font-weight: 850;
  background: linear-gradient(90deg, var(--blue-soft), rgba(255,255,255,.9));
}
.topic-toggle::after { content: "+"; flex: none; display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: white; color: var(--blue); font-size: 1.35rem; box-shadow: 0 2px 8px rgba(30, 60, 100, .12); }
.topic-toggle[aria-expanded="true"]::after { content: "−"; }
.topic-body { padding: 2px 24px 25px; border-top: 1px dashed var(--border); }
.topic-body[hidden] { display: none; }
.topic-card.search-hit { border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-soft); }

blockquote {
  margin: 19px 0; padding: 15px 18px 15px 20px; border: 0; border-left: 6px solid var(--pink);
  border-radius: 0 14px 14px 0; background: var(--pink-soft); color: #293754;
}
blockquote p { margin: 5px 0; }
strong { color: #102e64; }
mark { padding: 0 .18em; background: linear-gradient(transparent 45%, rgba(255,230,109,.82) 45%); }

pre {
  position: relative; margin: 18px 0; padding: 22px 18px 17px; overflow: auto;
  border: 1px solid #aabbd5; border-radius: 14px; background: #f4f7fc; color: #17213d;
  white-space: pre-wrap; word-break: break-word; line-height: 1.65;
}
code { padding: .12em .34em; border-radius: 5px; background: #edf2fa; font-family: "Cascadia Code", Consolas, monospace; font-size: .9em; }
pre code { padding: 0; background: transparent; }
.copy-button { position: absolute; top: 8px; right: 8px; padding: 6px 9px; color: var(--blue); font-size: .76rem; font-weight: 800; }
.copy-button.copied { background: #e2f5eb; color: var(--green); }

.table-wrap { margin: 18px 0; overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: white; }
table { width: 100%; min-width: 580px; border-collapse: collapse; font-size: .93rem; }
th, td { padding: 11px 13px; border-bottom: 1px solid #dbe3ef; border-right: 1px solid #e1e7f0; text-align: left; vertical-align: top; }
th { color: #102e64; background: var(--blue-soft); }
tr:last-child td { border-bottom: 0; }

figure.guide-figure { margin: 30px auto; max-width: 820px; }
figure.guide-figure img {
  display: block; width: 100%; height: auto; border: 1px solid #b9c7db; border-radius: 18px;
  background: white; box-shadow: var(--shadow); cursor: zoom-in;
}
figcaption { margin-top: 10px; padding: 0 10px; color: #53617a; text-align: center; font-size: .9rem; }

.empty-search { display: none; padding: 28px; border: 2px dashed var(--border); border-radius: 16px; background: white; text-align: center; }
.empty-search.visible { display: block; }
.search-status { min-height: 1.4em; margin: 4px 0 0; color: #5b6880; font-size: .78rem; }
.back-to-top { position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 46px; height: 46px; border: 1px solid var(--border); border-radius: 50%; background: white; box-shadow: var(--shadow); cursor: pointer; font-weight: 900; opacity: 0; pointer-events: none; transition: opacity .2s; }
.back-to-top.visible { opacity: 1; pointer-events: auto; }

dialog.image-dialog { width: min(94vw, 1240px); max-height: 94vh; padding: 14px; border: 0; border-radius: 18px; background: white; box-shadow: 0 24px 90px rgba(0,0,0,.35); }
dialog.image-dialog::backdrop { background: rgba(13, 23, 43, .82); }
.dialog-close { position: sticky; top: 0; float: right; z-index: 2; width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--ink); color: white; cursor: pointer; font-size: 1.4rem; }
.dialog-image { display: block; max-width: 100%; max-height: calc(94vh - 78px); margin: 0 auto; object-fit: contain; }
.dialog-caption { margin: 8px 0 0; text-align: center; }

.site-footer { display: flex; align-items: flex-start; justify-content: center; gap: 22px; padding: 30px 26px; color: #dfe9ff; background: var(--ink); text-align: left; font-size: .82rem; line-height: 1.65; }
.site-footer img { display: block; width: 112px; height: 62px; padding: 5px 10px; border-radius: 10px; background: white; object-fit: contain; }
.site-footer p { max-width: 760px; margin: 0 0 6px; }
.footer-back-link { display: inline-block; margin: 0 0 12px; color: white; font-weight: 850; }
.footer-back-link:hover { color: var(--yellow); }
.site-footer .copyright { color: white; font-weight: 850; }
.site-footer .trademark-note { color: #afbdd7; font-size: .77rem; }

@media (max-width: 900px) {
  body { font-size: 16px; }
  .hero { padding: 48px 22px 35px; }
  .brand-bar-inner { min-height: 78px; gap: 12px; padding: 8px 18px; }
  .brand-lockup { width: 140px; height: 58px; }
  .brand-name { padding-left: 12px; font-size: .76rem; }
  .service-marks { position: relative; top: auto; right: auto; width: min(336px, 88vw); height: 294px; margin: 38px auto 0; transform: none; }
  .service-mark { width: 108px; height: 108px; }
  .service-mark img { width: 52px; height: 52px; }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; }
  .page-shell { display: block; padding: 20px 14px 70px; }
  .sidebar { position: fixed; inset: 56px 12px auto; z-index: 60; max-height: calc(100vh - 72px); transform: translateY(-120%); opacity: 0; transition: .2s ease; }
  .sidebar.open { transform: translateY(0); opacity: 1; }
  .guide-content > h1 { margin-top: 62px; padding: 17px 17px 16px 25px; }
  .topic-body { padding: 1px 16px 20px; }
  .topic-toggle { padding: 15px 16px; }
  figure.guide-figure { margin: 24px -4px; }
  .site-footer { flex-direction: column; text-align: center; }
}

@media (max-width: 600px) {
  .brand-bar-inner { gap: 8px; }
  .brand-lockup { width: 118px; height: 52px; }
  .brand-name { display: none; }
  .hub-back-link { padding: 8px 10px; font-size: .76rem; }
}

@media (min-width: 901px) and (max-width: 1180px) {
  .hero { padding-bottom: 52px; }
  .service-marks { position: relative; top: auto; right: auto; margin: 38px auto 0; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

@media print {
  @page { size: A4; margin: 16mm; }
  body { color: #111; background: white; font-size: 10.5pt; line-height: 1.55; }
  .reading-progress, .mobile-bar, .sidebar, .back-to-top, .copy-button, .hub-back-link, .site-footer { display: none !important; }
  .hero { padding: 14mm 0 10mm; color: #111; background: white; border-bottom: 3px solid #222; }
  .brand-bar { background: white; }
  .brand-bar-inner { min-height: 20mm; padding: 2mm 0; }
  .eyebrow { display: none; }
  .brand-lockup { width: 38mm; height: 18mm; margin: 0; padding: 0; border: 0; box-shadow: none; }
  .service-marks { position: relative; top: auto; right: auto; width: 68mm; height: 54mm; margin: 6mm auto; border: 0; background: none; transform: none; }
  .service-mark { width: 24mm; height: 24mm; min-height: 0; box-shadow: none; }
  .service-mark img { width: 12mm; height: 12mm; }
  .hero-copy { color: #333; }
  .page-shell { display: block; max-width: none; padding: 0; }
  .guide-content > h1 { break-before: page; box-shadow: none; }
  .topic-card { break-inside: avoid; box-shadow: none; }
  .topic-body[hidden] { display: block !important; }
  .topic-toggle::after { display: none; }
  figure.guide-figure img { box-shadow: none; }
  a { color: inherit; text-decoration: none; }
}
