:root {
  --bg: #0B1026;
  --bg-2: #111a3a;
  --text: #E7ECFF;
  --muted: #9AA6CF;
  --line: rgba(165, 243, 252, .14);
  --wisp: #4FD1C5;
  --flit: #2ED8E6;
  --irisa: #B9A7FF;
  --gold: #FDE68A;
  --serif: "Gowun Batang", serif;
  --sans: "Pretendard", -apple-system, "Segoe UI", "Malgun Gothic", sans-serif;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(ellipse at 50% -10%, #1E3A6B 0%, var(--bg) 55%) fixed, var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.75;
  word-break: keep-all;
  overflow-x: hidden;
}
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 700; line-height: 1.35; margin: 0; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); text-align: center; margin-bottom: .6em; }
section { max-width: var(--max); margin: 0 auto; padding: 96px 20px; }

/* 상단 바 */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px max(20px, calc((100% - var(--max)) / 2 + 20px));
  background: rgba(11, 16, 38, .65);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-weight: 700; font-size: 1.2rem; }
.nav nav { display: flex; gap: 22px; }
.nav nav a { text-decoration: none; color: var(--muted); font-size: .95rem; transition: color .2s; }
.nav nav a:hover { color: var(--text); }

/* 첫 화면 */
.hero {
  display: grid; grid-template-columns: 1fr 1.1fr; align-items: center; gap: 24px;
  min-height: min(calc(100vh - 64px), 820px); padding-top: 40px;
}
.eyebrow { color: var(--wisp); letter-spacing: .2em; text-transform: uppercase; font-size: .8rem; margin: 0 0 16px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--wisp), var(--flit), var(--irisa));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { color: var(--muted); font-size: 1.08rem; margin: 22px 0 32px; max-width: 34em; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-block; padding: 12px 26px; border-radius: 999px;
  text-decoration: none; font-weight: 600; transition: transform .2s, box-shadow .2s, background .2s;
}
.btn.small { padding: 9px 20px; font-size: .9rem; margin-top: 18px; }
.downloads { display: flex; gap: 10px; flex-wrap: wrap; }
.btn.primary { background: linear-gradient(90deg, var(--wisp), var(--irisa)); color: #0B1026; box-shadow: 0 0 24px rgba(79, 209, 197, .35); }
.btn.primary:hover { transform: translateY(-2px); box-shadow: 0 0 36px rgba(185, 167, 255, .5); }
.btn.ghost { border: 1px solid var(--line); color: var(--text); }
.btn.ghost:hover { background: rgba(165, 243, 252, .08); }

/* 세계수와 요정 */
.tree { width: 100%; max-width: 620px; justify-self: center; }
.tree img {
  width: 100%; height: auto; display: block;
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 55%, transparent 100%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 55%, transparent 100%);
  animation: breathe 9s ease-in-out infinite;
}
@keyframes breathe { 50% { filter: brightness(1.12); transform: scale(1.015); } }

/* 소개 */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; color: var(--muted); font-size: 1.05rem; }
.about-grid p { margin: 0; }

/* 요정 카드 */
.section-lead { text-align: center; color: var(--muted); margin: 0 0 48px; }
.fairy {
  --accent: var(--wisp);
  display: grid; grid-template-columns: 160px 1fr; gap: 36px; align-items: start;
  padding: 36px; margin-bottom: 24px;
  border: 1px solid var(--line); border-radius: 28px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, transparent), rgba(17, 26, 58, .55));
  scroll-margin-top: 90px;
  transition: border-color .3s;
}
.fairy:hover { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.fairy-icon { width: 160px; height: 160px; border-radius: 36px; filter: drop-shadow(0 0 24px color-mix(in srgb, var(--accent) 45%, transparent)); }
.fairy-kind { margin: 0 0 6px; color: var(--accent); font-size: .85rem; letter-spacing: .04em; }
.fairy h3 { font-size: 1.9rem; }
.fairy h3 span { font-family: var(--sans); font-size: .95rem; font-weight: 400; color: var(--muted); margin-left: 8px; }
.fairy-body > p:not(.fairy-kind) { color: #C9D2F2; margin: 12px 0 18px; }
.badge {
  font-family: var(--sans); font-style: normal; font-size: .75rem; font-weight: 600;
  vertical-align: middle; margin-left: 8px; padding: 3px 10px; border-radius: 999px;
  color: var(--gold); border: 1px solid rgba(253, 230, 138, .45); background: rgba(253, 230, 138, .08);
}
.btn.disabled { cursor: default; color: var(--muted); border-style: dashed; }
.btn.disabled:hover { background: none; }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  font-size: .82rem; padding: 4px 12px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  color: color-mix(in srgb, var(--accent) 70%, white);
}

.fairy.seed { --accent: var(--gold); border-style: dashed; background: transparent; }
.seed-icon { width: 160px; height: 160px; display: grid; place-items: center; }
.seed-icon span {
  width: 18px; height: 18px; border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 30px 10px rgba(253, 230, 138, .35);
  animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: scale(1.4); opacity: .6; } }

