:root {
  color-scheme: light;
  --ink: #24314a;
  --muted: #65708a;
  --paper: rgba(255, 255, 255, 0.92);
  --line: rgba(90, 102, 132, 0.14);
  --pink: #fbcfe8;
  --pink-deep: #be185d;
  --mint: #c8e6c9;
  --mint-deep: #237a52;
  --apricot: #ffe0b2;
  --apricot-deep: #9a5b16;
  --blue: #dbeafe;
  --blue-deep: #2563a5;
  --yellow: #fef3c7;
  --lavender: #ede9fe;
  --shadow: 0 24px 70px rgba(93, 81, 135, 0.13);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 10%, rgba(251, 207, 232, 0.78), transparent 24rem),
    radial-gradient(circle at 92% 18%, rgba(219, 234, 254, 0.9), transparent 28rem),
    radial-gradient(circle at 18% 74%, rgba(220, 252, 231, 0.78), transparent 25rem),
    linear-gradient(145deg, #fffaf5 0%, #fff 48%, #faf7ff 100%);
  font-family: "Noto Sans KR", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.72;
  word-break: keep-all;
}

a { color: inherit; }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 0.65rem 0.9rem;
  color: #fff;
  background: var(--ink);
  border-radius: 4px;
  transform: translateY(-160%);
}

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

.guide-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 44px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 8px 4px 22px;
}

.brand {
  color: var(--pink-deep);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.header-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.header-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0.4rem 0.85rem;
  color: var(--blue-deep);
  background: rgba(239, 246, 255, 0.86);
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
}

.header-link-practice {
  color: var(--pink-deep);
  background: rgba(253, 242, 248, 0.9);
  border-color: var(--pink);
}

.header-link:hover { transform: translateY(-1px); }

.header-link:focus-visible,
.section-nav a:focus-visible,
.start-card > a:focus-visible,
.reference-list a:focus-visible,
.topic-card:focus-visible,
.article-pager a:focus-visible {
  outline: 3px solid rgba(37, 99, 165, 0.28);
  outline-offset: 3px;
}

.hero,
.content-section,
.start-card {
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.84fr) minmax(420px, 1.16fr);
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
  padding: clamp(34px, 6vw, 72px);
  border-radius: 12px;
  overflow: hidden;
}

.eyebrow,
.section-kicker,
.detail-label {
  margin: 0 0 0.7rem;
  color: var(--pink-deep);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  max-width: 10ch;
  font-size: clamp(2.8rem, 6vw, 5.4rem);
  line-height: 1.03;
  letter-spacing: -0.075em;
}

.hero-lead {
  margin: 1.5rem 0 0;
  color: #4d5871;
  font-size: clamp(1rem, 1.8vw, 1.18rem);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.35rem;
}

.hero-tags span {
  padding: 0.42rem 0.7rem;
  color: #6d4160;
  background: #fff7fb;
  border: 1px solid #fbcfe8;
  border-radius: 5px;
  font-size: 0.78rem;
  font-weight: 800;
}

.hero-figure { margin: 0; }

.hero-figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border: 10px solid rgba(255, 255, 255, 0.88);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(87, 73, 118, 0.18);
}

.hero-figure figcaption {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.section-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin: 22px 0;
}

.section-nav a {
  padding: 0.5rem 0.85rem;
  color: #56627b;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.guide-nav a[aria-current="page"] {
  color: #fff;
  background: #384967;
  border-color: #384967;
}

.content-section {
  margin-top: 22px;
  padding: clamp(30px, 6vw, 68px);
  border-radius: 10px;
}

.section-heading { max-width: 760px; }

.section-heading h2,
.start-card h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.1rem);
  line-height: 1.15;
  letter-spacing: -0.055em;
}

.section-heading > p:last-child {
  margin: 1.05rem 0 0;
  color: var(--muted);
}

.principle-grid,
.design-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 2rem;
}

