/* 바탕·폰 틀·화면 전환. W1 소유 */
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: var(--mt-outside);
  color: var(--mt-ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: var(--track-ko);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  overflow: hidden;
}
button { font: inherit; color: inherit; letter-spacing: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; -webkit-user-select: none; user-select: none; }
button:focus { outline: none; }
button:focus-visible { outline: 2px solid var(--mt-ink); outline-offset: 2px; }
img { display: block; -webkit-user-drag: none; }
input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
[hidden] { display: none !important; }

/* 폰 틀: 폰에서는 화면 가득, 데스크톱에서는 가운데 최대 430px 한 줄 */
#app {
  position: relative;
  width: 100%;
  max-width: var(--phone-max);
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--mt-bg);
  isolation: isolate;
}

/* 화면 한 장(경로의 한 칸) */
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: var(--mt-bg);
  overflow: hidden;
  will-change: transform;
}
.screen.is-under { pointer-events: none; }
.screen.is-gone { visibility: hidden; }
/* 밀기 전환(NavigationStack push/pop 느낌) */
.screen.push-in   { animation: mt-push-in var(--dur-push) var(--ease-push) both; }
.screen.push-out  { animation: mt-push-out var(--dur-push) var(--ease-push) both; }
.screen.pop-in    { animation: mt-pop-in var(--dur-push) var(--ease-push) both; }
.screen.pop-out   { animation: mt-pop-out var(--dur-push) var(--ease-push) both; }
.screen.fade-in   { animation: mt-fade-in 0.25s var(--ease-io) both; }
@keyframes mt-push-in  { from { transform: translateX(100%); box-shadow: -8px 0 24px rgba(0,0,0,0.12); } to { transform: none; box-shadow: -8px 0 24px rgba(0,0,0,0); } }
@keyframes mt-push-out { from { transform: none; filter: brightness(1); } to { transform: translateX(-30%); filter: brightness(0.92); } }
@keyframes mt-pop-in   { from { transform: translateX(-30%); filter: brightness(0.92); } to { transform: none; filter: brightness(1); } }
@keyframes mt-pop-out  { from { transform: none; } to { transform: translateX(100%); } }
@keyframes mt-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .screen.push-in, .screen.push-out, .screen.pop-in, .screen.pop-out { animation-duration: 0.01s; }
}

/* 세로 스크롤 영역(스크롤 막대 숨김 — 앱 scrollIndicators(.hidden)) */
.scroll-y { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; scrollbar-width: none; }
.scroll-y::-webkit-scrollbar, .scroll-x::-webkit-scrollbar { display: none; }
.scroll-x { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; }

/* 위 안전 영역(상태 막대) 띠 */
.safe-top { flex: 0 0 auto; height: var(--sat); }

/* '준비 중' 빈 화면(아직 없는 경로) */
.mt-pending { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--mt-mut); padding: 24px; text-align: center; }
.mt-pending b { color: var(--mt-ink); font-size: 17px; font-weight: 700; }
.mt-pending code { font-size: 12px; color: var(--mt-faint); }

/* 화면 읽기 전용 숨김 글자 */
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 인트로(SplashView) — 흰 바탕, 가운데 묶음은 화면 높이 52% 자리 */
.intro { position: absolute; inset: 0; z-index: var(--z-intro); background: #fff; transition: opacity 0.4s var(--ease-io); cursor: pointer; }
.intro.leave { opacity: 0; pointer-events: none; }
.intro-stack { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; }
.intro-frame { position: relative; width: 313.667px; height: 182px; overflow: hidden; will-change: transform, filter; }
.intro-sweep { position: absolute; top: -40px; bottom: -40px; left: 50%; width: 70px; margin-left: -35px; mix-blend-mode: screen; pointer-events: none;
  background: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,0.85) 50%, rgba(255,255,255,0)); }
.intro-hangul { margin-top: 26px; color: var(--mt-ink); opacity: 0; white-space: nowrap; line-height: 1.2; }
.intro-slogan { margin-top: 12px; color: #555; opacity: 0; white-space: nowrap; line-height: 1.2; }
.intro-skip { position: absolute; left: calc(100% - 52px); top: calc(100% - 40px); transform: translate(-50%, -50%); padding: 12px; min-height: 44px; color: #6E6E6E; white-space: nowrap; }
