:root {
  /* Design scan tokens: Mono* Mono** Mono* Mono** */
  --mint: #7CFFD8;
  --violet: #9B6BFF;
  --coral: #FF8FB7;
  --lemon: #FFE66D;
  --marble: #F7F2EA;
  --ink: #182033;
  --sky: #9CEBFF;
  --lilac: #DCCBFF;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --display: "Space Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --human: "Nunito Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--marble);
  color: var(--ink);
  scroll-snap-type: y mandatory;
}

body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  font-family: var(--human);
  background:
    radial-gradient(circle at 16% 20%, rgba(124, 255, 216, .36), transparent 31%),
    radial-gradient(circle at 80% 10%, rgba(255, 143, 183, .30), transparent 28%),
    linear-gradient(145deg, #F7F2EA 0%, #F7F2EA 42%, #DCCBFF 100%);
}

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  filter: saturate(1.08);
}

.wash {
  position: absolute;
  width: 44vw;
  height: 44vw;
  border-radius: 40% 60% 45% 55%;
  opacity: .54;
  mix-blend-mode: multiply;
  filter: blur(28px);
  transform: translate3d(var(--mx, 0px), var(--my, 0px), 0);
  transition: transform .7s ease-out;
}

.wash-a { left: -10vw; top: 4vh; background: radial-gradient(circle, #7CFFD8 0%, #9CEBFF 45%, transparent 70%); }
.wash-b { right: -14vw; top: 24vh; background: radial-gradient(circle, #FFE66D 0%, #FF8FB7 48%, transparent 72%); }
.wash-c { left: 32vw; bottom: -18vw; background: radial-gradient(circle, #DCCBFF 0%, #9B6BFF 52%, transparent 72%); }

.site-nav {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.45rem;
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .04em;
  color: var(--ink);
}

.wordmark {
  padding: .55rem .75rem;
  border: 1px solid rgba(24, 32, 51, .18);
  border-radius: 999px;
  background: rgba(247, 242, 234, .58);
  box-shadow: 0 16px 40px rgba(24, 32, 51, .08);
}

.cap { color: var(--violet); }

.nav-notes { display: flex; gap: .65rem; flex-wrap: wrap; justify-content: flex-end; }
.nav-notes span {
  padding: .45rem .6rem;
  border-radius: 999px;
  background: rgba(255, 230, 109, .42);
  border: 1px dashed rgba(24, 32, 51, .22);
}

.story-shell { position: relative; z-index: 1; }

.chapter {
  position: relative;
  min-height: 100vh;
  scroll-snap-align: start;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 4.5rem minmax(0, 1fr);
  isolation: isolate;
  overflow: hidden;
}

.split {
  position: relative;
  min-height: 100vh;
  padding: clamp(6rem, 9vw, 9rem) clamp(1.5rem, 4vw, 5.5rem) clamp(3rem, 5vw, 5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.code-side {
  background:
    linear-gradient(90deg, rgba(247, 242, 234, .92), rgba(247, 242, 234, .55)),
    repeating-linear-gradient(0deg, rgba(24, 32, 51, .045) 0 1px, transparent 1px 34px);
}

.art-side {
  background:
    radial-gradient(circle at 72% 28%, rgba(255, 230, 109, .40), transparent 24%),
    radial-gradient(circle at 18% 70%, rgba(156, 235, 255, .48), transparent 30%),
    linear-gradient(135deg, rgba(124, 255, 216, .22) 0%, rgba(156, 235, 255, .20) 28%, rgba(155, 107, 255, .24) 58%, rgba(255, 143, 183, .25) 100%);
}

.chapter-label {
  margin: 0 0 1.25rem;
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--violet);
}

h1, h2 {
  margin: 0;
  line-height: .98;
  letter-spacing: -.06em;
  color: var(--ink);
}

h1 {
  max-width: 10ch;
  font-family: var(--display);
  font-size: clamp(3.35rem, 8vw, 7.8rem);
}

h2 {
  max-width: 11ch;
  font-family: var(--display);
  font-size: clamp(2.8rem, 6vw, 6.8rem);
}

.cursor {
  color: var(--coral);
  animation: blink .8s steps(2) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.lead, .short-copy {
  max-width: 35rem;
  margin: 1.35rem 0 0;
  font-size: clamp(1.05rem, 1.6vw, 1.45rem);
  line-height: 1.48;
  font-weight: 700;
}

.code-tablet, .inscription-block {
  margin-top: 2rem;
  width: min(100%, 40rem);
  padding: 1.15rem;
  border-radius: 1.4rem;
  background: rgba(24, 32, 51, .91);
  color: var(--marble);
  font-family: var(--mono);
  box-shadow: 0 24px 60px rgba(24, 32, 51, .20), inset 0 0 0 1px rgba(156, 235, 255, .24);
}

.code-tablet p, .inscription-block p { margin: .55rem 0; }
.endglyph { float: right; color: var(--lemon); }

.bead {
  display: inline-block;
  width: .72rem;
  height: .72rem;
  margin-right: .6rem;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 18px var(--mint);
  animation: beadBounce 3.2s ease-in-out infinite;
}
.bead.lemon { background: var(--lemon); box-shadow: 0 0 18px var(--lemon); animation-delay: .28s; }
.bead.coral { background: var(--coral); box-shadow: 0 0 18px var(--coral); animation-delay: .55s; }

@keyframes beadBounce { 0%, 72%, 100% { transform: translateY(0); } 82% { transform: translateY(-10px); } 90% { transform: translateY(2px); } }

.seam {
  position: relative;
  z-index: 5;
  display: grid;
  place-items: center;
}

.seam span {
  display: block;
  width: 1.8rem;
  height: 72vh;
  border-radius: 999px;
  background: linear-gradient(180deg, #7CFFD8 0%, #9CEBFF 28%, #9B6BFF 58%, #FF8FB7 100%);
  box-shadow: 0 0 18px rgba(124, 255, 216, .75), 0 0 42px rgba(155, 107, 255, .36);
  transform: translateY(var(--seamY, 0px)) skewY(var(--seamSkew, -5deg));
  transition: border-radius .6s ease, transform .6s ease, width .6s ease;
}

.chapter[data-seam="slides"] .seam span { width: 2.5rem; border-radius: 22% 78% 26% 74%; }
.chapter[data-seam="curve"] .seam span { width: 2rem; border-radius: 72% 28% 70% 30%; }
.chapter[data-seam="horizon"] .seam { display: none; }

.plinth-scene {
  position: relative;
  width: min(37rem, 82vw);
  aspect-ratio: 1;
  margin: auto;
  transform-style: preserve-3d;
}

.aurora-loop, .chromosome, .bust, .plinth, .laurel-loop, .column-base, .tablet-stack, .microscope-strip, .floating-beads i, .marble-chip {
  transform: translate3d(calc(var(--px, 0px) * var(--depth, 1)), calc(var(--py, 0px) * var(--depth, 1)), 0);
}

.aurora-loop {
  position: absolute;
  inset: 10%;
  border: 2.2rem solid rgba(124, 255, 216, .48);
  border-top-color: rgba(255, 143, 183, .58);
  border-right-color: rgba(155, 107, 255, .50);
  border-radius: 48% 52% 44% 56%;
  filter: blur(.5px);
  animation: rotateLoop 16s linear infinite;
  --depth: .34;
}

.loop-two { inset: 21% 7% 18% 22%; border-color: rgba(255, 230, 109, .36) rgba(156, 235, 255, .52) rgba(155, 107, 255, .34) rgba(124, 255, 216, .42); animation-duration: 21s; animation-direction: reverse; --depth: .62; }

@keyframes rotateLoop { to { rotate: 360deg; } }

.chromosome {
  position: absolute;
  left: 28%;
  top: 17%;
  width: 45%;
  height: 45%;
  border-radius: 44% 56% 43% 57%;
  border: 1.7rem solid rgba(247, 242, 234, .72);
  box-shadow: inset 0 0 30px rgba(155, 107, 255, .32), 0 0 50px rgba(124, 255, 216, .42);
  --depth: .9;
}

.chromosome i {
  position: absolute;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: var(--lemon);
  box-shadow: 0 0 18px var(--lemon);
}
.chromosome i:nth-child(1) { left: -12%; top: 38%; }
.chromosome i:nth-child(2) { right: -12%; top: 42%; background: var(--mint); box-shadow: 0 0 18px var(--mint); }
.chromosome i:nth-child(3) { left: 12%; top: -8%; background: var(--coral); box-shadow: 0 0 18px var(--coral); }
.chromosome i:nth-child(4) { right: 14%; bottom: -8%; background: var(--sky); box-shadow: 0 0 18px var(--sky); }
.chromosome i:nth-child(5) { left: 38%; bottom: -14%; }
.chromosome i:nth-child(6) { right: 36%; top: -14%; background: var(--mint); }

.bust {
  position: absolute;
  left: 35%;
  bottom: 28%;
  width: 30%;
  height: 34%;
  border-radius: 47% 53% 42% 42%;
  background: linear-gradient(135deg, #F7F2EA, #DCCBFF);
  box-shadow: inset -18px -12px 0 rgba(24, 32, 51, .06), 0 28px 46px rgba(24, 32, 51, .12);
  --depth: .18;
}
.bust::before { content: ""; position: absolute; left: 22%; top: -18%; width: 56%; height: 30%; border-radius: 50% 50% 35% 35%; background: #F7F2EA; box-shadow: 0 0 0 .35rem rgba(255, 230, 109, .55); }
.plinth {
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 6%;
  padding: 1.7rem 1rem;
  text-align: center;
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: .12em;
  background: linear-gradient(160deg, #F7F2EA, #DCCBFF);
  border-radius: 1.3rem .8rem 1.8rem .9rem;
  box-shadow: 0 22px 46px rgba(24, 32, 51, .13);
  --depth: .08;
}

.glass-slide { background: rgba(247, 242, 234, .64); backdrop-filter: blur(2px); }
.annotation-list { list-style: none; padding: 0; margin: 2rem 0 0; width: min(35rem, 100%); }
.annotation-list li {
  margin: .9rem 0;
  padding: 1rem;
  border-left: .5rem solid var(--mint);
  border-radius: 1rem;
  background: rgba(247, 242, 234, .68);
  font-family: var(--mono);
  box-shadow: 0 18px 38px rgba(24, 32, 51, .08);
  transform: translateX(var(--noteShift, 0px));
}
.annotation-list span { color: var(--violet); margin-right: .8rem; }
.annotation-list b { float: right; color: var(--coral); }

.slide-gallery { flex-direction: row; align-items: center; gap: 1.4rem; justify-content: center; }
.microscope-strip {
  position: relative;
  width: 26%;
  height: 64vh;
  border-radius: 2rem;
  background: rgba(247, 242, 234, .42);
  border: 1px solid rgba(24, 32, 51, .16);
  box-shadow: inset 0 0 38px rgba(156, 235, 255, .34), 0 24px 50px rgba(24, 32, 51, .10);
  overflow: hidden;
  --depth: .28;
}
.strip-b { margin-top: 9vh; --depth: .52; }
.microscope-strip span {
  position: absolute;
  left: 20%;
  width: 60%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 230, 109, .78), rgba(255, 143, 183, .30), transparent 68%);
}
.microscope-strip span:nth-child(1) { top: 12%; }
.microscope-strip span:nth-child(2) { top: 42%; background: radial-gradient(circle, rgba(124, 255, 216, .72), rgba(156, 235, 255, .35), transparent 68%); }
.microscope-strip span:nth-child(3) { bottom: 10%; background: radial-gradient(circle, rgba(155, 107, 255, .55), rgba(220, 203, 255, .32), transparent 68%); }

.floating-beads { position: absolute; inset: 0; pointer-events: none; }
.floating-beads i {
  position: absolute;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--lemon);
  box-shadow: 0 0 16px var(--lemon);
  animation: floatBead 4.8s ease-in-out infinite;
}
.floating-beads i:nth-child(1) { left: 17%; top: 18%; }
.floating-beads i:nth-child(2) { left: 43%; top: 10%; background: var(--mint); box-shadow: 0 0 16px var(--mint); animation-delay: -.6s; }
.floating-beads i:nth-child(3) { right: 17%; top: 28%; background: var(--coral); box-shadow: 0 0 16px var(--coral); animation-delay: -1s; }
.floating-beads i:nth-child(4) { left: 29%; top: 55%; background: var(--sky); box-shadow: 0 0 16px var(--sky); animation-delay: -1.5s; }
.floating-beads i:nth-child(5) { right: 33%; bottom: 25%; animation-delay: -2s; }
.floating-beads i:nth-child(6) { right: 12%; bottom: 18%; background: var(--mint); box-shadow: 0 0 16px var(--mint); animation-delay: -2.4s; }
.floating-beads i:nth-child(7) { left: 12%; bottom: 18%; background: var(--violet); box-shadow: 0 0 16px var(--violet); animation-delay: -3s; }
.floating-beads i:nth-child(8) { left: 52%; bottom: 46%; background: var(--coral); box-shadow: 0 0 16px var(--coral); animation-delay: -3.5s; }

@keyframes floatBead { 0%, 100% { translate: 0 0; } 48% { translate: 0 -18px; } 62% { scale: 1.18 .86; } }

.spilled-aurora::before {
  content: "";
  position: absolute;
  inset: 10% -8% 8% 6%;
  border-radius: 34% 66% 42% 58%;
  background: linear-gradient(135deg, #7CFFD8 0%, #9CEBFF 28%, #9B6BFF 58%, #FF8FB7 100%);
  opacity: .42;
  filter: blur(9px);
}
.laurel-loop {
  position: relative;
  width: min(34rem, 74vw);
  aspect-ratio: 1;
  margin: auto;
  border: 1.6rem dotted rgba(24, 32, 51, .18);
  border-radius: 44% 56% 52% 48%;
  box-shadow: inset 0 0 45px rgba(124, 255, 216, .25);
  --depth: .42;
}
.column-base {
  position: absolute;
  left: 18%;
  bottom: 16%;
  width: 48%;
  height: 8rem;
  border-radius: 1rem 2rem .7rem 1.4rem;
  background: repeating-linear-gradient(90deg, #F7F2EA 0 24px, #DCCBFF 25px 30px);
  box-shadow: 0 24px 42px rgba(24, 32, 51, .14);
  --depth: .18;
}
.tablet-stack {
  position: absolute;
  right: 12%;
  top: 26%;
  display: grid;
  gap: .7rem;
  font-family: var(--mono);
  font-weight: 600;
  --depth: .72;
}
.tablet-stack div { padding: .8rem 1.1rem; border-radius: .8rem; background: rgba(247, 242, 234, .76); border: 1px solid rgba(24, 32, 51, .14); box-shadow: 0 14px 30px rgba(24, 32, 51, .10); }
.inscription-side { background: linear-gradient(135deg, rgba(247, 242, 234, .70), rgba(220, 203, 255, .64)); }

.chapter-finale {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 65%, rgba(255, 230, 109, .55), transparent 25%),
    linear-gradient(135deg, #7CFFD8 0%, #9CEBFF 28%, #9B6BFF 58%, #FF8FB7 100%);
}
.merged-panel {
  position: relative;
  z-index: 2;
  width: min(78rem, calc(100vw - 2rem));
  padding: clamp(2rem, 7vw, 6rem);
  border-radius: 3rem;
  text-align: center;
  background: rgba(247, 242, 234, .70);
  box-shadow: 0 34px 90px rgba(24, 32, 51, .18), inset 0 0 0 1px rgba(247, 242, 234, .50);
}
.merged-panel h2 { max-width: 15ch; margin: auto; }
.merged-panel p:not(.chapter-label) { max-width: 47rem; margin: 1.4rem auto 0; font-size: 1.25rem; font-weight: 800; line-height: 1.45; }
.horizon-code { margin-top: 2rem; display: flex; justify-content: center; align-items: center; gap: .9rem; font-family: var(--display); font-size: clamp(1.1rem, 2.7vw, 2rem); color: var(--ink); }
.horizon-code span { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border-radius: 50%; background: var(--lemon); box-shadow: 0 0 22px var(--lemon); }
.horizon-strand { position: absolute; left: 5%; right: 5%; bottom: 15%; height: 9rem; border-radius: 50%; border-top: .8rem solid rgba(247, 242, 234, .62); }
.horizon-strand i { position: absolute; top: -1.45rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--marble); box-shadow: 0 0 18px rgba(247, 242, 234, .9); }
.horizon-strand i:nth-child(1) { left: 5%; } .horizon-strand i:nth-child(2) { left: 20%; } .horizon-strand i:nth-child(3) { left: 35%; } .horizon-strand i:nth-child(4) { left: 50%; } .horizon-strand i:nth-child(5) { left: 65%; } .horizon-strand i:nth-child(6) { left: 80%; } .horizon-strand i:nth-child(7) { left: 94%; }

.marble-chip {
  position: absolute;
  z-index: 8;
  width: 2.1rem;
  height: 1.5rem;
  border-radius: 45% 55% 40% 60%;
  background: linear-gradient(135deg, #F7F2EA, #DCCBFF);
  box-shadow: 0 14px 26px rgba(24, 32, 51, .10);
  animation: driftChip 7s ease-in-out infinite;
}
.chip-1 { left: 48%; top: 21%; --depth: .35; }
.chip-2 { left: 8%; bottom: 13%; animation-delay: -2s; --depth: .12; }
.chip-3 { left: 53%; top: 15%; animation-delay: -1.2s; --depth: .42; }
.chip-4 { right: 7%; bottom: 12%; animation-delay: -3s; --depth: .22; }
.chip-5 { left: 46%; bottom: 26%; animation-delay: -1.8s; --depth: .40; }
.chip-6 { right: 14%; top: 18%; animation-delay: -4s; --depth: .24; }
@keyframes driftChip { 0%, 100% { translate: 0 0; rotate: -4deg; } 50% { translate: 10px -18px; rotate: 10deg; } }

.progress-orbit {
  position: fixed;
  right: 1.3rem;
  bottom: 1.2rem;
  z-index: 30;
  display: grid;
  grid-auto-flow: column;
  gap: .5rem;
  padding: .6rem;
  border-radius: 999px;
  background: rgba(247, 242, 234, .58);
  border: 1px solid rgba(24, 32, 51, .14);
}
.progress-orbit span { width: .75rem; height: .75rem; border-radius: 50%; background: rgba(24, 32, 51, .20); transition: background .35s ease, transform .35s ease, box-shadow .35s ease; }
.progress-orbit span.active { background: var(--coral); transform: scale(1.25); box-shadow: 0 0 16px var(--coral); }

@media (max-width: 900px) {
  html { scroll-snap-type: y proximity; }
  .site-nav { align-items: flex-start; }
  .nav-notes span:nth-child(n+2) { display: none; }
  .chapter { grid-template-columns: 1fr; }
  .split { min-height: 50vh; padding: 5.8rem 1.25rem 2.5rem; }
  .seam { position: absolute; inset: 46% 1rem auto; height: 3rem; }
  .seam span { width: 72vw; height: 1.3rem; transform: none; }
  .slide-gallery { min-height: 52vh; }
  .microscope-strip { height: 42vh; }
  h1 { font-size: clamp(3rem, 15vw, 5rem); }
  h2 { font-size: clamp(2.6rem, 13vw, 4.6rem); }
}
