/* =========================================================
   ZUN — shared layer
   두 페이지가 공유하는 브랜드 토큰 / 내비게이션 / 플로팅 캐릭터
   ========================================================= */

:root {
  --ink: #05070f;          /* Deep Black */
  --navy: #0b1433;         /* Midnight Navy */
  --navy-2: #121d45;
  --line: rgba(160, 180, 255, 0.14);
  --white: #eef1fb;
  --muted: #98a2c6;
  --blue: #3b6cff;         /* Electric Blue */
  --cyan: #62e3ea;
  --violet: #9a8cff;

  --font-sans: "Pretendard Variable", Pretendard, "Noto Sans KR", "Noto Sans CJK KR", system-ui, sans-serif;
  --font-pixel: "Galmuri11", "Galmuri9", var(--font-sans);
  --font-mono: "JetBrains Mono", "D2Coding", ui-monospace, SFMono-Regular, Menlo, monospace;

  --nav-h: 56px;
  --wrap: min(1180px, 100% - 40px);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--white);
  background: var(--ink);
  line-height: 1.65;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

.wrap { width: var(--wrap); margin-inline: auto; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 200;
  background: var(--white); color: var(--ink); padding: 10px 14px; border-radius: 8px;
  font-weight: 700; text-decoration: none; transition: top .2s;
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- pixel sprite ---------- */
/* 픽셀 아이콘 (SVG) */
.zun {
  filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, .35));
  user-select: none;
  -webkit-user-drag: none;
}
.zun-float { animation: zun-float 3.6s ease-in-out infinite; }
.zun-bounce { animation: zun-bounce 1.1s steps(2, jump-none) infinite; }
.zun-walk { animation: zun-walk .5s steps(2, jump-none) infinite; }

