:root {
  color-scheme: dark;
  --night: #07101f;
  --night-soft: #0d1930;
  --panel: rgba(15, 27, 50, 0.9);
  --paper: #f0e5c9;
  --ink: #f4f0e7;
  --muted: #aab5ca;
  --dim: #77859e;
  --gold: #d8bd7d;
  --blue: #7ea6d9;
  --line: rgba(196, 211, 238, 0.16);
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 8%, rgba(73, 105, 158, 0.18), transparent 26rem),
    radial-gradient(circle at 88% 28%, rgba(171, 135, 80, 0.1), transparent 24rem),
    linear-gradient(180deg, #0a1428, var(--night) 62%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
  line-height: 1.72;
  word-break: keep-all;
}

a { color: inherit; }

code {
  padding: 0.08rem 0.3rem;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.09);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 0.6rem 0.8rem; color: var(--night); background: var(--paper); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

.guide-shell { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding: 22px 0 42px; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 4px 2px 22px; }
.brand { color: var(--gold); font-size: 1rem; font-weight: 900; text-decoration: none; }
.header-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; }
.header-link { padding: 0.45rem 0.75rem; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; font-size: 0.8rem; font-weight: 800; text-decoration: none; }
.header-link-primary { color: var(--paper); border-color: rgba(216, 189, 125, 0.38); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(430px, 1.18fr);
  align-items: center;
  gap: clamp(28px, 5vw, 60px);
  min-height: 590px;
  padding: clamp(34px, 6vw, 68px);
  background: linear-gradient(135deg, rgba(16, 29, 55, 0.98), rgba(8, 17, 34, 0.96));
  border: 1px solid var(--line);
  border-radius: 18px 4px 18px 4px;
  box-shadow: var(--shadow);
}

.eyebrow, .section-kicker, .detail-label { margin: 0 0 0.75rem; color: var(--gold); font-size: 0.73rem; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; }
.hero h1 { margin: 0; max-width: 9ch; font-family: Georgia, "Noto Serif KR", serif; font-size: clamp(2.8rem, 6vw, 5.15rem); font-weight: 700; line-height: 1.04; letter-spacing: -0.065em; }
.hero-lead { margin: 1.4rem 0 0; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.12rem); }
.hero-figure { margin: 0; }
.hero-figure img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border: 1px solid rgba(216, 189, 125, 0.26); border-radius: 3px; box-shadow: 0 20px 48px rgba(0, 0, 0, 0.38); }
.hero-figure figcaption { margin-top: 0.75rem; color: var(--dim); font-size: 0.78rem; text-align: center; }

.guide-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.4rem; margin: 24px 0; padding: 0.7rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.guide-nav a { position: relative; padding: 0.35rem 0; color: var(--muted); font-size: 0.84rem; font-weight: 800; text-decoration: none; }
.guide-nav a[aria-current="page"] { color: var(--paper); }
.guide-nav a[aria-current="page"]::after { position: absolute; right: 0; bottom: -0.72rem; left: 0; height: 2px; background: var(--gold); content: ""; }

.content-section { margin-top: 20px; padding: clamp(30px, 6vw, 62px); background: var(--panel); border: 1px solid var(--line); border-radius: 4px; }
.section-heading { max-width: 760px; }
.section-heading h2, .closing-card h2 { margin: 0; font-family: Georgia, "Noto Serif KR", serif; font-size: clamp(1.85rem, 4vw, 3.1rem); line-height: 1.18; letter-spacing: -0.05em; }
.section-heading > p:last-child { margin: 1rem 0 0; color: var(--muted); }

.feature-grid, .principle-grid, .usage-grid, .topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 2rem; }
.feature-card, .principle-card, .usage-card, .topic-card { padding: 1.35rem; background: rgba(7, 16, 31, 0.58); border: 1px solid var(--line); border-radius: 3px; }
.feature-card > span, .principle-card > span, .usage-card > span { display: block; color: var(--gold); font-size: 0.72rem; font-weight: 900; letter-spacing: 0.12em; }
.feature-card h3, .principle-card h3, .usage-card h3, .note-card h3 { margin: 0.8rem 0 0.45rem; font-size: 1.06rem; letter-spacing: -0.025em; }
.feature-card p, .principle-card p, .usage-card p, .note-card p { margin: 0; color: var(--muted); }

