@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fragment Mono";
  src: url("/fonts/fragment-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --sans: "Archivo", "Pretendard Variable", Pretendard, "Apple SD Gothic Neo",
    "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --mono: "Fragment Mono", ui-monospace, "SF Mono", Menlo, "Apple SD Gothic Neo",
    monospace;
  --pad: clamp(18px, 4vw, 64px);
  --bg: #16142b;
  --ink: #ebe7ff;
  --acc: #8f7dff;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}
body[data-room="sel"] {
  --bg: #0b0b0b;
  --ink: #f5f3ee;
  --acc: #ffd60a;
}
body[data-room="mer"] {
  --bg: #0a2f5c;
  --ink: #e8f3fa;
  --acc: #9ad6ff;
}
body[data-room="rho"] {
  --bg: #e2401c;
  --ink: #fff1e4;
  --acc: #1c0d07;
}
body[data-room="ilo"] {
  --bg: #d6f04a;
  --ink: #14150f;
  --acc: #14150f;
}
body[data-room="note"] {
  --bg: #121212;
  --ink: #efece4;
  --acc: #9d93ff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 0;
}
body {
  --soft: color-mix(in srgb, var(--ink) 64%, transparent);
  --line: color-mix(in srgb, var(--ink) 24%, transparent);
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  touch-action: manipulation;
  transition:
    background-color 0.9s var(--ease),
    color 0.9s var(--ease);
}
h1,
h2,
h3,
p,
dl,
dd,
figure {
  margin: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
img,
svg,
canvas {
  display: block;
  max-width: 100%;
}
[data-ko] {
  white-space: pre-line;
}
:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 4px;
  border-radius: 2px;
}
::selection {
  background: var(--ink);
  color: var(--bg);
}
.mono {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.4;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 50;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  font-size: 13px;
  transform: translateY(-200%);
}
.skip:focus {
  transform: none;
}

/* ───── top bar ───── */
.bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 14px var(--pad);
  pointer-events: none;
}
.bar > * {
  pointer-events: auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  justify-self: start;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
}
.brand img {
  border-radius: 7px;
}
.brand i,
.foot-mark i,
.note-title i {
  font-style: normal;
  color: var(--acc);
  transition: color 0.9s var(--ease);
}
.bar-room {
  display: flex;
  gap: 10px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition:
    background-color 0.9s var(--ease),
    border-color 0.9s var(--ease);
}
.bar-room span:first-child {
  color: var(--soft);
}
.lang {
  justify-self: end;
  width: 40px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition:
    background-color 0.3s,
    color 0.3s,
    border-color 0.9s var(--ease);
}
.lang:hover {
  background: var(--ink);
  color: var(--bg);
}

/* ───── side rail ───── */
.rail {
  position: fixed;
  right: calc(var(--pad) - 6px);
  top: 50%;
  z-index: 19;
  display: none;
  flex-direction: column;
  gap: 2px;
  transform: translateY(-50%);
}
.rail a {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  color: var(--soft);
  transition: color 0.3s;
}
.rail b {
  font-weight: 400;
}
.rail b::after {
  content: "";
  display: inline-block;
  width: 10px;
  height: 1px;
  margin-left: 8px;
  vertical-align: middle;
  background: currentColor;
  transition: width 0.4s var(--ease);
}
.rail span {
  opacity: 0;
  transform: translateX(6px);
  transition:
    opacity 0.3s,
    transform 0.3s var(--ease);
  white-space: nowrap;
}
.rail a:hover,
.rail a[aria-current] {
  color: var(--ink);
}
.rail a:hover span {
  opacity: 1;
  transform: none;
}
.rail a[aria-current] b::after {
  width: 26px;
}
@media (min-width: 1100px) and (hover: hover) {
  .rail {
    display: flex;
  }
  main > .room {
    padding-right: calc(var(--pad) + 52px);
  }
}
.keep {
  text-transform: none;
}

/* ───── rooms ───── */
.room {
  position: relative;
  min-height: 100svh;
  padding: clamp(84px, 13vh, 132px) var(--pad) clamp(64px, 11vh, 120px);
}
.strip {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  transition: border-color 0.9s var(--ease);
}
.strip > :last-child {
  justify-self: end;
  text-align: right;
}
.strip-mid {
  color: var(--soft);
}
@media (max-width: 599px) {
  .strip {
    grid-template-columns: 1fr auto;
  }
  .strip-mid {
    display: none;
  }
}
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  border: 1px solid currentColor;
  vertical-align: 0;
}
.dot.live {
  background: currentColor;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}

