/* ════════════════════════════════════════════
   MIND · 모아허브 심리·성향 테스트 포털
   디자인 시스템 (허브 + 테스트 공통 컴포넌트)
   ════════════════════════════════════════════ */

:root {
  --bg: #F7F6F4;
  --surface: #FFFFFF;
  --ink: #1A1A2E;
  --sub: #595B6E;
  --muted: #9A9CAD;
  --line: #ECEAE6;
  --brand: #6C5CE7;          /* MIND 보라 */
  --brand-soft: #EFEDFD;
  --ink-cta: #16162A;
  --radius-lg: 24px;
  --radius-md: 18px;
  --shadow: 0 18px 50px rgba(26, 26, 46, 0.08);
  --shadow-sm: 0 8px 22px rgba(26, 26, 46, 0.06);
  --wrap: 1080px;

  /* 테스트별 시그니처 색 */
  --c-mbti: #FF6B9D;
  --c-teto: #F76D7F;
  --c-tarot: #7C5CBF;
  --c-ai: #4A90D9;
  --c-stress: #2EC4B6;
  --c-career: #FF8C42;
  --c-color: #E84393;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); overflow-x: clip; }
body {
  font-family: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  line-height: 1.55;
}
a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

/* ───────── Nav ───────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247, 246, 244, 0.85);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { max-width: var(--wrap); margin: 0 auto; padding: 13px 20px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 17px; letter-spacing: -0.01em; }
.brand .mark { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.brand small { color: var(--muted); font-weight: 600; font-size: 12px; margin-left: 2px; }
.nav-links { display: flex; gap: 18px; font-size: 14px; font-weight: 600; color: var(--sub); }
.nav-links a:hover { color: var(--ink); }
.nav-home { font-size: 13px; font-weight: 700; color: var(--brand); }

/* ───────── 허브 히어로 ───────── */
.hero { max-width: var(--wrap); margin: 0 auto; padding: clamp(44px, 7vh, 76px) 20px clamp(20px, 4vh, 36px); text-align: center; }
.hero .eyebrow { display: inline-block; background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 800; border-radius: 999px; padding: 6px 14px; margin: 0 0 16px; }
.hero h1 { font-size: clamp(30px, 5.2vw, 52px); line-height: 1.14; letter-spacing: -0.03em; font-weight: 800; margin: 0 0 14px; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p { font-size: clamp(15px, 2vw, 17px); color: var(--sub); margin: 0 auto; max-width: 540px; }
.hero-stat { display: inline-flex; gap: 22px; margin-top: 24px; padding: 14px 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow-sm); }
.hero-stat b { font-weight: 800; }
.hero-stat span { color: var(--muted); font-size: 13px; font-weight: 600; }

/* ───────── 테스트 카드 그리드 ───────── */
.grid-wrap { max-width: var(--wrap); margin: 0 auto; padding: clamp(20px, 4vh, 40px) 20px clamp(40px, 8vh, 80px); }
.grid-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.grid-head h2 { font-size: clamp(20px, 3vw, 28px); letter-spacing: -0.02em; font-weight: 800; margin: 0; }
.grid-head span { color: var(--muted); font-size: 13px; font-weight: 600; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.test-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 22px 20px 20px; overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform .25s, box-shadow .25s, border-color .25s;
}
.test-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: transparent; }
.test-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--accent, var(--brand)); }
.test-card .emoji { font-size: 34px; line-height: 1; margin-bottom: 12px; }
.test-card h3 { font-size: 18px; letter-spacing: -0.01em; margin: 0 0 6px; }
.test-card .tagline { font-size: 13.5px; color: var(--sub); margin: 0 0 16px; flex: 1; }
.test-card .meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 14px; }
.test-card .chip { background: color-mix(in srgb, var(--accent) 14%, #fff); color: var(--accent); border-radius: 999px; padding: 3px 10px; font-weight: 800; }
.test-card .go { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 14px; color: var(--accent, var(--brand)); }
.test-card.soon { opacity: 0.85; }
.test-card.soon .go { color: var(--muted); }

/* ───────── 광고 슬롯 ───────── */
.ad-slot { max-width: var(--wrap); margin: 0 auto; padding: 8px 20px; text-align: center; }
.ad-slot ins { display: block; }
.ad-label { font-size: 11px; color: var(--muted); letter-spacing: 0.08em; margin-bottom: 4px; }

/* ───────── Footer ───────── */
.footer { border-top: 1px solid var(--line); }
.footer-inner { max-width: var(--wrap); margin: 0 auto; padding: 28px 20px 36px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 13px; font-weight: 600; }
.footer-inner nav { display: flex; gap: 14px; }
.footer-inner a:hover { color: var(--ink); }

/* ════════════════════════════════════════════
   테스트 실행 공통 컴포넌트 (각 테스트 페이지 재사용)
   페이지에서 body 또는 .test-shell 에 --accent 지정
   ════════════════════════════════════════════ */
.test-shell { max-width: 640px; margin: 0 auto; padding: 0 20px; --accent: var(--brand); }
.test-hero { text-align: center; padding: clamp(34px, 6vh, 60px) 0 24px; }
.test-hero .emoji { font-size: 52px; margin-bottom: 12px; }
.test-hero h1 { font-size: clamp(26px, 4.6vw, 38px); letter-spacing: -0.02em; margin: 0 0 10px; }
.test-hero p { color: var(--sub); margin: 0 auto 24px; max-width: 460px; }
.btn-start, .btn-primary {
  display: inline-block; background: var(--accent); color: #fff; font-weight: 800;
  border: 0; border-radius: 999px; padding: 15px 36px; font-size: 16px;
  box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 35%, transparent); transition: transform .2s, filter .2s;
}
.btn-start:hover, .btn-primary:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn-ghost { display: inline-block; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 13px 26px; font-weight: 700; }

/* 진행 바 */
.progress { position: sticky; top: 56px; z-index: 10; background: var(--bg); padding: 14px 0 8px; }
.progress-track { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .35s ease; }
.progress-count { font-size: 13px; color: var(--muted); font-weight: 700; margin-top: 8px; text-align: center; }

/* 문항 */
.question { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(24px, 4vw, 34px); box-shadow: var(--shadow-sm); animation: qIn .35s ease; }
@keyframes qIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.question h2 { font-size: clamp(18px, 2.6vw, 23px); letter-spacing: -0.01em; margin: 0 0 20px; line-height: 1.4; }
.options { display: grid; gap: 11px; }
.option {
  text-align: left; width: 100%; background: var(--bg); border: 1.5px solid var(--line);
  border-radius: var(--radius-md); padding: 16px 18px; font-size: 15px; font-weight: 600; color: var(--ink);
  transition: border-color .18s, background .18s, transform .12s;
}
.option:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--bg)); }
.option:active { transform: scale(0.99); }
.option.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg)); }