.topic-card { position: relative; display: grid; min-height: 190px; align-content: start; color: var(--ink); text-decoration: none; transition: border-color 0.16s, transform 0.16s; }
.topic-card:hover { border-color: rgba(216, 189, 125, 0.5); transform: translateY(-2px); }
.topic-card small { color: var(--gold); font-size: 0.72rem; font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.topic-card strong { margin-top: 1rem; font-family: Georgia, "Noto Serif KR", serif; font-size: 1.4rem; }
.topic-card p { margin: 0.55rem 0 0; color: var(--muted); }
.topic-card b { margin-top: 1rem; color: var(--gold); }

.fact-table-wrap { margin-top: 2rem; overflow-x: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.fact-table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 0.88rem; }
.fact-table th, .fact-table td { padding: 1rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.fact-table th { width: 24%; color: var(--paper); }
.fact-table td { color: var(--muted); }
.fact-table tr:last-child th, .fact-table tr:last-child td { border-bottom: 0; }

.note-card { margin-top: 14px; padding: 1.25rem 1.4rem; background: rgba(216, 189, 125, 0.07); border-left: 3px solid var(--gold); }
.note-card h3 { margin-top: 0; color: var(--paper); }
.note-card a, .source-list a { color: var(--paper); text-underline-offset: 3px; }

.steps { margin: 2rem 0 0; padding: 0; list-style: none; counter-reset: use-step; }
.steps li { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 1rem; padding: 1.35rem 0; border-top: 1px solid var(--line); counter-increment: use-step; }
.steps li::before { color: var(--gold); font-family: Georgia, serif; font-size: 1.6rem; content: "0" counter(use-step); }
.steps h3 { margin: 0; font-size: 1.05rem; }
.steps p { margin: 0.45rem 0 0; color: var(--muted); }

.source-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem 1.2rem; margin: 1.5rem 0 0; padding-left: 1.1rem; color: var(--muted); }
.source-list li::marker { color: var(--gold); }

.article-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.article-pager a { display: grid; min-height: 88px; align-content: center; gap: 0.25rem; padding: 1rem 1.2rem; background: rgba(13, 25, 48, 0.86); border: 1px solid var(--line); border-radius: 3px; text-decoration: none; }
.article-pager a:last-child { text-align: right; }
.article-pager span { color: var(--dim); font-size: 0.74rem; }
.article-pager strong { color: var(--paper); font-size: 0.95rem; }

.closing-card { display: flex; align-items: center; justify-content: space-between; gap: 2rem; margin-top: 20px; padding: clamp(28px, 5vw, 48px); background: linear-gradient(135deg, rgba(24, 40, 70, 0.94), rgba(12, 22, 42, 0.96)); border: 1px solid var(--line); border-radius: 4px; }
.closing-card p { margin: 0.6rem 0 0; color: var(--muted); }
.closing-card > a { flex: 0 0 auto; padding: 0.75rem 1rem; color: var(--night); background: var(--paper); border-radius: 3px; font-weight: 900; text-decoration: none; }

.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 24px 2px 0; color: var(--dim); font-size: 0.76rem; }
.site-footer div { display: flex; gap: 0.8rem; }
.site-footer a { color: var(--muted); }

.header-link:focus-visible, .guide-nav a:focus-visible, .topic-card:focus-visible, .article-pager a:focus-visible, .closing-card > a:focus-visible, .source-list a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero h1 { max-width: 12ch; }
  .hero-figure { max-width: 680px; }
}

@media (max-width: 620px) {
  .guide-shell { width: min(100% - 18px, 1080px); padding-top: 10px; }
  .site-header { align-items: flex-start; }
  .hero, .content-section { padding: 26px 20px; }
  .hero { gap: 24px; border-radius: 10px 2px 10px 2px; }
  .hero h1 { font-size: clamp(2.35rem, 13vw, 3.8rem); }
  .guide-nav { justify-content: flex-start; gap: 1rem; overflow-x: auto; flex-wrap: nowrap; }
  .guide-nav a { flex: 0 0 auto; }
  .feature-grid, .principle-grid, .usage-grid, .topic-grid, .source-list { grid-template-columns: 1fr; }
  .article-pager { grid-template-columns: 1fr; }
  .article-pager a:last-child { text-align: left; }
  .closing-card { align-items: flex-start; flex-direction: column; }
  .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; }
}
