/* 반려동물 성격유형 테스트 - 페이지 CSS
   tasteskill의 system.css / layout.css / motion.css 위에 얹는 부분만 씁니다.
   1) 한글 글꼴: 배정된 Figtree에는 한글이 없어서 영문·숫자는 Figtree, 한글은 둥근 글꼴(Jua / Gowun Dodum)로 이어 줍니다.
   2) 광고 자리표시, 16유형 캐릭터 목록, JS로 그리는 검사 화면(종 선택 → 아이 정보 → 20문항 → 작성완료 → 결과). */

:root {
  --font-display: "Figtree", "Jua", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-text: "Figtree", "Gowun Dodum", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
body { word-break: keep-all; overflow-wrap: anywhere; }

/* 광고 자리. 애드센스 게시자 ID가 설정되어 html.ads-on이 붙을 때만 보입니다.
   애드센스 정책(광고와 버튼 사이 간격)에 맞춰 위아래 여백을 넉넉히 둡니다. */
.ad-slot { display: none; }
html.ads-on .ad-slot { display: block; min-height: 100px; margin-block: var(--s-5); }
html.ads-on .ad-slot > span { display: block; font-size: var(--t-label); color: var(--muted); }
html.ads-on .hero--film .ad-slot { flex: none; margin: 0 0 var(--s-3); }

/* close-word: 이름을 .wrap 폭에 맞춘 크기 (한글 9자) */
.close__word { font-size: min(10.2vw, 136px); line-height: 1.2; white-space: nowrap; }
@media (max-width: 1023px) { .close__word { font-size: 9.4vw; } }

/* 네 가지 기준: 넓은 화면에서는 세로 사진 */
@media (min-width: 1024px) { #axes .tile { --tile-ratio: 4 / 5; } }

/* 16유형 캐릭터 */
.types { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: var(--s-6) var(--s-4); }
.types img { display: block; width: 100%; height: auto; border-radius: var(--r-lg); margin-bottom: var(--s-3); }
.types strong { display: block; font: 500 var(--t-lead)/1.3 var(--font-text); }
.types span { display: block; font-size: var(--t-small); line-height: 1.4; }
@media (min-width: 640px) and (max-width: 1023px) {
  #axes .tile { --tile-ratio: 3 / 2; }
  /* 진행 순서(pinned-chapters)가 멈춰 있는 태블릿: 세 단계가 한 화면에 들어가게 사진 높이를 줄임 */
  #how:not(.is-live) .mo-pc__visual > img { max-height: 17svh; }
  /* 16유형: 한 화면에 들어가도록 캐릭터를 88px로 */
  #types { --h: 1; }
  .types img { width: 88px; }
}
/* 휴대폰: 진행 순서 세 단계는 두 화면 */
@media (max-width: 639px) {
  #how:not(.is-live) { height: auto; min-height: 200svh; }
  #how:not(.is-live) .mo-pc__visual > img { aspect-ratio: 1; max-height: none; }
  #how:not(.is-live) .mo-pc__steps { gap: 56px; }
}
@media (max-width: 1023px) { .types { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 639px) {
  .types { gap: var(--s-4) var(--s-2); }
  .types img { margin-bottom: var(--s-1); }
  .types strong { font-size: var(--t-small); }
  .types span { font-size: var(--t-label); }
  .section-head p { font-size: var(--t-body); }
}

/* 검사 화면: 랜딩을 숨기고 main 안에 한 화면씩 그립니다 */
body:not([data-screen="landing"]) [data-landing] { display: none; }
body:not([data-screen="landing"]) .nav__links,
body:not([data-screen="landing"]) .nav__actions,
body:not([data-screen="landing"]) .nav__toggle { visibility: hidden; }
.app-screen { padding: calc(var(--nav) + var(--s-7)) 0 var(--s-9); min-height: 100svh; }
.screen { width: min(640px, 100%); margin-inline: auto; display: flex; flex-direction: column; gap: var(--s-4); }
.screen h2 { font: var(--display-weight) clamp(26px, 5vw, 34px)/1.3 var(--font-display); letter-spacing: -0.01em; }
.screen .lead, .screen .hint, .screen .disclaimer { color: var(--muted); }
.screen .hint:empty { display: none; }
.screen .disclaimer { font-size: var(--t-small); }
.screen .btn { width: 100%; }
.screen .row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); margin-top: var(--s-2); }
.screen .row > :only-child { grid-column: 1 / -1; }
.btn:disabled { opacity: .4; cursor: default; pointer-events: none; }

.panel-card { background: var(--p-surface); border-radius: var(--r-lg); padding: var(--s-7) var(--s-6); display: flex; flex-direction: column; gap: var(--s-4); box-shadow: 0 12px 32px rgba(110, 70, 40, .08); }
@media (max-width: 639px) { .panel-card { padding: var(--s-6) var(--s-5); } }

/* 종 선택 */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
button.choice { display: flex; flex-direction: column; gap: var(--s-3); align-items: stretch; padding: var(--s-3) var(--s-3) var(--s-4); border: 2px solid var(--line); border-radius: var(--r-lg); background: var(--p-surface); color: var(--ink); font: var(--display-weight) 24px/1.2 var(--font-display); cursor: pointer; transition: border-color 150ms var(--ease), transform 150ms var(--ease); }
button.choice .photo { display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--r-md); background: var(--p-bg); }
button.choice img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms var(--ease); }
@media (hover: hover) and (pointer: fine) {
  button.choice:hover { border-color: var(--action); transform: translateY(-2px); }
  button.choice:hover img { transform: scale(1.03); }
  button.option:hover { border-color: var(--action); transform: translateY(-1px); }
}
button.choice:active, button.option:active { transform: translateY(1px) scale(.985); }

