/* StudioJson 토스 미니앱 랜딩 v2 — 후킹형.
   첫 화면: 내 것 하나 고르기(해 · 고민 · 받는 분) → 답은 가린 채 토스로. 그다음 0원 가격표, 실제 화면, 끝 단추.
   색과 글꼴은 각 앱 것 그대로(body 의 w-*). 읽는 사람 대부분이 50~60대 안드로이드: 본문 18px, 단추 62px. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
button, input, select { font: inherit; color: inherit; }

:root {
  --ui: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  --wrap: 1120px;
  --gut: clamp(20px, 5vw, 40px);
}

.w-tarot {
  --bg: #17112B; --bg2: #1F1838; --ink: #EFE8F7; --mute: #B3A9C9; --line: #3A3060;
  --accent: #E2BC6A; --accent-ink: #1B1433; --accent-2: #F6E3B4; --seal: #8E2B2B; --seal-ink: #F6E3B4;
  --display: 'Hahmlet', 'Nanum Myeongjo', serif; --body: var(--ui);
  --h-weight: 600; --lh: 1.7;
  color-scheme: dark;
}
.w-saju {
  --bg: #FBF5EC; --bg2: #F3EADB; --ink: #1F2766; --mute: #555C8C; --line: #DCCFDF;
  --accent: #2C3FA6; --accent-ink: #FFFFFF; --accent-2: #EE3F8A; --seal: #E2364F; --seal-ink: #FFF5F0;
  --display: 'Jua', var(--ui); --body: 'Gowun Batang', serif;
  --h-weight: 400; --lh: 1.85;
}
.w-greeting {
  --bg: #F6EEE3; --bg2: #EEE2D1; --ink: #3A281D; --mute: #6E5747; --line: #DCCBB5;
  --accent: #C4561F; --accent-ink: #FFFFFF; --accent-2: #2F4E9C; --seal: #C4561F; --seal-ink: #FFF8EE;
  --display: 'Sunflower', 'IBM Plex Sans KR', sans-serif; --body: 'IBM Plex Sans KR', var(--ui);
  --h-weight: 700; --lh: 1.75;
}

body.app {
  background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 18px; line-height: var(--lh);
  word-break: keep-all; overflow-wrap: anywhere;
}
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; border-radius: 6px; }

/* ── 머리 ── */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 18px; }
.who { display: flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--ui); font-weight: 700; font-size: 19px; }
.who img { width: 44px; height: 44px; border-radius: 12px; }
.badge { font-family: var(--ui); font-size: 14px; font-weight: 600; color: var(--mute); border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; white-space: nowrap; text-decoration: none; }
a.badge:hover { color: var(--ink); border-color: var(--mute); }

/* ── 첫 화면 ── */
.hero { display: grid; gap: 32px; padding-block: 8px 64px; align-items: center; }
@media (min-width: 960px) { .hero { grid-template-columns: 1fr 1fr; gap: 64px; padding-block: 32px 96px; } }
.hero h1 {
  font-family: var(--display); font-weight: var(--h-weight);
  font-size: clamp(34px, 9vw, 58px); line-height: 1.22; letter-spacing: -0.01em; margin: 0;
  text-wrap: balance;
}
.hero h1 .who-name { color: var(--accent); }
.w-saju .hero h1 .who-name { color: var(--accent-2); }
.when { display: inline-block; margin: 0 0 14px; font-family: var(--ui); font-size: 16px; font-weight: 700; color: var(--accent); }

