/* 나알기 — 공통 스타일 */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');
@import url('https://fonts.googleapis.com/css2?family=Black+Han+Sans&display=swap');

:root {
  --paper: #ffffff;
  --paper-2: #f6f5f1;
  --ink: #1c1b1a;
  --ink-2: #5c5955;
  --ink-3: #9a968f;
  --line: #e5e2dc;
  --stamp: #d8321e;
  --yellow: #ffd23f;
  --lilac: #d9ccff;
  --mint: #bfeedd;
  --peach: #ffd2b8;
  --sky: #cfe6ff;
  --radius: 14px;
  --max: 560px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1a1918; --paper-2: #232120; --ink: #f1efea; --ink-2: #c2bdb5; --ink-3: #8a857d; --line: #38352f;
  }
}
:root[data-theme="dark"] {
  --paper: #1a1918; --paper-2: #232120; --ink: #f1efea; --ink-2: #c2bdb5; --ink-3: #8a857d; --line: #38352f;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper-2); color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-size: 16px; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere;
}
a { color: inherit; }
button { font: inherit; }
img { max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
.display { font-family: "Black Han Sans", "Pretendard Variable", sans-serif; font-weight: 400; letter-spacing: -0.01em; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* 상단 */
.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 0 6px; }
.logo { text-decoration: none; display: inline-flex; align-items: baseline; gap: 6px; }
.logo .display { font-size: 26px; }
.logo small { font-size: 12px; color: var(--ink-3); }
.top-nav { display: flex; gap: 14px; font-size: 13px; color: var(--ink-2); }
.top-nav a { text-decoration: none; }

/* 히어로 */
.hero { padding: 26px 0 14px; }
.hero h1 { font-size: 40px; line-height: 1.1; }
.hero p { margin: 10px 0 0; color: var(--ink-2); font-size: 16px; }

/* 메뉴 타일 */
.menu { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0 28px; }
.tile {
  position: relative; display: block; text-decoration: none; background: var(--paper); border: 1.5px solid var(--ink);
  border-radius: var(--radius); padding: 16px 14px 14px; min-height: 148px;
  box-shadow: 3px 3px 0 var(--ink);
}
.tile:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.tile .emoji { font-size: 30px; line-height: 1; display: block; margin-bottom: 10px; }
.tile h3 { font-size: 18px; }
.tile p { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.tile.wide { grid-column: 1 / -1; min-height: 0; display: flex; gap: 14px; align-items: center; }
.tile.wide .emoji { margin: 0; font-size: 38px; }
.tile .tag { position: absolute; top: 10px; right: 10px; font-size: 11px; padding: 2px 7px; border-radius: 999px; background: var(--yellow); color: #1c1b1a; font-weight: 600; }
.tile.c-lilac { background: var(--lilac); color: #1c1b1a; } .tile.c-lilac p { color: #3a3550; }
.tile.c-mint { background: var(--mint); color: #1c1b1a; } .tile.c-mint p { color: #2f4a40; }
.tile.c-peach { background: var(--peach); color: #1c1b1a; } .tile.c-peach p { color: #5a3d2c; }
.tile.c-sky { background: var(--sky); color: #1c1b1a; } .tile.c-sky p { color: #2c4660; }
.tile.c-yellow { background: var(--yellow); color: #1c1b1a; } .tile.c-yellow p { color: #5a4a10; }
.tile.c-yellow .tag { background: #1c1b1a; color: #fff; }

.section-title { font-size: 15px; color: var(--ink-3); margin: 24px 0 10px; font-weight: 600; }

/* 카드 공통 */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; margin: 12px 0; }
.card.strong { border: 1.5px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.muted { color: var(--ink-2); font-size: 14px; }
.small { font-size: 13px; color: var(--ink-3); }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 15px 18px; border-radius: 12px; border: 1.5px solid var(--ink); background: var(--ink); color: var(--paper);
  font-size: 16px; font-weight: 700; cursor: pointer; text-decoration: none; margin-top: 10px;
}
.btn.ghost { background: var(--paper); color: var(--ink); }
.btn.yellow { background: var(--yellow); color: #1c1b1a; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, .choice:focus-visible, a:focus-visible { outline: 3px solid var(--stamp); outline-offset: 2px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 퀴즈 */
.progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 10px 0 18px; }
.progress i { display: block; height: 100%; background: var(--ink); width: 0; transition: width .25s; }
.qnum { font-size: 13px; color: var(--ink-3); margin-bottom: 6px; }
.qtext { font-size: 22px; font-weight: 700; line-height: 1.35; margin-bottom: 18px; }
.choices { display: grid; gap: 10px; }
.choice {
  width: 100%; text-align: left; padding: 15px 16px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--paper); color: var(--ink); font-size: 16px; line-height: 1.45; cursor: pointer;
}
.choice:active { border-color: var(--ink); background: var(--yellow); }
@media (hover: hover) { .choice:hover { border-color: var(--ink); } }

/* 결과 */
.result-head { text-align: center; padding: 10px 0 6px; }
.result-head .kicker { font-size: 14px; color: var(--ink-2); }
.result-head .emoji { font-size: 64px; line-height: 1; margin: 8px 0; }
.result-head h2 { font-size: 34px; }
.result-head .sub { margin-top: 6px; color: var(--ink-2); font-size: 15px; }
.stamp-wrap { position: relative; }
.stamp {
  position: absolute; right: 8px; top: -8px; transform: rotate(-12deg); color: var(--stamp); border: 3px solid var(--stamp);
  border-radius: 8px; padding: 2px 8px; font-family: "Black Han Sans", sans-serif; font-size: 20px; opacity: .9; pointer-events: none;
  mix-blend-mode: multiply;
}
:root[data-theme="dark"] .stamp { mix-blend-mode: normal; }
.desc { font-size: 16px; line-height: 1.7; }
.desc p { margin: 0 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chip { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 15px; }
.kv b { font-weight: 700; }
.bar { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ink); border-radius: 99px; }

/* 통계 막대 */
.hist { display: grid; gap: 4px; align-items: end; height: 110px; grid-auto-flow: column; }
.hist b { display: block; background: var(--ink); border-radius: 3px 3px 0 0; min-height: 2px; }
.hist-x { display: grid; grid-auto-flow: column; font-size: 10px; color: var(--ink-3); text-align: center; margin-top: 4px; }

/* 상장 */
.cert {
  position: relative; background: var(--paper); border: 2px solid var(--ink); border-radius: 6px; padding: 18px 16px 16px; margin: 14px 0;
  outline: 1px solid var(--ink); outline-offset: -7px;
}
.cert .title { font-family: "Black Han Sans", sans-serif; font-size: 24px; text-align: center; }
.cert .who { text-align: center; font-size: 20px; font-weight: 800; margin: 8px 0 2px; }
.cert .why { text-align: center; color: var(--ink-2); font-size: 14px; }
.cert .val { text-align: center; font-size: 15px; margin-top: 6px; }
.cert .stamp { right: 12px; bottom: 10px; top: auto; font-size: 16px; }

/* 테이블 */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--ink-3); font-weight: 600; font-size: 12px; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* 업로드 */
.drop {
  border: 2px dashed var(--ink-3); border-radius: var(--radius); padding: 26px 16px; text-align: center; background: var(--paper);
  cursor: pointer;
}
.drop.over { border-color: var(--ink); background: var(--yellow); }
.drop input { display: none; }
.steps { counter-reset: s; padding: 0; margin: 0; list-style: none; }
.steps li { counter-increment: s; position: relative; padding-left: 34px; margin: 10px 0; font-size: 15px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 1px; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--paper); font-size: 13px; font-weight: 700; display: grid; place-items: center; }
details { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; background: var(--paper); margin: 8px 0; }
summary { cursor: pointer; font-weight: 600; }
.privacy-note { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-2); background: var(--mint); color: #1f3d33; border-radius: 10px; padding: 10px 12px; margin: 10px 0; }

/* 광고 자리 */
.ad { min-height: 0; margin: 16px 0; text-align: center; }
.ad ins { display: block; }

/* 푸터 */
footer { padding: 30px 0 40px; color: var(--ink-3); font-size: 12px; }
footer nav { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
footer a { text-decoration: none; color: var(--ink-2); }

/* 토스트 */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; }
.toast.on { opacity: 1; }

.hidden { display: none !important; }
.center { text-align: center; }

/* 글 본문 (소개·개인정보) */
.prose h2 { font-size: 20px; margin: 26px 0 8px; }
.prose p, .prose li { font-size: 15px; color: var(--ink-2); }
.prose ul { padding-left: 18px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (min-width: 640px) { .hero h1 { font-size: 48px; } .tile { min-height: 160px; } }
