/* ──────────────────────────────────────────────────────────────────
   명리결 storefront — 첫 화면의 결. **PHASE 1: HERO + 접수 카드만.**

   `sf.css` 뒤에 실린다. 여기 있는 것은 전부 **겉모습**이다 — 구조도
   차례도 손대지 않으므로, 이 파일 하나만 빼면 예전 화면으로 돌아간다.

   깊이는 층으로 만든다. 한 장짜리 배경 그림처럼 보이면 실패다.

     뒤   밤하늘 · 별 · 달 · 오행 문양
     중   먼 산 · 처마 · 운무
     앞   구슬(안내자 자리) · 12지 벗 · 금빛 티끌

   움직임은 `transform` 과 `opacity` 로만 한다. 캔버스도 WebGL 도
   애니메이션 라이브러리도 쓰지 않는다.
   ────────────────────────────────────────────────────────────────── */

:root {
  --night-0: #070813;
  --night-1: #0c0a1a;
  --night-2: #15102d;
  --violet: #2a1b4e;
  --violet-hi: #4a2f7a;
  --ivory: #f6f1e4;
  --gold-hi: #f7e3a6;
  --gold-mid: #d9b25c;
  --gold-lo: #9a7326;
}

/* 아래 섹션까지 같은 밤 위에 앉게 한다. 한 세계 안이라는 느낌. */
html, body { background: var(--night-0); }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(120% 70% at 50% -10%, #2b1c52 0%, #140f2b 46%,
                    var(--night-0) 100%);
}