/* 문항 */
.progress { font: 500 var(--t-lead)/1.3 var(--font-text); color: var(--action); }
.bar { height: 12px; border-radius: 999px; background: color-mix(in oklab, var(--p-accent) 16%, var(--p-bg)); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: var(--p-accent); }
button.option { display: flex; align-items: center; gap: var(--s-4); width: 100%; min-height: 76px; padding: var(--s-5); text-align: left; border: 2px solid var(--line); border-radius: var(--r-lg); background: var(--p-surface); color: var(--ink); font: 400 18px/1.5 var(--font-text); cursor: pointer; transition: border-color 150ms var(--ease), transform 150ms var(--ease); }
button.option::before { content: attr(data-key); flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: color-mix(in oklab, var(--p-accent) 14%, var(--p-bg)); color: var(--action); font: 500 16px/1 var(--font-text); }

/* 결과 */
.result { text-align: center; align-items: center; }
.result .art { width: min(260px, 100%); height: auto; border-radius: var(--r-lg); }
.result .code { font: var(--display-weight) clamp(26px, 6vw, 34px)/1.3 var(--font-display); }
.result .detail { text-align: left; font-size: 18px; line-height: 1.7; }
.meter { list-style: none; width: 100%; margin: var(--s-2) 0 0; padding: var(--s-5) 0 0; border-top: 1px solid var(--line); display: grid; gap: var(--s-4); text-align: left; }
.meter__head { display: flex; justify-content: space-between; gap: var(--s-2); font-size: var(--t-small); }
.meter .bar { height: 10px; margin-top: var(--s-1); }
.actions { display: grid; gap: var(--s-3); }

/* 320px 폭: 로고는 "성격유형"만 남겨 버튼과 메뉴가 한 줄에 들어가게 */
@media (max-width: 359px) { .logo-pre { display: none; } }

@media (prefers-reduced-motion: reduce) { button.choice, button.option, button.choice img { transition: none; } }

/* 검사 화면 제목과 유형 코드는 문장부호·영문까지 둥근 글꼴 하나로 */
.screen h2, .result .code { font-family: "Jua", var(--font-display); }

/* 히어로 사진은 휴대폰용 세로 크롭을 <picture>로 고름: picture 자체가 프레임을 채우게 */
.hero__media > picture { position: absolute; inset: 0; display: block; }

/* 카카오톡 공유 버튼: 카카오 디자인 가이드의 노란색(#FEE500)과 검정 글자(85%) */
.btn.btn--kakao { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: #FEE500; color: rgba(0, 0, 0, .85); border-color: #FEE500; }
.btn.btn--kakao:hover { background: #f5dc00; border-color: #f5dc00; color: rgba(0, 0, 0, .85); }
.more-link { align-self: center; color: var(--action); padding: var(--s-2) 0; }