.title {
  margin: clamp(10px, 2.5vh, 28px) 0 clamp(18px, 4vh, 44px) -0.045em;
  font-size: clamp(4.6rem, 23.5vw, 24rem);
  font-weight: 700;
  font-stretch: 125%;
  line-height: 0.8;
  letter-spacing: -0.045em;
  white-space: nowrap;
  width: fit-content;
}
.title span {
  color: transparent;
  -webkit-text-stroke: 0.012em var(--ink);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.hang {
  display: grid;
  gap: clamp(22px, 4vw, 56px);
}
.art {
  position: relative;
  min-width: 0;
}
.art canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  border-radius: 4px;
  touch-action: pan-y;
  cursor: crosshair;
}
.art.open canvas {
  border: 1px solid var(--line);
  transition: border-color 0.9s var(--ease);
}
.art-cap {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  color: var(--soft);
}

.placard {
  align-self: end;
  max-width: 420px;
  padding-top: 14px;
  border-top: 2px solid var(--ink);
  transition: border-color 0.9s var(--ease);
}
.placard-fig {
  color: var(--soft);
}
.placard h3 {
  margin-top: 16px;
  font-size: 30px;
  font-weight: 700;
  font-stretch: 112%;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.placard-sub {
  margin-top: 6px;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.4;
  word-break: keep-all;
}
.placard-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  margin-top: 16px;
  color: var(--soft);
}
.placard-meta span + span::before {
  content: "·";
  margin: 0 8px;
}
.placard-body {
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.7;
  color: color-mix(in srgb, var(--ink) 84%, transparent);
  word-break: keep-all;
  text-wrap: pretty;
}
.enter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.enter {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  padding: 13px 20px 13px 22px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 15px;
  font-weight: 600;
  transition:
    background-color 0.3s,
    color 0.3s,
    border-color 0.3s,
    gap 0.3s var(--ease);
}
.enter:hover {
  gap: 22px;
  background: var(--acc);
  border-color: var(--acc);
  color: var(--bg);
}
body[data-room="ilo"] .enter:hover {
  background: transparent;
  color: var(--ink);
}
.enter.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.enter.ghost:hover {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

@media (min-width: 900px) {
  .hang {
    grid-template-columns: minmax(0, 8fr) minmax(260px, 3.4fr);
    align-items: end;
  }
  .flip .hang {
    grid-template-columns: minmax(260px, 3.4fr) minmax(0, 8fr);
  }
  .flip .art {
    order: 2;
  }
  .flip .title {
    margin-left: auto;
    margin-right: 0;
  }
  .art canvas {
    aspect-ratio: 16 / 9.6;
  }
}

/* ───── lobby ───── */
.lobby {
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}
.wordmark {
  display: flex;
  align-items: baseline;
  margin: clamp(8px, 3vh, 36px) 0 clamp(18px, 4vh, 40px) -0.04em;
  font-size: 25vw;
  font-weight: 800;
  line-height: 0.82;
  letter-spacing: -0.05em;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}
.wordmark span {
  display: inline-block;
  font-variation-settings:
    "wght" 800,
    "wdth" 100;
  will-change: font-variation-settings;
}
.wordmark .period {
  color: var(--acc);
}
.lobby-grid {
  display: grid;
  gap: 36px;
  margin-top: auto;
}
.lede {
  font-size: clamp(1.7rem, 3.3vw, 3rem);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.03em;
  word-break: keep-all;
}
.lede-sub {
  max-width: 34em;
  margin-top: 16px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--soft);
  word-break: keep-all;
}
.go {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
  padding: 14px 18px 14px 24px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  font-size: 15px;
  transition: background-color 0.3s;
}
.go:hover {
  background: var(--acc);
}
.go-arrow {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  animation: nudge 1.8s var(--ease) infinite;
}
@keyframes nudge {
  50% {
    transform: translateY(3px);
  }
}
.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: end;
  gap: 0 20px;
}
.facts div {
  padding: 10px 0 14px;
  border-top: 1px solid var(--line);
}
.facts dt {
  color: var(--soft);
}
.facts dd {
  margin-top: 6px;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.plan {
  align-self: end;
}
.plan svg {
  width: 100%;
  height: auto;
  overflow: visible;
}
.plan-room rect {
  fill: transparent;
  transition: fill 0.3s;
}
.plan-room:hover rect:first-of-type,
.plan-room:focus-visible rect:first-of-type {
  fill: var(--acc);
}
.plan-room:hover text,
.plan-room:focus-visible text {
  fill: var(--bg);
}
.plan-room .plan-fill {
  pointer-events: none;
}
.plan-hatch {
  stroke: var(--ink);
  stroke-width: 1;
  opacity: 0.22;
}
.plan-walls path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.5;
  stroke-linecap: square;
}
.plan text {
  font-family: var(--mono);
  fill: var(--ink);
  transition: fill 0.3s;
}
.plan-no {
  font-size: 10px;
  opacity: 0.6;
}
.plan-name {
  font-family: var(--sans);
  font-size: 19px;
  font-weight: 700;
  font-stretch: 118%;
  letter-spacing: -0.02em;
}
.plan-route {
  fill: none;
  stroke: var(--acc);
  stroke-width: 1.5;
  stroke-dasharray: 3 6;
  pointer-events: none;
  animation: walk 1.4s linear infinite;
}
@keyframes walk {
  to {
    stroke-dashoffset: -18;
  }
}
.plan-arrow {
  fill: none;
  stroke: var(--acc);
  stroke-width: 1.5;
  pointer-events: none;
}
.plan-you {
  fill: var(--acc);
  pointer-events: none;
  animation: pulse 2.4s ease-in-out infinite;
}
.plan figcaption {
  display: flex;
  justify-content: space-between;
  padding-top: 10px;
  color: var(--soft);
}
@media (min-width: 900px) {
  .lobby-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 4.4fr);
    gap: clamp(24px, 4vw, 64px);
    align-items: end;
  }
  .facts {
    grid-template-columns: 1fr;
  }
}