/* ═══════════════════════════════════ 머리띠 */
.hd {
  background: linear-gradient(180deg, #0b0918f2, #0b091899);
  border-bottom: 1px solid #3a2f5e66;
  height: 54px;
}
.hd .logo { display: none; }
.hd .mark { height: 26px; width: auto; display: block; opacity: .95;
            filter: drop-shadow(0 0 10px #c9a22755); }

/* ═══════════════════════════════════ HERO */
.hero {
  padding: 0 0 26px;
  background: none;                /* 장면이 대신한다 */
  min-height: 560px;
}
.hero::after { content: none; }    /* 옛 별무늬를 끈다 */

.scene {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
  z-index: 0;
  /* 아래 섹션으로 자연스럽게 넘어가게 바닥을 흐린다 */
  -webkit-mask-image: linear-gradient(180deg, #000 78%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 78%, transparent 100%);
}
.sc { position: absolute; }

/* ── 뒤: 하늘 ── */
.sky {
  inset: 0;
  background:
    radial-gradient(100% 62% at 50% 4%, #4a2f7a55 0%, transparent 62%),
    radial-gradient(150% 90% at 50% -18%, #2b1c52 0%, #120e26 52%,
                    var(--night-0) 100%);
}

/* ── 뒤: 별 ── */
.stars { inset: 0; }
.stars.s1 {
  background-image:
    radial-gradient(1.6px 1.6px at 12% 14%, #fff6dd 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 78% 9%,  #fff6dd 50%, transparent 51%),
    radial-gradient(1.7px 1.7px at 41% 26%, #ffe9a8 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 92% 31%, #fff6dd 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 60% 41%, #e9dcff 50%, transparent 51%);
  animation: hx-tw-a 5.5s ease-in-out infinite;
}
.stars.s2 {
  background-image:
    radial-gradient(1.2px 1.2px at 26% 33%, #fff6dd 50%, transparent 51%),
    radial-gradient(1.1px 1.1px at 66% 18%, #d9c9ff 50%, transparent 51%),
    radial-gradient(1.3px 1.3px at 8% 44%,  #fff6dd 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 86% 52%, #ffe9a8 50%, transparent 51%);
  animation: hx-tw-b 7.5s ease-in-out infinite;
}
.stars.s3 {
  background-image:
    radial-gradient(2.1px 2.1px at 33% 8%,  #fff9e8 50%, transparent 51%),
    radial-gradient(2px 2px   at 71% 36%,  #fff3cf 50%, transparent 51%),
    radial-gradient(1.9px 1.9px at 18% 56%, #fff9e8 50%, transparent 51%);
  animation: hx-tw-c 9s ease-in-out infinite;
}
@keyframes hx-tw-a { 0%,100% { opacity: .85 } 50% { opacity: .35 } }
@keyframes hx-tw-b { 0%,100% { opacity: .40 } 50% { opacity: .95 } }
@keyframes hx-tw-c { 0%,100% { opacity: .70 } 40% { opacity: 1 } }

/* ── 뒤: 달 ── */
.moon {
  right: 26px; top: 20px; width: 62px; height: 62px; border-radius: 50%;
  background:
    radial-gradient(60% 60% at 36% 32%, #fffaf0 0%, #f3e3b6 42%,
                    #cfa856 78%, #a8813a 100%);
  box-shadow:
    0 0 20px #f0d79a4d, 0 0 54px #c9a22733, 0 0 100px #7a5cc42b;
  opacity: .8;
  animation: hx-breathe 11s ease-in-out infinite;
}
.moon::after {                      /* 아주 옅은 결 — 평면으로 안 보이게 */
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(14% 14% at 62% 58%, #00000018 0%, transparent 60%),
    radial-gradient(9% 9%  at 40% 70%, #00000014 0%, transparent 60%);
}

/* ── 뒤: 오행 문양 (저장소의 로고 문양을 그대로 씀) ── */
.emblem {
  right: -52px; top: 58px; width: 290px; height: 290px; opacity: .055;
  animation: hx-spin 210s linear infinite;
}

/* ── 중: 먼 산 · 처마 · 운무 ── */
.ridge { left: 0; right: 0; width: 100%; display: block; }
.ridge.far  { bottom: 108px; opacity: .5; }
.ridge.near { bottom: 52px; opacity: .9; }
.eaves { left: 0; right: 0; top: 0; width: 100%; display: block; opacity: .8; }

.mist {
  left: -12%; right: -12%; bottom: 74px; height: 130px;
  background: radial-gradient(60% 100% at 50% 60%, #6c54a855 0%,
                              transparent 70%);
  filter: blur(14px);
  animation: hx-drift 26s ease-in-out infinite;
}

/* ── 앞: 구슬 = **안내자 캐릭터가 설 자리** ──
   진짜 캐릭터 그림이 들어오면 `.guide img` 가 이 위에 얹힌다.
   그때까지는 빛나는 사주 구슬이 그 자리를 지킨다. 빈 네모가 아니다. */
.guide, .motes.front { position: absolute; pointer-events: none; }
.motes.front { inset: 0; z-index: 0; }
.guide { right: 6px; top: 116px; width: 150px; height: 196px; z-index: 0; }
.orb {
  position: absolute; left: 8px; top: 0; width: 132px; height: 132px;
  border-radius: 50%;
  background:
    radial-gradient(42% 38% at 34% 28%, #fffdf4 0%, #ffe9b0 26%,
                    #e0b45f 52%, #8d5fd0 84%, #4a2f7a 100%);
  box-shadow:
    inset 0 -14px 26px #2a1b4e99,
    0 0 22px #f0cf5e66, 0 0 60px #b07de099, 0 0 120px #7a5cc455;
  animation: hx-orb 6.5s ease-in-out infinite;
}
/* 구슬은 캐릭터(6.4초)와 **다른 박자**로. 같이 뛰면 한 덩어리가 된다. */
.guide.has-char .orb {
  animation: hx-orb 4.4s ease-in-out infinite;
}
.orb::before {                      /* 금테 */
  content: ""; position: absolute; inset: -7px; border-radius: 50%;
  border: 1px solid #e8c87a66;
  box-shadow: inset 0 0 12px #f0cf5e33;
}
.orb::after {                       /* 하이라이트 */
  content: ""; position: absolute; left: 22%; top: 16%;
  width: 26%; height: 18%; border-radius: 50%;
  background: radial-gradient(#ffffffcc, transparent 70%);
  filter: blur(1px);
}
.guide .wisp {                      /* 구슬을 감는 전통 구름결 */
  position: absolute; left: -6px; bottom: 34px; width: 160px; opacity: .8;
}
.companion {                        /* 12지 벗 — 작게, 하나만 */
  position: absolute; right: -4px; bottom: 2px; width: 84px; height: auto;
  filter: drop-shadow(0 6px 14px #00000066);
}
.guide-float { animation: hx-float 7.5s ease-in-out infinite; }
.guide-float.slow { animation-duration: 9.5s; animation-delay: -2s; }

/* ── 앞: 안내자 캐릭터 ────────────────────────────────────────────────
   그림(`static/img/guide.webp`)이 **와 있을 때만** 그린다. 서버가
   `has_guide` 로 알려 주므로, 없을 때 404 를 부르는 일이 없다.

   캐릭터가 오면 자리가 이렇게 바뀐다 —

     구슬    주인공 자리를 내주고 **손 곁에 뜬 빛**으로 내려간다(§5)
     12지 벗 더 작아져 뒤로 물러난다(§6)
     달빛    캐릭터 뒤에서 숨 쉰다

   「카드 안의 그림」처럼 보이지 않게, 머리와 소매가 산·운무보다 앞에
   서고 구슬과 티끌이 그 앞에 온다. 층은 그리는 차례가 정한다. */
.char-glow {
  position: absolute; left: 50%; top: 4%;
  width: 150%; height: 86%; margin-left: -75%;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%,
              #b48ce855 0%, #7a5cc42e 42%, transparent 72%);
  filter: blur(10px);
  animation: hx-breathe 9s ease-in-out infinite;
  opacity: 0;                       /* 캐릭터가 있을 때만 켠다 */
}
.guide.has-char .char-glow { opacity: 1; }

.hero-char {
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: auto; display: block;
  filter: drop-shadow(0 10px 22px #00000073)
          drop-shadow(0 0 26px #7a5cc43d);
}

/* 캐릭터가 오면 구슬은 **손 곁의 빛**이 된다. 버리지 않는다. */
/* 구슬을 **하나 더 그리지 않는다.**

   그림 안에 이미 태극 구슬이 그 손에 있다. 옆에 우리 구슬을 하나 더
   띄워 보았더니 소매 위에 얹힌 덩어리로 보였다 — 두 개는 많다.
   그래서 이 자리에서는 구슬을 **그 구슬을 감싸는 빛**으로 쓴다.
   버리지 않고, 그림 속 구슬과 이어 붙이는 쪽을 골랐다(§5).

   자리는 그림의 구슬 한복판(칸의 74% · 26%)이다. */
.guide.has-char .orb {
  left: 57%; top: 12%; right: auto; bottom: auto;
  width: 34%; height: auto; aspect-ratio: 1;
  background: radial-gradient(50% 50% at 50% 50%,
              transparent 0%, transparent 46%,
              #ffe9a84d 58%, #b07de033 74%, transparent 88%);
  box-shadow: 0 0 34px #f0cf5e33, 0 0 72px #b07de033;
  mix-blend-mode: screen;
  opacity: .85;
}
.guide.has-char .orb::before,
.guide.has-char .orb::after { content: none; }
.guide.has-char .wisp {
  left: 20%; bottom: auto; top: 60%; width: 30%; opacity: .45;
  animation: hx-ribbon 11s ease-in-out infinite;
}
/* 그림 안에 이미 토끼가 있다. **둘이 되면 안 된다.** */
.guide.has-char .companion { display: none; }
/* 달빛은 캐릭터 뒤 윗몸 쪽에서 숨 쉰다. */
.guide.has-char .char-glow {
  left: 20%; top: 2%; width: 86%; height: 56%; margin-left: 0;
}

/* 캐릭터는 **주인공**이다. 구슬만 있을 때보다 자리를 넓게 준다 —
   작으면 장식처럼 보이고, 그러면 이 리디자인의 뜻이 없다(§4). */
/* 캐릭터가 오면 **주인공 크기**로 선다. 오른쪽으로 조금 흘려 보내
   화면을 꽉 채우고, 옷자락이 접수 카드 뒤로 들어가 층을 만든다.
   높이는 그림 비율(576:860)이 정한다 — 눌리거나 늘어나지 않게. */
.guide.has-char {
  right: -8px; top: 92px; width: 270px; height: auto;
  aspect-ratio: 576 / 860;
}
.guide.has-char .hero-char { position: static; width: 100%; }

/* ── 살아 있게 하는 움직임 ────────────────────────────────────────────
   그림은 **한 장짜리**다. 옷자락만 떼어 흔들려면 그려진 살을 가로질러
   잘라야 하는데, 후보 자리가 전부 91~100% 채워져 있어 이음매가 어긋나
   보인다. 게다가 가장 하늘거리는 치맛자락은 캐릭터의 65% 아래 —
   접수 카드가 덮는 자리다. 얻는 것보다 잃는 것이 크다.

   그래서 **자르지 않는다.** 대신 셋으로 살아 있게 한다.

     캐릭터  아주 느리게 둥실. 위아래만 하면 승강기처럼 보이므로
             좌우로도 1~2px. 얼굴·손은 거의 제자리다.
     바람    캐릭터 앞으로 얇은 빛띠가 천천히 지나간다 — 옷이 바람을
             받는 것처럼 보이게 하는 것은 옷이 아니라 **주변**이다.
     구슬    캐릭터와 **다른 박자**로 숨 쉰다. 같이 뛰면 한 덩어리로
             보여 죽은 그림이 된다.
   ──────────────────────────────────────────────────────────────── */
@keyframes hx-char {
  0%   { transform: translate3d(0, 0, 0); }
  30%  { transform: translate3d(-1.0px, -2.6px, 0); }
  62%  { transform: translate3d(1.0px, -4.4px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}
.guide.has-char .hero-char.guide-float {
  animation: hx-char 5.8s ease-in-out infinite;
  will-change: transform;
}

/* 바람 — 얇은 빛띠가 왼쪽 아래에서 오른쪽 위로 스쳐 간다. */
.guide .wind { display: none; }
.guide.has-char .wind {
  display: block; position: absolute;
  left: -24%; right: -24%; top: 40%; height: 30%;
  pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(101deg, transparent 0%, #cdb8ff1c 22%,
              #ffeec028 42%, #cdb8ff19 62%, transparent 88%);
  filter: blur(14px);
  animation: hx-wind 11.5s ease-in-out infinite;
}
@keyframes hx-wind {
  0%   { transform: translate3d(-9%, 2%, 0) skewX(-3deg); opacity: 0; }
  20%  { opacity: .82; }
  78%  { opacity: .58; }
  100% { transform: translate3d(13%, -3%, 0) skewX(-8deg); opacity: 0; }
}
/* 주인공이 넓어진 만큼 제목 칸을 한 뼘 좁힌다. `:has` 를 모르는
   브라우저에서는 예전 폭 그대로라 깨지지 않는다. */
/* 칸이 좁아진 만큼 글자도 한 눈금 줄인다 — 줄 수가 늘면 첫 화면이
   길어지고, 그러면 접수 카드가 아래로 밀린다. 넉 줄을 지킨다. */
.hero:has(.guide.has-char) h1.big { max-width: 48%; font-size: 23px; }
.hero:has(.guide.has-char) h1.big .yr { font-size: 36px; }
.hero:has(.guide.has-char) .hook { max-width: 60%; }
.hero:has(.guide.has-char) .sub { max-width: 52%; }
/* 오른쪽이 캐릭터로 꽉 찼으니 달은 그 머리 위로 올려 작게 둔다. */
.hero:has(.guide.has-char) .moon { right: 10px; top: 8px;
                                   width: 46px; height: 46px; }
.hero:has(.guide.has-char) .emblem { opacity: .04; }

/* ── 앞: 금빛 티끌 ── */
.motes { inset: 0; }
.motes.front i { animation-name: hx-mote-wind; }
.motes.back i { opacity: 0; animation-duration: 18s; }
.motes.back i:nth-child(1) { left: 58%; animation-delay: -1.5s; }
.motes.back i:nth-child(2) { left: 70%; animation-delay: -6.5s; width: 2px; height: 2px; }
.motes.back i:nth-child(3) { left: 82%; animation-delay: -11s; }
.motes.back i:nth-child(4) { left: 92%; animation-delay: -15.5s; width: 2px; height: 2px; }
.motes i {
  position: absolute; bottom: -8px; width: 3px; height: 3px;
  border-radius: 50%; background: #f5dc9e;
  box-shadow: 0 0 6px #f0cf5eaa; opacity: 0;
  animation: hx-mote 14s linear infinite;
}
.motes i:nth-child(1) { left: 8%;  animation-delay: 0s;    }
.motes i:nth-child(2) { left: 21%; animation-delay: -2.6s; }
.motes i:nth-child(3) { left: 35%; animation-delay: -5.1s; width: 2px; height: 2px; }
.motes i:nth-child(4) { left: 49%; animation-delay: -7.7s; }
.motes i:nth-child(5) { left: 63%; animation-delay: -10.2s; width: 4px; height: 4px; }
.motes i:nth-child(6) { left: 77%; animation-delay: -3.4s; }
.motes i:nth-child(7) { left: 88%; animation-delay: -8.9s; width: 2px; height: 2px; }
.motes i:nth-child(8) { left: 95%; animation-delay: -12.1s; }

/* ═══════════════════════════════════ HERO 글자 */
.hero .wrap { padding-top: 18px; }
.hero:has(.guide.has-char) .wrap::before {
  content: ""; position: absolute; left: 0; top: 0;
  width: 78%; height: 300px; pointer-events: none; z-index: -1;
  background: linear-gradient(100deg, #0a0818f2 0%, #0a0818d9 34%,
                              #0a081880 58%, transparent 78%);
  filter: blur(6px);
}

/* ── 훅 표 — 작게. **단추처럼 보이지 않게.** ──────────────────
   여는 자물쇠 하나와 한 줄. 제목보다 훨씬 작아야 제목이 산다. */
.hook {
  display: inline-flex; align-items: center; gap: 5px;
  margin: 0 0 10px; padding: 3px 9px 3px 7px;
  font-size: 11.5px; line-height: 1.5; letter-spacing: -0.2px;
  color: #cbbce8; white-space: nowrap;
  border: 1px solid #c9a22733; border-radius: 999px;
  background: linear-gradient(180deg, #c9a2270f, #c9a22705);
}
.hook b { color: var(--gold-hi); font-weight: 700; }
.hook-lock {
  width: 10px; height: 11.5px; flex: 0 0 10px;
  color: var(--gold-mid); opacity: .95;
}

h1.big {
  margin: 0 0 10px; font-size: 29px; line-height: 1.26;
  letter-spacing: -1.1px; max-width: 56%;
  word-break: keep-all; overflow-wrap: break-word;
  text-shadow: 0 2px 18px #000000b3, 0 0 34px #00000066;
}
h1.big .yr {
  display: block; font-size: 40px; line-height: 1.06; font-weight: 900;
  letter-spacing: -1.8px; margin-bottom: 2px;
  background: linear-gradient(180deg, #fff6d8 0%, var(--gold-hi) 34%,
                              var(--gold-mid) 68%, var(--gold-lo) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 10px #c9a2274d);
}
/* **세 군데를 같은 금빛으로 든다.** 납작한 한 가지 색이 아니라 위가
   밝고 아래가 깊은 결 — `.yr` 이 쓰던 그 금이다. 셋이 같은 톤이라
   흩어져 보이지 않고 한 덩어리로 읽힌다. */
h1.big em {
  font-style: normal; font-weight: 900;
  /* **금빛 덩어리는 쪼개지지 않는다.** 「큰 운」이 줄 끝에서 갈리면
     금이 두 조각으로 흩어져 보인다. */
  white-space: nowrap;
  background: linear-gradient(180deg, #fff6d8 0%, var(--gold-hi) 32%,
                              var(--gold-mid) 66%, var(--gold-lo) 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 6px #c9a22766);
}
.hero .sub {
  margin: 0 0 14px; font-size: 13.5px; color: #cabfe2; max-width: 72%;
  word-break: keep-all;
  /* 캐릭터 옷자락 위로 지나가는 줄이 있어 **바탕을 깔아 준다.**
     판을 하나 더 만들지 않고 글자만 또렷하게 한다. */
  text-shadow: 0 1px 3px #0b0818e6, 0 0 14px #0b0818b3;
}

/* ═══════════════════════════════════ 접수 카드 (기능은 그대로) */
.wiz {
  position: relative; z-index: 1;
  background:
    linear-gradient(180deg, #1a1430e6 0%, #120e24f2 100%);
  border: 1px solid #6b55a866;
  border-radius: 18px; padding: 18px 16px 16px;
  box-shadow:
    0 0 0 1px #00000040,
    0 18px 44px -12px #000000cc,
    0 0 42px -10px #7a5cc466;
  backdrop-filter: blur(6px);
  overflow: hidden;
}
.wiz::before {                      /* 아주 약한 전통 살결 */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  opacity: .032;
  background-image:
    repeating-linear-gradient(45deg, #e8d9a0 0 1px, transparent 1px 14px),
    repeating-linear-gradient(-45deg, #e8d9a0 0 1px, transparent 1px 14px);
}
.wiz::after {                       /* 네 귀퉁이 금선 */
  content: ""; position: absolute; inset: 7px; pointer-events: none;
  border-radius: 13px;
  background:
    linear-gradient(#c9a22788, #c9a22788) left top / 16px 1px no-repeat,
    linear-gradient(#c9a22788, #c9a22788) left top / 1px 16px no-repeat,
    linear-gradient(#c9a22788, #c9a22788) right top / 16px 1px no-repeat,
    linear-gradient(#c9a22788, #c9a22788) right top / 1px 16px no-repeat,
    linear-gradient(#c9a22788, #c9a22788) left bottom / 16px 1px no-repeat,
    linear-gradient(#c9a22788, #c9a22788) left bottom / 1px 16px no-repeat,
    linear-gradient(#c9a22788, #c9a22788) right bottom / 16px 1px no-repeat,
    linear-gradient(#c9a22788, #c9a22788) right bottom / 1px 16px no-repeat;
}
.wiz > * { position: relative; z-index: 1; }

.wiz-title {
  margin: 0 0 12px; font-size: 12px; letter-spacing: 2.6px;
  color: #a596c9; text-transform: none;
}
.wiz-title b { color: var(--gold-hi); letter-spacing: 2.6px; }

.pbar { background: #2a2142; }
.pbar i { background: linear-gradient(90deg, #8d6fe0, var(--gold-hi)); }

/* 입력칸은 **화려하게 만들지 않는다.** 읽히는 것이 먼저다. */
input[type=text], input[type=email], input[type=tel] {
  background: #0d0a1ae6; border-color: #4a3d6e;
}
input:focus {
  border-color: var(--gold-mid);
  box-shadow: 0 0 0 3px #c9a22722;
}
.seg button { background: #0d0a1ae6; border-color: #4a3d6e; }
.seg button[aria-pressed="true"] {
  border-color: var(--gold-mid); color: var(--gold-hi);
  background: #1e1736;
}

/* ═══════════════════════════════════ CTA — 고급 금속 */
.cta {
  background: linear-gradient(180deg, #fbeec0 0%, #edcf82 22%,
                              #d9b25c 58%, #b98f37 100%);
  color: #2a1e06; border: none;
  box-shadow:
    inset 0 1px 0 #fffdf2cc,
    inset 0 -2px 0 #8a6a2466,
    0 8px 22px -8px #c9a22799,
    0 0 0 1px #8a6a2455;
  text-shadow: 0 1px 0 #ffffff66;
  transition: transform .12s ease, box-shadow .2s ease, filter .2s ease;
}
.cta:hover { filter: brightness(1.04); }
.cta:active { transform: scale(.975); box-shadow:
  inset 0 2px 6px #8a6a2466, 0 4px 12px -8px #c9a22799; }
.cta.ghost {
  background: transparent; color: var(--gold-hi);
  border: 1px solid #c9a22766; box-shadow: none; text-shadow: none;
}
.cta.ghost:active { transform: scale(.975); }

/* ═══════════════════════════════════ 움직임 */
@keyframes hx-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}
@keyframes hx-orb {
  0%, 100% { transform: scale(1);     opacity: .70; }
  50%      { transform: scale(1.035); opacity: 1; }
}
@keyframes hx-breathe {
  0%, 100% { opacity: .92; }
  50%      { opacity: 1; }
}
@keyframes hx-drift {
  0%, 100% { transform: translateX(-10px); }
  50%      { transform: translateX(10px); }
}
@keyframes hx-spin { to { transform: rotate(360deg); } }
@keyframes hx-mote {
  0%   { transform: translateY(0)     scale(.7); opacity: 0; }
  12%  { opacity: .85; }
  88%  { opacity: .5; }
  100% { transform: translateY(-460px) scale(1); opacity: 0; }
}
/* 앞쪽 티끌은 곧게 오르지 않는다. 비스듬히 밀려 올라가야 바람이 분다. */
@keyframes hx-mote-wind {
  0%   { transform: translate3d(0, 0, 0)          scale(.7); opacity: 0; }
  12%  { opacity: .85; }
  50%  { transform: translate3d(11px, -230px, 0)  scale(.9); }
  88%  { opacity: .5; }
  100% { transform: translate3d(-6px, -460px, 0)  scale(1); opacity: 0; }
}
@keyframes hx-ribbon {
  0%, 100% { transform: translate3d(0, 0, 0); opacity: .45; }
  50%      { transform: translate3d(7px, -4px, 0); opacity: .7; }
}

/* 움직임을 줄여 달라고 한 사람에게는 **전부 멈춘다.** */
@media (prefers-reduced-motion: reduce) {
  .stars, .moon, .emblem, .mist, .orb, .guide-float, .motes i,
  .char-glow, .hero-char, .wind, .wisp {
    animation: none !important;
  }
  .wind { opacity: 0 !important; }
  .motes { display: none; }
}

/* ═══════════════════════════════════ 폭 */
@media (max-width: 379px) {          /* 375 */
  h1.big { font-size: 26px; max-width: 55%; }
  h1.big .yr { font-size: 35px; }
  .guide { right: 2px; top: 118px; width: 136px; height: 178px; }
  .guide.has-char { right: -14px; top: 96px; width: 252px; height: auto; }
  .orb { width: 118px; height: 118px; }
  .companion { width: 84px; }
  .moon { width: 54px; height: 54px; right: 18px; top: 18px; }
  .emblem { width: 250px; height: 250px; right: -46px; }
  .hero { min-height: 540px; }
}
@media (min-width: 400px) {          /* 430 */
  h1.big { font-size: 32px; max-width: 57%; }
  h1.big .yr { font-size: 44px; }
  .guide { right: 12px; top: 112px; width: 168px; height: 214px; }
  .guide.has-char { right: 0; top: 88px; width: 300px; height: auto; }
  .hero:has(.guide.has-char) h1.big { max-width: 45%; }
  .orb { width: 150px; height: 150px; }
  .companion { width: 102px; }
  .moon { width: 70px; height: 70px; right: 34px; }
  .emblem { width: 320px; height: 320px; }
  .hero { min-height: 600px; }
}


/* ═══════════════════════════════════ 가려진 결과 (HERO teaser)
   **아직 아무 결과도 아니다.** 지어낸 연도나 풀이를 넣지 않는다.
   가린 자리는 누가 봐도 가린 자리로 보여야 하고, 그 위에 「입력하면
   실제 결과로 바뀐다」고 적어 둔다 — 궁금하게는 하되 속이지 않는다. */
/* **캐릭터 위에 얹힌다.** 접수 카드가 하던 것과 같은 일이다 — 주인공
   그림이 아래로 길게 내려오므로, 글이 그 위에 오면 반투명으로는 읽히지
   않는다. 그래서 여기부터는 바탕을 거의 불투명하게 깐다. */
.peek {
  position: relative; z-index: 1; margin: 2px 0 14px;
  padding: 12px 12px 13px; border-radius: 13px;
  border: 1px solid #6b55a84d;
  background: linear-gradient(180deg, #1a1430f2 0%, #120e24fa 100%);
  box-shadow: 0 10px 34px #00000059;
}

.peek-note {
  margin: 0 0 9px; font-size: 11.5px; line-height: 1.5;
  color: #9a8cba; letter-spacing: -0.2px; word-break: keep-all;
}
.peek-note b { color: #c3b4e2; font-weight: 600; }

.peek-cards { list-style: none; margin: 0; padding: 0;
              display: grid; gap: 7px; }

.pk {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 12px; border-radius: 9px;
  border: 1px solid #6b55a84d;
  background: linear-gradient(180deg, #221a3d, #191230);
  opacity: .62;
  transition: opacity .55s ease, border-color .55s ease,
              box-shadow .55s ease;
}
.pk-q {
  font-size: 12.5px; line-height: 1.4; color: #bcb0d6;
  word-break: keep-all; flex: 1 1 auto;
  transition: color .55s ease;
}
.pk-a {
  position: relative; overflow: hidden; flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 12px; letter-spacing: .3px; color: #6a5a94;
  transition: color .55s ease;
}

/* 모자이크 — **내용이 없다.** 타일만 그린다.
   가로세로로 겹친 격자에 아주 옅은 흐림을 얹어, 「무언가 있는데
   뭉개졌다」로 보이게 한다. 칸 수는 `--n` 이 정한다. */
.mo {
  display: inline-block; vertical-align: -2px;
  width: calc(var(--n, 8) * 8px); height: 13px;
  border-radius: 2px; opacity: .62;
  /* **칸마다 톤이 다른 모자이크.** 규칙적인 바둑판은 무늬로 보이고
     세로 줄만 그으면 바코드로 보인다. 글자가 뭉개진 것처럼 보이려면
     칸마다 밝기가 달라야 해서, 작은 타일 하나를 그려 깔았다.
     **내용은 없다** — 가릴 글자가 애초에 없다. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='104' height='14'%3E%3Crect width='104' height='14' fill='%234a3e73'/%3E%3Crect x='0.0' y='0.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.34'/%3E%3Crect x='6.5' y='0.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.62'/%3E%3Crect x='13.0' y='0.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.18'/%3E%3Crect x='19.5' y='0.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.78'/%3E%3Crect x='26.0' y='0.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.46'/%3E%3Crect x='32.5' y='0.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.26'/%3E%3Crect x='39.0' y='0.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.70'/%3E%3Crect x='45.5' y='0.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.38'/%3E%3Crect x='52.0' y='0.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.54'/%3E%3Crect x='58.5' y='0.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.22'/%3E%3Crect x='65.0' y='0.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.66'/%3E%3Crect x='71.5' y='0.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.30'/%3E%3Crect x='78.0' y='0.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.74'/%3E%3Crect x='84.5' y='0.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.42'/%3E%3Crect x='91.0' y='0.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.58'/%3E%3Crect x='97.5' y='0.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.20'/%3E%3Crect x='0.0' y='6.5' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.68'/%3E%3Crect x='6.5' y='6.5' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.36'/%3E%3Crect x='13.0' y='6.5' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.24'/%3E%3Crect x='19.5' y='6.5' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.60'/%3E%3Crect x='26.0' y='6.5' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.44'/%3E%3Crect x='32.5' y='6.5' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.76'/%3E%3Crect x='39.0' y='6.5' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.28'/%3E%3Crect x='45.5' y='6.5' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.50'/%3E%3Crect x='52.0' y='6.5' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.64'/%3E%3Crect x='58.5' y='6.5' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.32'/%3E%3Crect x='65.0' y='6.5' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.56'/%3E%3Crect x='71.5' y='6.5' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.40'/%3E%3Crect x='78.0' y='6.5' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.72'/%3E%3Crect x='84.5' y='6.5' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.22'/%3E%3Crect x='91.0' y='6.5' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.48'/%3E%3Crect x='97.5' y='6.5' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.66'/%3E%3Crect x='0.0' y='13.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.34'/%3E%3Crect x='6.5' y='13.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.62'/%3E%3Crect x='13.0' y='13.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.18'/%3E%3Crect x='19.5' y='13.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.78'/%3E%3Crect x='26.0' y='13.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.46'/%3E%3Crect x='32.5' y='13.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.26'/%3E%3Crect x='39.0' y='13.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.70'/%3E%3Crect x='45.5' y='13.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.38'/%3E%3Crect x='52.0' y='13.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.54'/%3E%3Crect x='58.5' y='13.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.22'/%3E%3Crect x='65.0' y='13.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.66'/%3E%3Crect x='71.5' y='13.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.30'/%3E%3Crect x='78.0' y='13.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.74'/%3E%3Crect x='84.5' y='13.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.42'/%3E%3Crect x='91.0' y='13.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.58'/%3E%3Crect x='97.5' y='13.0' width='6.5' height='6.5' fill='%23cbb9f2' opacity='0.20'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-position: 0 50%;
  filter: blur(.5px);
  transition: opacity .55s ease;
}
.pk.on .mo { opacity: .82; }

/* 지금 가리키는 카드 — **아주 약하게만** 든다. */
.pk.on {
  opacity: 1; border-color: #c9a22766;
  box-shadow: 0 0 0 1px #c9a22714, 0 6px 22px #0000004d;
}
.pk.on .pk-q { color: #efe7ff; }
.pk.on .pk-a { color: #8a7ab4; }

/* 가린 자리를 빛이 **한 번** 지나간다. 계속 반짝이지 않는다. */
.pk.on .pk-a::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%,
              #f3e3b04d 48%, transparent 76%);
  transform: translateX(-120%);
  animation: pk-shimmer 1.15s ease-out 1;
}
@keyframes pk-shimmer {
  to { transform: translateX(120%); }
}

/* 숫자 카드만 조금 더 궁금하게 — 잠깐 밝아졌다 도로 가려진다. */
.pk.on .pk-a.num .mo { animation: pk-num 1.25s ease-out 1; }
@keyframes pk-num {
  0%   { opacity: .82; filter: blur(.7px); }
  38%  { opacity: 1;   filter: blur(.2px); }
  100% { opacity: .82; filter: blur(.7px); }
}

/* ── 첫 CTA ───────────────────────────────────────────────── */
.hero-cta {
  position: relative; z-index: 1; overflow: hidden;
  /* **한 줄로 둔다.** 「무료」가 두 줄로 갈리면 눈에 안 들어온다.
     375 에서도 안 깨지게 자간만 한 눈금 조인다. */
  white-space: nowrap; letter-spacing: -0.4px;
}
.hero-cta .go { margin-left: 4px; font-weight: 700; }
.hero-cta::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 34%,
              #fff3cf40 50%, transparent 66%);
  transform: translateX(-130%);
  animation: cta-sweep 5.2s ease-in-out infinite;
}
@keyframes cta-sweep {
  0%, 82%  { transform: translateX(-130%); }
  92%      { transform: translateX(130%); }
  100%     { transform: translateX(130%); }
}
.open-note { position: relative; z-index: 1; margin: 8px 0 0;
             text-align: center; }

/* ── CTA 를 누른 뒤 한 박자 ──────────────────────────────────
   기다리는 척하지 않는다. 계산을 기다리는 것이 아니라 **넘어가는
   동작**일 뿐이라 1초 안에 끝난다. */
.peek.folding { opacity: .28; transition: opacity .45s ease; }
.opening {
  position: relative; z-index: 2; margin: 10px 0 0;
  text-align: center; font-size: 12.5px; color: #cbbce8;
}
.opening::before {
  content: ""; display: block; height: 1px; margin: 0 0 10px;
  background: linear-gradient(90deg, transparent, var(--gold-hi),
              transparent);
  transform: scaleX(0); transform-origin: 50% 50%;
  animation: open-line .62s ease-out forwards;
}
@keyframes open-line { to { transform: scaleX(1); } }

/* 움직임을 줄여 달라고 한 사람에게는 **전부 멈춘다.**
   멈춰도 카드 넉 장과 CTA 는 그대로 읽혀야 한다. */
@media (prefers-reduced-motion: reduce) {
  .pk { opacity: .92; }
  .pk.on { box-shadow: none; }
  .pk.on .pk-a::after,
  .pk.on .pk-a.num .mo,
  .hero-cta::after,
  .opening::before { animation: none !important; }
  .hero-cta::after { opacity: 0; }
  .peek.folding { opacity: 1; transition: none; }
}
