:root {
  /* Compliance tokens from DESIGN.md: Space Grotesk** navigation */
  --abyss: #061226;
  --navy: #0B1F46;
  --pearl: #F1E7D0;
  --coral: #FF4F6D;
  --violet: #6B4DFF;
  --cyan: #3DE7D8;
  --black: #01040B;
  --serif: "Cormorant Garamond", Georgia, serif;
  --display: "Fraunces", Georgia, serif;
  --sans: "Space Grotesk", Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--pearl);
  background:
    radial-gradient(circle at 18% 16%, rgba(107, 77, 255, .25), transparent 32vw),
    radial-gradient(circle at 86% 24%, rgba(61, 231, 216, .13), transparent 26vw),
    linear-gradient(135deg, var(--abyss), var(--navy) 52%, var(--black));
  font-family: var(--sans);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  opacity: .18;
  background-image:
    radial-gradient(circle at 12% 22%, rgba(241, 231, 208, .28) 0 1px, transparent 1px),
    radial-gradient(circle at 84% 61%, rgba(61, 231, 216, .22) 0 1px, transparent 1px);
  background-size: 39px 43px, 31px 37px;
  mix-blend-mode: screen;
}

.cursor-orb {
  position: fixed;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  left: -14rem;
  top: -14rem;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(circle, rgba(61, 231, 216, .16), rgba(107, 77, 255, .08) 38%, transparent 70%);
  filter: blur(12px);
}

.sky-nav {
  position: fixed;
  top: 1.1rem;
  left: 1.1rem;
  right: 1.1rem;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font: 700 .78rem/1 var(--sans);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--pearl);
}

.nav-mark { color: var(--cyan); }
.nav-links { display: flex; gap: 1.1rem; }
.nav-links a { opacity: .72; transition: color .3s, opacity .3s; }
.nav-links a:hover { color: var(--coral); opacity: 1; }

.chapter {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(5rem, 8vw, 7rem) clamp(1.4rem, 5vw, 5.5rem);
}

.hero { display: grid; place-items: center; }

.stage-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(18px);
  opacity: .55;
  pointer-events: none;
}

.stage-glow.violet { width: 48vw; height: 28vw; background: var(--violet); left: -8vw; bottom: 8vh; }
.stage-glow.cyan { width: 34vw; height: 34vw; background: var(--cyan); right: -15vw; top: 15vh; opacity: .23; }

.wordmark {
  position: absolute;
  z-index: 2;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(5rem, 18vw, 17rem);
  font-weight: 700;
  letter-spacing: -.075em;
  line-height: .78;
  color: var(--pearl);
  text-shadow: 0 1.5rem 4rem rgba(1, 4, 11, .7);
  transform: translateY(-7vh) rotate(-4deg);
}

.wordmark span { color: var(--coral); font-style: italic; }

.artifact-wrap {
  position: relative;
  z-index: 4;
  width: min(72vw, 980px);
  aspect-ratio: 1.38;
  transform: rotate(-12deg);
  animation: breathe 7s ease-in-out infinite;
}

