/*
 * 미니 콘텐츠(풍등 · 태우기 · 돌탑) 공용 글 · 버튼 모양. 2026-11-23 사용자 결정.
 *
 * 글
 * - 글꼴은 전부 Pretendard. 마지막에 결과로 건네는 문구만 명조(.say-serif).
 * - 제목 글(.say-title): 시작 화면의 문장, 위쪽 안내 문장, 화면 제목이 모두 이 모양이다.
 * - 설명 글: 제목보다 한 단계 작고 옅다.
 * - 조작 안내(.say-hint): 「하늘을 밀어서 둘러봐」 같은 말은 아래쪽에 알약 모양으로 둔다.
 * - 가운데 글(.say-c): 시작 화면. 한 문장이 화면 한가운데에 나왔다가 사라지고 다음 문장이 나온다.
 * - 위쪽 글(.say-t): 그 뒤의 안내. 머리줄 아래 같은 자리에 나오고, 새 문장이 나올 때 앞 문장은 위로 스르르 사라진다.
 * - 제목 묶음(.say-head): 바뀌지 않는 제목 + 설명. 위쪽 글과 같은 자리.
 * 버튼
 * - 큰 버튼(.cta) · 보조 버튼(.ghost) · 글자 버튼(.text-btn)의 크기 · 둥글기 · 글자 모양을 세 서비스가 같게 쓴다. 색은 서비스마다 따로 정한다.
 * 동작은 say.js.
 */
@font-face { font-family: "UMSH Serif"; src: url("/assets/fonts/um-serif/UMSerif-Ko-600.woff2?v=bGP2rG75ovm") format("woff2"); font-weight: 100 749; font-display: swap; }

.app {
  --say-gap: 84px;                                   /* 머리줄 아래에서 위쪽 글까지 */
  --say-serif: "UMSH Serif", "Noto Serif KR", "Nanum Myeongjo", serif;
  /* 2026-11-23 사용자: 메인 문구 크기 통일(3px 줄였다가 2px 키움 → 390px 폭에서 22.4px) */
  --say-title-size: clamp(calc(var(--umsh-text-xl) - 1px), calc(6vw - 1px), calc(var(--umsh-text-2xl) - 1px));
  --say-sub-color: #ffffffb8;
  --cta-bottom: calc(30px + env(safe-area-inset-bottom));   /* 큰 버튼 아래 여백 */
}

/* 제목 글 */
.say-title,
.say-head h1,
.say-head h2,
.say-c p,
.say-t p {
  margin: 0;
  text-align: center;
  font-family: inherit;
  font-size: var(--say-title-size);
  font-weight: var(--umsh-weight-bold);
  line-height: 1.45;
  letter-spacing: -0.025em;
  word-break: keep-all;
  text-wrap: balance;
  color: #fff;
  text-shadow: 0 2px 16px #000000b3;
}
/* 설명 글 */
.say-sub,
.say-head p {
  margin: 12px 0 0;
  text-align: center;
  font-size: var(--umsh-text-body);
  font-weight: var(--umsh-weight-regular);
  line-height: 1.65;
  letter-spacing: -0.01em;
  word-break: keep-all;
  text-wrap: balance;
  color: var(--say-sub-color);
  text-shadow: 0 1px 10px #000000b3;
}

/* 결과로 건네는 문구만 명조 */
.say-serif, .say-serif p, .say-serif h1, .say-serif h2, p .say-serif { font-family: var(--say-serif) !important; font-weight: var(--umsh-weight-semibold) !important; letter-spacing: -0.02em; line-height: 1.5; }

