:root {
  --ink: #24322d;
  --muted: #68756f;
  --paper: #fffdf9;
  --cream: #f5f1e9;
  --green: #2f5d50;
  --green-deep: #244c41;
  --green-soft: #e5f0eb;
  --blue: #426b82;
  --blue-soft: #e9f2f6;
  --coral: #d86f57;
  --coral-soft: #fff0eb;
  --gold: #c8913c;
  --line: #e3ddd2;
  --shadow: 0 18px 48px rgba(43, 61, 53, .09);
  --radius: 22px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: inherit; }
button, input { font: inherit; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 16px; z-index: 100; padding: 10px 14px; background: #fff; border-radius: 10px; }

.hero {
  position: relative;
  overflow: hidden;
  padding: 68px 24px 92px;
  color: #fff;
  background: linear-gradient(135deg, #244c41 0%, #356859 58%, #617f70 100%);
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
}
.hero::before { width: 440px; height: 440px; right: -145px; top: -255px; }
.hero::after { width: 260px; height: 260px; left: -120px; bottom: -130px; }
.hero-inner { position: relative; z-index: 1; width: min(1120px, 100%); margin: auto; }
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  color: #e8f3ee;
  background: rgba(255, 255, 255, .07);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .07em;
}
.kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #f2bb6b; box-shadow: 0 0 0 4px rgba(242, 187, 107, .16); }
.hero h1 { max-width: 780px; margin: 0; font-size: clamp(2.3rem, 6.2vw, 4.8rem); line-height: 1.08; letter-spacing: -.055em; }
.hero h1 em { color: #ffd1c3; font-style: normal; }
.hero-copy { max-width: 650px; margin: 22px 0 0; color: #dfebe6; font-size: clamp(1rem, 2vw, 1.16rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.hero-actions a { display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; color: #fff; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px; text-decoration: none; font-size: .82rem; font-weight: 800; }
.hero-actions a:hover { background: rgba(255, 255, 255, .17); }
.hero-actions span { color: #ffd1c3; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.hero-meta span { padding: 7px 11px; border-radius: 999px; color: #dbe9e3; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); font-size: .8rem; }

.shell { width: min(1120px, calc(100% - 32px)); margin: -48px auto 80px; position: relative; z-index: 2; }
.featured { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.feature-card {
  min-width: 0;
  padding: 23px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.feature-card:hover { transform: translateY(-4px); border-color: #b9c9c1; box-shadow: 0 22px 58px rgba(43, 61, 53, .13); }
.feature-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.feature-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--green-soft); color: var(--green); }
.feature-card[data-tone="blue"] .feature-icon { color: var(--blue); background: var(--blue-soft); }
.feature-card[data-tone="coral"] .feature-icon { color: var(--coral); background: var(--coral-soft); }
.feature-arrow { color: #9aa59f; font-size: 1.2rem; }
.feature-eyebrow { margin: 19px 0 4px; color: var(--green); font-size: .72rem; font-weight: 850; letter-spacing: .08em; }
.feature-card[data-tone="blue"] .feature-eyebrow { color: var(--blue); }
.feature-card[data-tone="coral"] .feature-eyebrow { color: var(--coral); }
.feature-card h2 { margin: 0; font-size: 1.25rem; letter-spacing: -.035em; }
.feature-card p { margin: 10px 0 0; color: var(--muted); font-size: .88rem; }

.library { margin-top: 42px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.15rem); letter-spacing: -.04em; }
.section-head p { margin: 5px 0 0; color: var(--muted); font-size: .9rem; }
.search-wrap { position: relative; flex: 0 1 340px; }
.search-wrap svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #7c8983; }
.search {
  width: 100%;
  height: 46px;
  padding: 0 15px 0 43px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
}
.search:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(47, 93, 80, .12); }
.filters { display: flex; gap: 8px; margin-bottom: 20px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter {
  flex: 0 0 auto;
  padding: 8px 13px;
  color: var(--muted);
  background: #ebe6dc;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 750;
}
.filter[aria-pressed="true"] { color: #fff; background: var(--green); }
.category { margin: 29px 0; }
.category-title { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 1rem; }
.category-title span { display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; color: var(--muted); background: #ebe6dc; border-radius: 999px; font-size: .72rem; }
.doc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.doc-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: start;
  min-width: 0;
  padding: 16px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  text-decoration: none;
  transition: border-color .18s ease, transform .18s ease;
}
.doc-card:hover { transform: translateY(-2px); border-color: #b8c9c1; }
.doc-type { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: var(--green); background: var(--green-soft); font-size: .68rem; font-weight: 900; }
.doc-category { display: inline-block; margin: 0 0 4px; color: var(--green); font-size: .68rem; font-weight: 850; letter-spacing: .03em; }
.doc-card h3 { margin: 0 0 4px; font-size: .98rem; line-height: 1.4; letter-spacing: -.025em; }
.doc-card p { display: -webkit-box; margin: 0; overflow: hidden; color: var(--muted); font-size: .78rem; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.doc-meta { margin-top: 8px; color: #65736d; font-size: .72rem; }
.doc-arrow { margin-top: 9px; color: #a0aaa5; }
.empty { display: none; padding: 35px; color: var(--muted); text-align: center; background: var(--paper); border: 1px dashed var(--line); border-radius: 16px; }

.footer { padding: 28px 24px 40px; color: var(--muted); text-align: center; font-size: .78rem; }
.footer strong { color: var(--green); }

/* Generated Markdown documents */
.doc-body { background: #f4f1ea; }
.doc-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 9px max(18px, calc((100% - 1040px) / 2));
  background: rgba(255, 253, 249, .93);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.doc-nav a { color: var(--green); text-decoration: none; font-size: .86rem; font-weight: 800; }
.doc-nav span { overflow: hidden; color: var(--muted); font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.doc-article {
  width: min(920px, calc(100% - 30px));
  margin: 28px auto 70px;
  padding: clamp(28px, 6vw, 62px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.doc-article > header { margin-bottom: 30px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.document-toc { margin: 0 0 30px; padding: 14px 17px; background: #f2eee6; border: 1px solid var(--line); border-radius: 14px; }
.document-toc summary { color: var(--green); cursor: pointer; font-weight: 800; }
.document-toc nav { margin-top: 12px; }
.document-toc ul { margin: 6px 0; padding-left: 1.2rem; }
.document-toc a { color: var(--muted); font-size: .84rem; text-decoration: none; }
.doc-article h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.15; letter-spacing: -.055em; }
.doc-article h2 { margin: 2.2em 0 .7em; font-size: 1.55rem; line-height: 1.35; letter-spacing: -.035em; }
.doc-article h3 { margin: 1.8em 0 .6em; font-size: 1.18rem; }
.doc-article h4 { margin: 1.5em 0 .5em; }
.doc-article p, .doc-article li { font-size: .97rem; }
.doc-article blockquote { margin: 24px 0; padding: 16px 20px; color: #3d584d; background: var(--green-soft); border-left: 4px solid var(--green); border-radius: 0 12px 12px 0; }
.doc-article blockquote p { margin: .3em 0; }
.doc-article table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: .86rem; }
.doc-article .table-scroll { overflow-x: auto; }
.doc-article th, .doc-article td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.doc-article th { background: var(--green-soft); }
.doc-article pre { overflow-x: auto; padding: 16px; color: #e2f0e9; background: #223b33; border-radius: 12px; }
.doc-article code { padding: .15em .35em; background: #eeeae2; border-radius: 5px; font-size: .9em; }
.doc-article pre code { padding: 0; background: transparent; }
.doc-article img { max-width: 100%; height: auto; }
.doc-article a { color: var(--green); text-underline-offset: 3px; }
.doc-article hr { margin: 36px 0; border: 0; border-top: 1px solid var(--line); }
.doc-article input[type="checkbox"] { accent-color: var(--green); transform: scale(1.12); }

.portal-home {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 999;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  color: #fff !important;
  background: #2f5d50;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(30, 59, 50, .28);
  text-decoration: none !important;
  font: 750 13px/1.2 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
}

@media (max-width: 780px) {
  .hero { padding: 48px 20px 78px; }
  .shell { width: min(100% - 20px, 1120px); margin-top: -37px; }
  .featured { grid-template-columns: 1fr; }
  .feature-card { padding: 20px; }
  .section-head { align-items: stretch; flex-direction: column; }
  .search-wrap { flex-basis: auto; }
  .doc-grid { grid-template-columns: 1fr; }
  .doc-article { width: min(100% - 16px, 920px); margin-top: 12px; padding: 23px 18px 44px; border-radius: 17px; }
  .doc-article p, .doc-article li { font-size: .94rem; }
  .doc-nav { padding-inline: 14px; }
}

@media print {
  .doc-nav, .portal-home { display: none !important; }
  .doc-body, body { background: #fff; }
  .doc-article { width: 100%; margin: 0; padding: 0; border: 0; box-shadow: none; }
}