/* 약속 */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 28px; }
.card { padding: 28px; border-radius: 22px; border: 1px solid var(--line); background: rgba(17, 26, 58, .55); }
.card h4 { font-size: 1.2rem; margin-bottom: 10px; }
.card p { margin: 0; color: var(--muted); }

/* 연락 */
.contact { text-align: center; }
.contact p { color: var(--muted); margin: 0 0 28px; }

.footer {
  display: flex; justify-content: center; align-items: center; gap: 10px;
  padding: 32px 20px; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line);
}

/* 스크롤 등장 */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.reveal.shown { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tree img, .seed-icon span { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* 좁은 화면 */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: auto; text-align: center; }
  .hero .lead { margin-left: auto; margin-right: auto; }
  .cta { justify-content: center; }
  .tree { max-width: 480px; order: -1; }
  .about-grid, .cards { grid-template-columns: 1fr; }
  section { padding: 72px 16px; }
}
@media (max-width: 640px) {
  .nav nav { gap: 14px; }
  .nav nav a { font-size: .85rem; }
  .brand span { display: none; }
  .fairy { grid-template-columns: 1fr; padding: 26px 20px; gap: 18px; text-align: center; }
  .fairy-icon, .seed-icon { width: 112px; height: 112px; margin: 0 auto; }
  .chips, .downloads { justify-content: center; }
}

/* 문서 페이지 (개인정보처리방침) */
.doc { max-width: 820px; margin: 0 auto; padding: 72px 20px 48px; }
.doc h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.doc-meta { color: var(--muted); margin: 6px 0 28px; }
.doc > p { color: #C9D2F2; }
.doc section { max-width: none; padding: 0; margin: 48px 0 0; scroll-margin-top: 90px; }
.doc h2 { text-align: left; font-size: 1.45rem; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.doc h2 img { border-radius: 10px; }
.doc h3 { font-size: 1.1rem; margin: 26px 0 8px; }
.doc ul { padding-left: 1.2em; color: #C9D2F2; }
.doc li { margin: 6px 0; }
.doc a:not(.btn) { color: var(--flit); }
.doc code { font-size: .88em; padding: 1px 6px; border-radius: 6px; background: rgba(165, 243, 252, .08); color: #DDF7FB; word-break: break-all; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: rgba(17, 26, 58, .55); }
.toc a { text-decoration: none; color: var(--muted) !important; font-size: .9rem; padding: 4px 10px; border-radius: 999px; }
.toc a:hover { color: var(--text) !important; background: rgba(165, 243, 252, .08); }
.app-policy { --accent: var(--wisp); padding: 28px !important; border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 24px; background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, transparent), rgba(17, 26, 58, .5)); }
.app-policy > p { color: var(--muted); margin-top: 0; }
.doc table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 12px 0 8px; display: block; overflow-x: auto; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.doc th { color: var(--accent, var(--text)); font-weight: 600; white-space: nowrap; }
.doc td { color: #C9D2F2; min-width: 140px; }
.doc-back { margin-top: 56px; text-align: center; }
.footer a { color: var(--muted); }
.footer .sep { opacity: .5; }
@media (max-width: 640px) {
  .doc { padding: 48px 16px 32px; }
  .app-policy { padding: 20px 16px !important; }
}