.three-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.principle-card,
.detail-card,
.limits-card,
.technical-note,
.quiet-note {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.principle-card {
  min-height: 210px;
  padding: 1.5rem;
}

.card-mint { background: #f1fcf4; }
.card-blue { background: #f2f7ff; }
.card-pink { background: #fff5fa; }
.card-yellow { background: #fffbea; }

.card-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: #64708b;
  background: rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  font-size: 0.76rem;
  font-weight: 900;
}

.principle-card h3,
.detail-card h3,
.technical-note h3,
.limits-card h3 {
  margin: 1rem 0 0.55rem;
  font-size: 1.16rem;
  letter-spacing: -0.035em;
}

.principle-card p,
.detail-card p,
.technical-note p,
.limits-card p { margin: 0; color: var(--muted); }

.quiet-note {
  margin-top: 14px;
  padding: 1.1rem 1.25rem;
  color: #6a5567;
  background: #fff8fb;
  border-color: #fbcfe8;
}

.quiet-note strong { color: var(--pink-deep); }

.guide-directory { background: rgba(249, 247, 255, 0.94); }

.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 2rem;
}

.topic-card {
  position: relative;
  display: flex;
  min-height: 230px;
  flex-direction: column;
  padding: 1.45rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.topic-card:hover {
  border-color: #bfdbfe;
  box-shadow: 0 12px 26px rgba(73, 88, 122, 0.1);
  transform: translateY(-2px);
}

.topic-card > span {
  color: var(--pink-deep);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.topic-card > strong {
  margin-top: 1rem;
  font-size: 1.14rem;
  letter-spacing: -0.035em;
}

.topic-card p { margin: 0.6rem 0 1rem; color: var(--muted); }
.topic-card b { margin-top: auto; color: var(--blue-deep); font-size: 1.2rem; }

.comparison-table-wrap {
  margin-top: 2rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  -webkit-overflow-scrolling: touch;
}

.comparison-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.88rem;
}

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

.comparison-table thead th {
  color: #536078;
  background: #f8f7fc;
  font-size: 0.78rem;
}

.comparison-table tbody th { white-space: nowrap; }
.comparison-table tbody a { color: var(--blue-deep); font-weight: 900; }
.comparison-table tbody tr:last-child th,
.comparison-table tbody tr:last-child td { border-bottom: 0; }
.comparison-table .haribao-row { background: #fff8fb; }
.comparison-table .haribao-row th { color: var(--pink-deep); }

.source-note {
  margin: 0.75rem 0 0;
  color: #7b8498;
  font-size: 0.78rem;
}

.color-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 2rem;
}

.color-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem;
  background: #fbfbfd;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.color-item > div { display: grid; }
.color-item strong { font-size: 0.9rem; }
.color-item span:last-child { color: var(--muted); font-size: 0.78rem; }

.key-sample {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  color: #374151;
  border-radius: 4px;
  box-shadow: 0 3px 0 rgba(75, 85, 99, 0.18);
  font-weight: 900;
}

.key-left { background: var(--mint); }
.key-right { background: var(--apricot); }
.key-special { background: #eee; }

.detail-card {
  padding: 1.5rem;
  background: #fbfbfd;
}

.detail-card-korean {
  background: linear-gradient(145deg, #fff7fb, #fffaf0);
  border-color: #f7d5df;
}

.detail-label { margin-bottom: 0; color: #7a6fa0; }
.detail-card h3 { margin-top: 0.45rem; }

code,
kbd {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.9em;
}

code {
  padding: 0.12rem 0.34rem;
  color: #73415f;
  background: #fdf2f8;
  border-radius: 5px;
}

kbd {
  padding: 0.12rem 0.38rem;
  color: #435069;
  background: #f5f5f7;
  border: 1px solid #d7d9e0;
  border-bottom-width: 2px;
  border-radius: 5px;
}

.technical-note {
  margin-top: 14px;
  padding: 1.4rem 1.5rem;
  background: #f4f7ff;
  border-color: #dbeafe;
}

.technical-note h3 { margin-top: 0; color: var(--blue-deep); }

.language-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 2rem;
}

.language-list > div {
  display: grid;
  gap: 0.18rem;
  padding: 1rem 1.1rem;
  background: #fbfbfd;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.language-list strong { font-size: 0.95rem; }
.language-list span { color: var(--muted); font-size: 0.82rem; }

.limits-card {
  margin-top: 14px;
  padding: 1.45rem 1.55rem;
  background: transparent;
  border-color: transparent;
}

.limits-card h3 { margin-top: 0; }
.limits-card ul { margin: 0; padding-left: 1.2rem; }
.limits-card li + li { margin-top: 0.45rem; }

.hangul-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.25fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: 2rem;
}

.hangul-flow > div {
  display: grid;
  gap: 0.35rem;
  min-height: 108px;
  place-content: center;
  padding: 1rem;
  text-align: center;
  background: #fbfbfd;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.hangul-flow span { color: var(--muted); font-size: 0.78rem; }
.hangul-flow strong { font-size: clamp(1.15rem, 2.5vw, 1.55rem); }
.hangul-flow > b { color: #98a1b5; }

.references-section { background: rgba(249, 247, 255, 0.94); }

.reference-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1.2rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.reference-list a {
  display: block;
  padding: 0.85rem 1rem;
  color: #505d78;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 0.84rem;
  font-weight: 750;
  text-decoration: none;
}

.reference-list a:hover { color: var(--blue-deep); border-color: #bfdbfe; }
.compact-references { margin-top: 1.25rem; }

.start-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-top: 22px;
  padding: clamp(28px, 5vw, 52px);
  background: linear-gradient(135deg, rgba(253, 242, 248, 0.96), rgba(239, 246, 255, 0.96));
  border-radius: 10px;
}

.start-card p { margin: 0.65rem 0 0; color: var(--muted); }

.start-card > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 0.45rem;
  min-height: 50px;
  padding: 0.7rem 1.15rem;
  color: #fff;
  background: #384967;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(56, 73, 103, 0.2);
}

.article-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.article-pager a {
  display: grid;
  gap: 0.25rem;
  min-height: 90px;
  align-content: center;
  padding: 1rem 1.2rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
}

.article-pager a:last-child { text-align: right; }
.article-pager span { color: var(--muted); font-size: 0.76rem; }
.article-pager strong { font-size: 0.95rem; }
.article-pager a:hover { border-color: #bfdbfe; }

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 24px 6px 0;
  color: #7a8396;
  font-size: 0.78rem;
}

.site-footer > div { display: flex; gap: 0.85rem; }
.site-footer a { color: #66718a; }

@media (max-width: 840px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { max-width: 680px; }
  .hero h1 { max-width: 12ch; }
  .hero-figure { max-width: 680px; }
  .principle-grid,
  .design-grid,
  .reference-list,
  .topic-grid,
  .three-card-grid { grid-template-columns: 1fr; }
  .principle-card { min-height: 0; }
  .topic-card { min-height: 0; }
}

@media (max-width: 620px) {
  .guide-shell { width: min(100% - 18px, 1120px); padding-top: 10px; }
  .site-header { align-items: flex-start; }
  .header-links { gap: 0.35rem; }
  .header-link { min-height: 34px; padding: 0.32rem 0.65rem; font-size: 0.75rem; }
  .hero,
  .content-section { padding: 26px 20px; border-radius: 10px; }
  .hero { gap: 24px; }
  .hero h1 { font-size: clamp(2.45rem, 14vw, 4rem); }
  .hero-figure img { border-width: 6px; border-radius: 8px; }
  .section-nav { justify-content: flex-start; padding: 0 4px; }
  .color-guide,
  .language-list { grid-template-columns: 1fr; }
  .hangul-flow { grid-template-columns: 1fr; }
  .hangul-flow > b { justify-self: center; transform: rotate(90deg); }
  .article-pager { grid-template-columns: 1fr; }
  .article-pager a:last-child { text-align: left; }
  .start-card { align-items: flex-start; flex-direction: column; padding: 26px 20px; }
  .site-footer { align-items: flex-start; flex-direction: column; }
}

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

/*
기능: 도움말 첫 화면을 주제 목록 하나로 보여 준다.
영향: guide/index.html에서만 사용하며 개별 주제 문서의 레이아웃은 건드리지 않는다.
참조: --ink, --muted, --paper, --line, --shadow 토큰.
*/
.index-intro {
  max-width: 60rem;
  margin: 0 auto;
  padding: 3.5rem 1.25rem 0;
  text-align: center;
}

.index-intro h1 {
  margin: 0.35rem 0 0.75rem;
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.25;
}

.index-lead {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.guide-index {
  max-width: 48rem;
  margin: 2.5rem auto 0;
  padding: 0 1.25rem;
}

.guide-index ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.guide-index a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: var(--paper);
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.guide-index a:hover,
.guide-index a:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(90, 102, 132, 0.3);
  box-shadow: var(--shadow);
}

.guide-index-number {
  flex: none;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.guide-index-body {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.guide-index-body strong {
  font-size: 1.1rem;
  line-height: 1.4;
}

.guide-index-body span {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.guide-index-arrow {
  flex: none;
  margin-left: auto;
  color: var(--muted);
  font-size: 1.15rem;
}

.index-back {
  max-width: 48rem;
  margin: 2rem auto 3.5rem;
  padding: 0 1.25rem;
  text-align: center;
}

.index-back a {
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid var(--line);
  padding-bottom: 0.15rem;
}

@media (max-width: 34rem) {
  .guide-index a { padding: 1.05rem 1.1rem; gap: 0.75rem; }
  .guide-index-arrow { display: none; }
}
