/* 명리결 storefront — 움직임.
   ──────────────────────────────────────────────────────────────────
   시선의 끝은 언제나 CTA 다. 배경이 버튼보다 화려하면 실패다.
   그래서 세기를 이 순서로 둔다 —

     1 결제 버튼   2 sticky CTA   3 잠긴 답
     4 고른 묶음   5 무료 결과    6 장식

   transform 과 opacity 만 쓴다. layout 을 흔들지 않는다.
   무거운 canvas·WebGL·애니메이션 라이브러리를 쓰지 않는다.
   ────────────────────────────────────────────────────────────────── */

:root {
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.2, .9, .3, 1.15);
}

/* ── 화면에 들어올 때만 올라온다 (scroll reveal) ── */
[data-rise] {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition: opacity .42s var(--ease-out), transform .42s var(--ease-out);
  will-change: opacity, transform;
}
[data-rise].in { opacity: 1; transform: none; }
[data-rise].done { will-change: auto; }

@keyframes rise {
  from { opacity: 0; transform: translate3d(0, 16px, 0); }
  to   { opacity: 1; transform: none; }
}
@keyframes pop-in {
  from { opacity: 0; transform: scale(.82); }
  to   { opacity: 1; transform: none; }
}
@keyframes sweep {
  from { background-position: 130% 0; }
  to   { background-position: -60% 0; }
}

/* ══════════════════════════════════ HERO — 차례로 선다 */
.hero h1.big, .hero .sub, .hero .wiz {
  animation: rise .5s var(--ease-out) both;
}
.hero h1.big { animation-delay: .05s; }
.hero .sub   { animation-delay: .16s; }
.hero .wiz   { animation-delay: .34s; }   /* 첫 입력이 가장 늦게, 또렷하게 */

/* 핵심 낱말(「재물운」) 위를 **빛이 지나간다.**

   2026-09-30. 여기가 그 낱말의 **진짜 색을 정하던 자리**였다 —
   `-webkit-text-fill-color` 는 `color` 를 이긴다. `sf-hero.css` 에서
   아무리 밝은 금을 줘도 화면에 칠해지던 것은 이 그라디언트였고,
   그 바탕이 `--gold`(#c9a227, 어둡다)라서 「금이 죽어 보인다」였다.

   **어두운 끝을 두지 않는다.** 밝은 금 ↔ 더 밝은 흰금 사이에서만
   움직인다. 어두운 값을 하나라도 넣으면 다시 탁해진다.
   **번짐(`drop-shadow`)은 넣지 않는다** — 가장자리를 뭉갠다.
   한 번만 스치고 마는 것이 아니라 3.2초마다 돈다 — 대표가 찾은
   그 반짝임이다. */
