/* =========================================================================
   집에 가고 싶다 — base.css
   디자인 시스템 (다크 픽셀 / 도트 무드)
   밤하늘 그라데이션 · 픽셀 별 · 베벨 픽셀 버튼 · 하드 오프셋 그림자 · Galmuri
   모든 페이지가 이 파일을 공유합니다. 토큰/클래스명은 그대로, 값만 도트로 교체.
   ========================================================================= */

/* ---------- 도트 폰트 (Galmuri) — jsdelivr woff2 ---------- */
@font-face{
  font-family:'Galmuri11';
  src:url('https://cdn.jsdelivr.net/gh/quiple/galmuri/dist/Galmuri11.woff2') format('woff2');
  font-weight:400;
  font-display:swap;
}
@font-face{
  font-family:'Galmuri11 Bold';
  src:url('https://cdn.jsdelivr.net/gh/quiple/galmuri/dist/Galmuri11-Bold.woff2') format('woff2');
  font-weight:700;
  font-display:swap;
}
@font-face{
  font-family:'Galmuri9';
  src:url('https://cdn.jsdelivr.net/gh/quiple/galmuri/dist/Galmuri9.woff2') format('woff2');
  font-weight:400;
  font-display:swap;
}
@font-face{
  font-family:'GalmuriMono9';
  src:url('https://cdn.jsdelivr.net/gh/quiple/galmuri/dist/GalmuriMono9.woff2') format('woff2');
  font-weight:400;
  font-display:swap;
}

/* ---------- 디자인 토큰 ---------- */
:root {
  /* 도트 팔레트 (office_worker_day 의 톤으로 통일) */
  --peach:        #ffd27a;  /* 금색 강조 */
  --peach-deep:   #e0a94a;  /* 금색 음영(베벨 그림자) */
  --pink:         #ff7a9c;  /* 분홍 강조 */
  --pink-deep:    #c44d6b;  /* 진분홍(넥타이) */
  --lavender:     #a7c2e6;  /* 셔츠블루(밝은 라인) */
  --lavender-deep:#4a5180;  /* 진한 라인 */
  --sky:          #141733;  /* 밤하늘 상단 */
  --sky-deep:     #0e1020;  /* 밤하늘 바닥 */
  --mint:         #6fe39a;  /* 초록(진행/성공) */
  --mint-deep:    #3fae6e;  /* 초록 음영 */
  --cream:        #0e1020;  /* 전체 배경(베이스) */

  /* 잉크(글자) — 어두운 배경 위 밝은 픽셀 텍스트 */
  --ink:        #c9cee6;
  --ink-soft:   #8b91b4;
  --ink-faint:  #5a608a;
  --on-card:    #c9cee6;

  /* 표면 — 불투명 어두운 플레이트 */
  --card:        #0b1228;
  --card-solid:  #141733;
  --glass:       #0b1228;
  --line:        #2a2e40;

  /* 그림자 — 하드 오프셋 픽셀 그림자 */
  --shadow-sm:  2px 2px 0 #05070f;
  --shadow:     3px 3px 0 #05070f;
  --shadow-lg:  5px 5px 0 #05070f;

  /* 곡률 — 픽셀 직각 */
  --r-sm: 0;
  --r:    0;
  --r-lg: 0;
  --r-pill: 0;

  /* 모션 — 계단(도트) */
  --ease: steps(1, end);
  --ease-soft: steps(3, end);

  /* 폰트 — Galmuri 픽셀 */
  --font-body: "Galmuri11", "DungGeunMo", "Apple SD Gothic Neo", monospace;
  --font-soft: "Galmuri11", "DungGeunMo", monospace;
  --font-hand: "Galmuri9", "Galmuri11", monospace;

  /* 레이아웃 */
  --maxw: 880px;
}

/* ---------- 리셋 ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  line-height: 1.6;
  letter-spacing: 0.4px;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: none;
  text-rendering: geometricPrecision;
  background: var(--cream);
}
img, svg { display: block; max-width: 100%; image-rendering: pixelated; }
[hidden] { display: none !important; } /* display 지정 컴포넌트(.chip 등)에서도 hidden 속성이 항상 동작하도록 */
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
:focus-visible { outline: 2px solid var(--peach); outline-offset: 2px; border-radius: 0; }

