:root {
  /* Space Grotesk** for the munju.org wordmark */
  --polar: #EAF7FF;
  --frost: #BFD8E8;
  --navy: #07111F;
  --glass: #0B1F33;
  --cyan: #5EF7FF;
  --violet: #8B7CFF;
  --amber: #F4C76B;
  --veil: rgba(234, 247, 255, 0.14);
  --seam-x: 50%;
  --scene-shift: 0vw;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--navy);
  color: var(--polar);
  font-family: "Noto Sans KR", Inter, system-ui, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 52% 18%, rgba(94, 247, 255, 0.18), transparent 28%),
    radial-gradient(circle at 87% 73%, rgba(139, 124, 255, 0.18), transparent 30%),
    linear-gradient(115deg, #07111F 0%, #0B1F33 45%, #07111F 100%);
  pointer-events: none;
}

#experience {
  position: relative;
  width: 100vw;
  height: 100vh;
  isolation: isolate;
  background: linear-gradient(90deg, rgba(234, 247, 255, 0.025), transparent 48%, rgba(94, 247, 255, 0.04));
}

.ambient-grid,
.scanline {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.ambient-grid {
  opacity: .32;
  background-image:
    linear-gradient(rgba(191, 216, 232, 0.065) 1px, transparent 1px),
    linear-gradient(90deg, rgba(191, 216, 232, 0.055) 1px, transparent 1px);
  background-size: 7.5vw 7.5vw;
  mask-image: radial-gradient(circle at center, #000 20%, transparent 78%);
}

.scanline {
  background: linear-gradient(180deg, transparent 0%, rgba(94, 247, 255, .10) 48%, transparent 52%);
  height: 22vh;
  animation: scan 8s linear infinite;
  mix-blend-mode: screen;
}

.scene {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, var(--seam-x)) 1px minmax(0, calc(100% - var(--seam-x)));
  opacity: 0;
  transform: translateX(var(--scene-shift)) scale(1.012);
  filter: blur(14px);
  transition: opacity .8s ease, transform .9s cubic-bezier(.19, 1, .22, 1), filter .9s ease;
  pointer-events: none;
}

.scene.active {
  opacity: 1;
  transform: translateX(var(--scene-shift)) scale(1);
  filter: blur(0);
  pointer-events: auto;
}

.scene.protocol { --seam-x: 34%; --scene-shift: -3vw; }
.scene.public-layer { --seam-x: 57%; --scene-shift: 4vw; }
.scene.merge { --seam-x: 48%; --scene-shift: 0vw; }

.chamber {
  position: relative;
  min-width: 0;
  height: 100vh;
  padding: clamp(2rem, 6vw, 6rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.left-chamber {
  background: linear-gradient(110deg, rgba(234, 247, 255, 0.045), transparent 54%);
}

.right-chamber {
  background: linear-gradient(250deg, rgba(191, 216, 232, 0.07), transparent 62%);
}

.chamber::before,
.chamber::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.chamber::before {
  inset: 8%;
  border: 1px solid rgba(191, 216, 232, .12);
  background: linear-gradient(135deg, rgba(234, 247, 255, .06), transparent 38%, rgba(94, 247, 255, .035));
  clip-path: polygon(0 0, 88% 0, 100% 12%, 100% 100%, 12% 100%, 0 88%);
}

.chamber::after {
  width: 34vw;
  height: 34vw;
  border: 1px solid rgba(94, 247, 255, .18);
  transform: rotate(28deg);
  opacity: .32;
  filter: blur(.2px);
}

.left-chamber::after { left: -19vw; top: 8vh; }
.right-chamber::after { right: -17vw; bottom: 5vh; }

.seam {
  position: relative;
  z-index: 5;
  width: 1px;
  height: 100vh;
  background: linear-gradient(180deg, transparent, var(--cyan) 22%, var(--polar) 52%, var(--violet) 78%, transparent);
  box-shadow: 0 0 22px rgba(94, 247, 255, .75), 0 0 70px rgba(139, 124, 255, .35);
}

.seam::before,
.seam::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 11vw;
  height: 100%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(234, 247, 255, .105), transparent);
  filter: blur(16px);
}

.seam-nav {
  position: fixed;
  z-index: 10;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
  pointer-events: auto;
}

.tick {
  position: relative;
  width: 42px;
  height: 11px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.tick::before {
  content: "";
  position: absolute;
  inset: 5px 0;
  background: rgba(191, 216, 232, .35);
  box-shadow: 0 0 10px rgba(94, 247, 255, .16);
  transition: transform .35s ease, background .35s ease, box-shadow .35s ease;
}

.tick span {
  position: absolute;
  left: 50px;
  top: -5px;
  color: rgba(234, 247, 255, .42);
  font: 500 .58rem/1 "Orbitron", monospace;
  letter-spacing: .16em;
  opacity: 0;
  transition: opacity .35s ease;
}

.tick.active::before {
  background: var(--cyan);
  transform: scaleX(1.6);
  box-shadow: 0 0 18px rgba(94, 247, 255, .85);
}

.tick.active span { opacity: 1; }

.protocol-label,
.technical-caption,
.percent,
.seal {
  font-family: "Orbitron", monospace;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.protocol-label {
  position: relative;
  z-index: 3;
  margin-bottom: 2.2rem;
  color: var(--cyan);
  font-size: clamp(.62rem, .9vw, .82rem);
  text-shadow: 0 0 18px rgba(94, 247, 255, .5);
}

.wordmark,
.chapter-title {
  position: relative;
  z-index: 3;
  margin: 0;
  font-family: "Space Grotesk", Inter, system-ui, sans-serif;
  font-weight: 600;
  line-height: .78;
  letter-spacing: var(--tracking, -.065em);
  text-transform: lowercase;
  color: var(--polar);
  filter: blur(var(--type-blur, 0px));
  text-shadow: 0 0 32px rgba(94, 247, 255, .24), 0 0 70px rgba(139, 124, 255, .17);
  transition: letter-spacing .45s ease, filter .45s ease, transform .45s ease;
}

.wordmark { font-size: clamp(4.2rem, 12vw, 15rem); }
.chapter-title { font-size: clamp(4rem, 10vw, 12rem); }

.statement,
.note,
.final-copy {
  position: relative;
  z-index: 3;
  max-width: 34rem;
  color: rgba(234, 247, 255, .77);
  font-size: clamp(1rem, 1.45vw, 1.42rem);
  line-height: 1.65;
  font-weight: 300;
}

.statement { margin-top: 1.5rem; }
.note { margin-top: 2rem; }

.decrypt {
  opacity: 0;
  transform: translateY(18px);
  clip-path: inset(0 100% 0 0);
}

.scene.active .decrypt {
  animation: decrypt 1.35s .25s cubic-bezier(.19, 1, .22, 1) forwards;
}

.skeleton-stack {
  position: relative;
  z-index: 3;
  display: grid;
  gap: .85rem;
  width: min(30vw, 420px);
  margin-bottom: 1.7rem;
}

.skeleton-stack span,
.bar,
.index-lines b,
.ghost-copy span {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(191, 216, 232, .15), rgba(94, 247, 255, .68), rgba(191, 216, 232, .13));
  background-size: 240% 100%;
  animation: shimmer 2.2s linear infinite;
  box-shadow: 0 0 16px rgba(94, 247, 255, .17);
}

.skeleton-stack span:nth-child(1) { width: 72%; }
.skeleton-stack span:nth-child(2) { width: 46%; animation-delay: .18s; }
.skeleton-stack span:nth-child(3) { width: 61%; animation-delay: .34s; }

.scene.active.opening .intro-skeleton { animation: skeletonLift 1.4s 1.3s forwards; }

.language-fragments,
.ghost-copy {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 2rem;
}

.language-fragments span,
.ghost-copy span {
  border: 1px solid rgba(191, 216, 232, .16);
  background: rgba(234, 247, 255, .055);
  color: rgba(234, 247, 255, .66);
  padding: .7rem .9rem;
  font-size: .8rem;
  letter-spacing: .06em;
  backdrop-filter: blur(16px);
}

.frost-gate {
  position: absolute;
  inset: 14vh 14vw 14vh 8vw;
  perspective: 1000px;
}

.gate-plane {
  position: absolute;
  top: 5%;
  bottom: 5%;
  width: 43%;
  border: 1px solid rgba(234, 247, 255, .18);
  background: linear-gradient(130deg, rgba(234, 247, 255, .15), rgba(94, 247, 255, .045), transparent);
  box-shadow: inset 0 0 32px rgba(234, 247, 255, .055), 0 0 45px rgba(94, 247, 255, .13);
  backdrop-filter: blur(18px);
  animation: paneDrift 7s ease-in-out infinite;
}

.gate-left { left: 0; transform: rotateY(-19deg) skewY(-4deg); }
.gate-right { right: 0; transform: rotateY(19deg) skewY(4deg); animation-delay: -2.6s; }

.gate-core {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--cyan), var(--polar), transparent);
  box-shadow: 0 0 34px rgba(94, 247, 255, .9);
}

