:root {
  color-scheme: light;
  --black: #050505;
  --white: #fffdf4;
  --yellow: #ffd21f;
  --gray: #e8e6de;
  --muted: #565656;
  --line: #050505;
}

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

body {
  margin: 0;
  min-width: 320px;
  color: var(--black);
  background:
    linear-gradient(135deg, var(--yellow) 0 11%, transparent 11%) top left / 34rem 22rem no-repeat,
    linear-gradient(315deg, var(--black) 0 8%, transparent 8%) bottom right / 28rem 18rem no-repeat,
    var(--white);
  font-family: Arial, "Noto Sans KR", sans-serif;
  line-height: 1.62;
  word-break: keep-all;
}

a { color: inherit; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 0.55rem 0.75rem; color: var(--white); background: var(--black); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.guide-shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 20px 0 42px; }

.site-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 4px 0 20px; }
.brand { font-size: 1rem; font-weight: 1000; letter-spacing: -0.03em; text-decoration: none; text-transform: uppercase; }
.header-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.45rem; }
.header-link { padding: 0.42rem 0.72rem; color: var(--black); background: var(--white); border: 2px solid var(--black); font-size: 0.78rem; font-weight: 900; text-decoration: none; }
.header-link-primary { background: var(--yellow); }

.hero { position: relative; display: grid; grid-template-columns: minmax(0, 0.78fr) minmax(430px, 1.22fr); align-items: center; gap: clamp(28px, 5vw, 60px); min-height: 570px; padding: clamp(32px, 6vw, 64px); background: var(--white); border: 4px solid var(--black); box-shadow: 12px 12px 0 var(--yellow); }
.hero::before { position: absolute; top: 0; left: 0; width: 84px; height: 14px; background: var(--yellow); content: ""; }
.eyebrow, .section-kicker, .detail-label { margin: 0 0 0.7rem; font-size: 0.72rem; font-weight: 1000; letter-spacing: 0.14em; text-transform: uppercase; }
.eyebrow, .section-kicker { display: inline-block; padding: 0.15rem 0.38rem; background: var(--yellow); }
.hero h1 { margin: 0; max-width: 9ch; font-size: clamp(3rem, 6.4vw, 5.7rem); font-weight: 1000; line-height: 0.95; letter-spacing: -0.08em; }
.hero-lead { margin: 1.45rem 0 0; max-width: 38rem; color: var(--muted); font-size: clamp(1rem, 1.7vw, 1.12rem); font-weight: 650; }
.hero-figure { margin: 0; }
.hero-figure img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border: 4px solid var(--black); }
.hero-figure figcaption { margin-top: 0.65rem; font-size: 0.76rem; font-weight: 800; text-align: right; }

.guide-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 28px 0 22px; border: 3px solid var(--black); }
.guide-nav a { padding: 0.72rem 0.8rem; border-right: 2px solid var(--black); font-size: 0.83rem; font-weight: 1000; text-align: center; text-decoration: none; }
.guide-nav a:last-child { border-right: 0; }
.guide-nav a[aria-current="page"] { background: var(--yellow); }

.content-section { margin-top: 22px; padding: clamp(30px, 6vw, 64px); background: var(--white); border: 3px solid var(--black); }
.content-section:nth-of-type(even) { box-shadow: 9px 9px 0 var(--gray); }
.section-heading { max-width: 780px; }
.section-heading h2, .closing-card h2 { margin: 0; font-size: clamp(2rem, 4.6vw, 3.75rem); font-weight: 1000; line-height: 1.04; letter-spacing: -0.065em; }
.section-heading > p:last-child { margin: 1rem 0 0; color: var(--muted); font-weight: 600; }

.feature-grid, .principle-grid, .topic-grid, .usage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin-top: 2rem; border-top: 2px solid var(--black); border-left: 2px solid var(--black); }
.feature-card, .principle-card, .topic-card, .usage-card { min-height: 190px; padding: 1.35rem; background: var(--white); border-right: 2px solid var(--black); border-bottom: 2px solid var(--black); }
.feature-card > span, .principle-card > span, .usage-card > span { display: inline-grid; width: 34px; height: 34px; place-items: center; color: var(--black); background: var(--yellow); font-size: 0.72rem; font-weight: 1000; }
.feature-card h3, .principle-card h3, .usage-card h3, .warning-box h3 { margin: 0.85rem 0 0.45rem; font-size: 1.1rem; font-weight: 1000; letter-spacing: -0.035em; }
.feature-card p, .principle-card p, .usage-card p, .warning-box p { margin: 0; color: var(--muted); }

.topic-card { position: relative; display: flex; flex-direction: column; color: var(--black); text-decoration: none; }
.topic-card:hover { background: var(--yellow); }
.topic-card small { font-size: 0.7rem; font-weight: 1000; letter-spacing: 0.1em; text-transform: uppercase; }
.topic-card strong { margin-top: 1rem; font-size: 1.35rem; font-weight: 1000; line-height: 1.12; }
.topic-card p { margin: 0.55rem 0 1rem; color: var(--muted); }
.topic-card b { margin-top: auto; font-size: 1.25rem; }