h1.big em {
  /* **메탈 골드 질감 + 광택.**(지정값 2026-09-30 · 광택 2026-10-01)

     중요한 것은 「금색」이 아니라 **금속으로 보이는가**다. 윗면이 밝고
     가운데가 선명하고 아래가 한 단 진한 **세로 다섯 정거장**이 금속의
     두께를 만든다 — 그 자리(0/20/48/72/100)가 질감의 전부다.

     **배경은 한 겹이어야 한다.** 두 겹을 얹으면 `background-clip: text`
     에서 윗겹이 칠해지지 않는다(2026-10-01 에 빨강으로 확인했다). 그래서
     램프와 흰 띠를 **한 그라디언트 안에** 넣고, 글자 높이의 세 배로 세워
     **세로로 내린다.** 보이는 창은 늘 그 1/3 이다.

       자리  0%   창이 맨 위   = 지정 다섯 정거장 그대로 (쉬는 모습)
       자리 50%   창이 가운데  = 흰 띠가 글자를 지난다 (번쩍)

     띠가 지나간 뒤 **한 박자 쉰다.** 쉬지 않고 계속 돌면 장식이 되고,
     쉬었다 한 번씩 번쩍이면 금속이 된다.
     **둘레의 점 반짝이는 두지 않는다** — 넣었다가 걷었다. */
  background-image: linear-gradient(176deg,
      /* ── 쉬는 창: 대표 지정 다섯 정거장 ── */
      #FFF7CC 0%,  #FFE27A 7%,  #FFC83D 16%, #E7B11E 24%, #D99A00 33%,
      /* ── 지나가는 흰 띠 ── */
      #FFF2B8 37%, #FFFFFF 44%, #FFF2B8 51%,
      /* ── 다시 금속 ── */
      #FFE27A 58%, #FFC83D 67%, #E7B11E 75%, #D99A00 84%,
      #FFF7CC 90%, #FFE27A 95%, #FFC83D 100%);
  background-size: 100% 300%;
  background-position: 0 0%;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gold-shine 3.4s ease-in-out infinite;
}
@keyframes gold-shine {
  0%, 66% { background-position: 0 0%; }
  100%    { background-position: 0 100%; }
}

@keyframes shimmer {
  from { background-position: 120% 0; }
  to   { background-position: -40% 0; }
}

/* ══════════════════════════════════ WIZARD — 앱처럼 넘어간다 */
.step.on { animation: step-in .26s var(--ease-out) both; }
.step.on.back { animation-name: step-in-back; }
@keyframes step-in {
  from { opacity: 0; transform: translate3d(16px, 0, 0); }
  to   { opacity: 1; transform: none; }
}
@keyframes step-in-back {
  from { opacity: 0; transform: translate3d(-16px, 0, 0); }
  to   { opacity: 1; transform: none; }
}
.pbar i { transition: width .38s var(--ease-out); }

/* ══════════════════════════════════ ANALYSIS — 일부러 끌지 않는다 */
.steps li .s-name::before {
  content: "";
  display: inline-block; width: 12px; height: 12px; margin-right: 7px;
  border-radius: 50%; vertical-align: -1px;
  border: 2px solid #3a3350; border-top-color: var(--gold);
  animation: spin .7s linear infinite;
}
.steps li.done .s-name::before {
  content: "✓"; width: auto; height: auto; border: none;
  color: var(--ok); animation: none; margin-right: 5px; font-weight: 800;
}
.steps li.done { animation: step-glow .7s var(--ease-out) 1 both; }
@keyframes step-glow {
  0%   { background: #58c08a00; }
  35%  { background: #58c08a14; }
  100% { background: #58c08a00; }
}
.steps li.done .s-val { animation: rise .3s var(--ease-out) both; }

/* ══════════════════════════════════ 무료 결과 */
.free-card.in .openmark { animation: pop-in .34s var(--ease-spring) .12s both; }
/* 첫 굵은 문장만 아주 짧게. 계속 번쩍이지 않는다. */
.free-card.in p b:first-of-type {
  animation: emphasize 1s var(--ease-out) .3s 1 both;
}
@keyframes emphasize {
  0%   { color: #ddd7e8; }
  30%  { color: #fff0b8; }
  100% { color: var(--text); }
}
.tz.open .a { animation: pop-in .4s var(--ease-spring) both; }

/* ══════════════════════════════════ 잠긴 답 — 뒤에 진짜가 있다
   화면에 가장 가까운 한 장만 움직인다. 일곱 장이 동시에 움직이지 않는다. */
.lock-item.near .skel i { animation: skel-sweep 2.4s var(--ease-out) infinite; }
.lock-item.near .skel i:nth-child(2) { animation-delay: .12s; }
.lock-item.near .skel i:nth-child(3) { animation-delay: .24s; }
.lock-item.near .skel i:nth-child(4) { animation-delay: .36s; }
@keyframes skel-sweep {
  0%, 60%, 100% { background: linear-gradient(90deg, #3a3350, #262038); }
  25%           { background: linear-gradient(90deg, #4a4166, #2f2848); }
}
.lock-item.near h4 { animation: lock-bounce .6s var(--ease-spring) 1; }
@keyframes lock-bounce {
  0%   { transform: translateY(0); }
  35%  { transform: translateY(-3px); }
  100% { transform: translateY(0); }
}
.lock-item.near::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%,
              #ffffff12 50%, transparent 62%);
  background-size: 260% 100%;
  animation: sweep 2.6s var(--ease-out) 1;
}

/* ══════════════════════════════════ CTA — 가장 센 자리 */
.cta.mid, .sticky .cta, #pay { position: relative; overflow: hidden; }
.cta.mid::after, .sticky .cta::after, #pay::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 41%,
              #ffffff55 50%, transparent 59%);
  background-size: 250% 100%; background-position: 130% 0;
}
/* 본문 CTA 는 화면에 들어올 때 한 번만 */
.cta.mid.in::after { animation: sweep 1.6s var(--ease-out) 1; }

/* sticky — 잠긴 내용을 충분히 본 뒤 한 번 부드럽게 알린다.
   버튼이 커졌다 작아졌다 하지 않는다. 그림자만 숨 쉰다. */
.sticky.nudge .cta { animation: nudge .7s var(--ease-spring) 1; }
@keyframes nudge {
  0%   { box-shadow: 0 8px 20px #c9a22733; }
  45%  { box-shadow: 0 10px 30px #c9a22788; }
  100% { box-shadow: 0 8px 20px #c9a22733; }
}
.sticky.nudge .cta::after { animation: sweep 1.5s var(--ease-out) 1; }
/* 그 뒤로는 드물게, 아주 약하게 */
.sticky.idle .cta::after { animation: sweep 1.4s var(--ease-out) 3.6s infinite; }
.sticky .p .now, .sum-row.total b { transition: color .22s ease; }
.sticky .p .now.bump, .sum-row.total b.bump { color: #fff0b8; }

/* 결제 버튼 — 화면에서 가장 눌러보고 싶은 것 */
#pay::after { animation: sweep 1.5s var(--ease-out) .6s infinite; }

/* ══════════════════════════════════ 상품 시트 */
.scrim { opacity: 0; transition: opacity .26s ease; }
.scrim.show { opacity: 1; }
.sheet.open { transition: transform .42s var(--ease-spring); }
.sheet.open .pack { animation: rise .4s var(--ease-out) both; }
.sheet.open .pack:nth-of-type(1) { animation-delay: .06s; }
.sheet.open .pack:nth-of-type(2) { animation-delay: .14s; }
.sheet.open .pack:nth-of-type(3) { animation-delay: .22s; }

.pack { transition: transform .22s var(--ease-spring),
                    border-color .22s ease, background .22s ease; }
.pack.sel { transform: scale(1.012); }
.pack.sel .pack-title::after {
  content: "✓"; color: var(--ok); margin-left: 7px;
  display: inline-block; animation: pop-in .3s var(--ease-spring) both;
}
/* 추천 배지 — 시트를 처음 열 때만 한 번 */
.sheet.open .pack-badge:not(.soonbadge) {
  animation: badge-glow 1.5s var(--ease-out) .35s 1;
}
@keyframes badge-glow {
  0%, 100% { box-shadow: 0 0 0 0 #f0cf5e00; }
  40%      { box-shadow: 0 0 14px 2px #f0cf5e66; }
}

/* ══════════════════════════════════ 만드는 중 · 완료 */
.card.fulfil { transition: border-color .3s ease; }
.card.fulfil.completed .openmark { animation: pop-in .4s var(--ease-spring) both; }
.card.fulfil.completed .cta { animation: rise .42s var(--ease-out) .1s both; }
.progress i { transition: width .5s var(--ease-out); }

.tick { display: inline-block; width: 15px; height: 15px; margin-right: 6px;
        vertical-align: -2px; }
.tick path {
  stroke: var(--ok); stroke-width: 3; fill: none;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 22; stroke-dashoffset: 22;
  animation: draw .42s var(--ease-out) forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.spark {
  position: fixed; left: 50%; top: 30%; width: 6px; height: 6px;
  border-radius: 50%; pointer-events: none; z-index: 95;
  animation: spark .9s ease-out forwards;
}
@keyframes spark {
  from { opacity: 1; transform: translate(0, 0) scale(1); }
  to   { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.4); }
}

/* ══════════════════════════════════════════════════════════════════
   움직임을 원하지 않는 사람에게는 **전부 끈다.**
   기능·정보·CTA 는 그대로 남는다.
   ══════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  [data-rise] { opacity: 1 !important; transform: none !important; }
  /* 움직임을 줄여 달라면 **멈추고 단색으로** 선다 — `.tm-val` 과 같다.
     단색도 죽지 않게 밝은 금 그대로다. */
  /* 움직임만 멈춘다. **그라디언트와 둘레 빛은 남긴다** — 그건
     움직임이 아니라 색이다. 띠는 지나간 자리에서 멈춘다. */
  h1.big em { animation: none !important; }
  .spark { display: none !important; }
  .steps li .s-name::before {
    animation: none !important; border-top-color: #3a3350;
  }
  .pack.sel { transform: none; }
}
