:root {
  --depth-color: #f0b35f;
  --depth-color-rgb: 240, 179, 95;
}

body.cristallo-genome-v3 {
  background: #050608;
}

body.cristallo-genome-v3 main {
  position: relative;
  isolation: isolate;
  overflow: clip;
  background: #050608;
}

.cristallo-descent-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 700ms ease;
}

body.is-in-cristallo-depth .cristallo-descent-canvas {
  opacity: 0.88;
}

.cristallo-depth-rail {
  position: fixed;
  left: clamp(0.75rem, 1.5vw, 1.5rem);
  top: 50%;
  z-index: 74;
  display: grid;
  gap: 0.18rem;
  transform: translateY(-50%) translateX(-4rem);
  opacity: 0;
  transition: opacity 300ms ease, transform 450ms ease;
}

body.is-in-cristallo-depth .cristallo-depth-rail {
  transform: translateY(-50%) translateX(0);
  opacity: 1;
}

.cristallo-depth-rail a {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.55rem;
  height: 2.55rem;
  color: #c9ced3;
  text-decoration: none;
}

.cristallo-depth-rail a::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -0.45rem;
  width: 1px;
  height: 0.72rem;
  background: rgba(255, 255, 255, 0.16);
  transform: translateX(-50%);
}

.cristallo-depth-rail a:first-child::before {
  display: none;
}

.cristallo-depth-rail i {
  display: block;
  width: 0.36rem;
  height: 0.36rem;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  background: #050608;
  box-shadow: 0 0 0 0 rgba(var(--depth-color-rgb), 0);
  transition: width 220ms ease, height 220ms ease, background 220ms ease, box-shadow 220ms ease;
}

.cristallo-depth-rail a:hover i,
.cristallo-depth-rail a:focus-visible i,
.cristallo-depth-rail a.is-active i {
  width: 0.72rem;
  height: 0.72rem;
  border-color: var(--depth-color);
  background: var(--depth-color);
  box-shadow: 0 0 1.1rem rgba(var(--depth-color-rgb), 0.66);
}

.cristallo-depth-rail span {
  position: absolute;
  left: 2.8rem;
  top: 50%;
  width: max-content;
  max-width: 12rem;
  padding: 0.35rem 0.5rem;
  border-left: 1px solid var(--depth-color);
  color: #f5f7f8;
  background: rgba(5, 6, 8, 0.94);
  font: 700 0.62rem/1.1 var(--font-sans, Arial, sans-serif);
  letter-spacing: 0;
  opacity: 0;
  pointer-events: none;
  transform: translate(0.4rem, -50%);
  transition: opacity 160ms ease, transform 160ms ease;
}

.cristallo-depth-rail a:hover span,
.cristallo-depth-rail a:focus-visible span,
.cristallo-depth-rail a.is-active span {
  opacity: 1;
  transform: translate(0, -50%);
}

.cristallo-depth-readout {
  position: fixed;
  right: clamp(0.8rem, 2vw, 2rem);
  bottom: clamp(0.75rem, 2vw, 1.5rem);
  z-index: 68;
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.65rem;
  align-items: center;
  color: #f5f7f8;
  opacity: 0;
  pointer-events: none;
  transform: translateY(1rem);
  transition: opacity 300ms ease, transform 450ms ease;
}

body.is-in-cristallo-depth .cristallo-depth-readout {
  opacity: 0.72;
  transform: translateY(0);
}

.cristallo-depth-readout > span {
  min-width: 2.25rem;
  color: var(--depth-color);
  font: 500 1.55rem/1 var(--font-mono, Consolas, monospace);
}

.cristallo-depth-readout p {
  display: grid;
  gap: 0.08rem;
  margin: 0;
  padding-left: 0.65rem;
  border-left: 1px solid rgba(var(--depth-color-rgb), 0.62);
}

.cristallo-depth-readout small,
.cristallo-depth-readout strong {
  letter-spacing: 0;
}

.cristallo-depth-readout small {
  color: #77808a;
  font-size: 0.58rem;
}

.cristallo-depth-readout strong {
  font-size: 0.72rem;
}