.architecture i,
.floorplan span,
.floating-window,
.central-aperture span {
  position: absolute;
  border: 1px solid rgba(191, 216, 232, .18);
  background: rgba(234, 247, 255, .07);
  backdrop-filter: blur(15px);
}

.slab { width: 21vw; height: 8vh; transform: skewX(-20deg); }
.slab-a { top: 22vh; right: 13vw; animation: resolveA 5s ease-in-out infinite; }
.slab-b { top: 43vh; right: 22vw; animation: resolveB 6s ease-in-out infinite; }
.slab-c { top: 64vh; right: 9vw; animation: resolveA 7s ease-in-out infinite reverse; }
.prism { width: 8vw; height: 8vw; clip-path: polygon(50% 0, 100% 38%, 78% 100%, 16% 82%, 0 22%); }
.prism-a { top: 18vh; right: 5vw; background: rgba(139, 124, 255, .12); animation: float 8s ease-in-out infinite; }
.prism-b { bottom: 16vh; right: 35vw; background: rgba(94, 247, 255, .10); animation: float 9s ease-in-out infinite reverse; }

.percent {
  position: absolute;
  right: 6vw;
  bottom: 5vh;
  color: var(--amber);
  font-size: .78rem;
}

.narrow-index { padding-right: 3vw; }
.expansive { padding-left: 9vw; }