/* 조작 안내: 아래쪽 알약 모양 */
.say-hint {
  display: block; width: fit-content; max-width: 100%; margin: 0 auto 14px; padding: 10px 18px;
  border: 1px solid #ffffff24; border-radius: 999px; background: #ffffff1a;
  font-size: var(--umsh-text-md); font-weight: var(--umsh-weight-medium); line-height: 1.5; letter-spacing: -0.01em; text-align: center; word-break: keep-all;
  color: #ffffffe6; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}

.say-hint:empty:not(.typing) { display: none; }

/* 반짝이는 조작 안내(.say-hint.glint): 타자 치듯 나온 뒤, 글자가 밝아졌다 가라앉고 빛 한 줄이 글 위를 지나간다 */
.say-hint.glint { position: relative; overflow: hidden; min-height: 1.5em; animation: sayGlintText 2.2s ease-in-out infinite; }
.say-hint.glint::before { content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; background: linear-gradient(100deg, #fff0, #ffffff73 50%, #fff0); animation: sayGlintSweep 2.8s ease-in-out infinite; pointer-events: none; }
.say-hint.typing::after { content: ""; display: inline-block; width: 1px; height: 1em; margin-left: 2px; vertical-align: -.14em; background: #fff; animation: sayCaret .7s steps(1) infinite; }
@keyframes sayGlintText { 0%, 100% { color: #ffffffd9; text-shadow: 0 0 0 #fff0; } 50% { color: #fff; text-shadow: 0 0 10px #ffe9b0cc, 0 0 2px #fff; } }
@keyframes sayGlintSweep { 0%, 35% { left: -40%; } 75%, 100% { left: 105%; } }
@keyframes sayCaret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .say-hint.glint, .say-hint.glint::before { animation: none; } }

/* 가운데 글 */
.say-c { position: absolute; inset: 0; z-index: 8; pointer-events: none; }
.say-c p { position: absolute; left: 28px; right: 28px; top: 50%; opacity: 0; transform: translateY(calc(-50% + 12px)); transition: opacity .36s ease, transform .36s ease; }
.say-c p.on { opacity: 1; transform: translateY(-50%); }
.say-c p.out { opacity: 0; transform: translateY(calc(-50% - 14px)); }

/* 위쪽 글: 머리줄 아래. 두 줄까지 들어가는 높이를 잡아 둔다 */
.say-t { position: absolute; z-index: 8; left: 28px; right: 28px; top: calc(var(--top) + var(--say-gap)); min-height: 3em; font-size: var(--say-title-size); pointer-events: none; }
.say-t p { position: absolute; left: 0; right: 0; top: 0; opacity: 0; transform: translateY(12px); transition: opacity .36s ease, transform .36s ease; }
.say-t p.on { opacity: 1; transform: none; }
.say-t p.out { opacity: 0; transform: translateY(-18px); }

/* 제목 묶음 */
.say-head { position: absolute; z-index: 8; left: 28px; right: 28px; top: calc(var(--top) + var(--say-gap)); text-align: center; pointer-events: none; }

/* 다른 것과 차례로 놓이는 자리(위에서부터 쌓는 화면)에서는 흐름 안에 둔다 */
.say-t.flow, .say-head.flow { position: relative; left: auto; right: auto; top: auto; width: 100%; }

/* 버튼: 크기 · 둥글기 · 글자 모양만 맞춘다. 색은 화면마다 따로 */
.app .cta {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 56px; padding: 0 20px;
  border-radius: 999px;
  font-family: inherit; font-size: var(--umsh-text-base); font-weight: var(--umsh-weight-semibold); letter-spacing: -0.01em; line-height: 1.3;
  box-shadow: none;
}
.app .cta:disabled { box-shadow: none; }
.app .cta[hidden] { display: none; }
.app .ghost {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 52px; padding: 0 18px;
  border: 1px solid #ffffff52; border-radius: 999px; background: #ffffff0f;
  font-family: inherit; font-size: var(--umsh-text-body); font-weight: var(--umsh-weight-medium); letter-spacing: -0.01em; line-height: 1.3; color: #fff;
}
.app .ghost[hidden] { display: none; }
.app .text-btn { font-size: var(--umsh-text-md); font-weight: var(--umsh-weight-medium); letter-spacing: -0.01em; color: #ffffffa6; }

@media (prefers-reduced-motion: reduce) {
  .say-c p, .say-t p { transition: opacity .2s; }
  .say-c p, .say-c p.out { transform: translateY(-50%); }
  .say-t p, .say-t p.out { transform: none; }
}