main > .cristallo-chamber {
  --chamber-color: #f0b35f;
  --chamber-rgb: 240, 179, 95;
  position: relative;
  z-index: 2;
  scroll-margin-top: calc(var(--header-height) + 0.75rem);
  width: min(calc(100% - clamp(1.5rem, 8vw, 8rem)), 92rem);
  margin-inline: auto;
  border-top: 1px solid rgba(var(--chamber-rgb), 0.2);
  border-bottom: 1px solid rgba(var(--chamber-rgb), 0.12);
  background-color: rgba(5, 6, 8, 0.74);
  box-shadow: 0 0 5rem rgba(0, 0, 0, 0.34);
}

main > .cristallo-chamber::before {
  content: attr(data-chamber-index);
  position: absolute;
  top: clamp(1.1rem, 3vw, 2rem);
  left: 50%;
  z-index: 7;
  min-width: 2.4rem;
  padding: 0.35rem 0.48rem;
  border: 1px solid rgba(var(--chamber-rgb), 0.45);
  color: var(--chamber-color);
  background: rgba(5, 6, 8, 0.88);
  font: 600 0.63rem/1 var(--font-mono, Consolas, monospace);
  letter-spacing: 0;
  text-align: center;
  transform: translateX(-50%);
}

main > .cristallo-chamber::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 0;
  width: 1px;
  background: rgba(var(--chamber-rgb), 0.18);
  pointer-events: none;
}

main > [data-chamber="memory"] {
  --chamber-color: #f0b35f;
  --chamber-rgb: 240, 179, 95;
}

main > [data-chamber="voice"] {
  --chamber-color: #78d7e8;
  --chamber-rgb: 120, 215, 232;
}

main > [data-chamber="relation"] {
  --chamber-color: #b99ce7;
  --chamber-rgb: 185, 156, 231;
}

main > [data-chamber="collective"] {
  --chamber-color: #9fdcff;
  --chamber-rgb: 159, 220, 255;
}

main > [data-chamber="learning"] {
  --chamber-color: #80dfba;
  --chamber-rgb: 128, 223, 186;
}

main > [data-chamber="origin"] {
  --chamber-color: #c8a5f1;
  --chamber-rgb: 200, 165, 241;
}

main > [data-chamber="matter"] {
  --chamber-color: #f08a38;
  --chamber-rgb: 240, 138, 56;
}

main > [data-chamber="constellation"] {
  --chamber-color: #8dbef1;
  --chamber-rgb: 141, 190, 241;
}

main > [data-chamber="play"] {
  --chamber-color: #83e0bd;
  --chamber-rgb: 131, 224, 189;
}

main > [data-chamber="idea"] {
  --chamber-color: #63e1d0;
  --chamber-rgb: 99, 225, 208;
}

main > [data-chamber="rest"] {
  --chamber-color: #f2f4f2;
  --chamber-rgb: 242, 244, 242;
}

.cristallo-chamber .eyebrow span:first-child,
.cristallo-chamber .scene-line,
.cristallo-chamber .ideaing-window-label {
  color: var(--chamber-color);
}

.cristallo-chamber.scene {
  display: grid;
  min-height: clamp(44rem, 100svh, 62rem);
  padding: clamp(7rem, 12vh, 9.5rem) clamp(2rem, 7vw, 7rem);
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}

.cristallo-chamber.scene .scene-media {
  position: absolute;
  top: clamp(4.75rem, 8vh, 7rem);
  bottom: clamp(4rem, 7vh, 6rem);
  z-index: 1;
  width: min(69%, 64rem);
  height: auto;
  overflow: hidden;
  border: 1px solid rgba(var(--chamber-rgb), 0.28);
  background: #090b0e;
  box-shadow: 0 1.2rem 5rem rgba(0, 0, 0, 0.48);
}

.cristallo-chamber.scene[data-chamber-side="left"] .scene-media {
  right: clamp(1.5rem, 4vw, 4rem);
  left: auto;
  clip-path: polygon(10% 0, 100% 0, 100% 100%, 0 100%, 0 12%);
}