.index-lines {
  position: relative;
  z-index: 3;
  width: 22vw;
  display: grid;
  gap: .65rem;
  margin-top: 2.4rem;
}

.index-lines b:nth-child(1) { width: 90%; }
.index-lines b:nth-child(2) { width: 54%; }
.index-lines b:nth-child(3) { width: 72%; }
.index-lines b:nth-child(4) { width: 38%; }

.floorplan {
  position: relative;
  width: min(58vw, 900px);
  height: 64vh;
  border: 1px solid rgba(191, 216, 232, .16);
  clip-path: polygon(10% 0, 100% 0, 92% 100%, 0 88%);
  background:
    linear-gradient(90deg, rgba(234, 247, 255, .08), transparent 18%),
    linear-gradient(160deg, rgba(94, 247, 255, .08), rgba(139, 124, 255, .055), transparent);
  box-shadow: inset 0 0 80px rgba(94, 247, 255, .055), 0 0 70px rgba(7, 17, 31, .8);
}

.floorplan .bar { position: absolute; left: 10%; height: 16px; }
.floorplan .long { top: 18%; width: 56%; }
.floorplan .mid { top: 31%; width: 39%; animation-delay: .2s; }
.floorplan .short { top: 44%; width: 25%; animation-delay: .4s; }
.wire { background: transparent !important; border-color: rgba(94, 247, 255, .32) !important; }
.w1 { width: 42%; height: 1px; left: 42%; top: 58%; transform: rotate(-24deg); }
.w2 { width: 1px; height: 46%; left: 70%; top: 18%; }
.w3 { width: 28%; height: 20%; left: 20%; bottom: 12%; transform: skewX(-20deg); }
.seal { position: absolute; right: 12%; bottom: 14%; color: var(--cyan); font-size: .66rem; }

.technical-caption { margin-top: 1.4rem; color: rgba(191, 216, 232, .55); font-size: .62rem; }