/* ---------- 하늘(밤하늘 그라데이션 + 픽셀 별 + 스캔라인) ---------- */
/* .sky 는 fixed 풀스크린 배경. 시간대에 따라 shared.js 가 클래스로 색을 바꿈 */
.sky {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(180deg, var(--sky) 0%, #0b0e1e 60%, var(--sky-deep) 100%);
  background-size: 100% 100%;
  image-rendering: pixelated;
  animation: none;
  transition: background 1.2s steps(4, end);
}
/* 시간대 테마 (shared.js 가 .sky 에 부여) — 모두 다크 도트 톤 */
.sky.theme-dawn    { background-image: linear-gradient(180deg, #2a2350 0%, #5a3a6e 55%, #7d5a3a 100%); }
.sky.theme-day     { background-image: linear-gradient(180deg, #141733 0%, #1b2348 55%, #243049 100%); }
.sky.theme-golden  { background-image: linear-gradient(180deg, #3a2f55 0%, #6e4a52 50%, #e0a94a 100%); }
.sky.theme-evening { background-image: linear-gradient(180deg, #141733 0%, #2a2352 50%, #5a3a55 100%); }
.sky.theme-night   { background-image: linear-gradient(180deg, #07080f 0%, #0e1020 55%, #141733 100%); }

/* 픽셀 별 (구 빛망울 .sky::after 자리) */
.sky::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 20% 18%, #d3dbf3 99%, transparent),
    radial-gradient(1px 1px at 64% 12%, #fff7d6 99%, transparent),
    radial-gradient(1px 1px at 82% 28%, #d3dbf3 99%, transparent),
    radial-gradient(1px 1px at 38% 40%, #a7c2e6 99%, transparent),
    radial-gradient(1px 1px at 12% 62%, #d3dbf3 99%, transparent),
    radial-gradient(1px 1px at 90% 56%, #fff7d6 99%, transparent),
    radial-gradient(1px 1px at 52% 72%, #a7c2e6 99%, transparent);
  background-repeat: no-repeat;
  filter: none;
  opacity: 0.85;
  animation: starTwinkle 2.4s steps(2, end) infinite;
}
@keyframes starTwinkle {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 0.45; }
}
/* 전화면 CRT 스캔라인 */
.sky::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px, rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.10) 2px, rgba(0,0,0,0.10) 3px
  );
  mix-blend-mode: multiply;
}

/* ---------- 떠다니는 픽셀 구름 (shared.js 가 .cloud-layer 안에 생성) ---------- */
.cloud-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
/* 이모지 글자는 죽이고(font-size:0) box-shadow 로 계단형 픽셀 구름 실루엣 */
.cloud {
  position: absolute;
  font-size: 0 !important; /* shared.js 인라인 이모지 폰트크기 무력화 → 밝은 ☁️ 대신 은은한 픽셀 구름 */
  width: 24px;
  height: 10px;
  opacity: 0.8;
  image-rendering: pixelated;
  filter: none;
  will-change: transform;
  animation: cloudDrift linear infinite;
  background: #1b2348;
  box-shadow:
    6px -4px 0 0 #1b2348,
    12px 0 0 0 #1b2348,
    -6px 0 0 0 #1b2348,
    0 0 0 1px #2a2e40,
    6px -4px 0 1px #2a2e40;
}
@keyframes cloudDrift {
  from { transform: translateX(-20vw); }
  to   { transform: translateX(120vw); }
}

/* ---------- 레이아웃 ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 40px);
  position: relative;
  z-index: 1;
}
.center-screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack-lg { display: flex; flex-direction: column; gap: 2rem; }
.row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.row-center { justify-content: center; }

/* ---------- 내비게이션 ---------- */
.nav {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem clamp(16px, 5vw, 40px);
  max-width: 1100px;
  margin: 0 auto;
  flex-wrap: wrap;
  background: var(--card-solid);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 0 #05070f;
}
.nav__home {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
  font-family: var(--font-soft);
  font-size: 0.92rem;
  color: #13203a;
  padding: 0.45rem 0.85rem;
  border-radius: 0;
  background: var(--peach);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: inset 2px 2px 0 #fff3c4, inset -2px -2px 0 #e0a94a, 0 0 0 1px #191c28, 3px 3px 0 #05070f;
  transition: transform 0.06s steps(1, end);
}
.nav__home:hover { transform: translateY(-1px); background: var(--peach); }
.nav__home:active { transform: translate(1px,1px); box-shadow: inset -2px -2px 0 #fff3c4, inset 2px 2px 0 #e0a94a, 0 0 0 1px #191c28, 1px 1px 0 #05070f; }
.nav__home[aria-current="page"] { background: var(--peach); box-shadow: inset 2px 2px 0 #fff3c4, inset -2px -2px 0 #e0a94a, 0 0 0 1px #191c28, 3px 3px 0 #05070f; font-weight: 700; }
.nav__links { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.nav__link {
  font-family: var(--font-soft);
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding: 0.4rem 0.8rem;
  border-radius: 0;
  border: 1px solid transparent;
  transition: color 0.06s steps(1, end), background 0.06s steps(1, end);
}
.nav__link:hover, .nav__link[aria-current="page"] { color: var(--peach); background: var(--glass); border: 1px solid var(--line); box-shadow: inset 1px 1px 0 #05070f; }

/* 좁은 화면: 홈 라벨은 줄바꿈 금지, 메뉴는 아래줄로 자연스럽게 흘림 */
@media (max-width: 560px) {
  .nav { flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.7rem 0.8rem; }
  .nav__home { font-size: 0.9rem; padding: 0.4rem 0.8rem; }
  .nav__links { justify-content: center; gap: 0.2rem; }
  .nav__link { font-size: 0.8rem; padding: 0.36rem 0.55rem; }
}
@media (max-width: 360px) {
  /* 아주 좁으면 홈은 집 아이콘만 (텍스트는 스크린리더용으로 유지) */
  .nav__home { font-size: 0; gap: 0; padding: 0.42rem 0.6rem; }
  .nav__home::before { content: "🏠"; font-size: 1.05rem; }
}

/* ---------- 타이포 ---------- */
.title {
  font-family: var(--font-soft);
  font-weight: 700;
  font-size: clamp(1.8rem, 6vw, 3.2rem);
  line-height: 1.15;
  letter-spacing: 0;
  color: var(--peach);
  text-shadow: 3px 3px 0 #0b1228, 6px 6px 0 rgba(0,0,0,0.35);
}
.title--hand {
  font-family: var(--font-soft);
  font-weight: 700;
  font-size: clamp(2.2rem, 8vw, 4.2rem);
  line-height: 1.05;
  color: var(--peach);
  text-shadow: 3px 3px 0 #0b1228, 6px 6px 0 rgba(0,0,0,0.35);
  animation: crt 2.4s steps(2, end) infinite;
}
@keyframes crt { 0%, 100% { transform: translate(0,0); } 50% { transform: translate(0.6px,-0.4px); } }
.subtitle {
  font-family: var(--font-soft);
  font-size: clamp(0.9rem, 2.4vw, 1.15rem);
  color: var(--ink-soft);
  font-weight: 400;
}
.eyebrow {
  font-family: var(--font-hand);
  font-size: clamp(0.85rem, 2.4vw, 1.1rem);
  color: var(--mint);
  letter-spacing: 0.4px;
}
.lead { font-size: clamp(0.95rem, 2.2vw, 1.1rem); color: var(--ink-soft); }
.hand { font-family: var(--font-hand); }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.text-grad {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: var(--peach);
  text-shadow: 2px 2px 0 #05070f;
}

/* ---------- 카드 ---------- */
.card {
  background: var(--card);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: inset 0 0 0 1px #05070f, var(--shadow);
  padding: clamp(1.2rem, 4vw, 2rem);
  image-rendering: pixelated;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: clamp(1rem, 3vw, 1.6rem);
}

/* 메뉴 카드(메인 허브의 메뉴들) */
.menu-card {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: left;
  background: var(--card);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: inset 0 0 0 1px #05070f, var(--shadow);
  padding: 1.4rem 1.4rem;
  transition: transform 0.08s steps(2, end), box-shadow 0.08s steps(2, end);
  position: relative;
  overflow: hidden;
}
.menu-card:hover { transform: translate(-2px,-2px); box-shadow: inset 0 0 0 1px #05070f, inset 0 0 0 2px var(--peach), 5px 5px 0 #05070f; }
.menu-card__emoji { font-size: 2.4rem; line-height: 1; margin-bottom: 0.3rem; image-rendering: pixelated; }
.menu-card__title { font-family: var(--font-soft); font-size: 1.2rem; font-weight: 700; color: var(--peach); text-shadow: 2px 2px 0 #05070f; }
.menu-card__desc { font-size: 0.85rem; color: var(--ink-soft); }
.menu-card__go { margin-top: 0.6rem; font-family: var(--font-hand); font-size: 0.95rem; color: var(--ink-faint); transition: color 0.06s steps(1, end), transform 0.06s steps(1, end); }
.menu-card:hover .menu-card__go { color: var(--mint); transform: translateX(3px); }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: var(--font-soft);
  font-size: 0.95rem;
  font-weight: 700;
  color: #13203a;
  padding: 0.7rem 1.4rem;
  border-radius: 0;
  background: var(--lavender);
  box-shadow: inset 2px 2px 0 #ffffff, inset -2px -2px 0 var(--lavender-deep), 0 0 0 1px #191c28, 3px 3px 0 #05070f;
  transition: transform 0.06s steps(1, end), box-shadow 0.06s steps(1, end);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  text-shadow: none;
}
.btn:hover { transform: translate(-1px,-1px); box-shadow: inset 2px 2px 0 #ffffff, inset -2px -2px 0 var(--lavender-deep), 0 0 0 1px #191c28, 4px 4px 0 #05070f; filter: brightness(1.04); }
.btn:active { transform: translate(1px,1px); box-shadow: inset -2px -2px 0 #ffffff, inset 2px 2px 0 var(--lavender-deep), 0 0 0 1px #191c28, 1px 1px 0 #05070f; }
.btn--ghost {
  background: var(--glass);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: var(--ink);
  font-weight: 400;
  box-shadow: inset 0 0 0 1px var(--line), 0 0 0 1px #191c28, 3px 3px 0 #05070f;
  text-shadow: none;
}
.btn--ghost:hover { color: var(--peach); box-shadow: inset 0 0 0 1px var(--peach), 0 0 0 1px #191c28, 4px 4px 0 #05070f; }
.btn--ghost:active { transform: translate(1px,1px); box-shadow: inset 0 0 0 1px var(--line), 0 0 0 1px #191c28, 1px 1px 0 #05070f; }
.btn--lg { font-size: 1.1rem; padding: 0.9rem 2rem; }
.btn--block { display: flex; width: 100%; }

/* 메인 히어로의 거대한 "집 가고 싶다" 버튼 */
.home-btn {
  position: relative;
  font-family: var(--font-soft);
  font-weight: 700;
  font-size: clamp(1.2rem, 4.5vw, 1.9rem);
  color: #13203a;
  padding: clamp(0.9rem, 4vw, 1.4rem) clamp(1.6rem, 7vw, 2.8rem);
  border-radius: 0;
  background: var(--peach);
  box-shadow: inset 3px 3px 0 #fff3c4, inset -3px -3px 0 var(--peach-deep), 0 0 0 1px #191c28, 5px 5px 0 #05070f;
  transition: transform 0.06s steps(1, end), box-shadow 0.06s steps(1, end);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  text-shadow: none;
}
.home-btn:hover { transform: translate(-2px,-2px); box-shadow: inset 3px 3px 0 #fff3c4, inset -3px -3px 0 var(--peach-deep), 0 0 0 1px #191c28, 7px 7px 0 #05070f; }
.home-btn:active { transform: translate(2px,2px); box-shadow: inset -3px -3px 0 #fff3c4, inset 3px 3px 0 var(--peach-deep), 0 0 0 1px #191c28, 2px 2px 0 #05070f; }

/* ---------- 카운트다운 ---------- */
.countdown { display: inline-flex; align-items: baseline; gap: 0.3rem; font-family: var(--font-soft); }
.countdown__num {
  font-size: clamp(2rem, 8vw, 3.8rem);
  font-weight: 700;
  color: var(--peach);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-shadow: 2px 2px 0 #05070f;
}
.countdown__colon { font-size: clamp(1.6rem, 6vw, 3rem); color: var(--mint); animation: blink 1.6s steps(1, end) infinite; }
.countdown__unit { font-family: var(--font-hand); font-size: 0.8rem; color: var(--ink-soft); margin-right: 0.4rem; }
@keyframes blink { 50% { opacity: 0.2; } }

/* ---------- 칩 / 배지 ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-hand);
  font-size: 0.78rem;
  color: var(--mint);
  padding: 0.3rem 0.7rem;
  border-radius: 0;
  background: var(--glass);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 1px #05070f;
}

/* ---------- 진행 바 ---------- */
.progress { width: 100%; height: 10px; border-radius: 0; background: var(--line); overflow: hidden; box-shadow: inset 0 0 0 1px #05070f; }
.progress__bar { height: 100%; border-radius: 0; background: var(--mint); box-shadow: inset 0 -2px 0 var(--mint-deep); transition: width 0.3s steps(8, end); }

/* ---------- 푸터 ---------- */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2.5rem 1rem 2rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-family: var(--font-hand);
  border-top: 1px solid var(--line);
  background: var(--card-solid);
  box-shadow: 0 -2px 0 #05070f;
}
.footer a { color: var(--mint); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 떠다니는 이펙트 (버튼 클릭 시 위로 떠오르는 이모지/하트) ---------- */
.floaty {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  font-size: 1.4rem;
  image-rendering: pixelated;
  animation: floatUp 1.3s steps(8, end) forwards;
  will-change: transform, opacity;
}
@keyframes floatUp {
  0%   { transform: translateY(0) scale(0.6); opacity: 0; }
  20%  { opacity: 1; transform: translateY(-10px) scale(1.1); }
  100% { transform: translateY(-120px) scale(0.9); opacity: 0; }
}

/* ---------- 토스트 ---------- */
.toast-wrap { position: fixed; left: 50%; bottom: 2rem; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 0.5rem; align-items: center; pointer-events: none; }
.toast {
  background: var(--card-solid);
  color: var(--ink);
  font-family: var(--font-hand);
  font-size: 0.85rem;
  padding: 0.6rem 1.1rem;
  border-radius: 0;
  box-shadow: 0 0 0 1px #191c28, var(--shadow);
  border: 1px solid var(--line);
  animation: toastIn 0.3s steps(3, end) forwards, toastOut 0.3s steps(3, end) forwards;
  animation-delay: 0s, 2.4s;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

/* ---------- 등장 애니메이션 ---------- */
.fade-in { animation: fadeIn 0.5s steps(4, end) both; }
.fade-up { animation: fadeUp 0.5s steps(4, end) both; }
.delay-1 { animation-delay: 0.12s; }
.delay-2 { animation-delay: 0.24s; }
.delay-3 { animation-delay: 0.36s; }
.delay-4 { animation-delay: 0.48s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

/* 부드러운 호흡(숨쉬기) — 멍때리기/공용 (도트 톤: 계단 펄스) */
.breathe { animation: breathe 8s steps(6, end) infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }

/* ---------- 유틸 ---------- */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; } .mt-5 { margin-top: 3rem; }
.mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }

/* ---------- 모션 줄이기 선호 존중 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .sky { animation: none; }
  .sky::after { animation: none; }
  .cloud { display: none; }
}