/* ──────────────────────────────────
   기본 리셋 & 변수
────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

@font-face {
  font-family: "OkDanDan";
  src: url("fonts/OkDanDan.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --surface2: #f4f3f9;
  --ink: #1c1b2e;
  --ink-muted: #6b6a85;
  --ink-light: #a8a7be;
  --accent: #ffec69;
  --accent2: #69bc6a;
  --accent3: #f38db9;
  --border: #e8e7f0;
  --shadow: rgba(28, 27, 46, 0.07);
  --radius: 20px;
  --radius-sm: 12px;
  --max-w: 720px;
  --font-body: "Noto Sans KR", sans-serif;
  --font-ok: "OkDanDan", sans-serif;
}

html {
  /* background: #e8e7f0; */
  background: #fff;
}

body {
  font-family: var(--font-body);
  /* background: var(--bg); */
  background: var(--accent);
  color: var(--ink);
  min-height: 100dvh;
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
  overflow-x: hidden;
}
.yellow {
  color: var(--accent);
}
.green {
  color: var(--accent2);
}
.pink {
  color: var(--accent3);
}
.white {
  color: var(--surface);
}
.ok {
  font-family: "OkDanDan", sans-serif;
}

/* ──────────────────────────────────
   페이지 시스템
────────────────────────────────── */
.page {
  display: none;
  min-height: 100dvh;
  animation: fadeUp 0.4s ease forwards;
}
.page.active {
  display: flex;
  flex-direction: column;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ──────────────────────────────────
   랜딩 페이지
────────────────────────────────── */
.landing-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 24px 48px;
  flex: 1;
}

.landing-illustration {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0px;
  width: 100%;
  max-width: 400px;
  padding: 80px 0 16px;
}
.landing-illustration img {
  width: 50%;
  height: auto;
  display: block;
}

.landing-content {
  width: 100%;
  max-width: 480px;
  text-align: center;
}

.landing-eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  /* color: var(--accent3); */
  margin-bottom: 12px;
}

.landing-title {
  font-family: var(--font-ok);
  font-size: clamp(40px, 10vw, 64px);
  font-weight: 300;
  line-height: 1.12;
  color: var(--ink);
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}
.landing-title em {
  /* color: var(--accent3); */
}

.landing-desc {
  font-size: 15px;
  line-height: 1.7;
  /* color: var(--ink-muted); */
  margin-bottom: 24px;
}

.landing-meta {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.meta-tag {
  background: var(--surface2);
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.btn-start {
  background: var(--ink);
  color: white;
  font-family: var(--font-ok);
  font-size: 24px;
  font-weight: 700;
  padding: 18px 48px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.15s;
  letter-spacing: 0.01em;
  width: 100%;
  max-width: 320px;
}
.btn-start:hover {
  background: var(--surface);
  transform: translateY(-2px);
  color: var(--ink);
}

.btn-start:active {
  transform: translateY(0);
}

/* ──────────────────────────────────
   질문 페이지
────────────────────────────────── */
.question-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px 16px;
  position: sticky;
  top: 0;
  background: transparent;
  z-index: 10;
  border-bottom: 1px solid var(--ink);
}
.question-illustration {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 300px;
}
.question-illustration img {
  width: 100%;
  height: auto;
  display: block;
}

.btn-back {
  background: var(--ink);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--surface);
  transition: background 0.2s;
}
.btn-back:hover {
  background: var(--surface);
  color: var(--ink);
}

.progress-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-bar {
  height: 6px;
  /* background: var(--border); */
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--ink);
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
/* .progress-text {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 500;
  text-align: right;
} */

.question-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 40px;
  padding: 24px;
}

.question-card {
  width: 100%;
  max-width: 480px;
}

.question-dimension-badge {
  display: inline-block;
  background: var(--ink);
  color: var(--surface);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.question-number {
  font-family: var(--font-ok);
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 12px;
  font-weight: 300;
  font-style: italic;
}

.question-text {
  font-size: clamp(32px, 5vw, 26px);
  font-family: var(--font-ok);
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 36px;
  color: var(--ink);
  word-break: keep-all;
}

.answers-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.answer-btn {
  width: 100%;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 20px 24px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s,
    transform 0.15s;
  line-height: 1.5;
  word-break: keep-all;
}
.answer-btn:hover {
  background: #f5f4ff;
  transform: translateX(4px);
}
.answer-btn:active {
  transform: translateX(2px) scale(0.99);
}
.answer-btn.selected {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--accent);
}

/* 슬라이드 애니메이션 */
.question-card.slide-out {
  animation: slideOut 0.25s ease forwards;
}
.question-card.slide-in {
  animation: slideIn 0.3s ease forwards;
}
@keyframes slideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-40px);
  }
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ──────────────────────────────────
   결과 페이지
────────────────────────────────── */
.result-inner {
  padding: 0 24px 60px;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}

