:root {
  --paper: #faf8f3;
  --card: #ffffff;
  --ink: #1c1a17;
  --muted: #6f6a60;
  --line: #e6e0d3;
  --accent: #0f5c4a;
  --accent-soft: #e8f1ee;
  --red: #b03030;
  --grade-a: #157a4d;
  --grade-b: #557a1e;
  --grade-c: #8a6800;
  --grade-d: #b04a15;
  --grade-f: #b03030;
  --grade-q: #6e6a5e;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.75;
  font-size: 17px;
  word-break: keep-all;
}

h1, h2, h3, .serif {
  font-family: "Noto Serif KR", "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", serif;
  line-height: 1.35;
  font-weight: 700;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 22px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- nav ---------- */
header.site {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
nav.site {
  max-width: 760px; margin: 0 auto; padding: 16px 22px;
  display: flex; align-items: baseline; gap: 22px; flex-wrap: wrap;
}
nav.site .brand {
  font-family: "Noto Serif KR", "Apple SD Gothic Neo", "Malgun Gothic", serif;
  font-weight: 900; font-size: 1.15rem; color: var(--ink);
  letter-spacing: -0.01em;
}
nav.site .brand:hover { text-decoration: none; }
nav.site .links { display: flex; gap: 18px; font-size: 0.92rem; }
nav.site .links a { color: var(--muted); }
nav.site .links a[aria-current="page"], nav.site .links a:hover { color: var(--accent); text-decoration: none; }

/* ---------- hero ---------- */
.hero { padding: 72px 0 56px; }
.hero h1 { font-size: clamp(1.9rem, 5.5vw, 2.9rem); font-weight: 900; letter-spacing: -0.02em; }
.hero p.lead { margin-top: 20px; font-size: 1.12rem; color: var(--muted); max-width: 34em; }
.hero p.lead strong { color: var(--ink); font-weight: 700; }

/* ---------- sections ---------- */
section { padding: 44px 0; border-top: 1px solid var(--line); }
section h2 { font-size: 1.45rem; margin-bottom: 18px; letter-spacing: -0.01em; }
section h3 { font-size: 1.08rem; margin: 26px 0 8px; }
section p + p { margin-top: 14px; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }

/* ---------- receipt ---------- */
.receipt {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 28px 26px;
  margin: 26px 0;
  box-shadow: 0 1px 0 rgba(0,0,0,0.03);
  position: relative;
}
.receipt::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 8px, transparent 8px 16px);
  opacity: 0.5;
}
.receipt .r-title {
  text-align: center; font-weight: 700; letter-spacing: 0.35em;
  font-size: 0.85rem; color: var(--muted); margin-bottom: 18px;
}
.receipt ol { list-style: none; counter-reset: r; }
.receipt ol li {
  counter-increment: r;
  display: flex; gap: 14px; align-items: baseline;
  padding: 13px 0;
  border-bottom: 1px dashed var(--line);
}
.receipt ol li:last-child { border-bottom: none; }
.receipt ol li::before {
  content: counter(r, decimal-leading-zero);
  font-variant-numeric: tabular-nums;
  color: var(--accent); font-weight: 700; font-size: 0.85rem;
  flex: 0 0 auto;
}
.receipt ol li b { font-weight: 700; }
.receipt .r-total {
  margin-top: 18px; padding-top: 14px;
  border-top: 2px solid var(--ink);
  display: flex; justify-content: space-between;
  font-weight: 700;
}

/* ---------- grade chips ---------- */
.grade {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2em; height: 2em; border-radius: 4px;
  color: #fff; font-weight: 900;
  font-family: "Noto Serif KR", "Apple SD Gothic Neo", "Malgun Gothic", serif;
  flex: 0 0 auto; font-size: 0.95rem;
}
.g-a { background: var(--grade-a); }
.g-b { background: var(--grade-b); }
.g-c { background: var(--grade-c); }
.g-d { background: var(--grade-d); }
.g-f { background: var(--grade-f); }
.g-q { background: var(--grade-q); }

table.grades { width: 100%; border-collapse: collapse; margin: 18px 0; }
table.grades th, table.grades td {
  padding: 12px 10px; border-bottom: 1px solid var(--line);
  vertical-align: top; text-align: left; font-weight: 400;
}
table.grades th { width: 3.2em; }

/* ---------- cards / tracks ---------- */
.tracks { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 22px; }
@media (max-width: 640px) { .tracks { grid-template-columns: 1fr; } }
.track {
  background: var(--card); border: 1px solid var(--line); border-radius: 4px;
  padding: 24px 22px;
}
.track .tag {
  display: inline-block; font-size: 0.78rem; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; margin-bottom: 12px;
  background: var(--accent-soft); color: var(--accent);
}
.track.biz .tag { background: #f6ecec; color: var(--red); }
.track h3 { margin: 0 0 10px; }
.track p { font-size: 0.95rem; color: var(--muted); }
.track .go { display: inline-block; margin-top: 14px; font-weight: 700; font-size: 0.95rem; }

/* ---------- status ---------- */
.status {
  border: 1px solid var(--line); background: var(--card); border-radius: 4px;
  padding: 22px; margin-top: 20px;
  display: flex; gap: 28px; flex-wrap: wrap;
}
.status .n {
  font-family: "Noto Serif KR", "Apple SD Gothic Neo", "Malgun Gothic", serif;
  font-weight: 900; font-size: 1.7rem; display: block;
}
.status .l { font-size: 0.85rem; color: var(--muted); }

/* ---------- severity ---------- */
.sev { display: inline-block; width: 0.8em; height: 0.8em; border-radius: 50%; margin-right: 8px; }
.sev.r { background: var(--red); }
.sev.o { background: var(--grade-d); }
.sev.y { background: var(--grade-c); }

ul.plain { list-style: none; }
ul.plain li { padding: 10px 0; border-bottom: 1px dashed var(--line); }
ul.plain li:last-child { border-bottom: none; }

.state {
  display: inline-block; font-size: 0.78rem; font-weight: 700;
  padding: 2px 9px; border-radius: 999px; margin-left: 8px;
  background: var(--accent-soft); color: var(--accent); vertical-align: middle;
}
.state.wait { background: #efece4; color: var(--muted); }

blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 18px; margin: 18px 0;
  color: var(--muted);
}

.notice {
  background: var(--accent-soft); border-radius: 4px;
  padding: 18px 20px; margin: 22px 0; font-size: 0.95rem;
}
.notice.warn { background: #f9f1e3; }

/* ---------- footer ---------- */
footer.site {
  border-top: 1px solid var(--line);
  margin-top: 56px; padding: 36px 0 56px;
  font-size: 0.85rem; color: var(--muted);
}
footer.site p + p { margin-top: 10px; }
footer.site .links { margin-bottom: 16px; display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------- page head ---------- */
.pagehead { padding: 56px 0 8px; }
.pagehead h1 { font-size: clamp(1.6rem, 4.5vw, 2.2rem); font-weight: 900; letter-spacing: -0.02em; }
.pagehead p { margin-top: 12px; color: var(--muted); }

.btn {
  display: inline-block; background: var(--accent); color: #fff;
  padding: 12px 26px; border-radius: 4px; font-weight: 700;
  margin-top: 18px;
}
.btn:hover { text-decoration: none; opacity: 0.92; }
