:root {
  color-scheme: dark;
  --void: #0b090f;
  --panel: #171120;
  --ivory: #f7f0e7;
  --accent: #d6b4f2;
  --rule: #382c42;
  --serif: "Noto Serif KR", "Batang", "AppleMyungjo", serif;
  --sans: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; background: var(--void); color: var(--ivory); font: 16px/1.6 var(--sans); }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
h1, h2 { margin: 0; }
.shell { width: min(1180px, calc(100% - 88px)); margin-inline: auto; }

.entrance {
  min-height: 100svh;
  display: grid;
  place-items: center;
  position: relative;
  isolation: isolate;
  overflow-x: clip;
  background: radial-gradient(ellipse at 50% 46%, #261730 0, #130e1c 40%, var(--void) 75%);
}
.portal { position: relative; display: grid; place-items: center; width: 100%; min-height: 100svh; overflow: hidden; padding: 72px 20px; }
.portal-arch {
  position: absolute;
  pointer-events: none;
  top: 50%; left: 50%; translate: -50% -50%;
  width: min(620px, 83vw);
  height: min(740px, 88svh);
  border: 1px solid #c6a1e84f;
  border-radius: 50% 50% 5px 5px / 39% 39% 5px 5px;
  box-shadow: 0 0 78px #a66cdd22, inset 0 0 64px #703dab16;
  animation: arch-breathe 5.5s ease-in-out infinite;
}
.portal-arch::before {
  content: "";
  position: absolute;
  inset: 11px;
  border: 1px solid #c6a1e822;
  border-radius: inherit;
}
.portal-arch::after {
  content: "";
  position: absolute;
  left: 50%; top: -4px;
  width: 7px; height: 7px;
  rotate: 45deg;
  background: #dcc0f5;
  box-shadow: 0 0 16px #d9b5fa;
}
.portal-link {
  position: relative;
  width: min(520px, 79vw);
  display: grid;
  justify-items: center;
  padding-block: 24px;
  text-align: center;
  animation: enter-frame 1s cubic-bezier(.16, 1, .3, 1) both;
}
.portal h1 { font-family: var(--serif); font-size: clamp(1.55rem, 5.2vw, 3.45rem); line-height: 1.24; letter-spacing: -.075em; font-weight: 900; text-shadow: 0 3px 22px #0b090f; }
.portal h1 span, .portal h1 em, .portal h1 strong { display: block; }
.portal h1 em { color: var(--accent); font-style: normal; }
.portal h1 strong { margin-top: .06em; font-size: 1.97em; line-height: 1.08; }
.enter {
  display: inline-grid; place-items: center;
  min-height: 48px; min-width: 130px;
  margin-top: clamp(28px, 7vh, 60px);
  border: 1px solid #cfb3e66b; border-radius: 30px;
  background: #160f1c; color: #f5e7ff;
  font-size: .9375rem; font-weight: 700; letter-spacing: .14em;
  transition: background .3s, color .3s, box-shadow .4s, transform .3s;
}
.portal-link:hover .enter, .portal-link:focus-visible .enter { background: #e3c6fa; color: #251431; box-shadow: 0 0 38px #ad72ed65; transform: translateY(-3px); }

.drift { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bubble-field { position: absolute; inset: 0; translate: var(--x, 0) var(--y, 0); transition: translate .55s ease-out; }
.bubble-lane { position: absolute; bottom: 0; left: var(--left); width: var(--size); height: var(--size); animation: float-up var(--duration) var(--delay) linear infinite; }
.bubble {
  width: 100%; height: 100%; border-radius: 50%; display: block;
  background: radial-gradient(ellipse at 26% 20%, #fff7 0, #e7d3fd2b 6%, transparent 28%), radial-gradient(circle at 62% 71%, #834ad71c 37%, #ad80eb3b 67%, #e3bbff51 84%, #9c71c03b 100%);
  border: 1px solid #c9a5fa69;
  box-shadow: inset 0 -3px 8px #bca5e04f, inset 4px 1px 9px #71469842, 0 0 13px #8555bf20;
  opacity: var(--opacity); animation: sway var(--sway) ease-in-out alternate infinite;
}
.interior { position: relative; isolation: isolate; background: radial-gradient(ellipse at 87% 4%, #24162e, var(--void) 57%); }
.interior .drift { opacity: .55; }
.site-header { position: sticky; top: 0; z-index: 2; background: #0d0a11df; backdrop-filter: blur(14px); border-bottom: 1px solid var(--rule); }
.site-header nav { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 68px; }
.site-header a { padding-block: 10px; color: #dbcedf; font-size: .9375rem; transition: color .25s; }
.site-header a:hover { color: #eac7ff; }
.nav-sections { display: flex; gap: clamp(22px, 5vw, 54px); }
.back { font-weight: 750; }
.inside { animation: enter-frame .9s cubic-bezier(.16, 1, .3, 1) both; }
.introduction { padding-block: clamp(64px, 10vw, 130px) clamp(66px, 8vw, 100px); }
.intro-heading h1, .characters h2 { font: 900 clamp(2.25rem, 6vw, 4.8rem)/1.13 var(--serif); letter-spacing: -.075em; }
.intro-heading { margin-bottom: 30px; }
.image-slot { min-width: 0; position: relative; overflow: hidden; border: 1px solid var(--rule); background: linear-gradient(150deg, #24182f9c, #100c19c2 70%); }
.image-slot::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .65; background: linear-gradient(118deg, transparent 25%, #a775d316 48%, transparent 67%); transform: translateX(-110%); animation: sweep 10s 1s ease-in-out infinite; }
.cover-slot { aspect-ratio: 2.55; min-height: 210px; }
.intro-copy:empty { display: none; }
.characters { padding-block: clamp(54px, 8vw, 94px) clamp(86px, 11vw, 144px); border-top: 1px solid var(--rule); }
.cast-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 2vw, 24px); margin-top: 34px; }
.character { --lag: 0ms; transition: opacity .66s var(--lag), transform .8s var(--lag); }
.character:nth-child(2) { --lag: 85ms; }.character:nth-child(3) { --lag: 170ms; }.character:nth-child(4) { --lag: 255ms; }
.portrait { aspect-ratio: 3 / 4; border-radius: 90px 90px 3px 3px / 52px 52px 3px 3px; }
.profile { min-height: 56px; border-bottom: 1px solid var(--rule); }
.reveal-pending { opacity: 0; transform: translateY(26px); }
[data-reveal] { transition: opacity .66s var(--lag,0ms), transform .8s var(--lag,0ms); }
.transition { position: fixed; inset: 0; z-index: 4; pointer-events: none; background: radial-gradient(ellipse at center, #352047, var(--void) 72%); opacity: 0; transition: opacity .36s ease; }
.leaving .transition { opacity: 1; }
.leaving .portal-link { animation: leave-frame .36s ease both; }

@keyframes enter-frame { from { opacity: 0; transform: translateY(17px); } to { opacity: 1; transform: translateY(0); } }
@keyframes leave-frame { to { opacity: 0; transform: scale(1.035); } }
@keyframes arch-breathe { 50% { box-shadow: 0 0 112px #a66cdd37, inset 0 0 81px #703dab2b; } }
@keyframes float-up { from { transform: translateY(30vh); } to { transform: translateY(-125vh); } }
@keyframes sway { from { transform: translateX(calc(-1 * var(--wander))) scale(.92); } to { transform: translateX(var(--wander)) scale(1.04); } }
@keyframes sweep { 0%, 16% { transform: translateX(-115%); } 45%, 100% { transform: translateX(115%); } }

@media (max-width: 700px) {
  .shell { width: calc(100% - 36px); }
  .portal-arch { height: min(650px, 81svh); }
  .cast-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portrait { border-radius: 62px 62px 3px 3px / 38px 38px 3px 3px; }
}
@media (hover: none) { .bubble-field { translate: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .drift { display: none; }
  .reveal-pending { opacity: 1; transform: none; }
}

[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
h3, p { margin: 0; }
.portal { isolation: isolate; }
.portal::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background: linear-gradient(0deg,#0c0816f5 1%,#140c2191 55%,#140a19a8),url("assets/zones/seoul.webp") center 57% / cover;
  opacity: .8;
}
.entrance .drift { z-index: 1; }
.portal-arch { background: linear-gradient(180deg,#1e162b22,#110c1a92); }
.portal h1 img { width: 100%; height: auto; max-height: 56svh; object-fit: contain; filter: drop-shadow(0 8px 19px #0a070f); }
.enter { margin-top: clamp(20px,4.5vh,52px); }
.enter:hover, .enter:focus-visible { background: #e3c6fa; color: #251431; box-shadow: 0 0 38px #ad72ed65; transform: translateY(-3px); }
#interior { position: relative; animation: enter-frame .55s cubic-bezier(.16,1,.3,1) both; }
.nav-sections { align-items: center; gap: clamp(10px,3.2vw,42px); }
#sound { padding: 4px 10px; font-size: .8125rem; font-weight: 750; letter-spacing: .08em; border: 1px solid #856e96; border-radius: 24px; background: transparent; color: #c9b7d2; }
#sound[aria-pressed=true] { background: #d6b4f2; color: #201429; }
.intro-hero {
  min-height: min(720px, calc(100svh - 68px)); display: grid; align-items: end;
  background: linear-gradient(90deg,#100a17f0 0%,#100a17bd 45%,#100a1710 84%),linear-gradient(0deg,#0b090f 0%,transparent 65%),url("assets/zones/sea.webp") center 52% / cover;
  padding-block: clamp(100px,15vh,170px) clamp(66px,10vh,110px);
}
.intro-story h2, .floor-heading h2, .section-heading h2 { font: 900 clamp(2.5rem,6vw,5rem)/1.14 var(--serif); letter-spacing: -.075em; }
.intro-story p { max-width: 35rem; font-size: clamp(1rem,1.65vw,1.16rem); line-height: 1.78; margin-top: 1.14em; word-break: keep-all; color: #e2d8e6; }
.intro-story .intro-last { font-weight: 750; color: #fff5eb; }
.button { display: inline-flex; align-items:center; justify-content:center; min-height: 46px; padding: .65rem 1.35rem; margin-top: 1.65rem; font-weight: 750; border: 1px solid #dec5ed; background: #ecdcf3; color: #24122a; transition: background .2s, transform .25s; }
.button:hover { background: #fff4fd; transform: translateY(-2px); }
.quiet-button { border: 1px solid var(--rule); padding: .5rem 1rem; background: #171120; }
.story { padding-block: 62px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 2rem; }
.story-pages { background: #030305; width: min(100%,800px); margin-inline: auto; }
.story-pages img { display: block; width: 100%; height: auto; }
.story-bottom { display: block; margin: 2rem auto 0; }

.characters { padding-block: clamp(68px,8vw,110px); }
.cast-groups { display: flex; flex-wrap: wrap; gap: .52rem; margin-top: 1.8rem; }
.cast-groups button { padding: .5rem .86rem; background: #181122; border: 1px solid var(--rule); border-radius: 30px; color: #d7cae0; transition: color .2s, background .25s, border-color .25s; }
.cast-groups button:hover { border-color: #cfafe6; }
.cast-groups button[aria-pressed=true] { color: #1c1025; background: #e6cfef; border-color: #e6cfef; }
.cast-grid { grid-template-columns: repeat(3,minmax(0,1fr)); align-items: stretch; margin-top: 24px; }
.character { background: #15101c; border: 1px solid var(--rule); overflow: hidden; }
.character img { display: block; width: 100%; height: auto; transition: transform .6s cubic-bezier(.16,1,.3,1); }
.character:hover img { transform: scale(1.035); }
.character .profile { min-height: 0; padding: 1rem 1.05rem 1.15rem; border: 0; line-height: 1.65; color: #dcd2e0; font-size: 1rem; word-break: keep-all; }

.floor-heading { padding-block: 54px 30px; }
.floor-heading h2 { font-size: clamp(2.5rem,5vw,4.2rem); }
.floor {
  min-height: calc(100svh - 68px);
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: end;
  overflow: hidden;
  padding-block: 8rem clamp(46px,10vh,116px);
  background: #10101b;
  border-top: 1px solid #8e79a449;
}
.floor-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 50%; z-index: -2; }
.floor::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg,#0a0812fa 0%,#0b0814b0 24%,#0b08141a 67%),linear-gradient(90deg,#0b08147c,transparent 70%); }
.floor-copy { text-shadow: 0 3px 18px #06050a; }
.floor-copy h3 { font: 900 clamp(2.75rem,8vw,7.5rem)/1.09 var(--serif); letter-spacing: -.075em; word-break: keep-all; }
.floor-range { font-size: 1rem; font-weight: 750; color: #e2bee9; letter-spacing: .12em; margin-bottom: .68em; }
.floor-description { max-width: 32em; margin-top: 1.1rem; font-size: clamp(1rem,1.8vw,1.22rem); line-height: 1.7; color: #f7edf7; word-break: keep-all; }
.floor--sea .floor-art { object-position: center 58%; }
.floor--caldera .floor-art { object-position: center 65%; }
.gate { display: grid; place-items: center; min-height: calc(100svh - 68px); text-align: center; background: repeating-linear-gradient(135deg,#4c24372b 0 20px,transparent 20px 40px),radial-gradient(ellipse at center,#331520,#110b11 68%); border-block: 1px solid #92556890; }
.gate-copy { padding-block: 50px; }
.gate h3 { font: 900 clamp(2.2rem,7vw,5rem)/1.2 var(--serif); letter-spacing: -.065em; margin-bottom: .5em; color: #ffe7ea; }
.gate p { color: #f1b6c0; }
.gate .button { background: #f7dbe0; border-color: #f7dbe0; }
.site-footer { padding-block: 2.1rem; text-align: right; color: #dac9e5; }

@media (max-width: 700px) {
  .portal::before { background-position: 52% center; }
  .intro-hero { background-image: linear-gradient(0deg,#0b090f 0%,#110a19e8 32%,#110a1940 84%),url("assets/zones/sea.webp"); }
  .cast-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .character .profile { font-size: .9375rem; padding: .7rem .78rem .89rem; }
}
@media (max-width: 390px) {
  .site-header nav { gap: 8px; }
  .nav-sections { gap: 10px; }
  .site-header a { font-size: .8125rem; white-space: nowrap; }
  #sound { padding-inline: 7px; }
}

/* Covers, portraits and the pinned tower sequence */
.intro-hero { min-height: calc(100svh - 68px); align-items: center; padding-block: clamp(58px,9vh,108px); }
.intro-story h2 { width: min(100%,460px); margin-left: clamp(-13px,-1vw,0px); }
.intro-story h2 img { display: block; width: 100%; height: auto; }
.intro-story p { max-width: 31rem; }
.intro-story .button { border-radius: 40px; }
.characters { position: relative; }
.characters::before { content: ""; position: absolute; inset: 1rem 10% auto; height: 70%; pointer-events: none; z-index: -1; background: radial-gradient(ellipse at 50% 42%,#39224663,transparent 69%); }
.cast-groups { gap: .45rem 1.35rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--rule); }
.cast-groups button { padding: .35rem 0; background: transparent; border: 0; border-radius: 0; position: relative; }
.cast-groups button[aria-pressed=true] { color: #f6e3ff; background: transparent; }
.cast-groups button[aria-pressed=true]::after { content: ""; position: absolute; left: 0; right: 0; height: 1px; bottom: -.25rem; background: #dfb7ee; }
.cast-grid { gap: clamp(12px,2.6vw,30px); margin-top: clamp(22px,4vw,46px); }
.character { padding: 0; border: 0; border-radius: 34px 6px 34px 6px; overflow: hidden; background: #211529; line-height: 0; }
.character img { aspect-ratio: 1216 / 832; object-fit: cover; }
.character:focus-visible { outline-offset: 4px; }
.character:hover img, .character:focus-visible img { filter: brightness(1.13); }

.character-detail {
  width: min(1100px,calc(100% - 50px));
  max-height: calc(100dvh - 52px);
  position: fixed;
  color: var(--ivory);
  background: radial-gradient(ellipse at 5% 0%,#3a2346,#19101f 62%);
  border: 1px solid #735b807d;
  border-radius: 48px 12px 48px 12px;
  padding: clamp(26px,4vw,56px);
  overscroll-behavior: contain;
}
.character-detail[open] { animation: enter-frame .35s cubic-bezier(.16,1,.3,1) both; }
.character-detail::backdrop { background: #08050cce; backdrop-filter: blur(9px); }
body:has(.character-detail[open]) { overflow: hidden; }
.detail-close { position: absolute; right: 16px; top: 12px; z-index: 1; }
.detail-close button { width: 44px; height: 44px; background: #201427; border: 1px solid #a888ad90; border-radius: 50%; font-size: 1.6rem; line-height: 1; }
.detail-layout { display: grid; align-items: start; grid-template-columns: 1.14fr 1fr; gap: clamp(23px,4vw,58px); }
.detail-portrait { margin: 0; min-width: 0; }
.detail-portrait img { display: block; width: 100%; height: auto; border-radius: 28px 4px 28px 4px; background: #160e1b; }
.detail-moods { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 15px; }
.detail-moods button { background: transparent; border: 1px solid #8a719579; color: #e0d0e5; border-radius: 20px; padding: .28rem .64rem; font-size: .875rem; }
.detail-moods button[aria-pressed=true] { background: #e9c9f2; border-color: #e9c9f2; color: #211527; font-weight: 750; }
.detail-copy #detail-group { color: var(--accent); font-weight: 700; margin-bottom: .4rem; }
.detail-copy h2 { font: 900 clamp(2.5rem,5vw,4.5rem)/1.12 var(--serif); letter-spacing: -.07em; }
.detail-fields { display: grid; grid-template-columns: 1.4fr .8fr .8fr; gap: .8rem; border-block: 1px solid #805f8d57; padding-block: .8rem; margin: 1.1rem 0; }
.detail-fields dt { color: #ccadc9; font-size: .875rem; }
.detail-fields dd { margin: 0; font-weight: 750; word-break: keep-all; }
#detail-bio { color: #eee1ed; margin-bottom: 1.1rem; word-break: keep-all; }
#detail-skills { padding-left: 1.1rem; margin: .45rem 0 0; word-break: keep-all; color: #dfcbe2; }
#detail-skills li { margin: .3rem 0; }

.floor-track { height: var(--track, calc(100svh - 68px)); }
.floor-stage { height: calc(100svh - 68px); min-height: 300px; position: sticky; top: 68px; overflow: hidden; isolation: isolate; background: #100a15; }
.floor-scenes, .floor-scene { position: absolute; inset: 0; }
.floor-scene { display: grid; align-items: end; padding-bottom: clamp(55px,10vh,115px); isolation: isolate; opacity: 0; transition: opacity .7s ease; }
.floor-scene.is-current { opacity: 1; z-index: 1; }
.floor-scene .floor-art { z-index: -2; transform: scale(1.07); transition: transform 1.65s cubic-bezier(.16,1,.3,1); }
.floor-scene.is-current .floor-art { transform: scale(1); }
.floor-scene::before { position: absolute; content: ""; inset: 0; z-index: -1; background: linear-gradient(0deg,#0a0812fa 0%,#0b0814ad 23%,transparent 66%),linear-gradient(180deg,#0b08147c,transparent 35%); }
.floor-scene .floor-copy { opacity: 0; transform: translateY(19px); transition: opacity .28s,transform .55s ease; }
.floor-scene.is-current .floor-copy { opacity: 1; transform: none; transition-delay: .22s; }
.floor-overlay { position: absolute; inset: clamp(18px,4.7vh,56px) max(18px,calc((100% - 1180px)/2)) auto; z-index: 3; pointer-events: none; }
.floor-overlay h2 { margin-bottom: .58rem; color: #f5e4fa; font-size: clamp(.9rem,1.6vw,1.15rem); text-shadow: 0 2px 8px #0b090f; }
.floor-meter { position: relative; width: clamp(70px,12vw,136px); height: 2px; background: #f4d8f954; overflow: hidden; }
.floor-meter::after { content: ""; display: block; height: 100%; width: var(--progress,12.5%); background: #f5cefe; transition: width .42s ease; }
.floor-warning { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 50px 20px 25px; text-align: center; background: radial-gradient(ellipse at center,#351723,#160a14 66%); color: #efc5cf; }
.floor-warning:is(.is-current) div { animation: enter-frame .62s ease-out both; }
.floor-warning h3 { font: 900 clamp(2.1rem,6.8vw,5.3rem)/1.17 var(--serif); color: #ffebe8; letter-spacing: -.065em; margin-bottom: .55em; }


@media (max-width: 700px) {
  .intro-story h2 { width: min(92%,450px); }
  .detail-layout { grid-template-columns: 1fr; gap: 22px; }
  .character-detail { width: calc(100% - 24px); max-height: calc(100dvh - 24px); border-radius: 27px 8px 27px 8px; padding: 50px 17px 24px; }
  .cast-groups { gap: .3rem 1rem; }
  .character { border-radius: 20px 4px 20px 4px; }
}

@media (any-pointer: fine) {
  html, html *, html *::before, html *::after {
    cursor: url("assets/cursor.png") 5 4, none !important;
  }
  :is(a, button, summary):hover, :is(a, button, summary):hover * {
    cursor: url("assets/cursor-active.png") 5 4, none !important;
  }
}
