:root {
  --black-cherry: #210611;
  --velvet: #5A1027;
  --rose: #8E2A46;
  --cream: #F4E8D0;
  --mauve: #C89AA7;
  --plum: #3B1938;
  --gold: #B49A5E;
  --display: "Bebas Neue", Impact, "Arial Narrow", sans-serif;
  --body: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Noto Sans Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--black-cherry);
  color: var(--cream);
  font-family: var(--body);
}

.observatory {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(circle at 80% 18%, rgba(180, 154, 94, .08), transparent 18rem),
    linear-gradient(135deg, #210611 0%, #3B1938 46%, #210611 100%);
}

.buzz-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 25vh;
  color: rgba(244, 232, 208, .035);
  font: 400 clamp(3rem, 9vw, 9rem)/1 var(--display);
  letter-spacing: .08em;
  overflow: hidden;
}

.buzz-field span {
  display: grid;
  place-items: center;
  transform: rotate(var(--r, -8deg));
}
.buzz-field span:nth-child(3n) { --r: 9deg; color: rgba(200, 154, 167, .05); }
.buzz-field span:nth-child(4n) { --r: -17deg; }

.folio-strip {
  position: fixed;
  right: clamp(.8rem, 2vw, 1.8rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: grid;
  gap: .8rem;
  font: 700 .68rem/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: .12em;
}

.folio-link {
  color: rgba(244, 232, 208, .45);
  text-decoration: none;
  writing-mode: vertical-rl;
  padding: .75rem .32rem;
  border: 1px solid rgba(244, 232, 208, .14);
  background: rgba(33, 6, 17, .6);
  transition: color .35s ease, border-color .35s ease, background .35s ease, transform .35s ease;
}
.folio-link span { color: var(--gold); margin-bottom: .42rem; }
.folio-link.active {
  color: var(--cream);
  border-color: var(--gold);
  background: rgba(90, 16, 39, .88);
  transform: translateX(-.25rem);
}

.chambers { position: relative; z-index: 1; }
.chamber { min-height: 145vh; position: relative; }
.sticky-scene {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(8, 1fr);
  padding: clamp(1.5rem, 4vw, 4rem);
}

.chamber-missing .sticky-scene { background: #210611; }
.chamber-coordinates .sticky-scene { background: linear-gradient(120deg, #210611, #5A1027); }
.chamber-lock .sticky-scene { background: #3B1938; }
.chamber-fit .sticky-scene { background: linear-gradient(135deg, #210611 0%, #5A1027 68%, #3B1938 100%); }

.layer {
  position: absolute;
  will-change: transform, opacity, border-radius, clip-path;
  transform: translate3d(0, calc(var(--scroll-shift, 0px) * var(--depth, .2)), 0);
}

.guide-lines { inset: 8% 7%; }
.line { position: absolute; background: rgba(244, 232, 208, .22); }
.line-a { left: 4%; top: 18%; width: 42%; height: 1px; }
.line-b { right: 12%; top: 34%; width: 1px; height: 48%; }
.line-c { left: 35%; bottom: 12%; width: 52%; height: 1px; background: rgba(180, 154, 94, .65); }
.cross { position: absolute; width: 1.7rem; height: 1.7rem; border-top: 1px solid var(--gold); border-left: 1px solid var(--gold); opacity: .7; }
.cross-a { left: 10%; bottom: 26%; }
.cross-b { right: 24%; top: 16%; transform: rotate(180deg); }

.lu-moon {
  right: 12vw;
  top: 12vh;
  width: clamp(4.5rem, 9vw, 8.5rem);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gold);
  color: #210611;
  font: 700 clamp(.9rem, 1.7vw, 1.4rem)/1 var(--mono);
  box-shadow: -1.5rem 1rem 0 rgba(200, 154, 167, .22);
}

.letter-architecture { inset: 0; }
.giant-letter, .z-slab, .chapter-number, .emblem-p, .emblem-z {
  font-family: var(--display);
  font-weight: 400;
  color: var(--velvet);
  line-height: .72;
}
.p-gate {
  position: absolute;
  left: -5vw;
  bottom: -8vh;
  font-size: clamp(24rem, 58vw, 58rem);
  letter-spacing: -.08em;
}
.z-slab {
  position: absolute;
  font-size: clamp(14rem, 29vw, 32rem);
  color: var(--rose);
  opacity: .92;
  transform: rotate(-7deg);
}
.z-one { left: 34vw; top: 13vh; }
.z-two { right: 4vw; bottom: 4vh; color: var(--plum); transform: rotate(8deg); }

.caption-panel {
  left: clamp(1.5rem, 8vw, 8rem);
  top: 12vh;
  max-width: 25rem;
  padding-left: 1.1rem;
  border-left: 2px solid var(--gold);
}
.eyebrow {
  margin: 0 0 1rem;
  color: var(--gold);
  font: 700 .72rem/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: .18em;
}
h1, h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
}
h1 { font-size: clamp(5rem, 16vw, 16rem); line-height: .78; letter-spacing: -.035em; }
h2 { font-size: clamp(4.5rem, 12vw, 12rem); line-height: .78; letter-spacing: .01em; }
p { font-size: clamp(1rem, 1.45vw, 1.35rem); line-height: 1.55; color: rgba(244, 232, 208, .78); }

.coordinate-grid {
  inset: 10% 8%;
  background-image:
    linear-gradient(rgba(244, 232, 208, .12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 232, 208, .12) 1px, transparent 1px);
  background-size: 9vw 9vw;
  mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
}
.stone-field { inset: 0; }
.disc, .rect, .corridor { position: absolute; display: block; background: var(--rose); }
.disc { border-radius: 50%; animation: morphDisc 8s ease-in-out infinite alternate; }
.disc-a { width: 18vw; height: 18vw; left: 12vw; top: 20vh; background: var(--mauve); }
.disc-b { width: 10vw; height: 10vw; right: 16vw; bottom: 17vh; background: var(--gold); }
.rect-a { width: 28vw; height: 16vh; left: 46vw; top: 18vh; background: var(--plum); clip-path: polygon(0 0, 92% 0, 100% 100%, 8% 100%); }
.rect-b { width: 20vw; height: 34vh; left: 18vw; bottom: 8vh; background: var(--velvet); border-radius: var(--morph-radius, 0 3rem 0 3rem); }
.corridor-a { width: 34vw; height: 26vh; right: 7vw; top: 43vh; background: var(--rose); clip-path: polygon(0 0, 74% 0, 74% 28%, 32% 28%, 32% 72%, 100% 72%, 100% 100%, 0 100%, 0 72%, 42% 72%, 42% 28%, 0 28%); transform: rotate(-4deg); }
.cutout-map { left: 8vw; top: 13vh; right: 8vw; bottom: 10vh; mix-blend-mode: normal; }
.chapter-number { position: absolute; right: 2vw; top: -3vh; font-size: clamp(12rem, 32vw, 34rem); color: rgba(244, 232, 208, .12); }
.cutout-map h2 { position: absolute; left: 0; bottom: 5vh; max-width: 45rem; color: var(--cream); }
.coordinate-notes { right: 12vw; top: 18vh; display: grid; gap: .75rem; font: 700 .82rem/1 var(--mono); color: var(--gold); letter-spacing: .14em; }

.shadow-plane { inset: 12% 17%; background: #210611; clip-path: polygon(8% 0, 100% 18%, 87% 100%, 0 82%); opacity: .56; }
.puzzle-lock {
  left: 13vw;
  top: 18vh;
  width: 52vw;
  height: 58vh;
  background: var(--velvet);
  border-radius: 3rem 0 5rem 0;
  clip-path: polygon(0 0, 78% 0, 78% 26%, 100% 26%, 100% 74%, 76% 74%, 76% 100%, 0 100%);
  animation: lockMorph 9s ease-in-out infinite alternate;
}
.tab { position: absolute; border-radius: 50%; background: var(--mauve); }
.tab-left { width: 9rem; height: 9rem; left: -4rem; top: 34%; }
.tab-right { width: 7rem; height: 7rem; right: 6rem; top: -3rem; background: var(--gold); }
.lock-void { position: absolute; width: 13rem; height: 18rem; left: 46%; top: 28%; background: #3B1938; border-radius: 7rem 7rem 1rem 1rem; }
.z-route { right: 12vw; bottom: 16vh; width: 34vw; height: 28vh; }
.z-route span { position: absolute; left: 0; width: 100%; height: 28%; background: var(--rose); transform-origin: center; }
.z-route span:nth-child(1) { top: 0; }
.z-route span:nth-child(2) { top: 36%; transform: rotate(-27deg); background: var(--gold); }
.z-route span:nth-child(3) { bottom: 0; }
.lock-copy { right: 9vw; top: 14vh; max-width: 29rem; text-align: right; }

.resolved-emblem { inset: 9vh 10vw; }
.emblem-p { position: absolute; left: 0; bottom: 0; font-size: clamp(18rem, 36vw, 36rem); color: var(--cream); }
.emblem-z { position: absolute; font-size: clamp(9rem, 18vw, 18rem); color: var(--rose); }
.z-first { left: 36%; top: 23%; }
.z-second { left: 55%; top: 43%; color: var(--mauve); }
.emblem-moon { position: absolute; right: 4%; top: 19%; width: clamp(5rem, 11vw, 10rem); aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: #210611; font: 700 clamp(1rem, 2vw, 1.8rem)/1 var(--mono); letter-spacing: .1em; }
.final-rails { inset: 14% 9%; }
.final-rails i { position: absolute; display: block; height: 1px; background: rgba(244, 232, 208, .24); width: 76%; left: 12%; }
.final-rails i:nth-child(1) { top: 18%; }
.final-rails i:nth-child(2) { top: 50%; background: var(--gold); }
.final-rails i:nth-child(3) { bottom: 14%; }
.final-copy { right: 10vw; bottom: 10vh; max-width: 31rem; text-align: right; }

.is-aligned .lu-moon, .is-aligned .disc-b, .is-aligned .emblem-moon { box-shadow: 0 0 0 .5rem rgba(180, 154, 94, .18); }
.is-aligned .coordinate-notes { opacity: 1; }

@keyframes morphDisc { to { border-radius: 42% 58% 35% 65% / 54% 35% 65% 46%; transform: rotate(8deg); } }
@keyframes lockMorph { to { border-radius: 0 5rem 1rem 4rem; clip-path: polygon(0 6%, 71% 6%, 71% 0, 100% 24%, 100% 70%, 82% 70%, 82% 100%, 5% 100%); } }

@media (max-width: 760px) {
  .folio-strip { right: .35rem; }
  .sticky-scene { padding: 1rem 2.6rem 1rem 1rem; }
  .p-gate { font-size: 24rem; left: -8rem; }
  .z-one { left: 28vw; top: 28vh; }
  .z-two { right: -14vw; }
  .caption-panel, .lock-copy, .final-copy { left: 1.2rem; right: 3.2rem; top: auto; bottom: 7vh; text-align: left; }
  .puzzle-lock { left: 4vw; width: 78vw; }
  .z-route { right: 8vw; width: 58vw; }
  .cutout-map h2 { font-size: clamp(4rem, 20vw, 8rem); }
}