.cristallo-chamber.scene[data-chamber-side="right"] .scene-media {
  left: clamp(1.5rem, 4vw, 4rem);
  right: auto;
  clip-path: polygon(0 0, 90% 0, 100% 12%, 100% 100%, 0 100%);
}

.cristallo-chamber.scene[data-chamber-side="center"] .scene-media {
  left: 50%;
  width: calc(100% - clamp(3rem, 9vw, 9rem));
  transform: translateX(-50%);
  clip-path: polygon(5% 0, 95% 0, 100% 10%, 100% 90%, 95% 100%, 5% 100%, 0 90%, 0 10%);
}

.cristallo-chamber.scene .scene-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.78;
  filter: saturate(0.88) contrast(1.05);
  transform: scale(1.02);
  transition: opacity 800ms ease, transform 1400ms cubic-bezier(0.2, 0.7, 0.1, 1);
}

.cristallo-chamber.scene.is-visible .scene-media img {
  opacity: 0.9;
  transform: scale(1);
}

.cristallo-chamber.scene .scene-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: rgba(5, 6, 8, 0.18);
  pointer-events: none;
}

.cristallo-chamber.scene .scene-copy {
  position: relative;
  inset: auto;
  z-index: 4;
  width: min(100%, 36rem);
  max-width: 36rem;
  margin: 0;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border-left: 2px solid var(--chamber-color);
  background: rgba(5, 6, 8, 0.84);
  box-shadow: 0 1rem 4rem rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(2rem);
}

.cristallo-chamber.scene.is-visible .scene-copy {
  opacity: 1;
  transform: translateY(0);
}

.cristallo-chamber.scene[data-chamber-side="left"] .scene-copy {
  justify-self: start;
  text-align: left;
}

.cristallo-chamber.scene[data-chamber-side="right"] .scene-copy {
  justify-self: end;
  text-align: left;
}

.cristallo-chamber.scene[data-chamber-side="center"] .scene-copy {
  justify-self: center;
  text-align: center;
  border-right: 2px solid var(--chamber-color);
}

.cristallo-chamber.scene .scene-count {
  display: none;
}

