:root {
  --paper: #f4f2ec;
  --surface: #fff;
  --ink: #17191b;
  --ink-2: #4b5056;
  --ink-3: #868b91;
  --line: #e2ded4;
  --accent: #1f5c4a;
  --accent-hover: #174a3b;
  --accent-soft: #dde8e2;
  --shadow: 0 1px 2px rgb(60 52 30 / 6%), 0 12px 32px -12px rgb(60 52 30 / 18%);
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Geist", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --wrap: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
/* 종이 질감: 고정된 노이즈 한 장 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .35 0 0 0 0 .25 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { margin: 0; font-weight: 400; text-wrap: balance; }
p { text-wrap: pretty; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--surface); padding: 8px 12px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 14px; font-weight: 500; color: var(--ink-2); margin: 0 0 20px; }
.muted { color: var(--ink-3); }

/* 버튼 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  padding: 15px 26px;
  background: var(--accent);
  color: #fff;
  font: 500 16px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 8px 20px -10px rgb(31 92 74 / 70%);
  transition: background 0.2s, transform 0.2s;
}
.btn:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn.small { padding: 10px 18px; font-size: 14px; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { background: var(--surface); color: var(--ink); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--ink); }

/* 헤더 */
.site-header { padding: 22px 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: -0.01em; }
.brand:hover { color: var(--ink); }
.brand svg { flex: none; }
.site-nav { display: flex; align-items: center; gap: 28px; font-size: 15px; }
.site-nav a:not(.btn) { color: var(--ink-2); text-decoration: none; }
.site-nav a:not(.btn):hover { color: var(--ink); }
@media (max-width: 640px) { .site-nav a:not(.btn) { display: none; } }

/* 첫 화면 */
.hero { padding: 56px 0 96px; }
.hero .wrap { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 64px; align-items: center; }
.hero h1 { font-family: var(--serif); font-size: clamp(48px, 7vw, 92px); line-height: 0.95; letter-spacing: -0.02em; }
.hero h1 em { color: var(--accent); }
.hero .lede { font-size: 19px; color: var(--ink-2); max-width: 34ch; margin: 28px 0 36px; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.facts { display: flex; gap: 40px; margin: 48px 0 0; padding: 24px 0 0; border-top: 1px solid var(--line); }
.facts dt { font-size: 13px; color: var(--ink-3); }
.facts dd { margin: 2px 0 0; font: 500 22px/1.2 var(--mono); }
.sample { margin: 0; background: var(--surface); border-radius: 20px; padding: 28px 28px 20px; box-shadow: var(--shadow); transform: rotate(1.5deg); }
.sample img { display: block; margin: 0 auto; }
.sample figcaption { margin-top: 16px; font-size: 14px; color: var(--ink-3); }
@media (max-width: 860px) {
  .hero { padding-top: 24px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 48px; }
  .sample { max-width: 420px; transform: none; }
  .facts { gap: 28px; }
}

/* 본문 섹션 */
.section { padding: 96px 0; border-top: 1px solid var(--line); }
.section h2 { font-family: var(--serif); font-size: clamp(36px, 4.5vw, 56px); line-height: 1; letter-spacing: -0.015em; }
.split { display: grid; grid-template-columns: 5fr 7fr; gap: 64px; align-items: start; }
.split > :first-child { position: sticky; top: 32px; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 32px; } .split > :first-child { position: static; } }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 64px 1fr; padding: 28px 0; border-bottom: 1px solid var(--line); }
.steps li:first-child { padding-top: 0; }
.steps li::before { content: "0" counter(s); font: 500 15px var(--mono); color: var(--accent); padding-top: 4px; }
.steps h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.steps p { margin: 6px 0 0; color: var(--ink-2); max-width: 52ch; }

#bell { margin-top: 40px; }
.bell { width: 100%; height: auto; display: block; overflow: visible; }
.bell .area { fill: var(--accent-soft); }
.bell .outline { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.bell .you { fill: var(--accent); opacity: 0.85; }
.bell .mark { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 3 3; }
.bell .base { stroke: var(--line); }
.bell text { font: 500 12px var(--mono); fill: var(--ink-3); }
.bell .mark-label { font: 600 13px var(--sans); fill: var(--ink); }
.bands { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; margin: 32px 0 0; border-top: 1px solid var(--line); }
.bands div { padding: 16px 16px 0 0; }
.bands dt { font: 500 22px var(--mono); }
.bands dd { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }

.faq h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.01em; margin-top: 40px; }
.faq h3:first-child { margin-top: 0; }
.faq p, .faq li { color: var(--ink-2); max-width: 62ch; }
.faq p { margin: 8px 0 0; }
.faq ul { padding-left: 20px; margin: 8px 0 0; }

.cta-band { padding: 96px 0 120px; border-top: 1px solid var(--line); text-align: center; }
.cta-band h2 { font-family: var(--serif); font-size: clamp(40px, 5vw, 64px); line-height: 1; margin-bottom: 32px; }