/* ───── 01 SEL — split-flap board ───── */
.board {
  container-type: inline-size;
  padding: clamp(12px, 2.2vw, 28px);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #121212;
  color: #f5f3ee;
}
.board-head,
.board-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.board-head {
  padding-bottom: 12px;
  color: #ffd60a;
}
.board-head span:nth-child(2) {
  color: #8d8b86;
}
.board-rows {
  display: grid;
  gap: max(3px, 0.7cqw);
  font-size: 3.3cqw;
  letter-spacing: 0;
  line-height: 1;
}
.flap-row {
  display: flex;
  gap: 1.6cqw;
}
.flap-group {
  display: flex;
  gap: 0.28cqw;
}
.flap {
  position: relative;
  display: grid;
  place-items: center;
  width: 3.02cqw;
  height: 4.9cqw;
  border-radius: 0.3cqw;
  background: #232323;
  color: #f5f3ee;
  overflow: hidden;
}
.flap::after {
  content: "";
  position: absolute;
  inset: 50% 0 auto 0;
  height: 1px;
  background: #0b0b0b;
}
.flap.a {
  animation: flap-a 0.09s linear;
}
.flap.b {
  animation: flap-b 0.09s linear;
}
@keyframes flap-a {
  from {
    transform: scaleY(0.4);
    filter: brightness(1.6);
  }
}
@keyframes flap-b {
  from {
    transform: scaleY(0.4);
    filter: brightness(1.6);
  }
}
.flap-row.gold .flap {
  color: #ffd60a;
  background: #2b2508;
}
.flap-row.you .g-remark .flap {
  color: #ffd60a;
}
.board-foot {
  padding-top: 14px;
  color: #8d8b86;
}
.board-foot [data-msg].gold {
  color: #ffd60a;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid #4a4a48;
  border-radius: 999px;
  color: #f5f3ee;
  white-space: nowrap;
  transition:
    background-color 0.25s,
    color 0.25s;
}
.chip:hover {
  background: #f5f3ee;
  color: #0b0b0b;
}
@media (max-width: 640px) {
  .g-flight {
    display: none;
  }
  .board-rows {
    font-size: 4.1cqw;
  }
  .flap {
    width: 3.66cqw;
    height: 6.2cqw;
  }
  .flap-row {
    gap: 2cqw;
  }
  .flap-group {
    gap: 0.36cqw;
  }
  .board-head span:nth-child(2) {
    display: none;
  }
}

