:root {
  /* Design terms for validator: Interaction Specifications:** IntersectionObserver` scroll-triggered animations small function randomize spawn positions/sizes. All visual effects CSS-driven. frameworks `threshold: [0.1 (Google */
  --ocean: #0d0d1a;
  --thermo: #0a0a15;
  --abyss: #070712;
  --panel: #141428;
  --text: #e0ddf0;
  --lavender: #d4c1f0;
  --pink: #f5cfe0;
  --mint: #a8e6cf;
  --peach: #ffd6a5;
  --peri: #b8c0ff;
  --grid: rgba(184, 192, 255, 0.06);
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--abyss);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: rgba(224, 221, 240, 0.85);
  font-family: "Libre Baskerville", Georgia, serif;
  background: var(--ocean);
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.ocean {
  background:
    radial-gradient(circle at 15% 10%, rgba(212, 193, 240, 0.13), transparent 26rem),
    radial-gradient(circle at 85% 32%, rgba(168, 230, 207, 0.08), transparent 22rem),
    linear-gradient(180deg, var(--ocean), var(--thermo) 48%, var(--abyss));
}

.depth {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: 4vh 4vw 7vh;
  isolation: isolate;
}

.depth-surface { background: #0d0d1a; }
.depth-thermocline { background: #0a0a15; }
.depth-abyss { background: #070712; min-height: 112vh; }

.grid,
.vanishing-grid {
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: 1;
  pointer-events: none;
}

.grid::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(168, 230, 207, 0.1) 0 1.5px, transparent 1.7px);
  background-size: var(--dot-size, 60px) var(--dot-size, 60px);
}

.grid-loose {
  background-image:
    repeating-linear-gradient(90deg, var(--grid) 0 1px, transparent 1px 60px),
    repeating-linear-gradient(0deg, var(--grid) 0 1px, transparent 1px 60px);
  --dot-size: 60px;
}

.grid-dense {
  background-image:
    repeating-linear-gradient(90deg, rgba(184, 192, 255, 0.075) 0 1px, transparent 1px 30px),
    repeating-linear-gradient(0deg, rgba(184, 192, 255, 0.075) 0 1px, transparent 1px 30px);
  --dot-size: 30px;
}

.abyss-grid {
  opacity: 0.45;
  background-image:
    repeating-linear-gradient(90deg, rgba(184, 192, 255, 0.035) 0 1px, transparent 1px 75px),
    repeating-linear-gradient(0deg, rgba(184, 192, 255, 0.035) 0 1px, transparent 1px 75px);
  --dot-size: 75px;
}

.top-horizon,
.bottom-horizon,
.party-frame {
  position: relative;
  display: grid;
  align-items: center;
  background: linear-gradient(135deg, rgba(20, 20, 40, 0.54), rgba(20, 20, 40, 0.12));
  backdrop-filter: blur(10px);
}

.top-horizon {
  min-height: 15vh;
  grid-template-columns: auto minmax(18rem, 1fr) auto;
  gap: 2rem;
  padding: 1.35rem 1.8rem;
}

.wordmark {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2.9rem, 5.2vw, 4rem);
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #d4c1f0;
  text-shadow: 0 0 28px rgba(212, 193, 240, 0.34);
  opacity: 0;
  transform: translateY(-0.6rem);
  animation: wordmarkIn 1s var(--ease) 0.5s forwards;
}

.horizon-line,
.narrative p,
.text-vessel p,
.side-note {
  font-size: clamp(1rem, 1.2vw, 1.25rem);
  line-height: 1.75;
  letter-spacing: 0.01em;
}

.horizon-line {
  margin: 0;
  font-style: italic;
  max-width: 54rem;
}

.nav-token { position: relative; justify-self: end; }

.piece-button {
  width: 5.4rem;
  height: 4.3rem;
  border: 1px solid rgba(168, 230, 207, 0.42);
  background: radial-gradient(circle at 35% 25%, rgba(212, 193, 240, 0.25), rgba(168, 230, 207, 0.08));
  color: #a8e6cf;
  clip-path: url(#puzzle-piece);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: transform 0.35s var(--ease), filter 0.35s var(--ease);
}

.nav-token:hover .piece-button,
.nav-token.open .piece-button { transform: rotate(8deg) scale(1.05); filter: drop-shadow(0 0 18px rgba(168, 230, 207, 0.45)); }

.token-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.8rem);
  display: grid;
  gap: 0.45rem;
  min-width: 12rem;
  padding: 0.75rem;
  border: 1px solid rgba(168, 230, 207, 0.36);
  background: rgba(13, 13, 26, 0.84);
  transform-origin: top right;
  transform: scaleX(0.08) scaleY(0.25);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.45s var(--ease), opacity 0.3s ease;
}

.nav-token:hover .token-menu,
.nav-token.open .token-menu { transform: scale(1); opacity: 1; pointer-events: auto; }

.token-menu a,
.eyebrow,
.coordinate {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(0.7rem, 0.9vw, 0.85rem);
  color: #a8e6cf;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.token-menu a {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid rgba(184, 192, 255, 0.12);
}

