
/* ---------------- Open-source credits in help ---------------- */

.help-credits {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.help-credits p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 300;
  line-height: 1.7;
}

.help-credits a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.28);
}

/* ---------------- Prologue / entry ---------------- */

.intro {
  --intro-accent: #e4b478;
  position: fixed;
  inset: 0;
  z-index: 80;
  display: block;
  overflow: hidden auto;
  color: var(--ink);
  background: #050608;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.85s var(--ease-soft), visibility 0.85s var(--ease-soft);
}

/* Before the first script frame: keep the app out of the initial paint.
   A deep link removes this class in the head; the prologue removes it on show. */
html.intro-boot .app {
  visibility: hidden;
}

html.intro-boot .intro {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.intro.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.intro-open {
  overflow: hidden;
}

.intro-nebula {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(70% 60% at 72% 18%, rgba(130, 79, 43, 0.23), transparent 72%),
    radial-gradient(65% 72% at 12% 85%, rgba(42, 73, 122, 0.22), transparent 72%),
    radial-gradient(58% 55% at 45% 48%, rgba(72, 48, 89, 0.16), transparent 76%),
    #050608;
}

.nebula-blob {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(74px);
  mix-blend-mode: screen;
  opacity: 0.58;
  will-change: transform;
}

.nebula-a {
  top: -24%;
  left: -18%;
  width: min(72vw, 980px);
  height: min(72vw, 980px);
  background: radial-gradient(circle at 52% 50%, rgba(209, 121, 63, 0.58), transparent 66%);
  animation: nebulaDriftA 32s ease-in-out infinite alternate;
}

.nebula-b {
  top: -16%;
  right: -20%;
  width: min(64vw, 900px);
  height: min(64vw, 900px);
  background: radial-gradient(circle at 50% 50%, rgba(78, 124, 188, 0.5), transparent 68%);
  animation: nebulaDriftB 39s ease-in-out infinite alternate;
}

.nebula-c {
  bottom: -34%;
  left: 18%;
  width: min(68vw, 960px);
  height: min(68vw, 960px);
  background: radial-gradient(circle at 50% 50%, rgba(151, 89, 135, 0.38), transparent 68%);
  animation: nebulaDriftC 46s ease-in-out infinite alternate;
}

.nebula-d {
  right: -8%;
  bottom: -38%;
  width: min(55vw, 760px);
  height: min(55vw, 760px);
  background: radial-gradient(circle at 50% 50%, rgba(62, 129, 127, 0.3), transparent 68%);
  animation: nebulaDriftD 36s ease-in-out infinite alternate;
}

@keyframes nebulaDriftA {
  0% { transform: translate3d(-3%, -2%, 0) scale(1); }
  50% { transform: translate3d(5%, 4%, 0) scale(1.1); }
  100% { transform: translate3d(-1%, 8%, 0) scale(1.03); }
}

@keyframes nebulaDriftB {
  0% { transform: translate3d(3%, -3%, 0) scale(1.02); }
  50% { transform: translate3d(-5%, 6%, 0) scale(1.12); }
  100% { transform: translate3d(2%, 1%, 0) scale(1); }
}

@keyframes nebulaDriftC {
  0% { transform: translate3d(-4%, 4%, 0) scale(1); }
  50% { transform: translate3d(6%, -5%, 0) scale(1.08); }
  100% { transform: translate3d(1%, -1%, 0) scale(1.03); }
}

@keyframes nebulaDriftD {
  0% { transform: translate3d(2%, 3%, 0) scale(1.04); }
  50% { transform: translate3d(-4%, -3%, 0) scale(1); }
  100% { transform: translate3d(4%, 1%, 0) scale(1.08); }
}

#intro-nebula-canvas {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  pointer-events: none;
  opacity: 0.82;
  filter: blur(18px) saturate(1.12);
  mix-blend-mode: screen;
}

#intro-stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.82;
  pointer-events: none;
}

.intro-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(3, 4, 7, 0.58) 0%, transparent 19%, transparent 78%, rgba(3, 4, 7, 0.72) 100%),
    radial-gradient(circle at 52% 48%, transparent 34%, rgba(3, 4, 7, 0.26) 74%, rgba(3, 4, 7, 0.68) 100%);
}

.intro-shell {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  width: min(1340px, 100%);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(22px, 4.2vh, 46px) clamp(24px, 5.2vw, 78px) clamp(18px, 3.2vh, 32px);
}

.intro-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.intro-brand {
  pointer-events: none;
}

.intro-kicker {
  color: rgba(214, 199, 178, 0.62);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.24em;
  white-space: nowrap;
}

