/* 아홉 왕관 홈페이지. 색은 키아트(해 질 녘 금빛 → 핏빛 구름 → 자줏빛 어둠)에서 뽑음 */
:root {
  --ink: #120b14;
  --dusk: #1c1120;
  --plum: #2a1830;
  --gold: #f0b24a;
  --gold-hi: #ffdc94;
  --blood: #a8261c;
  --bone: #f4e8d4;
  --mute: #c4ad98;
  --line: rgb(240 178 74 / .28);
  --display: 'Hahmlet', 'Noto Serif KR', serif;
  --body: 'Noto Sans KR', system-ui, sans-serif;
  --caps: 'Cinzel', 'Hahmlet', serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --pad: clamp(20px, 5vw, 72px);
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; background: var(--ink); scrollbar-color: #5a3d2a var(--ink); }
body { font: 400 17px/1.75 var(--body); color: var(--bone); background: var(--ink); overflow-x: hidden; word-break: keep-all; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--gold); color: var(--ink); }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--gold); color: var(--ink); padding: 8px 14px; }
.skip:focus { top: 12px; }

h2 { font: 800 clamp(2.1rem, 4.6vw, 3.6rem)/1.15 var(--display); letter-spacing: -.02em; text-wrap: balance; }
h3 { font: 600 clamp(1.5rem, 2.6vw, 2.1rem)/1.25 var(--display); letter-spacing: -.01em; color: var(--gold-hi); }