/* 결과 */
.result { text-align: center; padding: clamp(30px, 6vh, 56px) 0; animation: qIn .4s ease; }
.result .badge { display: inline-block; background: color-mix(in srgb, var(--accent) 14%, #fff); color: var(--accent); font-weight: 800; border-radius: 999px; padding: 7px 16px; font-size: 13px; margin-bottom: 16px; }
.result h1 { font-size: clamp(26px, 5vw, 40px); letter-spacing: -0.02em; margin: 0 0 6px; }
.result .result-emoji { font-size: 64px; margin-bottom: 10px; }
.result .summary { font-size: 17px; color: var(--ink); font-weight: 700; margin: 0 0 18px; }
.result-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(22px, 4vw, 30px); box-shadow: var(--shadow-sm); text-align: left; margin: 0 0 16px; }
.result-card h3 { font-size: 15px; color: var(--accent); margin: 0 0 8px; font-weight: 800; }
.result-card p { margin: 0 0 14px; color: var(--sub); font-size: 14.5px; line-height: 1.7; }
.result-card p:last-child { margin-bottom: 0; }
.share-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 18px 0; }
.share-btn { display: inline-flex; align-items: center; gap: 7px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 11px 18px; font-weight: 700; font-size: 14px; }
.share-btn:hover { border-color: var(--accent); color: var(--accent); }

/* 다른 테스트 추천 (교차링크) */
.more-tests { max-width: 640px; margin: clamp(30px, 6vh, 56px) auto 0; padding: 0 20px; }
.more-tests h3 { font-size: 16px; margin: 0 0 14px; }
.more-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.more-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px 12px; text-align: center; transition: transform .2s, border-color .2s; }
.more-item:hover { transform: translateY(-3px); border-color: var(--accent); }
.more-item .e { font-size: 26px; }
.more-item .n { font-size: 12.5px; font-weight: 700; margin-top: 6px; }

/* 모션 민감 */
@media (prefers-reduced-motion: reduce) {
  .question, .result, .test-card { animation: none; transition: none; }
}

/* 반응형 */
@media (max-width: 860px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .nav-links { display: none; }
  .card-grid { grid-template-columns: 1fr; }
  .more-row { grid-template-columns: repeat(3, 1fr); }
  .hero-stat { flex-direction: column; gap: 8px; padding: 14px 22px; }
}