.intro-main {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(330px, 0.82fr);
  align-items: center;
  gap: clamp(42px, 7vw, 118px);
  flex: 1 1 auto;
  padding: clamp(44px, 7vh, 86px) 0 clamp(38px, 5vh, 62px);
}

.intro-copy {
  max-width: 690px;
}

.intro-overline {
  display: block;
  margin-bottom: 24px;
  color: var(--intro-accent);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.26em;
}

.intro-title {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(40px, 6.2vw, 88px);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.intro-title-line {
  display: inline-block;
  white-space: nowrap;
}

.intro-tagline {
  margin: 20px 0 0;
  color: rgba(224, 212, 196, 0.76);
  font-family: var(--serif);
  font-size: clamp(16px, 1.45vw, 21px);
  font-weight: 300;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.intro-title em {
  color: var(--intro-accent);
  font-style: normal;
}

.intro-en-title {
  margin: 9px 0 0;
  color: rgba(231, 218, 199, 0.58);
  font-family: var(--serif);
  font-size: clamp(17px, 1.5vw, 21px);
  font-style: italic;
  font-weight: 300;
  letter-spacing: 0.01em;
}

.intro-cn {
  max-width: 40ch;
  margin: 28px 0 0;
  color: rgba(222, 214, 202, 0.82);
  font-size: clamp(13.5px, 1.1vw, 15px);
  font-weight: 300;
  line-height: 1.95;
  letter-spacing: 0.015em;
}

.intro-en {
  max-width: 54ch;
  margin: 15px 0 0;
  color: rgba(203, 195, 184, 0.48);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 300;
  line-height: 1.85;
  letter-spacing: 0.015em;
}

.intro-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 22px;
  margin-top: 38px;
  color: rgba(192, 181, 166, 0.4);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.intro-card {
  position: relative;
  width: 100%;
  max-width: 432px;
  justify-self: end;
  padding: clamp(24px, 2.8vw, 34px);
  border: 1px solid rgba(235, 222, 203, 0.16);
  border-radius: 2px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 24%),
    rgba(8, 10, 14, 0.58);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(28px) saturate(135%);
  -webkit-backdrop-filter: blur(28px) saturate(135%);
}

.intro-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 30px;
  color: rgba(211, 198, 180, 0.52);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.17em;
}

.intro-card-index {
  color: var(--intro-accent);
}

.intro-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: rgba(232, 222, 209, 0.86);
  font-size: 11.5px;
  letter-spacing: 0.03em;
}

.intro-label span,
.intro-field label span {
  color: rgba(194, 183, 169, 0.42);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.intro-mass-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 8px;
  border-bottom: 1px solid rgba(226, 213, 194, 0.24);
}

.intro-mass-row input {
  width: 100%;
  min-width: 0;
  padding: 2px 0 8px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-family: var(--serif);
  font-size: clamp(44px, 4.4vw, 58px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
  -moz-appearance: textfield;
}

.intro-mass-row input::-webkit-outer-spin-button,
.intro-mass-row input::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.intro-mass-row span {
  flex: none;
  color: var(--intro-accent);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.intro-range {
  width: 100%;
  height: 26px;
  margin: 8px 0 0;
  accent-color: var(--intro-accent);
  cursor: ew-resize;
}

.intro-scale {
  display: flex;
  justify-content: space-between;
  color: rgba(194, 183, 169, 0.34);
  font-family: var(--mono);
  font-size: 8px;
}

.intro-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 15px 0 22px;
}

.intro-presets button {
  padding: 6px 9px;
  border: 1px solid rgba(225, 212, 194, 0.14);
  border-radius: 1px;
  color: rgba(216, 204, 189, 0.62);
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 0.3s, color 0.3s, background 0.3s;
}

.intro-presets button:hover,
.intro-presets button:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.48);
  color: var(--ink);
  background: rgba(var(--accent-rgb), 0.08);
  outline: none;
}

.intro-field {
  display: grid;
  gap: 7px;
  margin-bottom: 22px;
}

.intro-field label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: rgba(232, 222, 209, 0.78);
  font-size: 11.5px;
}

.intro-field select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid rgba(225, 212, 194, 0.16);
  border-radius: 1px;
  color: rgba(231, 220, 205, 0.82);
  background: rgba(255, 255, 255, 0.035);
  font-family: var(--sans);
  font-size: 11px;
  outline: none;
}

.intro-field select:focus-visible {
  border-color: rgba(var(--accent-rgb), 0.58);
}

.intro-path {
  padding: 13px 14px;
  border-left: 1px solid rgba(var(--accent-rgb), 0.42);
  background: rgba(var(--accent-rgb), 0.045);
}