/* 단추 — 금테 방패판 */
.btn {
  display: inline-flex; align-items: center; gap: .55em; padding: .85em 1.7em;
  font: 700 1rem/1 var(--body); color: #2a1406; letter-spacing: .02em;
  background: linear-gradient(#ffd98a, #e59f34 60%, #c27a1c);
  border: 1px solid #ffe9b8; box-shadow: inset 0 -2px 0 rgb(90 40 0 / .35), 0 10px 28px -10px rgb(240 150 40 / .7);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
  transition: filter .25s var(--ease), transform .25s var(--ease);
}
.btn:hover { filter: brightness(1.12); transform: translateY(-2px); }
.btn:active { transform: translateY(0); filter: brightness(.95); }
.btn[disabled] { filter: saturate(.3) brightness(.8); cursor: progress; transform: none; }
.btn svg { width: 1em; height: 1em; }
.btn-small { padding: .7em 1.4em; font-size: .9rem; }
.btn-ghost { background: rgb(18 11 20 / .55); color: var(--gold-hi); border-color: var(--gold); box-shadow: none; outline: 1px solid var(--line); outline-offset: -4px; }

/* 머리 띠 */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50; display: flex; align-items: center; gap: 28px;
  padding: 14px var(--pad); transition: background .4s, box-shadow .4s;
}
.nav.solid { background: rgb(18 11 20 / .92); box-shadow: 0 1px 0 var(--line); }
.nav-brand { display: flex; align-items: center; gap: 10px; font: 700 .95rem/1 var(--caps); letter-spacing: .22em; color: var(--gold-hi); }
.nav-brand svg { width: 26px; color: var(--gold); }
.nav nav { display: flex; gap: clamp(14px, 2.4vw, 34px); margin-left: auto; font-size: .95rem; font-weight: 500; }
.nav nav a { padding: 6px 0; background: linear-gradient(var(--gold), var(--gold)) 0 100% / 0 1px no-repeat; transition: background-size .35s var(--ease), color .2s; text-shadow: 0 1px 8px #000; }
.nav nav a:hover { background-size: 100% 1px; color: var(--gold-hi); }

/* 첫 화면 */
.hero { position: relative; min-height: 100svh; display: grid; align-items: end; justify-items: center; isolation: isolate; }
.hero-media { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.hero-media img, .hero-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-media img { animation: drift 40s ease-in-out infinite alternate; }
.hero-media video { opacity: 0; transition: opacity 1.6s; }
.hero-media video.on { opacity: 1; }
.hero-media::after { content: ''; position: absolute; inset: 0; background:
  radial-gradient(ellipse 70% 55% at 50% 62%, rgb(18 11 20 / .62), transparent 70%),
  linear-gradient(rgb(18 11 20 / .5), transparent 22%, transparent 55%, var(--ink) 98%); }
@keyframes drift { from { transform: scale(1.02); } to { transform: scale(1.1) translateX(-1.5%); } }
.hero-body { text-align: center; padding: 120px var(--pad) clamp(48px, 9vh, 96px); max-width: 980px; }
.hero h1 img { width: min(640px, 82vw); margin: 0 auto; filter: drop-shadow(0 18px 40px rgb(0 0 0 / .75)); animation: rise 1.6s var(--ease) both; }
@keyframes rise { from { opacity: 0; filter: blur(14px) brightness(2.2) drop-shadow(0 0 0 #000); transform: scale(1.08); } }
.hero-line { font: 800 clamp(1.5rem, 3.4vw, 2.5rem)/1.3 var(--display); margin-top: 18px; color: var(--gold-hi); text-shadow: 0 2px 18px #000; }
.hero-sub { margin: 14px auto 0; max-width: 40em; color: var(--bone); text-shadow: 0 1px 12px #000; text-wrap: balance; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; margin-top: 30px; }
.hero-plat { margin-top: 22px; font: 500 .82rem/1 var(--caps); letter-spacing: .28em; color: var(--mute); }

/* 구획 머리: 제목 + 로고의 마름모 줄 */
.head { text-align: center; padding: 0 var(--pad); margin-bottom: clamp(36px, 6vw, 64px); }
.head h2::after, .world h2::after {
  content: ''; display: block; height: 14px; margin: 22px auto 0; max-width: 300px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M7 0l7 7-7 7-7-7z' fill='%23f0b24a'/%3E%3C/svg%3E") center / 14px 14px no-repeat,
    linear-gradient(90deg, transparent, var(--gold) 30%, transparent 44%, transparent 56%, var(--gold) 70%, transparent) center / 100% 1px no-repeat;
}
.head p { margin-top: 18px; color: var(--mute); }
section { padding-block: clamp(72px, 11vw, 150px); }
.hero { padding-block: 0; }

/* 세계 */
.world { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 80px); align-items: center; padding-inline: var(--pad); max-width: 1500px; margin: 0 auto; }
.world h2::after { margin-left: 0; }
.world-text p { margin-top: 1.3em; max-width: 34em; }
.world-text p:first-of-type { margin-top: 2em; font-size: 1.12em; color: var(--gold-hi); }
.world-art img { width: 100%; border: 1px solid var(--line); box-shadow: 0 40px 80px -30px #000, 0 0 0 6px var(--ink), 0 0 0 7px rgb(240 178 74 / .5); }

/* 아홉 세력 — 깃발 띠가 펼쳐짐 */
.factions { background: linear-gradient(var(--ink), var(--dusk) 30%, var(--dusk) 70%, var(--ink)); }
.fac-strip { display: flex; height: min(72vh, 640px); min-height: 460px; gap: 3px; padding: 0 clamp(0px, 2vw, 32px); }
.fac {
  position: relative; flex: 1 1 0; min-width: 0; overflow: hidden; text-align: left;
  background: linear-gradient(transparent 30%, rgb(18 11 20 / .96)), var(--img) center / cover;
  border-top: 3px solid var(--c); transition: flex-grow .7s var(--ease), filter .5s;
  filter: saturate(.55) brightness(.6);
}
.fac[aria-expanded=true] { flex-grow: 7; filter: none; }
.fac:hover { filter: saturate(.9) brightness(.85); }
.fac[aria-expanded=true]:hover { filter: none; }
.fac-tab {
  position: absolute; left: 50%; bottom: 26px; translate: -50% 0; writing-mode: vertical-rl; white-space: nowrap;
  font: 800 1.25rem/1 var(--display); letter-spacing: .14em; color: var(--c); text-shadow: 0 2px 10px #000; transition: opacity .3s;
}
.fac[aria-expanded=true] .fac-tab { opacity: 0; }
.fac-info { position: absolute; left: 0; bottom: 0; width: min(560px, 62vw); padding: clamp(20px, 3vw, 44px); display: grid; gap: 8px; opacity: 0; transform: translateY(16px); transition: opacity .3s, transform .5s var(--ease); pointer-events: none; }
.fac[aria-expanded=true] .fac-info { opacity: 1; transform: none; transition-delay: .25s; }
.fac-en { font: 700 .85rem/1 var(--caps); letter-spacing: .26em; color: var(--c); }
.fac-ko { font: 800 clamp(2.2rem, 4.4vw, 3.6rem)/1.1 var(--display); text-shadow: 0 4px 24px #000; }
.fac-line { font-size: 1.02rem; line-height: 1.7; text-shadow: 0 1px 10px #000; }
.fac-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.fac-meta b { font-weight: 500; font-size: .85rem; padding: 4px 12px; border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); background: rgb(18 11 20 / .6); }

/* 게임 */
.game { max-width: 1500px; margin: 0 auto; }
.feat { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(24px, 5vw, 72px); align-items: center; padding: 0 var(--pad); margin-bottom: clamp(56px, 9vw, 120px); }
.feat.flip .shot { order: 2; }
.feat p { margin-top: 1em; color: var(--bone); max-width: 30em; }
.shot { display: block; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 30px 60px -28px #000; cursor: zoom-in; }
.shot img { width: 100%; transition: transform .8s var(--ease); }
.shot:hover img { transform: scale(1.035); }
.also { list-style: none; padding: clamp(24px, 4vw, 44px) var(--pad); margin: 0 var(--pad); display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 4vw, 56px); border-block: 1px solid var(--line); color: var(--mute); font-size: .98rem; }
.also strong { display: block; font: 600 1.25rem/1.3 var(--display); color: var(--gold-hi); margin-bottom: 6px; }

/* 영상 */
.trailer { background: radial-gradient(ellipse 80% 60% at 50% 55%, #3a1418, var(--ink) 70%); }
.trailer-frame { max-width: 1180px; margin: 0 auto; padding: 0 var(--pad); }
.trailer-frame video { width: 100%; aspect-ratio: 16/9; background: #000; border: 1px solid var(--gold); box-shadow: 0 0 0 6px var(--ink), 0 0 0 7px var(--line), 0 50px 120px -30px rgb(200 60 30 / .55); }
video::cue { font-family: var(--display); background: rgb(18 11 20 / .7); color: var(--bone); }

/* 화면 */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 0 var(--pad); max-width: 1700px; margin: 0 auto; }
.grid .shot:nth-child(1), .grid .shot:nth-child(6) { grid-column: span 2; grid-row: span 2; }
.grid .shot img { height: 100%; object-fit: cover; }

.lightbox { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; width: 100vw; height: 100dvh; color: var(--bone); }
.lightbox[open] { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; animation: fade .3s; }
.lightbox::backdrop { background: rgb(10 6 12 / .94); }
@keyframes fade { from { opacity: 0; } }
.lightbox figure { grid-column: 2; text-align: center; }
.lightbox img { max-height: 84dvh; margin: 0 auto; border: 1px solid var(--line); }
.lightbox figcaption { margin-top: 14px; color: var(--mute); font-size: .95rem; }
.lb-nav, .lb-close { width: 48px; height: 48px; display: grid; place-items: center; justify-self: center; border: 1px solid var(--line); color: var(--gold-hi); transition: background .2s; }
.lb-nav:hover, .lb-close:hover { background: rgb(240 178 74 / .16); }
.lb-nav svg, .lb-close svg { width: 18px; }
.lb-close { position: absolute; top: 16px; right: 16px; }

/* 알림 신청 */
.notify { position: relative; isolation: isolate; text-align: center; padding-inline: var(--pad); }
.notify-bg { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; opacity: .5; mask-image: linear-gradient(transparent, #000 25%, #000 75%, transparent); }
.notify-body { max-width: 720px; margin: 0 auto; }
.notify h2 { font-size: clamp(1.8rem, 3.8vw, 2.9rem); text-shadow: 0 2px 24px #000; }
.notify-body > p { margin-top: 16px; text-shadow: 0 1px 12px #000; }
form { margin-top: 32px; }
.field { display: flex; gap: 10px; align-items: stretch; }
.field label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.field input { flex: 1; min-width: 0; font: inherit; color: var(--bone); caret-color: var(--gold); background: rgb(18 11 20 / .85); border: 1px solid var(--gold); padding: .8em 1.1em; border-radius: 0; }
.field input::placeholder { color: #a89382; }
.consent { display: inline-flex; gap: 10px; align-items: center; margin-top: 18px; font-size: .92rem; cursor: pointer; text-shadow: 0 1px 8px #000; }
.consent input { width: 18px; height: 18px; accent-color: var(--gold); }
details { margin-top: 8px; font-size: .85rem; color: var(--mute); }
summary { cursor: pointer; display: inline-block; text-decoration: underline; text-underline-offset: 4px; }
details p { margin-top: 10px; padding: 14px 18px; background: rgb(18 11 20 / .85); border: 1px solid var(--line); text-align: left; line-height: 1.7; }
.form-msg { min-height: 1.75em; margin-top: 14px; font-weight: 500; }
.form-msg[data-kind=ok] { color: #b6e39a; }
.form-msg[data-kind=err] { color: #ffab9a; }

/* 바닥 */
.foot { text-align: center; padding: 56px var(--pad) 48px; border-top: 1px solid var(--line); background: #0d080f; color: var(--mute); font-size: .9rem; }
.foot-crown { width: 34px; color: var(--gold); margin: 0 auto 14px; }
.foot-name { font: 700 .95rem/1 var(--caps); letter-spacing: .24em; color: var(--gold-hi); }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 26px; margin: 22px 0; }
.foot nav a:hover { color: var(--gold-hi); }
.foot-legal { max-width: 60em; margin: 0 auto; font-size: .8rem; line-height: 1.7; }

@media (max-width: 900px) {
  .nav nav { display: none; }
  .nav-brand, .btn { white-space: nowrap; }
  .nav .btn { margin-left: auto; }
  .world, .feat { grid-template-columns: 1fr; }
  .feat.flip .shot { order: 0; }
  .hero-sub br { display: none; }
  /* 좁은 화면: 깃발 띠를 세로로 쌓음 */
  .fac-strip { flex-direction: column; height: auto; min-height: 0; padding: 0; }
  .fac { flex: none; height: 62px; border-top: 0; border-left: 3px solid var(--c); transition: height .6s var(--ease), filter .5s; }
  .fac[aria-expanded=true] { height: 400px; }
  .fac-tab { writing-mode: horizontal-tb; left: 20px; bottom: auto; top: 50%; translate: 0 -50%; }
  .fac-info { width: 100%; }
  .also { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .lightbox[open] { grid-template-columns: 1fr 1fr; align-content: center; gap: 14px; }
  .lightbox figure { grid-column: 1 / -1; grid-row: 1; }
  .field { flex-direction: column; }
  .field .btn { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01s !important; }
}