.cristallo-chamber.scene h2 {
  font-size: clamp(3rem, 6.5vw, 7rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.cristallo-chamber.scene-team {
  min-height: clamp(58rem, 120svh, 74rem);
}

.cristallo-chamber.scene-team .scene-copy {
  width: min(100%, 45rem);
  max-width: 45rem;
}

.cristallo-chamber-wide {
  border-right: 1px solid rgba(var(--chamber-rgb), 0.16);
  border-left: 1px solid rgba(var(--chamber-rgb), 0.16);
}

.mugen-origin.cristallo-chamber,
.mugen-lung.cristallo-chamber,
.foundry-program.cristallo-chamber,
.partner-constellation.cristallo-chamber,
.play-backwards.cristallo-chamber,
.ideaing-preview.cristallo-chamber,
.quiet-end.cristallo-chamber {
  margin-top: clamp(5rem, 11vh, 10rem);
  margin-bottom: clamp(5rem, 11vh, 10rem);
}

.mugen-origin.cristallo-chamber,
.play-backwards.cristallo-chamber {
  overflow: hidden;
}

.mugen-origin.cristallo-chamber .mugen-origin-media,
.play-backwards.cristallo-chamber .play-backwards-media {
  border: 1px solid rgba(var(--chamber-rgb), 0.28);
}

.mugen-lung.cristallo-chamber,
.foundry-program.cristallo-chamber,
.partner-constellation.cristallo-chamber,
.ideaing-preview.cristallo-chamber {
  background-color: rgba(7, 9, 12, 0.9);
}

.mugen-lung.cristallo-chamber,
.foundry-program.cristallo-chamber,
.partner-constellation.cristallo-chamber {
  padding-top: clamp(6rem, 10vw, 10rem);
  padding-bottom: clamp(6rem, 10vw, 10rem);
}

.mugen-lung.cristallo-chamber .mugen-lung-copy,
.foundry-program.cristallo-chamber .foundry-program-intro,
.partner-constellation.cristallo-chamber .partner-constellation-copy,
.ideaing-preview.cristallo-chamber .ideaing-intro {
  position: relative;
  z-index: 3;
}

.mugen-lung.cristallo-chamber .mugen-lung-copy::before,
.foundry-program.cristallo-chamber .foundry-program-intro::before,
.partner-constellation.cristallo-chamber .partner-constellation-copy::before,
.ideaing-preview.cristallo-chamber .ideaing-intro::before {
  content: "";
  display: block;
  width: clamp(3rem, 7vw, 7rem);
  height: 2px;
  margin-bottom: 1.5rem;
  background: var(--chamber-color);
}

.foundry-program.cristallo-chamber .foundry-milestones article,
.foundry-program.cristallo-chamber .foundry-system-column,
.foundry-program.cristallo-chamber .foundry-delivery-grid > section,
.partner-constellation.cristallo-chamber .partner-route-ledger p,
.ideaing-preview.cristallo-chamber .ideaing-workbench {
  border-color: rgba(var(--chamber-rgb), 0.24);
}

.quiet-end.cristallo-chamber {
  min-height: min(80svh, 52rem);
  background-color: rgba(5, 6, 8, 0.58);
}

body:not(.is-in-cristallo-depth) .cristallo-depth-rail,
body:not(.is-in-cristallo-depth) .cristallo-depth-readout {
  pointer-events: none;
}

@media (max-width: 900px) {
  .cristallo-depth-rail {
    top: auto;
    right: 0.75rem;
    bottom: 0.65rem;
    left: 0.75rem;
    grid-template-columns: repeat(9, 1fr);
    gap: 0;
    padding: 0.25rem 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(5, 6, 8, 0.9);
    transform: translateY(4rem);
  }

  body.is-in-cristallo-depth .cristallo-depth-rail {
    transform: translateY(0);
  }

  .cristallo-depth-rail a {
    width: 100%;
    height: 2.2rem;
  }

  .cristallo-depth-rail a::before,
  .cristallo-depth-rail span {
    display: none;
  }

  .cristallo-depth-readout {
    right: 0.9rem;
    bottom: 3.6rem;
  }

  main > .cristallo-chamber {
    scroll-margin-top: calc(var(--header-height) + 0.35rem);
    width: calc(100% - 1rem);
  }

  .cristallo-chamber.scene {
    min-height: 54rem;
    padding: 6rem 1rem 4rem;
    align-items: end;
  }

  .cristallo-chamber.scene .scene-media,
  .cristallo-chamber.scene[data-chamber-side="left"] .scene-media,
  .cristallo-chamber.scene[data-chamber-side="right"] .scene-media,
  .cristallo-chamber.scene[data-chamber-side="center"] .scene-media {
    top: 4rem;
    right: 1rem;
    bottom: 10rem;
    left: 1rem;
    width: auto;
    transform: none;
    clip-path: polygon(0 0, 92% 0, 100% 8%, 100% 100%, 8% 100%, 0 92%);
  }

  .cristallo-chamber.scene .scene-copy,
  .cristallo-chamber.scene[data-chamber-side="left"] .scene-copy,
  .cristallo-chamber.scene[data-chamber-side="right"] .scene-copy,
  .cristallo-chamber.scene[data-chamber-side="center"] .scene-copy {
    align-self: end;
    justify-self: stretch;
    width: 100%;
    max-width: none;
    padding: 1.25rem;
    border-right: 0;
    text-align: left;
  }

  .cristallo-chamber.scene h2 {
    font-size: clamp(2.8rem, 13vw, 5.2rem);
  }

  .cristallo-chamber.scene-team {
    min-height: 74rem;
  }

  .mugen-origin.cristallo-chamber,
  .mugen-lung.cristallo-chamber,
  .foundry-program.cristallo-chamber,
  .partner-constellation.cristallo-chamber,
  .play-backwards.cristallo-chamber,
  .ideaing-preview.cristallo-chamber,
  .quiet-end.cristallo-chamber {
    margin-top: 3rem;
    margin-bottom: 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cristallo-descent-canvas {
    transition: none;
  }

  .cristallo-chamber.scene .scene-media img,
  .cristallo-chamber.scene .scene-copy,
  .cristallo-depth-rail,
  .cristallo-depth-readout {
    transition: none;
  }
}