.shell-cloud {
  position: absolute;
  inset: 0;
  border-radius: 45% 55% 54% 46% / 58% 48% 52% 42%;
  background:
    radial-gradient(circle at 31% 25%, rgba(255, 255, 255, .78), transparent 7%),
    radial-gradient(circle at 40% 38%, #F1E7D0 0 18%, transparent 19%),
    radial-gradient(circle at 65% 54%, rgba(255, 79, 109, .34), transparent 21%),
    radial-gradient(circle at 58% 38%, rgba(61, 231, 216, .20), transparent 19%),
    linear-gradient(145deg, #F1E7D0 0 18%, #d4bfad 31%, #6B4DFF 62%, #01040B 100%);
  box-shadow:
    inset -3.2rem -3.2rem 5rem rgba(1, 4, 11, .58),
    inset 1.2rem 1.1rem 2rem rgba(255, 255, 255, .46),
    0 3.5rem 8rem rgba(1, 4, 11, .8),
    0 0 5rem rgba(107, 77, 255, .42);
}

.shell-lobe {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 25%, rgba(255,255,255,.68), rgba(241,231,208,.92) 27%, rgba(107,77,255,.56) 74%, rgba(1,4,11,.54));
  box-shadow: inset -1.3rem -1.6rem 2.4rem rgba(1,4,11,.38), inset .8rem .7rem 1.8rem rgba(255,255,255,.38);
}

.lobe-a { width: 43%; height: 58%; left: 6%; top: 22%; }
.lobe-b { width: 42%; height: 56%; left: 28%; top: 7%; }
.lobe-c { width: 42%; height: 54%; left: 51%; top: 27%; }
.lobe-d { width: 31%; height: 39%; left: 39%; top: 48%; background: radial-gradient(circle at 32% 25%, #F1E7D0, #FF4F6D 52%, #01040B); }

.shell-spiral {
  position: absolute;
  width: 43%;
  aspect-ratio: 1;
  left: 29%;
  top: 22%;
  border-radius: 50%;
  background: repeating-radial-gradient(circle at 48% 51%, transparent 0 1.25rem, rgba(1,4,11,.32) 1.35rem 1.55rem), radial-gradient(circle, rgba(241,231,208,.95), rgba(107,77,255,.55) 55%, transparent 68%);
  mix-blend-mode: multiply;
  opacity: .78;
}

.shell-shadow { position:absolute; inset: 64% 11% 3% 18%; border-radius: 50%; background: rgba(1,4,11,.52); filter: blur(18px); }

.shell-lines, .signal-lines { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; pointer-events: none; }
.draw { stroke: var(--cyan); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: drawLine 4s ease forwards, flicker 4s ease-in-out infinite alternate; }
.route-two { stroke: var(--coral); animation-delay: .5s; }
.route-three, .scratch-marks .draw { stroke: var(--black); stroke-width: 2; animation-delay: .9s; opacity: .7; }

.quest-note, .chapter-copy, .relic {
  background: rgba(11, 31, 70, .58);
  backdrop-filter: blur(10px);
}

.seal-frame {
  position: relative;
  border: 1px solid rgba(241, 231, 208, .34);
  box-shadow: inset 0 0 0 1px rgba(61, 231, 216, .12), 0 1.2rem 4rem rgba(1,4,11,.38);
}

.seal-frame::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  background: conic-gradient(from var(--angle, 0deg), var(--coral), transparent 18%, var(--cyan), transparent 42%, var(--violet), transparent 62%, var(--coral));
  filter: blur(1px);
  opacity: .95;
  animation: borderSpin 5s linear infinite;
}

.seal-frame::after {
  content: "";
  position: absolute;
  width: .9rem;
  height: .9rem;
  right: -.45rem;
  top: -.45rem;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 1.4rem var(--coral), -100% 100% 0 var(--cyan);
  animation: cornerBulb 2.8s ease-in-out infinite;
}

.quest-note {
  position: absolute;
  z-index: 8;
  width: min(18rem, 38vw);
  padding: 1.1rem;
  transform: rotate(-5deg);
}

.quest-note span, .eyebrow, .route-label {
  display: block;
  font: 700 .72rem/1.4 var(--sans);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--cyan);
}

.quest-note p { margin: .7rem 0 0; font: italic 1.18rem/1.1 var(--serif); }
.note-left { left: 5vw; top: 24vh; }
.note-right { right: 4vw; bottom: 15vh; transform: rotate(6deg); }

.marginal {
  position: absolute;
  z-index: 7;
  font: 700 .78rem/1 var(--sans);
  letter-spacing: .22em;
  color: var(--coral);
  text-transform: uppercase;
}
.slogan-a { left: 3vw; bottom: 7vh; transform: rotate(-90deg); transform-origin: left center; }
.slogan-b { right: 7vw; top: 18vh; color: var(--cyan); transform: rotate(8deg); }

.contraband-tag {
  position: absolute;
  z-index: 10;
  bottom: 8vh;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  padding: 1rem 1.25rem;
  border: 1px solid var(--coral);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,79,109,.22), rgba(61,231,216,.12));
  color: var(--pearl);
  font: 800 .78rem/1 var(--sans);
  letter-spacing: .22em;
  text-transform: uppercase;
  box-shadow: 0 0 2rem rgba(255,79,109,.22);
  transition: transform .3s, box-shadow .3s;
}
.contraband-tag:hover { transform: translateX(-50%) rotate(2deg) scale(1.05); box-shadow: 0 0 2.5rem rgba(61,231,216,.35); }