.result-header {
  text-align: center;
  padding: 40px 0 0;
}

.result-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 24px;
}

.result-illustration {
  width: 100%;
  max-width: 500px;
  aspect-ratio: 1/1;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.result-illustration img {
  width: 100%;
  height: 100%;
}

.result-type-badge {
  display: inline-block;
  font-family: var(--font-ok);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 8px 24px;
  border-radius: 999px;
  margin-bottom: 14px;
  color: var(--ink);
}

.result-type-name {
  font-family: var(--font-ok);
  font-size: clamp(32px, 5vw, 30px);
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.3;
}

.result-character-name {
  display: inline-block;
  background: var(--ink);
  padding: 8px 16px;
  border-radius: 40px;

  font-family: var(--font-ok);
  font-size: clamp(16px, 2vw, 30px);
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.3;

  color: white;
}

.result-summary {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.6;
  margin-bottom: 32px;
}

.result-img-download {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

/* 카드 공통 */
.result-desc-card,
.result-traits-card,
.result-strengths-card,
.result-chart-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.result-desc-card p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink);
  word-break: keep-all;
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-bottom: 16px;
}

.traits-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.trait-tag {
  background: var(--surface2);
  font-family: var(--font-ok);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
}

.strengths-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.strengths-list li {
  font-size: 14px;
  color: var(--ink);
  padding-left: 20px;
  position: relative;
  line-height: 1.5;
}
.strengths-list li::before {
  content: "✦";
  position: absolute;
  left: 0;
  color: var(--accent2);
  font-size: 11px;
  top: 2px;
}

/* 성향 그래프 */
.chart-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.chart-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chart-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chart-label-left {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.chart-label-right {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-muted);
}
.chart-pct {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent3);
}
.chart-track {
  height: 10px;
  background: var(--surface2);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.chart-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0;
}
.chart-bar.yellow {
  background: var(--accent);
}
.chart-bar.pink {
  background: var(--accent3);
}
.chart-bar.green {
  background: var(--accent2);
}
.chart-bar.black {
  background: var(--ink);
}
/* 공유 섹션 */
.share-section {
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  text-align: center;
}
.share-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-muted);
  margin-bottom: 16px;
  letter-spacing: 0.04em;
}
.share-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.btn-share,
.btn-download {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  border: none;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.15s,
    opacity 0.2s;
  flex: 1;
  min-width: 140px;
  justify-content: center;
}

.btn-share svg {
  width: 20px;
  height: auto;
}
.btn-share:hover,
.btn-download:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}
.btn-kakao {
  background: #fee500;
  color: #3a1d1d;
}
.btn-instagram {
  background: linear-gradient(
    135deg,
    #f09433,
    #e6683c,
    #dc2743,
    #cc2366,
    #bc1888
  );
  color: white;
}
.btn-go {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
  width: 100%;
  border: none;
  border-radius: 999px;
  color: var(--surface);
  font-family: var(--font-ok);
  font-size: 24px;
  font-weight: 600;
  padding: 16px;
  cursor: pointer;
  transition:
    border-color 0.2s,
    color 0.2s;
}

.btn-retry {
  width: 100%;
  background: var(--ink);
  border: 2px solid transparent;
  border-radius: 999px;
  color: var(--surface);
  font-family: var(--font-ok);
  font-size: 24px;
  font-weight: 600;
  padding: 16px;
  cursor: pointer;
  transition:
    border-color 0.2s,
    color 0.2s;
}
.btn-retry:hover {
  /* border-color: var(--ink); */
  color: var(--ink);
  background-color: var(--surface);
}

/* ──────────────────────────────────
   반응형
────────────────────────────────── */
@media (max-width: 480px) {
  .landing-inner {
    padding: 0 20px 40px;
  }
  .question-body {
    padding: 20px;
  }
  .answer-btn {
    padding: 18px 20px;
    font-size: 14px;
  }
  .result-inner {
    padding: 0 20px 48px;
  }
  .share-buttons {
    flex-direction: column;
  }
  .btn-share,
  .btn-download {
    min-width: unset;
  }
}

@media (max-width: 360px) {
  .landing-title {
    font-size: 36px;
  }
  .question-text {
    font-size: 18px;
  }
}

/* 데스크탑에서 중앙 정렬 + 미러 배경 */
@media (min-width: 721px) {
  html {
    background: #fff;
    background-image:
      radial-gradient(
        ellipse at 20% 50%,
        rgba(123, 110, 240, 0.08) 0%,
        transparent 60%
      ),
      radial-gradient(
        ellipse at 80% 20%,
        rgba(107, 207, 181, 0.08) 0%,
        transparent 60%
      );
  }
  body {
    box-shadow: 0 0 60px rgba(28, 27, 46, 0.1);
    min-height: 100vh;
  }
}