/* ───── 05 note ───── */
.note-grid {
  display: grid;
  gap: 40px;
  margin-top: clamp(28px, 7vh, 84px);
}
.note-title {
  font-size: clamp(3.6rem, 10.5vw, 11rem);
  font-weight: 700;
  font-stretch: 125%;
  line-height: 0.88;
  letter-spacing: -0.045em;
}
.note-copy p {
  max-width: 34em;
  margin-top: 16px;
  font-size: 16px;
  line-height: 1.75;
  color: color-mix(in srgb, var(--ink) 78%, transparent);
  word-break: keep-all;
}
.note-copy .note-lead {
  margin-top: 0;
  margin-bottom: 26px;
  font-size: clamp(1.6rem, 2.6vw, 2.3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--ink);
}
.contact {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.contact h3 {
  font-weight: 400;
  color: var(--soft);
}
.contact-mail {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25em;
  margin: 14px 0 12px;
  font-size: clamp(1.5rem, 4.6vw, 4.2rem);
  font-weight: 600;
  font-stretch: 112%;
  letter-spacing: -0.035em;
  line-height: 1.1;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px
    no-repeat;
  transition: background-size 0.5s var(--ease);
}
.contact-mail:hover {
  background-size: 100% 2px;
}
.contact-mail span {
  font-size: 0.5em;
  color: var(--acc);
}
.facts-link {
  border-bottom: 1px solid var(--line);
  transition:
    color 0.3s,
    border-color 0.3s;
}
.facts-link:hover {
  color: var(--acc);
  border-color: var(--acc);
}
.contact-note {
  max-width: 34em;
  margin-bottom: 14px;
  font-size: 16px;
  line-height: 1.7;
  color: color-mix(in srgb, var(--ink) 78%, transparent);
  word-break: keep-all;
}
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
}
.contact-link {
  display: block;
  width: fit-content;
  padding: 6px 0;
  color: var(--soft);
  transition: color 0.3s;
}
.contact-link:hover {
  color: var(--ink);
}
@media (min-width: 900px) {
  .note-grid {
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    gap: 48px clamp(32px, 6vw, 96px);
  }
  .contact {
    grid-column: 1 / -1;
  }
}

/* ───── footer ───── */
.foot {
  padding: 0 var(--pad) 22px;
  background: #121212;
  color: #efece4;
  overflow: hidden;
}
.foot-mark {
  display: block;
  width: fit-content;
  margin: 0 0 0 -0.05em;
  font-size: 27.5vw;
  font-weight: 800;
  font-stretch: 100%;
  line-height: 0.86;
  letter-spacing: -0.06em;
  white-space: nowrap;
}
.foot-mark i {
  color: #9d93ff;
}
.foot-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgb(239 236 228 / 0.22);
  color: rgb(239 236 228 / 0.62);
}
.foot-row a:hover {
  color: #efece4;
}

/* ───── reveal ───── */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.9s var(--ease),
    transform 0.9s var(--ease);
}
.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* ───── standalone rooms (/rho/, /ilo/) ───── */
.solo {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100svh;
  padding: 18px var(--pad) 22px;
}
.solo .strip {
  border-top: 0;
  padding-top: 0;
  align-items: center;
}
.solo-stage {
  position: relative;
  display: grid;
  min-height: 0;
  margin: 14px 0;
}
.solo-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  touch-action: none;
  cursor: crosshair;
}
.solo-foot {
  display: grid;
  gap: 18px;
  align-items: end;
}
.solo-title {
  margin: 0 0 0 -0.045em;
  width: fit-content;
  font-size: clamp(3.4rem, 15vw, 13rem);
  font-weight: 700;
  font-stretch: 125%;
  line-height: 0.8;
  letter-spacing: -0.045em;
  white-space: nowrap;
}
.solo-title span {
  color: transparent;
  -webkit-text-stroke: 0.012em var(--ink);
  font-weight: 500;
}
.solo-side p {
  max-width: 30em;
  font-size: 15px;
  line-height: 1.65;
  word-break: keep-all;
}
.solo-side .enter {
  margin-top: 16px;
}
.solo-side .mono {
  margin-bottom: 10px;
  color: var(--soft);
}
@media (min-width: 900px) {
  .solo-foot {
    grid-template-columns: 1fr auto;
  }
  .solo-side {
    text-align: right;
  }
  .solo-side .enter-row {
    justify-content: flex-end;
  }
}
.poster .strip,
.poster .solo-side,
.poster .lang {
  visibility: hidden;
}

/* ───── 404 ───── */
.lost {
  display: grid;
  align-content: center;
  gap: 18px;
  min-height: 100svh;
  padding: var(--pad);
}
.lost h1 {
  font-size: clamp(6rem, 34vw, 30rem);
  font-weight: 800;
  font-stretch: 125%;
  line-height: 0.8;
  letter-spacing: -0.05em;
  margin-left: -0.04em;
}
.lost h1 i {
  font-style: normal;
  color: var(--acc);
}
.lost p {
  font-size: 18px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