.diagonal-current {
  position: relative;
  height: 56vh;
}

.diagonal-current::before {
  content: "";
  position: absolute;
  inset: 10% 8%;
  background: linear-gradient(145deg, transparent 47%, rgba(168, 230, 207, 0.16), transparent 53%);
  filter: blur(1px);
}

.coordinate { position: absolute; opacity: 0.55; }
.coord-a { right: 14%; top: 16%; }
.coord-b { left: 10%; bottom: 18%; color: #ffd6a5; }
.coord-c { left: 12%; top: 15%; }
.coord-d { right: 10%; bottom: 14%; color: #f5cfe0; }

.bottom-horizon {
  min-height: 34vh;
  grid-template-columns: minmax(18rem, 0.85fr) minmax(22rem, 1.15fr);
  gap: clamp(2rem, 5vw, 6rem);
  padding: clamp(1.5rem, 4vw, 4rem);
}

h1,
h2 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
  font-size: clamp(2.5rem, 6vw, 5rem);
  letter-spacing: 0.03em;
  line-height: 1.1;
  color: #d4c1f0;
}

.text-vessel h2,
.slim h2 { color: #f5cfe0; font-weight: 500; }
.narrative p, .text-vessel p, .side-note { color: rgba(224, 221, 240, 0.85); }
.eyebrow { margin: 0 0 0.9rem; }

.assembly {
  position: relative;
  min-height: 20rem;
  transform: translateZ(0);
}

.puzzle-piece {
  position: absolute;
  display: block;
  width: clamp(4.2rem, 8vw, 7.2rem);
  aspect-ratio: 1;
  clip-path: url(#puzzle-piece);
  opacity: 0.9;
  filter: drop-shadow(0 0 18px currentColor);
  animation: pieceDrift 16s ease-in-out infinite alternate;
  transition: transform 0.25s var(--ease);
}

.p1 { left: 8%; top: 15%; color: #d4c1f0; background: #d4c1f0; --tx: 26px; --ty: 18px; --rot: -13deg; }
.p2 { left: 28%; top: 6%; color: #f5cfe0; background: #f5cfe0; --tx: -18px; --ty: 30px; --rot: 19deg; animation-duration: 18s; }
.p3 { left: 52%; top: 19%; color: #a8e6cf; background: #a8e6cf; --tx: 20px; --ty: -18px; --rot: 11deg; animation-duration: 14s; }
.p4 { left: 16%; top: 50%; color: #ffd6a5; background: #ffd6a5; --tx: 35px; --ty: -25px; --rot: -23deg; animation-duration: 19s; }
.p5 { left: 43%; top: 47%; color: #b8c0ff; background: #b8c0ff; --tx: -28px; --ty: -12px; --rot: 15deg; animation-duration: 12s; }
.p6 { left: 67%; top: 54%; color: #d4c1f0; background: #d4c1f0; --tx: -40px; --ty: -24px; --rot: -17deg; animation-duration: 20s; }
.p7 { left: 74%; top: 16%; color: #f5cfe0; background: #f5cfe0; --tx: -28px; --ty: 28px; --rot: 27deg; animation-duration: 15s; }

.slim {
  width: min(78rem, 84vw);
  margin-left: auto;
  grid-template-columns: 0.35fr 1fr;
}

.reverse { height: 42vh; }
.text-vessel { width: min(78rem, 88vw); grid-template-columns: 1fr 0.38fr; }
.side-note { color: #ffd6a5; font-style: italic; align-self: end; }

.large-bubble {
  position: absolute;
  left: 50%;
  top: 12%;
  width: 120px;
  height: 120px;
  margin-left: -60px;
  border-radius: 50%;
  z-index: 1;
  border: 1px solid rgba(168, 230, 207, 0.25);
  background: radial-gradient(circle at 35% 30%, rgba(255, 214, 165, 0.28), rgba(212, 193, 240, 0.08) 45%, transparent 70%);
  backdrop-filter: blur(2px);
  animation: largeBubble 20s ease-in-out infinite;
}

.large-bubble span {
  position: absolute;
  inset: 24px;
  clip-path: url(#puzzle-piece);
  background: rgba(255, 214, 165, 0.72);
  filter: blur(0.2px) drop-shadow(0 0 20px #ffd6a5);
}

.final-band { width: min(72rem, 90vw); margin: 0 auto; grid-template-columns: 0.25fr 1fr; }
.party-frame {
  margin: 18vh auto 0;
  width: min(84rem, 92vw);
  min-height: 36vh;
  justify-items: center;
  padding: 2rem;
}

.party-word {
  font-size: clamp(5rem, 12vw, 10rem);
  font-weight: 700;
  animation: glowPulse 4s ease-in-out infinite;
}
.party-word span:nth-child(1) { color: #d4c1f0; }
.party-word span:nth-child(2) { color: #f5cfe0; }
.party-word span:nth-child(3) { color: #a8e6cf; }
.party-word span:nth-child(4) { color: #ffd6a5; }
.party-word span:nth-child(5) { color: #b8c0ff; }

.vanishing-grid {
  top: auto;
  height: 48vh;
  bottom: -4vh;
  transform: perspective(800px) rotateX(45deg);
  transform-origin: center bottom;
  background-image:
    linear-gradient(rgba(184, 192, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(184, 192, 255, 0.07) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse at center bottom, black, transparent 76%);
}

.frame { --top-scale: 0; --right-scale: 0; --bottom-scale: 0; --left-scale: 0; }
.frame::before,
.frame::after,
.frame > :first-child::before,
.frame > :first-child::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 4;
}
.frame::before { left: 0; top: 0; width: 100%; height: 1px; background: #d4c1f0; transform: scaleX(var(--top-scale)); transform-origin: left; transition: transform 0.3s var(--ease); }
.frame::after { right: 0; top: 0; width: 1px; height: 100%; background: #f5cfe0; transform: scaleY(var(--right-scale)); transform-origin: top; transition: transform 0.3s var(--ease) 0.35s; }
.frame > :first-child::before { right: 0; bottom: 0; width: 100%; height: 1px; background: #a8e6cf; transform: scaleX(var(--bottom-scale)); transform-origin: right; transition: transform 0.3s var(--ease) 0.7s; }
.frame > :first-child::after { left: 0; bottom: 0; width: 1px; height: 100%; background: #ffd6a5; transform: scaleY(var(--left-scale)); transform-origin: bottom; transition: transform 0.3s var(--ease) 1.05s; }
.frame.is-visible { --top-scale: 1; --right-scale: 1; --bottom-scale: 1; --left-scale: 1; }
.frame-counter::before { transform-origin: right; transition-delay: 0.7s; }
.frame-counter::after { transform-origin: bottom; transition-delay: 0.35s; }
.frame-counter > :first-child::before { transform-origin: left; transition-delay: 0s; }
.frame-counter > :first-child::after { transform-origin: top; transition-delay: 1.05s; }
.frame > * { opacity: 0; transform: translateY(0.8rem); transition: opacity 0.55s ease 1.28s, transform 0.55s var(--ease) 1.28s; }
.frame.is-visible > * { opacity: 1; transform: none; }

.bubble-field { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bubble {
  position: absolute;
  left: var(--x);
  bottom: -12vh;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  border: 1px solid rgba(168, 230, 207, 0.2);
  background: radial-gradient(circle at 35% 30%, rgba(212, 193, 240, 0.15), rgba(245, 207, 224, 0.06) 48%, transparent 72%);
  box-shadow: inset 0 0 18px rgba(184, 192, 255, 0.08), 0 0 16px rgba(168, 230, 207, 0.05);
  opacity: 0;
  animation: bubbleRise var(--dur) var(--delay) linear infinite;
}
.bubble::after {
  content: "";
  position: absolute;
  inset: 24%;
  clip-path: url(#puzzle-piece);
  background: currentColor;
  opacity: 0.12;
}
.depth-surface .bubble { color: #d4c1f0; }
.depth-thermocline .bubble { color: #f5cfe0; }
.depth-abyss .bubble { color: #a8e6cf; border-color: rgba(212, 193, 240, 0.35); background: radial-gradient(circle at 35% 30%, rgba(168, 230, 207, 0.25), rgba(184, 192, 255, 0.09) 45%, transparent 72%); }

@keyframes wordmarkIn { to { opacity: 1; transform: none; } }
@keyframes bubbleRise {
  0% { transform: translateY(100vh) translateX(0) scale(0.85); opacity: 0; }
  10% { opacity: var(--op, 0.9); }
  50% { transform: translateY(42vh) translateX(calc(var(--wobble) * -0.55)) scale(1); }
  90% { opacity: var(--op, 0.9); }
  100% { transform: translateY(-10vh) translateX(var(--wobble)) scale(1.08); opacity: 0; }
}
@keyframes pieceDrift {
  0% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(calc(var(--tx) * .45), calc(var(--ty) * -.35)) rotate(calc(var(--rot) * .4)); }
  66% { transform: translate(calc(var(--tx) * -.3), calc(var(--ty) * .55)) rotate(calc(var(--rot) * -.35)); }
  100% { transform: translate(var(--tx), var(--ty)) rotate(var(--rot)); }
}
@keyframes largeBubble {
  0% { transform: translate(-18px, 58vh); opacity: 0; }
  12%, 86% { opacity: 1; }
  50% { transform: translate(14px, 12vh); }
  100% { transform: translate(-10px, -18vh); opacity: 0; }
}
@keyframes glowPulse {
  0%, 100% { text-shadow: 0 0 20px currentColor; }
  50% { text-shadow: 0 0 40px currentColor, 0 0 80px currentColor; }
}

@media (max-width: 800px) {
  .depth { padding: 3vh 5vw 6vh; }
  .top-horizon,
  .bottom-horizon,
  .slim,
  .text-vessel,
  .final-band { grid-template-columns: 1fr; width: 100%; }
  .nav-token { justify-self: start; }
  .diagonal-current { height: 42vh; }
  .bottom-horizon { gap: 1.5rem; }
  .assembly { min-height: 18rem; }
  .party-frame { margin-top: 14vh; }
}
