/* ============================================================
   천마전생록 — 랜딩 스타일 (다크 판타지 무협)
   ============================================================ */
:root {
  --bg:        #07050a;
  --bg-2:      #0d0a12;
  --bg-3:      #130d18;
  --ink:       #ece3d2;
  --ink-dim:   #9a8f7a;
  --ink-faint: #6b6253;
  --blood:     #c8102e;
  --blood-2:   #e63250;
  --blood-glow:#ff2d45;
  --gold:      #d9b85a;
  --gold-2:    #f3dd96;
  --gold-deep: #a8862f;
  --qi:        #8b3bff;
  --qi-2:      #b06bff;
  --line:      rgba(217,184,90,0.18);
  --serif: "Noto Serif KR", serif;
  --sans:  "Noto Sans KR", sans-serif;
  --deco:  "Noto Serif KR", serif;
  --cinzel:"Cinzel", serif;
  --maxw: 1180px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  overflow-x: hidden;
  letter-spacing: -0.01em;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
em { font-style: normal; color: var(--blood-glow); font-weight: 700; }
b  { color: var(--gold-2); font-weight: 700; }
::selection { background: var(--blood); color: #fff; }

/* ---------- 배경 텍스처 ---------- */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(120,20,30,0.22), transparent 60%),
    radial-gradient(80% 60% at 80% 110%, rgba(80,30,140,0.16), transparent 60%),
    var(--bg);
}
#ember-canvas { position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.85; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-family: var(--serif); font-weight: 700; font-size: .95rem;
  padding: .85em 1.7em; border-radius: 2px; cursor: pointer; border: 1px solid transparent;
  transition: transform .25s, box-shadow .25s, background .25s, color .25s;
  position: relative; white-space: nowrap;
}
.btn--lg { font-size: 1.05rem; padding: 1em 2.2em; }
.btn--gold {
  background: linear-gradient(160deg, var(--gold-2), var(--gold-deep));
  color: #1a1208; box-shadow: 0 6px 24px rgba(217,184,90,0.25), inset 0 1px 0 rgba(255,255,255,.4);
}
.btn--gold:hover { transform: translateY(-2px); box-shadow: 0 10px 34px rgba(217,184,90,0.45); }
.btn--ghost {
  background: rgba(20,12,18,.5); color: var(--gold-2); border-color: var(--line);
  backdrop-filter: blur(4px);
}
.btn--ghost:hover { border-color: var(--gold); color: #fff; transform: translateY(-2px); box-shadow: 0 0 24px rgba(200,16,46,.3); }

/* ---------- 네비 ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  transition: background .4s, padding .4s, border-color .4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(7,5,10,.82); backdrop-filter: blur(12px) saturate(1.2);
  border-bottom-color: var(--line); padding-top: .6rem; padding-bottom: .6rem;
}
.nav__brand { display: flex; align-items: center; gap: .65rem; margin-right: auto; }
.nav__logo { width: 38px; height: 38px; border-radius: 6px; box-shadow: 0 0 16px rgba(200,16,46,.4); }
.nav__title { font-family: var(--deco); font-size: 1.5rem; color: var(--gold-2); letter-spacing: .08em; }
.nav__links { display: flex; gap: 1.6rem; }
.nav__links a { font-family: var(--serif); font-size: .92rem; color: var(--ink-dim); position: relative; transition: color .25s; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; width: 0; height: 1px;
  background: var(--gold); transition: width .3s;
}
.nav__links a:hover { color: var(--gold-2); }
.nav__links a:hover::after { width: 100%; }
.nav__cta { font-size: .85rem; padding: .6em 1.3em; }
.nav__burger { display: none; background: none; border: none; color: var(--gold-2); font-size: 1.5rem; cursor: pointer; }

/* ---------- HERO ---------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hero__bg { position: absolute; inset: -8% 0 0 0; z-index: 0; will-change: transform; }
.hero__art {
  width: 100%; height: 116%; object-fit: cover; object-position: 50% 28%;
  filter: contrast(1.05) saturate(1.08) brightness(.82);
}
.hero__moon {
  position: absolute; top: 8%; left: 50%; transform: translateX(-50%); z-index: 0;
  width: min(58vw, 460px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(255,60,60,.32), rgba(190,20,30,.12) 55%, transparent 72%);
  filter: blur(6px); animation: moonPulse 7s ease-in-out infinite;
}
@keyframes moonPulse { 0%,100% { opacity: .8; } 50% { opacity: 1; } }
.hero__vignette {
  position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(180deg, rgba(7,5,10,.55) 0%, transparent 30%, rgba(7,5,10,.55) 72%, var(--bg) 100%),
    radial-gradient(120% 90% at 50% 60%, transparent 40%, rgba(7,5,10,.7) 100%);
}
.hero__content { position: relative; z-index: 2; text-align: center; padding: 0 1.2rem; max-width: 860px; }
.hero__eyebrow {
  font-family: var(--cinzel); letter-spacing: .42em; text-transform: uppercase;
  font-size: .8rem; color: var(--gold); margin-bottom: 1.2rem; padding-left: .42em;
}
.hero__title { display: flex; flex-direction: column; align-items: center; gap: .2rem; margin-bottom: 1.6rem; line-height: 1; }
.hero__hanja {
  font-family: var(--deco); font-size: clamp(3.6rem, 13vw, 8.2rem); color: #fff;
  text-shadow: 0 0 40px rgba(200,16,46,.55), 0 4px 30px rgba(0,0,0,.8);
  letter-spacing: .06em; background: linear-gradient(180deg, #fff, #f3dd96 55%, #c8102e 130%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero__kor { font-family: var(--serif); font-weight: 500; font-size: clamp(1rem,4.5vw,1.7rem); color: var(--ink-dim); letter-spacing: .55em; padding-left: .55em; }
.hero__tagline { font-family: var(--serif); font-size: clamp(1.05rem, 2.6vw, 1.45rem); color: var(--ink); margin-bottom: 2.2rem; line-height: 1.6; text-shadow: 0 2px 12px rgba(0,0,0,.9); }
.hero__cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1.8rem; }
.hero__platforms { font-size: .82rem; color: var(--ink-faint); letter-spacing: .04em; }
.hero__scroll { position: absolute; bottom: 2.2rem; left: 50%; transform: translateX(-50%); z-index: 3; width: 26px; height: 42px; border: 2px solid var(--line); border-radius: 14px; }
.hero__scroll span { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 4px; height: 8px; border-radius: 2px; background: var(--gold); animation: scrollDot 1.8s ease-in-out infinite; }
@keyframes scrollDot { 0% { opacity: 0; transform: translate(-50%,0); } 40% { opacity: 1; } 80%,100% { opacity: 0; transform: translate(-50%,14px); } }

/* ---------- 섹션 공통 ---------- */
section { position: relative; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto clamp(2.5rem,6vw,4rem); padding: 0 1.2rem; }
.section-head__kicker { font-family: var(--cinzel); letter-spacing: .3em; text-transform: uppercase; font-size: .78rem; color: var(--gold); display: block; margin-bottom: .9rem; }
.section-head__title { font-family: var(--serif); font-weight: 900; font-size: clamp(1.8rem, 5vw, 3rem); color: #fff; line-height: 1.2; }
.section-head__sub { margin-top: 1rem; color: var(--ink-dim); font-size: 1rem; }

/* ---------- LOGLINE ---------- */
.logline { padding: clamp(5rem,12vw,9rem) 1.2rem; text-align: center; }
.logline__inner { max-width: 820px; margin: 0 auto; }
.logline__quote { font-family: var(--serif); font-weight: 700; font-size: clamp(1.5rem, 5vw, 2.6rem); line-height: 1.5; color: #fff; text-shadow: 0 0 30px rgba(200,16,46,.3); }
.logline__attr { color: var(--blood-2); font-family: var(--serif); margin-top: 1.1rem; letter-spacing: .05em; }
.logline__rule { width: 70px; height: 2px; margin: 2.4rem auto; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.logline__body { color: var(--ink-dim); font-size: 1.08rem; line-height: 1.9; }

/* ---------- STORY BEATS ---------- */
.story { padding: clamp(3rem,8vw,6rem) 0 clamp(4rem,10vw,7rem); }
.beats { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1rem,4vw,2rem); display: flex; flex-direction: column; gap: clamp(2.5rem,6vw,5rem); }
.beat { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem,4vw,3.5rem); align-items: center; }
.beat--rev .beat__img { order: 2; }
.beat__img { position: relative; border-radius: 4px; overflow: hidden; aspect-ratio: 4/3; box-shadow: 0 24px 60px rgba(0,0,0,.6); border: 1px solid var(--line); }
.beat__img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 50%, rgba(7,5,10,.35)); }
.beat__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s ease; }
.beat:hover .beat__img img { transform: scale(1.05); }
.beat__no { font-family: var(--deco); font-size: 2.4rem; color: var(--blood); opacity: .85; display: block; margin-bottom: .4rem; line-height: 1; }
.beat__text h3 { font-family: var(--serif); font-weight: 900; font-size: clamp(1.4rem,3.4vw,2rem); color: #fff; margin-bottom: .9rem; }
.beat__text p { color: var(--ink-dim); font-size: 1.02rem; line-height: 1.85; }
.beat__text--full { grid-column: 1 / -1; text-align: center; max-width: 760px; margin: 0 auto; }
.beat__line { font-family: var(--serif); font-style: italic; color: var(--gold-2) !important; font-size: 1.15rem !important; margin-top: 1.3rem !important; padding-top: 1.3rem; border-top: 1px solid var(--line); }

/* ---------- FEATURES ---------- */
.features { padding: clamp(4rem,10vw,7rem) 0; background: linear-gradient(180deg, transparent, rgba(13,10,18,.6), transparent); }
.feat-grid { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1rem,4vw,2rem); display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.feat {
  background: linear-gradient(160deg, rgba(25,18,30,.7), rgba(13,10,18,.7));
  border: 1px solid var(--line); border-radius: 6px; padding: 2rem 1.7rem;
  transition: transform .3s, border-color .3s, box-shadow .3s; position: relative; overflow: hidden;
}
.feat::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--blood), var(--gold), transparent); transform: scaleX(0); transform-origin: left; transition: transform .4s; }
.feat:hover { transform: translateY(-6px); border-color: rgba(217,184,90,.4); box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.feat:hover::before { transform: scaleX(1); }
.feat__icon { font-size: 2rem; margin-bottom: 1rem; filter: drop-shadow(0 0 10px rgba(200,16,46,.4)); }
.feat h3 { font-family: var(--serif); font-weight: 700; font-size: 1.25rem; color: var(--gold-2); margin-bottom: .7rem; }
.feat p { color: var(--ink-dim); font-size: .96rem; line-height: 1.8; }

/* ---------- METHODS ---------- */
.methods { padding: clamp(3rem,8vw,6rem) 1.2rem; text-align: center; }
.method-row { display: flex; justify-content: center; gap: clamp(.6rem,2vw,1.4rem); flex-wrap: wrap; max-width: 900px; margin: 0 auto; }
.method {
  flex: 1 1 130px; max-width: 180px; padding: 1.8rem 1rem; border-radius: 6px;
  background: rgba(13,10,18,.6); border: 1px solid var(--line);
  transition: transform .3s, box-shadow .3s; position: relative;
}
.method:hover { transform: translateY(-6px); box-shadow: 0 0 36px color-mix(in srgb, var(--c) 45%, transparent); border-color: var(--c); }
.method__char { font-family: var(--deco); font-size: 3rem; display: block; color: var(--c); text-shadow: 0 0 24px var(--c); line-height: 1; margin-bottom: .6rem; }
.method b { color: #fff; font-family: var(--serif); font-size: 1.15rem; display: block; }
.method small { color: var(--ink-faint); font-size: .82rem; }
.methods__note { margin-top: 2.4rem; color: var(--ink-dim); font-size: 1.02rem; max-width: 640px; margin-left: auto; margin-right: auto; }

/* ---------- CHARACTERS ---------- */
.characters { padding: clamp(4rem,10vw,7rem) 0; }
.char-grid { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1rem,4vw,2rem); display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; }
.char {
  position: relative; border-radius: 6px; overflow: hidden; aspect-ratio: 3/4;
  border: 1px solid var(--line); cursor: pointer; transform-style: preserve-3d;
  transition: transform .2s ease, box-shadow .3s; background: var(--bg-2);
}
.char img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; transition: transform .6s, filter .4s; filter: grayscale(.3) brightness(.78); }
.char:hover img { transform: scale(1.08); filter: grayscale(0) brightness(.95); }
.char__overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 1.1rem; background: linear-gradient(0deg, rgba(7,5,10,.95) 8%, rgba(7,5,10,.35) 45%, transparent); }
.char__tag { position: absolute; top: .7rem; left: .7rem; z-index: 2; white-space: nowrap; font-family: var(--serif); font-weight: 700; font-size: .66rem; letter-spacing: .06em; padding: .22em .62em; border-radius: 3px; }
.char__tag.ally   { background: rgba(217,184,90,.2); color: var(--gold-2); border: 1px solid rgba(217,184,90,.4); }
.char__tag.enemy  { background: rgba(200,16,46,.2);  color: var(--blood-2); border: 1px solid rgba(200,16,46,.45); }
.char__tag.lead   { background: rgba(139,59,255,.2); color: var(--qi-2);   border: 1px solid rgba(139,59,255,.45); }
.char__name { font-family: var(--serif); font-weight: 900; font-size: 1.2rem; color: #fff; }
.char__hanja { font-family: var(--deco); font-size: .9rem; color: var(--gold); margin-left: .35rem; font-weight: 400; }
.char__role { font-size: .82rem; color: var(--ink-dim); margin-top: .2rem; opacity: 0; max-height: 0; transition: opacity .4s, max-height .4s; }
.char:hover .char__role { opacity: 1; max-height: 4rem; }

/* ---------- GALLERY ---------- */
.gallery { padding: clamp(4rem,10vw,7rem) 0; }
.gal-grid { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1rem,4vw,2rem); display: grid; grid-template-columns: repeat(3,1fr); gap: .8rem; }
.gal-item { position: relative; overflow: hidden; border-radius: 4px; aspect-ratio: 9/16; border: 1px solid var(--line); cursor: pointer; }
.gal-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s, filter .4s; filter: brightness(.8); }
.gal-item:hover img { transform: scale(1.07); filter: brightness(1); }
.gal-item__cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 1rem; font-family: var(--serif); font-size: .9rem; color: var(--ink); background: linear-gradient(0deg, rgba(7,5,10,.9), transparent); }