.geometry-field { background: radial-gradient(circle at 52% 50%, rgba(94, 247, 255, .12), transparent 42%); }
.floating-window { animation: float 9s ease-in-out infinite; }
.window-a { width: 32vw; height: 22vh; top: 20vh; left: 10vw; transform: rotate(-9deg); }
.window-b { width: 24vw; height: 34vh; top: 42vh; left: 23vw; transform: rotate(11deg); animation-delay: -2s; }
.window-c { width: 16vw; height: 16vw; top: 13vh; left: 37vw; clip-path: polygon(50% 0, 100% 30%, 82% 100%, 18% 100%, 0 30%); animation-delay: -4s; }
.orbital-mark {
  position: absolute;
  width: 30vw;
  height: 30vw;
  left: 17vw;
  top: 24vh;
  border: 1px dashed rgba(94, 247, 255, .27);
  border-radius: 50%;
  animation: spin 18s linear infinite;
}

.copy-dominant { padding-left: 7vw; }
.ghost-copy { flex-direction: column; width: min(28vw, 420px); }
.ghost-copy span { height: auto; border-radius: 0; animation-duration: 3.1s; }

.merged-left { align-items: flex-end; text-align: right; padding-right: 7vw; }
.merged-right { padding-left: 7vw; }
.final-copy { max-width: 28rem; }

.central-aperture {
  position: absolute;
  left: -11vw;
  top: 50%;
  width: 22vw;
  height: 55vh;
  transform: translateY(-50%);
  border: 1px solid rgba(234, 247, 255, .24);
  background: linear-gradient(90deg, rgba(94, 247, 255, .14), rgba(234, 247, 255, .06), rgba(139, 124, 255, .13));
  box-shadow: 0 0 60px rgba(94, 247, 255, .24), inset 0 0 50px rgba(234, 247, 255, .08);
  backdrop-filter: blur(20px);
  clip-path: polygon(18% 0, 82% 0, 100% 16%, 100% 84%, 82% 100%, 18% 100%, 0 84%, 0 16%);
}

.central-aperture span { inset: auto; }
.central-aperture span:nth-child(1) { width: 64%; height: 1px; left: 18%; top: 28%; }
.central-aperture span:nth-child(2) { width: 1px; height: 58%; left: 50%; top: 21%; }
.central-aperture span:nth-child(3) { width: 44%; height: 1px; left: 28%; bottom: 24%; }

@keyframes shimmer { 0% { background-position: 220% 0; } 100% { background-position: -80% 0; } }
@keyframes scan { 0% { transform: translateY(-30vh); } 100% { transform: translateY(112vh); } }
@keyframes decrypt { to { opacity: 1; transform: translateY(0); clip-path: inset(0 0 0 0); } }
@keyframes skeletonLift { to { opacity: 0; transform: translateY(-16px) scaleX(1.4); filter: blur(8px); } }
@keyframes paneDrift { 0%,100% { translate: 0 0; filter: blur(.2px); } 50% { translate: 0 -1.4vh; filter: blur(1.2px); } }
@keyframes resolveA { 0%,100% { opacity: .32; transform: translateY(0) skewX(-20deg); } 50% { opacity: .78; transform: translateY(-1.5vh) skewX(-20deg); } }
@keyframes resolveB { 0%,100% { opacity: .22; transform: translateX(0) skewX(-20deg); } 50% { opacity: .72; transform: translateX(2vw) skewX(-20deg); } }
@keyframes float { 0%,100% { translate: 0 0; } 50% { translate: 0 -2vh; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .scene { grid-template-columns: 1fr; }
  .seam { display: none; }
  .seam-nav { left: auto; right: 1rem; transform: translateY(-50%); }
  .chamber { grid-column: 1; padding: 2rem; }
  .right-chamber { position: absolute; inset: 0; opacity: .48; }
  .left-chamber { z-index: 2; background: rgba(7, 17, 31, .58); }
  .wordmark { font-size: 4.3rem; }
  .chapter-title { font-size: 4rem; }
  .central-aperture { left: 50%; width: 48vw; transform: translate(-50%, -50%); }
}