.intro-path-label {
  display: block;
  color: rgba(204, 191, 175, 0.46);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.13em;
}

.intro-path strong {
  display: block;
  margin-top: 5px;
  color: var(--intro-accent);
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.intro-path p {
  margin: 4px 0 0;
  color: rgba(206, 195, 181, 0.55);
  font-size: 10.5px;
  font-weight: 300;
  line-height: 1.6;
}

.intro-mass-hint {
  margin: 12px 0 19px;
  color: rgba(193, 181, 166, 0.38);
  font-size: 9.5px;
  font-weight: 300;
  line-height: 1.6;
}

.intro-submit,
.intro-direct {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border-radius: 1px;
  font-family: var(--sans);
  cursor: pointer;
  transition: background 0.35s var(--ease-soft), color 0.35s, border-color 0.35s;
}

.intro-submit {
  padding: 14px 16px;
  border: 1px solid var(--intro-accent);
  color: #17110a;
  background: var(--intro-accent);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.intro-submit span {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.intro-submit:hover,
.intro-submit:focus-visible {
  background: #f0c58e;
  outline: none;
}

.intro-direct {
  margin-top: 8px;
  padding: 11px 12px;
  border: 1px solid transparent;
  color: rgba(210, 199, 185, 0.52);
  background: transparent;
  font-size: 10px;
}

.intro-direct span {
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.12em;
}

.intro-direct:hover,
.intro-direct:focus-visible {
  border-color: rgba(225, 212, 194, 0.18);
  color: rgba(238, 226, 209, 0.88);
  outline: none;
}

.intro-footer {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(225, 212, 194, 0.1);
  color: rgba(190, 179, 165, 0.32);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.1em;
}

@media (max-width: 980px) {
  .intro {
    overflow-y: auto;
  }

  .intro-main {
    grid-template-columns: 1fr;
    gap: 36px;
    align-items: start;
    padding-top: 52px;
  }

  .intro-card {
    max-width: 560px;
    justify-self: start;
  }

  .intro-title {
    font-size: clamp(44px, 8.5vw, 64px);
  }
}

@media (max-width: 640px) {
  .intro-shell {
    padding: 18px 20px 22px;
  }

  .intro-top {
    align-items: flex-start;
  }

  .intro-kicker {
    font-size: 7.5px;
    letter-spacing: 0.16em;
  }

  .intro-main {
    gap: 28px;
    padding: 38px 0 28px;
  }

  .intro-overline {
    margin-bottom: 17px;
    font-size: 7.5px;
    letter-spacing: 0.18em;
  }

  .intro-title {
    font-size: clamp(34px, 9vw, 44px);
  }

  .intro-tagline {
    margin-top: 13px;
    font-size: 15px;
  }

  .intro-en-title {
    margin-top: 7px;
    font-size: 15px;
  }

  .intro-en-title {
    margin-top: 12px;
    font-size: 16px;
  }

  .intro-cn {
    margin-top: 23px;
    font-size: 12.5px;
    line-height: 1.85;
  }

  .intro-en {
    font-size: 10px;
  }

  .intro-notes {
    margin-top: 24px;
    font-size: 7px;
  }

  .intro-card {
    padding: 21px;
  }

  .intro-card-head {
    margin-bottom: 23px;
  }

  .intro-mass-row input {
    font-size: 45px;
  }

  .intro-presets {
    margin-bottom: 18px;
  }

  .intro-footer {
    flex-direction: column;
    gap: 5px;
    font-size: 7px;
    line-height: 1.5;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nebula-blob {
    animation: none !important;
  }

  .intro {
    transition: none;
  }
}


/* ---------------- Themed translucent cursors ---------------- */

@media (pointer: fine) {
  html,
  body {
    cursor: url("assets/cursors/cursor-default.png") 16 16, default !important;
  }

  a,
  button,
  [role="button"],
  select,
  input[type="range"],
  .track,
  .timeline-button,
  .brand,
  .help-toggle,
  .sound-toggle {
    cursor: url("assets/cursors/cursor-pointer.png") 16 16, pointer !important;
  }

  input[type="text"],
  input[type="number"],
  textarea {
    cursor: text !important;
  }

  .stage,
  #bh-canvas {
    cursor: url("assets/cursors/cursor-grab.png") 16 16, grab !important;
  }

  .stage.is-dragging,
  .stage.is-dragging #bh-canvas,
  #bh-canvas:active {
    cursor: url("assets/cursors/cursor-grabbing.png") 16 16, grabbing !important;
  }
}