/* 도장: 매일 무료. 앱마다 생김새가 다르다(밀랍 · 인주 · 우표) */
.stamp {
  float: right; shape-outside: circle(50%); margin: 0 0 8px 12px;
  width: clamp(84px, 22vw, 118px); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-content: center; text-align: center;
  background: var(--seal); color: var(--seal-ink); rotate: 10deg;
  font-family: var(--ui); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em;
}
.stamp small { display: block; font-size: clamp(11px, 2.8vw, 14px); font-weight: 700; opacity: .9; }
.stamp b { display: block; font-size: clamp(22px, 6vw, 30px); }
.w-tarot .stamp { box-shadow: 0 0 0 4px #6E1F1F inset, 0 10px 24px -8px rgba(0,0,0,.7); background: radial-gradient(circle at 35% 30%, #A8393A, #7A2222 70%); }
.w-saju .stamp { border-radius: 14px; shape-outside: inset(0 round 14px); rotate: -7deg; box-shadow: 0 0 0 3px var(--seal-ink) inset, 0 0 0 6px var(--seal) inset; font-family: 'Jua', var(--ui); font-weight: 400; }
.stamp > span { display: grid; place-content: center; width: 100%; height: 100%; border-radius: inherit; }
.w-greeting .stamp { display: block; }
.w-greeting .stamp { border-radius: 2px; shape-outside: inset(0); rotate: 6deg; padding: 6px; font-family: 'Sunflower', var(--ui);
  background: radial-gradient(circle, var(--bg) 3.6px, transparent 4px) -6px -6px / 12px 12px, var(--seal); box-shadow: 0 10px 20px -12px rgba(60,20,0,.5); }
.w-greeting .stamp > span { background: var(--seal); box-shadow: 0 0 0 1.5px rgba(255,248,238,.5) inset; }

.lede { margin: 14px 0 0; font-size: clamp(18px, 2.2vw, 21px); color: var(--mute); max-width: 30em; }
.go { margin-top: 26px; display: grid; gap: 10px; max-width: 460px; clear: both; }
.cta {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 62px; padding: 0 24px; border-radius: 16px;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--ui); font-size: 20px; font-weight: 800; text-decoration: none; text-align: center;
  transition: transform .12s ease, filter .12s ease;
}
.cta:hover { filter: brightness(1.06); }
.cta:active { transform: scale(.98); }
.cta-sub { margin: 0; font-family: var(--ui); font-size: 15px; line-height: 1.5; color: var(--mute); text-align: center; }
.cta-sub b { color: var(--ink); }