.float.clue { position: absolute; z-index: 6; filter: drop-shadow(0 1rem 1.5rem rgba(1,4,11,.55)); animation: float 5s ease-in-out infinite; }
.moon-hook { width: 5.5rem; height: 5.5rem; right: 19vw; top: 27vh; border: .32rem solid var(--pearl); border-left-color: transparent; border-radius: 50%; }
.rogue-flag { width: 5rem; height: 3.6rem; left: 20vw; bottom: 18vh; border-left: .18rem solid var(--cyan); background: linear-gradient(135deg, var(--coral) 0 45%, transparent 46%); clip-path: polygon(0 0, 100% 18%, 74% 54%, 100% 92%, 0 78%); }
.compass { width: 4.6rem; height: 4.6rem; right: 31vw; bottom: 23vh; border: 1px solid var(--cyan); border-radius: 50%; }
.compass::before { content:""; position:absolute; inset: 18% 48%; background: var(--coral); transform: rotate(38deg); }

.chapter-number {
  position: absolute;
  font: 900 clamp(6rem, 18vw, 15rem)/.8 var(--display);
  color: rgba(241, 231, 208, .06);
  right: 4vw;
  top: 8vh;
}

.chapter-copy {
  position: relative;
  z-index: 3;
  max-width: 48rem;
  padding: clamp(1.4rem, 4vw, 3rem);
}
.chapter-copy h2, .breach-copy h2 {
  margin: .55rem 0 1rem;
  font: 700 clamp(2.6rem, 6.2vw, 6.8rem)/.86 var(--serif);
  letter-spacing: -.04em;
}
.chapter-copy p { max-width: 38rem; color: rgba(241,231,208,.8); font-size: 1.08rem; line-height: 1.55; }