/* ---------- CTA ---------- */
.cta { padding: clamp(5rem,12vw,9rem) 1.2rem; text-align: center; background: radial-gradient(120% 100% at 50% 0%, rgba(120,20,30,.25), transparent 60%); }
.cta__inner { max-width: 680px; margin: 0 auto; }
.cta__line { font-family: var(--serif); font-style: italic; font-size: clamp(1.1rem,3vw,1.5rem); color: var(--gold-2); margin-bottom: 1rem; }
.cta__title { font-family: var(--serif); font-weight: 900; font-size: clamp(2rem,6vw,3.4rem); color: #fff; margin-bottom: 1rem; text-shadow: 0 0 40px rgba(200,16,46,.4); }
.cta__sub { color: var(--ink-dim); margin-bottom: 2rem; }
.cta__form { display: flex; gap: .6rem; max-width: 460px; margin: 0 auto 1.8rem; flex-wrap: wrap; }
.cta__form input { flex: 1 1 220px; padding: .9em 1.2em; background: rgba(13,10,18,.8); border: 1px solid var(--line); border-radius: 3px; color: var(--ink); font-family: var(--sans); font-size: .95rem; }
.cta__form input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217,184,90,.15); }
.cta__badges { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.store-badge { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--serif); font-size: .9rem; color: var(--ink-dim); padding: .7em 1.3em; border: 1px solid var(--line); border-radius: 4px; background: rgba(13,10,18,.6); }
.store-badge small { color: var(--ink-faint); font-size: .72rem; }
.cta__msg { margin-top: 1rem; color: var(--gold-2); font-family: var(--serif); }