@keyframes zun-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes zun-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes zun-walk {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-4px) rotate(-1.5deg); }
}
.zun-pop { animation: zun-pop .45s var(--ease-spring); }
@keyframes zun-pop {
  0% { transform: scale(.82) translateY(8px); opacity: .4; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* ---------- floating nav ---------- */
.nav {
  position: fixed; z-index: 100;
  top: 12px; left: 50%; transform: translateX(-50%);
  width: min(760px, calc(100% - 20px));
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(8, 12, 30, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  overflow: hidden;
}
.nav__brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; font-family: var(--font-sans); font-weight: 800;
  font-size: 1rem; letter-spacing: .24em;
}
.nav__brand img { width: 30px; height: auto; }
.brand-tile { border-radius: 22%; box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 20px 40px -20px rgba(0,0,0,.8); }
.nav__links { display: flex; gap: 4px; }
.nav__link {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 12px;
  border-radius: 10px;
  font-family: var(--font-pixel); font-size: .78rem; letter-spacing: .04em;
  text-decoration: none; color: var(--muted);
  transition: color .2s, background .2s;
}
.nav__link:hover { color: var(--white); background: rgba(255,255,255,.05); }
.nav__link[aria-current="page"] { color: var(--white); background: rgba(255,255,255,.08); }
.nav__link[aria-current="page"]::before {
  content: ""; width: 6px; height: 6px; background: var(--accent, var(--blue));
  box-shadow: 0 0 10px var(--accent, var(--blue));
}
.nav__long { display: none; }
.nav__progress {
  position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  transform-origin: left; transform: scaleX(var(--progress, 0));
  background: var(--accent, var(--blue));
}
@media (min-width: 560px) {
  .nav__long { display: inline; }
  .nav__short { display: none; }
  .nav__link { padding: 0 14px; font-size: .8rem; }
}

/* ---------- floating assistant ---------- */
.buddy {
  position: fixed; z-index: 90;
  right: max(10px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  display: flex; align-items: flex-end; gap: 6px;
  pointer-events: none;
}
.buddy__bubble {
  pointer-events: auto;
  max-width: 170px;
  padding: 8px 12px;
  border-radius: 12px 12px 2px 12px;
  background: var(--white); color: var(--ink);
  font-size: .82rem; font-weight: 600; line-height: 1.4;
  box-shadow: 4px 4px 0 rgba(0,0,0,.35);
  transition: opacity .3s, transform .3s var(--ease-out);
}
.buddy.is-quiet .buddy__bubble { opacity: 0; transform: translateY(6px) scale(.96); pointer-events: none; }
.buddy__btn {
  pointer-events: auto;
  width: 60px; height: 60px; padding: 0; border: 1px solid var(--line); border-radius: 16px;
  background: rgba(8, 12, 30, .8); backdrop-filter: blur(10px); cursor: pointer;
  display: grid; place-items: center;
}
.buddy__btn img { max-height: 48px; width: auto; }
@media (min-width: 900px) {
  .buddy__btn { width: 72px; height: 72px; }
  .buddy__btn img { max-height: 58px; }
  .buddy__bubble { max-width: 210px; font-size: .88rem; }
}

/* ---------- buttons ---------- */
.btn {
  --bg: var(--white); --fg: var(--ink);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px;
  border: 0; border-radius: 12px;
  background: var(--bg); color: var(--fg);
  font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer;
  transition: transform .25s var(--ease-out), box-shadow .25s, background .2s;
  will-change: transform;
}
.btn--ghost {
  --bg: transparent; --fg: var(--white);
  box-shadow: inset 0 0 0 1px rgba(238,241,251,.28);
}
.btn--ghost:hover { box-shadow: inset 0 0 0 1px rgba(238,241,251,.6); }
.btn__pixel-arrow {
  width: 12px; height: 12px;
  background:
    linear-gradient(currentColor 0 0) 0 50% / 8px 2px no-repeat,
    linear-gradient(currentColor 0 0) 6px 3px / 2px 2px no-repeat,
    linear-gradient(currentColor 0 0) 8px 5px / 2px 2px no-repeat,
    linear-gradient(currentColor 0 0) 6px 7px / 2px 2px no-repeat;
}
.btn-note { font-size: .8rem; color: var(--muted); }

/* ---------- 신청 방법 ---------- */
.apply {
  display: grid; gap: 8px; width: min(100%, 440px); margin-top: 18px; text-align: left;
}
.apply li {
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 10px 8px 12px;
  border-radius: 12px; border: 1px solid var(--line); background: rgba(5,7,15,.45);
  font-size: .95rem; font-weight: 600;
}
.apply b {
  flex: none; display: grid; place-items: center; width: 26px; height: 26px;
  background: var(--accent, var(--blue)); color: var(--ink); font-size: .85rem; font-weight: 800;
}
.apply span { flex: 1; }
.apply em, .hero__apply em { font-style: normal; color: var(--accent, var(--cyan)); font-weight: 800; }
.apply__copy {
  flex: none; min-height: 34px; padding: 0 12px; border-radius: 8px; border: 0; cursor: pointer;
  background: var(--white); color: var(--ink); font-weight: 800; font-size: .82rem;
}
.apply__copy:hover { background: #fff; box-shadow: 0 0 0 3px var(--accent, var(--blue)); }
.hero__apply { margin-top: 14px; font-size: .92rem; color: #c9d0ec; }

/* ---------- reveal ---------- */
.js .reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- pixel sky ---------- */
.pixel-sky { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.pixel-sky i {
  position: absolute; width: 3px; height: 3px; background: var(--white);
  opacity: .0; animation: twinkle var(--d, 4s) steps(3, end) infinite var(--delay, 0s);
}
.pixel-sky i.plus {
  width: 9px; height: 9px; background:
    linear-gradient(var(--c, var(--cyan)) 0 0) 3px 0 / 3px 9px no-repeat,
    linear-gradient(var(--c, var(--cyan)) 0 0) 0 3px / 9px 3px no-repeat;
}
@keyframes twinkle { 0%, 100% { opacity: 0; } 40% { opacity: .75; } 70% { opacity: .2; } }

/* ---------- about (shared structure) ---------- */
.about__links { display: flex; flex-wrap: wrap; gap: 10px; }
.about__link {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: .92rem;
  transition: border-color .2s, background .2s;
}
.about__link:hover { border-color: rgba(238,241,251,.45); background: rgba(255,255,255,.04); }
.about__link svg { width: 18px; height: 18px; }

/* ---------- footer ---------- */
.site-footer {
  padding: 40px 0 120px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: .86rem;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
.site-footer a { color: var(--white); text-underline-offset: 3px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 96px; z-index: 150; width: max-content; max-width: calc(100% - 40px); text-align: center;
  transform: translate(-50%, 20px); opacity: 0;
  padding: 10px 16px; border-radius: 10px;
  background: var(--white); color: var(--ink); font-weight: 700; font-size: .9rem;
  transition: opacity .25s, transform .25s var(--ease-out); pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .pixel-sky i { opacity: .4; }
}