.signal { display: flex; align-items: center; }
.signal-shell {
  position: absolute;
  right: 8vw;
  bottom: 7vh;
  width: min(36vw, 28rem);
  aspect-ratio: 1.2;
  transform: rotate(18deg);
}
.signal-shell div { position:absolute; border-radius: 50%; background: radial-gradient(circle at 30% 25%, #F1E7D0, #6B4DFF 65%, #01040B); box-shadow: inset -1rem -1rem 2rem rgba(1,4,11,.5); }
.signal-shell div:nth-child(1) { inset: 12% 39% 17% 5%; }
.signal-shell div:nth-child(2) { inset: 3% 18% 24% 28%; }
.signal-shell div:nth-child(3) { inset: 36% 5% 6% 45%; background: radial-gradient(circle at 30% 25%, #F1E7D0, #FF4F6D 54%, #01040B); }
.signal-lines { inset: 8vh 3vw auto auto; width: 62vw; height: 70vh; opacity: .85; }
.pin { fill: var(--coral); filter: drop-shadow(0 0 .7rem var(--coral)); }
.border-orbit { position: absolute; inset: 13vh 9vw; border: 1px dashed rgba(61,231,216,.35); border-radius: 54% 46% 48% 52%; transform: rotate(-12deg); animation: breathe 8s ease-in-out infinite reverse; }

.map { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 3rem; }
.map-ring { position: relative; width: min(44vw, 38rem); aspect-ratio: 1; border-radius: 50%; border: 1px solid rgba(241,231,208,.28); box-shadow: inset 0 0 5rem rgba(107,77,255,.16), 0 0 4rem rgba(61,231,216,.12); animation: slowRotate 24s linear infinite; }
.map-ring::before, .map-ring::after { content:""; position:absolute; inset: 14%; border-radius: 50%; border: 1px dashed rgba(255,79,109,.5); }
.map-ring::after { inset: 31%; border-color: rgba(61,231,216,.6); animation: slowRotate 14s linear infinite reverse; }
.ring-core { position:absolute; inset: 39%; border-radius: 50%; display:grid; place-items:center; background: radial-gradient(circle, #F1E7D0, #6B4DFF 64%, #01040B); color: var(--black); font: 900 2.2rem var(--display); }
.map-ring span { position:absolute; left:50%; top:50%; width: 9.5rem; margin-left:-4.75rem; margin-top:-.5rem; transform: rotate(calc(var(--i) * 60deg)) translateY(-17rem) rotate(calc(var(--i) * -60deg)); text-align:center; font: 700 .67rem/1 var(--sans); letter-spacing: .15em; text-transform: uppercase; color: var(--cyan); }
.map-copy { justify-self: end; }
.route-label { position:absolute; color: var(--coral); }
.label-a { left: 8vw; bottom: 12vh; transform: rotate(-7deg); }
.label-b { right: 6vw; top: 20vh; transform: rotate(9deg); color: var(--cyan); }

.objects { display: grid; place-items: center; }
.objects-title { max-width: 65rem; text-align: center; font: 700 clamp(4rem, 10vw, 10rem)/.8 var(--serif); letter-spacing: -.055em; margin: 0; }
.relic { position:absolute; width: 15rem; min-height: 8rem; padding: 1.2rem; }
.relic b { display:block; font: 850 1.15rem var(--display); color: var(--pearl); }
.relic span { display:block; margin-top:.65rem; color: rgba(241,231,208,.74); }
.relic-one { left: 7vw; top: 22vh; transform: rotate(-8deg); }
.relic-two { right: 9vw; top: 19vh; transform: rotate(7deg); }
.relic-three { left: 16vw; bottom: 15vh; transform: rotate(5deg); }
.relic-four { right: 15vw; bottom: 13vh; transform: rotate(-6deg); }
.pearl-drop { position:absolute; width: 2.3rem; aspect-ratio:1; border-radius:50%; background: radial-gradient(circle at 31% 26%, white, #F1E7D0 42%, #6B4DFF 76%, #01040B); animation: float 6s ease-in-out infinite; }
.drop-a { left: 39vw; top: 20vh; }
.drop-b { right: 30vw; bottom: 21vh; animation-delay: -1.7s; }
.drop-c { left: 49vw; bottom: 9vh; animation-delay: -.8s; }

.breach { display:grid; place-items:center; text-align:center; }
.breach-shell { position:absolute; width:min(74vw, 62rem); aspect-ratio: 2; border-radius: 50%; background: radial-gradient(circle at 50% 50%, transparent 0 25%, #3DE7D8 26% 27%, transparent 28% 31%, #FF4F6D 32% 33%, transparent 34%), radial-gradient(circle at 50% 50%, rgba(241,231,208,.18), rgba(107,77,255,.28), transparent 60%); box-shadow: 0 0 8rem rgba(61,231,216,.2); transform: rotate(-8deg); animation: breachPulse 4s ease-in-out infinite; }
.breach-copy { position:relative; z-index:3; max-width: 78rem; }
.breach-copy h2 { font-size: clamp(3.4rem, 7vw, 8rem); }
.final-tag { position: relative; left:auto; bottom:auto; display:inline-block; transform: rotate(2deg); margin-top: 1rem; }
.final-tag:hover { transform: rotate(-2deg) scale(1.05); }
.breach-slogan { position:absolute; bottom: 7vh; font: 900 clamp(1.3rem, 4vw, 4rem)/1 var(--sans); letter-spacing:.22em; color: rgba(255,79,109,.72); }

.is-visible .draw { animation-play-state: running; }

@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes borderSpin { to { --angle: 360deg; } }
@keyframes cornerBulb { 50% { transform: scale(1.7); background: var(--cyan); box-shadow: 0 0 1.8rem var(--cyan); } }
@keyframes breathe { 0%,100% { transform: rotate(-12deg) scale(1); } 50% { transform: rotate(-8deg) scale(1.045); } }
@keyframes drawLine { to { stroke-dashoffset: 0; } }
@keyframes flicker { 50% { filter: drop-shadow(0 0 .45rem currentColor); } }
@keyframes float { 0%,100% { transform: translate3d(0,0,0) rotate(-3deg); } 50% { transform: translate3d(0,-1.2rem,0) rotate(5deg); } }
@keyframes slowRotate { to { transform: rotate(360deg); } }
@keyframes breachPulse { 50% { transform: rotate(-4deg) scale(1.08); filter: saturate(1.4); } }

@media (max-width: 820px) {
  .nav-links { display: none; }
  .artifact-wrap { width: 118vw; }
  .wordmark { font-size: 24vw; }
  .quest-note { width: 42vw; font-size: .9rem; }
  .note-left { left: 1rem; top: 17vh; }
  .note-right { right: 1rem; bottom: 17vh; }
  .map { grid-template-columns: 1fr; }
  .map-ring { width: 80vw; justify-self:center; }
  .map-ring span { transform: rotate(calc(var(--i) * 60deg)) translateY(-39vw) rotate(calc(var(--i) * -60deg)); }
  .relic { width: 12rem; }
  .relic-one, .relic-three { left: 1rem; }
  .relic-two, .relic-four { right: 1rem; }
}