/* ---------- FOOTER ---------- */
.footer { border-top: 1px solid var(--line); padding: clamp(2.5rem,6vw,4rem) clamp(1rem,4vw,3rem) 2rem; background: var(--bg-2); }
.footer__top { max-width: var(--maxw); margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap; padding-bottom: 2rem; border-bottom: 1px solid var(--line); }
.footer__brand { display: flex; align-items: center; gap: 1rem; }
.footer__logo { width: 48px; height: 48px; border-radius: 8px; }
.footer__name { font-family: var(--serif); font-weight: 700; font-size: 1.2rem; color: var(--gold-2); }
.footer__name span { font-family: var(--deco); font-weight: 400; color: var(--ink-faint); font-size: .9rem; margin-left: .3rem; }
.footer__desc { color: var(--ink-faint); font-size: .85rem; }
.footer__nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.footer__nav a { color: var(--ink-dim); font-size: .9rem; transition: color .25s; }
.footer__nav a:hover { color: var(--gold-2); }
.footer__bottom { max-width: var(--maxw); margin: 1.6rem auto 0; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: var(--ink-faint); font-size: .82rem; }
.footer__legal a { transition: color .25s; }
.footer__legal a:hover { color: var(--gold-2); }

/* ---------- REVEAL 애니메이션 ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: .12s; }
.reveal[data-delay="2"] { transition-delay: .24s; }
.reveal[data-delay="3"] { transition-delay: .36s; }
.reveal[data-delay="4"] { transition-delay: .48s; }

/* ---------- LEGAL (약관/개인정보) ---------- */
.legal { max-width: 880px; margin: 0 auto; padding: clamp(7rem,14vw,9rem) clamp(1.2rem,5vw,2rem) 5rem; }
.legal__head { border-bottom: 1px solid var(--line); padding-bottom: 1.6rem; margin-bottom: 2.4rem; }
.legal__back { font-family: var(--serif); font-size: .9rem; color: var(--gold); display: inline-block; margin-bottom: 1.2rem; }
.legal__back:hover { color: var(--gold-2); }
.legal h1 { font-family: var(--serif); font-weight: 900; font-size: clamp(1.8rem,5vw,2.6rem); color: #fff; }
.legal__meta { color: var(--ink-faint); font-size: .88rem; margin-top: .6rem; }
.legal__intro { color: var(--ink-dim); margin-bottom: 2.2rem; line-height: 1.9; }
.legal h2 { font-family: var(--serif); font-weight: 700; font-size: 1.3rem; color: var(--gold-2); margin: 2.4rem 0 .9rem; padding-top: 1.2rem; border-top: 1px solid rgba(217,184,90,.08); }
.legal h3 { font-family: var(--serif); font-size: 1.05rem; color: var(--ink); margin: 1.4rem 0 .5rem; }
.legal p, .legal li { color: var(--ink-dim); font-size: .98rem; line-height: 1.9; }
.legal ul, .legal ol { padding-left: 1.4rem; margin: .6rem 0 1rem; }
.legal li { margin-bottom: .4rem; }
.legal a { color: var(--gold); }
.legal a:hover { color: var(--gold-2); }
.legal table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.4rem; font-size: .92rem; }
.legal th, .legal td { border: 1px solid var(--line); padding: .7rem .9rem; text-align: left; vertical-align: top; }
.legal th { background: rgba(217,184,90,.07); color: var(--gold-2); font-family: var(--serif); font-weight: 700; }
.legal td { color: var(--ink-dim); }
.legal__note { background: rgba(13,10,18,.7); border: 1px solid var(--line); border-left: 3px solid var(--blood); border-radius: 4px; padding: 1rem 1.3rem; margin: 1.4rem 0; color: var(--ink-dim); font-size: .92rem; }

/* ---------- 반응형 ---------- */
@media (max-width: 900px) {
  .feat-grid { grid-template-columns: repeat(2,1fr); }
  .char-grid { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 720px) {
  .nav__links, .nav__cta { display: none; }
  .nav__links.open { display: flex; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; background: rgba(7,5,10,.97); border-bottom: 1px solid var(--line); padding: .5rem 0; }
  .nav__links.open a { padding: .9rem clamp(1rem,4vw,3rem); }
  .nav__burger { display: block; }
  .beat, .beat--rev .beat__img { grid-template-columns: 1fr; order: 0; }
  .beat--rev .beat__text { order: 2; }
  .gal-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 480px) {
  .feat-grid { grid-template-columns: 1fr; }
  .char-grid { grid-template-columns: repeat(2,1fr); }
  .footer__top { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation: none !important; }
}