.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 14px; color: var(--ink-3); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

/* 시험 화면: 헤더와 본문을 숨기고 문제에만 집중한다 */
body.testing .site-header, body.testing .page, body.testing .site-footer { display: none; }
.test { min-height: 100dvh; display: flex; flex-direction: column; }
.test-bar { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 20px; padding: 18px 24px; max-width: var(--wrap); width: 100%; margin: 0 auto; }
.test-count { font: 500 15px var(--mono); }
.test-count b { font-weight: 600; }
.progress { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--accent); transform-origin: left; transition: width 0.3s ease; }
.timer { font: 500 15px var(--mono); color: var(--ink-2); }
.test-body { flex: 1; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; max-width: var(--wrap); width: 100%; margin: 0 auto; padding: 24px 24px 48px; }
.puzzle { margin: 0; background: var(--surface); border-radius: 20px; padding: 32px; box-shadow: var(--shadow); display: grid; place-items: center; }
.puzzle img { width: 100%; max-width: 420px; }
.test-prompt { font-family: var(--serif); font-size: 32px; line-height: 1.1; margin: 0 0 24px; }
.answers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.answers button {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
@media (hover: hover) { .answers button:hover { border-color: var(--ink-3); transform: translateY(-2px); box-shadow: var(--shadow); } }
.answers button:active, .answers button.picked { transform: scale(0.97); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.answers button span { position: absolute; top: 8px; left: 10px; font: 500 12px var(--mono); color: var(--ink-3); }
.answers img { display: block; width: 100%; aspect-ratio: 1; }
.hint { font-size: 14px; color: var(--ink-3); margin: 20px 0 0; }
@media (max-width: 860px) {
  .test-body { grid-template-columns: 1fr; gap: 24px; align-items: start; align-content: start; padding-top: 8px; }
  .puzzle { padding: 18px; }
  .test-prompt { font-size: 24px; margin-bottom: 14px; }
  .hint { display: none; }
}

/* 마지막 단계 폼 */
.final { min-height: 100dvh; display: grid; place-items: center; padding: 48px 24px; }
.final-card { width: 100%; max-width: 640px; }
.final h2 { font-family: var(--serif); font-size: clamp(40px, 6vw, 64px); line-height: 1; }
.final .lede { color: var(--ink-2); margin: 16px 0 32px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
@media (max-width: 520px) { .fields { grid-template-columns: 1fr; } }
.field label { display: block; font-size: 14px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field select, .inline-form select {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color 0.15s;
}
.field input:hover, .field select:hover, .inline-form select:hover { border-color: var(--ink-3); }
.final .btn { margin-top: 32px; }

/* 결과 페이지 */
.score { padding: 48px 0 80px; }
.score .wrap { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 64px; align-items: end; }
.score h1 { font-size: 17px; font-weight: 500; color: var(--ink-2); }
.score-num { font-family: var(--serif); font-size: clamp(120px, 20vw, 220px); line-height: 0.85; letter-spacing: -0.03em; margin: 16px 0 24px; font-variant-numeric: tabular-nums; }
.score-pct { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; margin: 0; }
.score-detail { color: var(--ink-2); margin: 6px 0 0; }
@media (max-width: 860px) { .score .wrap { grid-template-columns: 1fr; gap: 32px; } }

.groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 40px; }
@media (max-width: 760px) { .groups { grid-template-columns: 1fr; } }
.group { background: var(--surface); border-radius: 18px; padding: 28px; box-shadow: var(--shadow); }
.group h3 { font-size: 15px; font-weight: 600; color: var(--ink-2); margin-bottom: 20px; }
.cmp { display: grid; gap: 10px; }
.cmp-row { display: grid; grid-template-columns: minmax(0, 11em) 1fr 3em; align-items: center; gap: 12px; font-size: 14px; color: var(--ink-2); }
.cmp-row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-row .track { height: 10px; background: var(--paper); border-radius: 6px; overflow: hidden; }
.cmp-row .track i { display: block; height: 100%; width: var(--w); background: var(--ink-3); border-radius: 6px; }
.cmp-row.you { color: var(--ink); font-weight: 600; }
.cmp-row.you .track i { background: var(--accent); }
.cmp-row b { font: 500 15px var(--mono); text-align: right; }
.group .info { margin: 20px 0 0; font-size: 15px; color: var(--ink-2); }
.group .info strong { color: var(--ink); }
.inline-form p { margin: 0 0 12px; color: var(--ink-2); font-size: 15px; }
.inline-form div { display: flex; gap: 8px; }

.share-row { display: flex; gap: 8px; margin-top: 12px; max-width: 640px; }
.share-row input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; font: 14px var(--mono); color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.note { font-size: 14px; color: var(--ink-3); max-width: 62ch; margin-top: 40px; }

/* 등장 애니메이션 */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .rise:nth-child(2) { animation-delay: 0.08s; }
  .rise:nth-child(3) { animation-delay: 0.16s; }
  .rise:nth-child(4) { animation-delay: 0.24s; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
