html.is-gated,
html.is-gated body,
html.is-entering,
html.is-entering body {
  overflow: hidden;
  height: 100%;
}

html.is-gated .toc,
html.is-gated .wrap,
html.is-gated .galaxy-layer {
  display: none !important;
}

html.is-entering .toc,
html.is-entering .hint {
  opacity: 0;
  pointer-events: none;
}

html.is-entering .logo {
  opacity: 0;
  transform: scale(0.42);
  transform-origin: center center;
  animation: none !important;
  transition: opacity 0.95s cubic-bezier(0.22, 1, 0.36, 1), transform 0.95s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

html.is-entering .logo.is-in {
  opacity: 1;
  transform: scale(1);
}

html.is-entered .toc,
html.is-entered .hint {
  animation: ui-in 0.5s ease forwards !important;
}

html.is-entered .hint i {
  animation: drip 2.2s ease-in-out infinite !important;
}

html:not(.is-gated) .gate {
  display: none;
}

.gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 0;
  background: color-mix(in srgb, #070605 58%, transparent);
  overscroll-behavior: none;
  opacity: 1;
  transition: opacity 0.55s ease !important;
}

.gate.is-out {
  opacity: 0;
  pointer-events: none;
}

.gate-letter {
  position: relative;
  z-index: 1;
  display: block;
  width: min(612px, 94vw, calc(92svh * 0.7));
  margin: 0;
  opacity: 0;
  transform: translateY(-28px);
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 0.55s ease-out, transform 0.55s ease-out !important;
}

.gate-letter.is-in {
  opacity: 1;
  transform: none;
}

.gate-letter > img {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 22px 48px #000c);
}

.gate-sign {
  position: absolute;
  z-index: 2;
  left: 7.6%;
  top: 77.6%;
  width: 85.1%;
  height: 16.9%;
  overflow: visible;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #cfece0;
  font-family: Pretendard, "Noto Sans KR", sans-serif;
  font-size: clamp(1.56rem, 3.4vw, 2rem);
  letter-spacing: 0.06em;
  cursor: crosshair;
  touch-action: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease !important;
}

.gate-sign.is-ready {
  opacity: 1;
  pointer-events: auto;
}

.gate-sign canvas {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.gate-sign-hint {
  position: relative;
  z-index: 1;
  margin: 0;
  pointer-events: none;
  opacity: 0;
}

.gate-sign.is-ready .gate-sign-hint {
  animation: gate-hint-pulse 1.8s ease-in-out infinite !important;
}

.gate-sign.is-ink .gate-sign-hint {
  display: none;
}

html.is-sign-edit .gate-letter,
html.is-sign-edit .gate-letter.is-in {
  opacity: 1;
  transform: none;
  transition: none;
}

html.is-sign-edit .gate-sign {
  overflow: visible;
  opacity: 1;
  pointer-events: auto;
  cursor: move;
  border: 2px solid #c4a574;
  box-shadow: 0 0 0 1px #c4a57466, 0 0 12px #c4a57455;
}

.gate-sign-handle {
  position: absolute;
  z-index: 4;
  width: 12px;
  height: 12px;
  padding: 0;
  border: 1px solid #1c1712;
  background: var(--brass-bright);
  box-shadow: none;
  animation: none;
}

.gate-sign-handle.nw { left: 0; top: 0; transform: translate(-50%, -50%); cursor: nwse-resize; }
.gate-sign-handle.ne { right: 0; top: 0; transform: translate(50%, -50%); cursor: nesw-resize; }
.gate-sign-handle.sw { left: 0; bottom: 0; transform: translate(-50%, 50%); cursor: nesw-resize; }
.gate-sign-handle.se { right: 0; bottom: 0; transform: translate(50%, 50%); cursor: nwse-resize; }

.gate-sign-edit {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 81;
  width: min(280px, calc(100vw - 2rem));
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 88%, transparent);
  color: var(--vellum);
  font-size: 0.8rem;
  line-height: 1.5;
}

.gate-sign-edit pre {
  margin: 0 0 0.65rem;
  color: var(--brass-bright);
  font-size: 0.78rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.gate-sign-edit button {
  border: 1px solid var(--line);
  padding: 0.35rem 0.75rem;
  color: var(--vellum);
}

@keyframes gate-hint-pulse {
  0%,
  100% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}

@keyframes ui-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