.shape-band { display: flex; align-items: center; gap: clamp(16px, 4vw, 42px); margin-top: 2rem; padding: 1.4rem; overflow-x: auto; color: var(--black); background: var(--yellow); border: 3px solid var(--black); }
.shape { flex: 0 0 auto; width: 58px; height: 58px; background: currentColor; }
.shape-circle { border-radius: 50%; }
.shape-triangle { width: 0; height: 0; background: transparent; border-right: 34px solid transparent; border-bottom: 58px solid currentColor; border-left: 34px solid transparent; }
.shape-grid { background: repeating-linear-gradient(0deg, var(--black) 0 5px, transparent 5px 15px), repeating-linear-gradient(90deg, var(--black) 0 5px, transparent 5px 15px); }
.shape-star { clip-path: polygon(50% 0, 62% 34%, 100% 38%, 70% 60%, 80% 100%, 50% 76%, 20% 100%, 30% 60%, 0 38%, 38% 34%); }

.fact-list { margin: 2rem 0 0; padding: 0; list-style: none; border-top: 3px solid var(--black); }
.fact-list li { display: grid; grid-template-columns: minmax(150px, 0.3fr) minmax(0, 1fr); gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--black); }
.fact-list strong { font-weight: 1000; }
.fact-list span { color: var(--muted); }

.steps { margin: 2rem 0 0; padding: 0; list-style: none; counter-reset: focus-step; border-top: 3px solid var(--black); }
.steps li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 1rem; padding: 1.3rem 0; border-bottom: 1px solid var(--black); counter-increment: focus-step; }
.steps li::before { font-size: 1.8rem; font-weight: 1000; content: "0" counter(focus-step); }
.steps h3 { margin: 0; font-size: 1.08rem; font-weight: 1000; }
.steps p { margin: 0.4rem 0 0; color: var(--muted); }

.warning-box { margin-top: 1.4rem; padding: 1.35rem; color: var(--white); background: var(--black); border-left: 14px solid var(--yellow); }
.warning-box h3 { margin-top: 0; }
.warning-box p { color: #d6d6d6; }
.warning-box a { color: var(--yellow); text-underline-offset: 3px; }

.source-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 1.5rem 0 0; padding: 0; list-style: none; border-top: 2px solid var(--black); border-left: 2px solid var(--black); }
.source-list a { display: block; height: 100%; padding: 1rem; border-right: 2px solid var(--black); border-bottom: 2px solid var(--black); font-size: 0.86rem; font-weight: 800; text-decoration: none; }
.source-list a:hover { background: var(--yellow); }

.article-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.article-pager a { display: grid; min-height: 88px; align-content: center; gap: 0.2rem; padding: 1rem 1.15rem; background: var(--white); border: 3px solid var(--black); text-decoration: none; }
.article-pager a:last-child { text-align: right; }
.article-pager span { color: var(--muted); font-size: 0.72rem; font-weight: 800; text-transform: uppercase; }
.article-pager strong { font-weight: 1000; }
.article-pager a:hover { background: var(--yellow); }

.closing-card { display: flex; align-items: center; justify-content: space-between; gap: 2rem; margin-top: 22px; padding: clamp(28px, 5vw, 50px); color: var(--white); background: var(--black); border: 4px solid var(--black); }
.closing-card .section-kicker { color: var(--black); }
.closing-card p { margin: 0.65rem 0 0; color: #cacaca; }
.closing-card > a { flex: 0 0 auto; padding: 0.75rem 1rem; color: var(--black); background: var(--yellow); border: 2px solid var(--yellow); font-weight: 1000; text-decoration: none; }

.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 24px 0 0; font-size: 0.75rem; font-weight: 700; }
.site-footer div { display: flex; gap: 0.8rem; }

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

@media (max-width: 840px) {
  .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, 1120px); padding-top: 10px; }
  .site-header { align-items: flex-start; }
  .hero, .content-section { padding: 25px 18px; }
  .hero { gap: 24px; box-shadow: 7px 7px 0 var(--yellow); }
  .hero h1 { font-size: clamp(2.55rem, 14vw, 4rem); }
  .guide-nav { grid-template-columns: 1fr; }
  .guide-nav a { border-right: 0; border-bottom: 2px solid var(--black); }
  .guide-nav a:last-child { border-bottom: 0; }
  .feature-grid, .principle-grid, .topic-grid, .usage-grid, .source-list { grid-template-columns: 1fr; }
  .fact-list li { grid-template-columns: 1fr; gap: 0.35rem; }
  .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(--white);
  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: var(--black);
  box-shadow: 0 18px 44px rgba(5, 5, 5, 0.12);
}

.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; }
}

.index-warning {
  max-width: 48rem;
  margin: 2rem auto 0;
}
