/* NEXUS home: constellation / skill tree behind the content (constellation.js). Home only. */
.page-home main#top, .page-glossary main#top, .page-sim main#top, .page-library main#top { position: relative; }
/* dictionary: the list grows and shrinks (filters, open entries), so the layer is cut at the page instead of making it taller */
.page-glossary main#top, .page-sim main#top { overflow-y: clip; }
.page-glossary .cs-layer, .page-sim .cs-layer { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 220px, #000 calc(100% - 260px), transparent 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 220px, #000 calc(100% - 260px), transparent 100%); }
.cs-layer {
  position: absolute; left: 0; top: 0; z-index: 1; /* above the section tints, under the content (containers are z-index 1 and come later) */
  pointer-events: none; overflow: visible;
  animation: cs-in 1.6s ease both;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 520px, #000 calc(100% - 300px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 520px, #000 calc(100% - 300px), transparent 100%);
}
@keyframes cs-in { from { opacity: 0; } to { opacity: 1; } }
.cs-e { stroke: rgba(201, 169, 97, .19); stroke-width: .8; fill: none; } /* each link also gets an inline opacity from how open its surroundings are */
.cs-s { stroke: rgba(226, 200, 130, .32); stroke-width: 1; }
.cs-p { stroke: rgba(255, 238, 190, .95); stroke-width: 1.3; stroke-linecap: round; fill: none; stroke-dasharray: 5 100; stroke-dashoffset: 5; animation: cs-run 9s linear infinite; }
@keyframes cs-run { 0% { stroke-dashoffset: 5; opacity: 0; } 8% { opacity: 1; } 92% { opacity: 1; } 100% { stroke-dashoffset: -100; opacity: 0; } }
.cs-n { fill: #ece3cc; opacity: calc(.55 * var(--w, 1)); } /* --w: set per star by the script */
.cs-b { opacity: calc(1 * var(--w, 1)); fill: #fff6dc; }
.cs-d { fill: #ece3cc; opacity: calc(.5 * var(--w, 1)); }
.cs-x { fill: none; stroke: #fff3d2; stroke-width: .6; stroke-linecap: round; opacity: calc(.5 * var(--w, 1)); }
.cs-rip { transform-box: fill-box; transform-origin: center; opacity: 0; animation: cs-rip 8s ease-out infinite; }
@keyframes cs-rip { 0% { transform: scale(.55); opacity: .5; } 100% { transform: scale(2.7); opacity: 0; } }
.cs-tw { animation: cs-tw var(--d, 6s) ease-in-out var(--dl, 0s) infinite; }
@keyframes cs-tw { 0%, 100% { opacity: calc(.16 * var(--w, 1)); } 50% { opacity: calc(.95 * var(--w, 1)); } }
.cs-b.cs-tw { animation-name: cs-tw-b; }
@keyframes cs-tw-b { 0%, 100% { opacity: calc(.45 * var(--w, 1)); } 50% { opacity: calc(1 * var(--w, 1)); } }
.cs-spin { transform-box: fill-box; transform-origin: center; animation: cs-rot 90s linear infinite; }
@keyframes cs-rot { to { transform: rotate(360deg); } }
@media (max-width: 700px) { .cs-e { stroke: rgba(201, 169, 97, .26); } }
@media (prefers-reduced-motion: reduce) { .cs-layer, .cs-p, .cs-tw, .cs-spin, .cs-rip { animation: none; } .cs-p, .cs-rip { display: none; } }
/* Journal and conditions library: the filters and the cards stay clear (constellation.js keeps the whole column free), so the sky lives around the title and in the side margins.
   The page grows and shrinks with the filters, so the layer is cut at the page; it fades out at the top (under the menu) and bottom (before the footer). */
.page-library main#top { overflow-y: clip; }
.page-library .cs-layer { -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 90px, #000 calc(100% - 220px), transparent 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 90px, #000 calc(100% - 220px), transparent 100%); }