.qr { display: none; }
@media (min-width: 960px) and (hover: hover) {
  .qr { display: flex; align-items: center; gap: 18px; margin-top: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; }
  .qr svg { width: 96px; height: 96px; flex: none; background: #fff; padding: 6px; border-radius: 8px; }
  .qr p { margin: 0; font-family: var(--ui); font-size: 16px; line-height: 1.5; }
  .qr b { display: block; font-size: 17px; }
}

/* 고르기 칩: 큰 손가락용 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.chips legend { width: 100%; margin-bottom: 10px; padding: 0; font-family: var(--ui); font-size: 16px; font-weight: 700; }
.chip {
  min-height: 48px; padding: 0 18px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line); background: transparent; font-family: var(--ui); font-size: 17px; font-weight: 700;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.w-tarot .chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ── 0원 가격표 ── */
.sec { padding-block: 72px; }
.sec.alt { background: var(--bg2); }
.sec h2 { font-family: var(--display); font-weight: var(--h-weight); font-size: clamp(28px, 6vw, 42px); line-height: 1.25; margin: 0 0 10px; text-wrap: balance; }
.sec .sub { margin: 0 0 32px; color: var(--mute); max-width: 34em; }
.board { list-style: none; margin: 0; padding: 0; max-width: 720px; }
.board li { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.board .nm { font-family: var(--ui); font-weight: 700; font-size: 19px; }
.board .nm small { display: block; font-weight: 500; font-size: 15px; color: var(--mute); }
.board .dots { border-bottom: 2px dotted var(--line); translate: 0 -6px; }
.board .pr { text-align: right; font-family: var(--display); font-weight: var(--h-weight); font-size: 30px; line-height: 1; color: var(--accent); white-space: nowrap; }
.w-saju .board .pr { color: var(--accent-2); }
.board .pr small { display: block; margin-top: 6px; font-family: var(--ui); font-size: 14px; font-weight: 600; color: var(--mute); }
.board li.paid .pr { font-size: 22px; color: var(--mute); }
.fine { margin: 18px 0 0; font-family: var(--ui); font-size: 15px; color: var(--mute); max-width: 720px; }

/* ── 실제 화면 ── */
.strip { list-style: none; margin: 0; padding: 0 0 8px; display: grid; grid-auto-flow: column; grid-auto-columns: min(64vw, 260px); gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip li { scroll-snap-align: start; }
.strip figure { margin: 0; }
.strip img { border-radius: 20px; border: 1px solid var(--line); box-shadow: 0 18px 40px -24px rgba(0,0,0,.45); aspect-ratio: 636 / 1048; object-fit: cover; width: 100%; }
.strip figcaption { margin-top: 12px; font-family: var(--ui); font-size: 16px; font-weight: 600; color: var(--mute); }
@media (min-width: 960px) { .strip { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); overflow: visible; gap: 40px; max-width: 900px; } }

/* ── 끝 단추 ── */
.last { text-align: center; }
.last h2 { margin-bottom: 10px; }
.last .sub { margin: 0 auto 26px; }
.last .cta { max-width: 460px; margin-inline: auto; }

/* ── 다른 앱 ── */
.more { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.more a { display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; align-items: center; padding: 14px; border-radius: 18px; border: 1px solid var(--line); text-decoration: none; }
.more a:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.more img { width: 56px; height: 56px; border-radius: 14px; }
.more b { display: block; font-family: var(--ui); font-size: 19px; }
.more span { font-family: var(--ui); font-size: 16px; color: var(--mute); }
.more i { font-style: normal; font-family: var(--ui); font-size: 15px; font-weight: 800; color: var(--accent); white-space: nowrap; }
@media (min-width: 960px) { .more { grid-template-columns: 1fr 1fr; max-width: 820px; } }

.foot { padding-block: 40px 120px; font-family: var(--ui); font-size: 15px; color: var(--mute); border-top: 1px solid var(--line); }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 12px; }
.foot nav a { text-decoration: none; padding-block: 6px; }
.foot p { margin: 0; line-height: 1.6; }

.dock {
  position: fixed; inset: auto 0 0 0; z-index: 10;
  padding: 12px var(--gut) calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  transform: translateY(110%); transition: transform .25s ease;
}
.dock.on { transform: none; }
.dock .cta { max-width: 460px; margin: 0 auto; min-height: 58px; }
@media (min-width: 960px) { .dock { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ═══ 타로: 고민 고르기 → 엎어 둔 세 자리 ═══ */
.w-tarot .hero-wrap { position: relative; isolation: isolate; }
.w-tarot .hero-wrap::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(60% 50% at 70% 35%, rgba(226,188,106,.16), transparent 70%), url(/site-assets/toss/tarot/scene.webp) center top / cover no-repeat;
  opacity: .5; mask-image: linear-gradient(#000 55%, transparent);
}
@media (max-width: 959px) { .w-tarot .hero-wrap::before { opacity: .28; background-position: 70% top; } }
.spread { display: grid; gap: 22px; }
.slots-cap { margin: 0; text-align: center; font-family: var(--display); font-size: 21px; color: var(--accent-2); min-height: 1.7em; }
.slots { display: flex; justify-content: center; gap: clamp(10px, 3vw, 22px); }
.slot { display: grid; gap: 8px; justify-items: center; align-content: start; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.slot:disabled { cursor: default; }
.slot:focus-visible { outline: none; }
.slot:focus-visible .flip { outline: 3px solid var(--accent); outline-offset: 4px; }
.flip { position: relative; display: block; width: clamp(92px, 26vw, 148px); aspect-ratio: 2 / 3; border-radius: 10px; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.3,.7,.2,1); box-shadow: 0 20px 40px -18px rgba(0,0,0,.8); }
.flip img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 10px; backface-visibility: hidden; box-shadow: 0 0 0 1px rgba(226,188,106,.35); }
.flip .fr { transform: rotateY(180deg); }
.slot.rev .flip .fr { transform: rotateY(180deg) rotate(180deg); }
.slot.open .flip { transform: rotateY(180deg); }
@media (hover: hover) { .slot:not(:disabled):hover .flip { translate: 0 -6px; } }
.slot:not(:disabled) .flip { animation: nudge 2.8s ease-in-out infinite; }
.slot:nth-child(2):not(:disabled) .flip { animation-delay: .25s; }
.slot:nth-child(3):not(:disabled) .flip { animation-delay: .5s; }
@keyframes nudge { 0%, 70%, 100% { translate: 0 0; } 80% { translate: 0 -6px; } }
.slot .pos { font-family: var(--ui); font-size: 15px; font-weight: 700; color: var(--accent); }
.slot .nm { min-height: 1.4em; font-family: var(--display); font-size: 17px; line-height: 1.35; color: var(--ink); text-align: center; max-width: 9em; word-break: keep-all; }
.after { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 20px 18px 18px; border-radius: 18px; background: rgba(226,188,106,.1); box-shadow: inset 0 0 0 1px rgba(226,188,106,.35); animation: rise .5s cubic-bezier(.2,.7,.2,1); }
.after[hidden] { display: none; }
.after p { margin: 0; font-family: var(--ui); font-size: 17px; line-height: 1.55; }
.after p b { display: block; font-family: var(--display); font-size: 22px; color: var(--accent); }
.after .cta { width: 100%; max-width: 360px; }
.after-sub { font-size: 15px !important; color: var(--mute); }
@keyframes rise { from { opacity: 0; translate: 0 10px; } }
.w-tarot .chips { justify-content: center; }
.w-tarot .chips legend { text-align: center; }

/* ═══ 사주: 2027 신년운세 한 장, 답은 가림 ═══ */
.w-saju .hero-wrap { overflow-x: clip; }
.w-saju .hero > div:last-child { position: relative; isolation: isolate; padding-block: 24px; }
.sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.sky img { position: absolute; }
.sky .sun { width: clamp(220px, 60vw, 380px); right: clamp(-120px, -10vw, -40px); top: -10px; }
.sky .c1 { width: clamp(260px, 72vw, 440px); left: clamp(-140px, -12vw, -40px); bottom: 40px; }
.sheet { width: min(100%, 380px); margin-inline: auto; background: #FFFDF8; border-radius: 6px 6px 14px 14px; padding: 0 22px 22px; box-shadow: 0 2px 0 #E9DFCF, 0 4px 0 #FFFDF8, 0 6px 0 #E9DFCF, 0 30px 50px -30px rgba(31,39,102,.55); }
.sheet .bind { height: 24px; margin: 0 -22px; background: var(--accent); border-radius: 6px 6px 0 0; position: relative; }
.sheet .bind::after { content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 8px; background: radial-gradient(circle at 6px 0, transparent 3.5px, #FFFDF8 4px) 0 0 / 12px 8px repeat-x; }
.sheet .hd { display: grid; grid-template-columns: 1fr 84px; gap: 10px; align-items: center; padding: 18px 0 14px; border-bottom: 2px dotted var(--line); }
.sheet .hd p { margin: 0; font-family: var(--display); font-size: 17px; color: var(--mute); line-height: 1.3; }
.sheet .hd b { display: block; font-family: var(--display); font-weight: 400; font-size: 26px; color: var(--ink); line-height: 1.25; }
.sheet .hd img { width: 84px; height: 84px; object-fit: contain; }
.sheet h3 { margin: 14px 0 8px; font-family: var(--display); font-weight: 400; font-size: 18px; }
.bar { display: block; height: 12px; border-radius: 6px; margin: 8px 0; background: radial-gradient(circle, rgba(238,63,138,.55) 1.2px, transparent 1.6px) 0 0 / 5px 5px, rgba(238,63,138,.16); }
.months { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; mask-image: linear-gradient(#000 60%, transparent); }
.months li { display: grid; grid-template-columns: 2.6em 1fr; align-items: center; gap: 8px; font-family: var(--display); font-size: 16px; }
.months .bar { margin: 0; }
.lockline { margin: 4px 0 0; text-align: center; font-family: var(--ui); font-size: 15px; font-weight: 700; color: var(--accent-2); }
.yr { display: grid; gap: 8px; margin: 18px 0 0; font-family: var(--ui); }
.yr label { font-size: 16px; font-weight: 700; }
.yr select {
  appearance: none; -webkit-appearance: none; width: 100%; min-height: 56px; padding: 0 48px 0 18px;
  border: 2px solid var(--accent); border-radius: 14px; background: #fff; font-size: 20px; font-weight: 700; color: var(--ink);
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 26px) 50%, calc(100% - 19px) 50%; background-size: 7px 7px; background-repeat: no-repeat;
}

/* ═══ 좋은날: 받는 분 고르기 → 카드가 그분 말투로 ═══ */
.postcard {
  width: min(100%, 420px); margin: 0 auto; padding: 12px; border-radius: 6px;
  background: repeating-linear-gradient(135deg, #C8372D 0 14px, #FFFDF8 14px 22px, #2F4E9C 22px 36px, #FFFDF8 36px 44px);
  box-shadow: 0 30px 60px -30px rgba(58,40,29,.55); rotate: -1.2deg;
}
.postcard .in { background: #FFFDF8; border-radius: 2px; overflow: hidden; }
.postcard .pic { aspect-ratio: 4 / 3; background: var(--bg2); }
.postcard .pic img { width: 100%; height: 100%; object-fit: cover; }
.postcard .txt { padding: 16px 20px 14px; text-align: center; font-family: 'Gowun Batang', serif; color: var(--ink); }
.postcard .to { margin: 0; text-align: left; font-size: 16px; color: var(--mute); }
.postcard .line { margin: 6px 0; font-size: 20px; line-height: 1.6; }
.postcard .from { margin: 0; text-align: right; font-size: 16px; color: var(--mute); }
.w-greeting .chips { margin-bottom: 22px; }
.wall { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.wall img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; }
@media (min-width: 960px) { .wall { grid-template-columns: repeat(6, 1fr); gap: 14px; } }

/* 좋은날: 보내는 순서(실제 순서라 번호를 단다) · 글귀 바꾸기 */
.easy { list-style: none; margin: 0; padding: 0; counter-reset: e; display: grid; gap: 14px; max-width: 900px; }
.easy li { counter-increment: e; display: grid; grid-template-columns: 52px 1fr; column-gap: 16px; align-items: start; padding: 18px 20px; background: var(--bg); border-radius: 18px; }
.easy li::before { content: counter(e); grid-row: span 2; width: 52px; height: 52px; display: grid; place-content: center; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-family: var(--display); font-weight: 700; font-size: 24px; }
.easy b { font-family: var(--ui); font-size: 20px; }
.easy span { color: var(--mute); }
@media (min-width: 960px) { .easy { grid-template-columns: 1fr 1fr; gap: 18px; } }
.swap { display: block; margin: 18px auto 0; min-height: 50px; padding: 0 22px; border-radius: 999px; border: 1.5px solid var(--ink); background: transparent; font-family: var(--ui); font-size: 17px; font-weight: 700; cursor: pointer; }
@media (hover: hover) { .swap:hover { background: var(--ink); color: var(--bg); } }
.w-greeting .board .pr { font-size: 22px; }

/* 좋은날: 받는 분이 천천히 바뀐다 */
.postcard .in, .hero h1 .who-name { transition: opacity .4s ease; }
.turning .postcard .in, .turning .hero h1 .who-name { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .slot .flip { animation: none !important; } }
