/* Page-level hooks for js/vendor/scrollfx.js (see js/scroll-effects.js). */

html .sfx-corgi,
html .sfx-track,
html .sfx-trail,
html .sfx-cpath {
  transition: opacity 0.35s ease;
}

html.sfx-hero-near .sfx-corgi,
html.sfx-hero-near .sfx-track,
html.sfx-hero-near .sfx-trail,
html.sfx-hero-near .sfx-cpath {
  opacity: 0;
  pointer-events: none;
}

/* Sections only keep ~32px side margins, so the progress rail hugs the viewport edge instead of the cards. */
html .sfx-track {
  right: 12px !important;
}

/* Only after a launch does the hero end in deep space, so only then fade it into the page. */
html:not([data-launch="completed"]) .sfx-hero-horizon {
  display: none !important;
}

/* ---------- Scroll black hole (js/scroll-hole.js) ---------- */

html.sh-pin .hero-pin {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

html.sh-pin .hero-pin > .launch-hero {
  position: sticky;
  pointer-events: auto;
}

.sh-void,
.sh-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

.sh-void {
  z-index: 1;
  background: radial-gradient(circle at var(--hx, 50%) var(--hy, 50%), rgba(5, 5, 13, 0.25) 0, rgba(5, 5, 13, 0.85) 45%, #05050d 100%);
}

.sh-hole {
  position: absolute;
  left: 0;
  z-index: 3;
  pointer-events: none;
}

.sh-flash {
  z-index: 6;
  background: radial-gradient(circle at var(--hx, 50%) var(--hy, 50%), #fff 0, rgba(238, 226, 255, 0.9) 22%, rgba(150, 110, 240, 0.5) 65%, rgba(70, 35, 170, 0.3) 100%);
}

.sh-ring {
  position: absolute;
  left: var(--hx, 50%);
  top: var(--hy, 50%);
  z-index: 7;
  width: 0;
  height: 0;
  translate: -50% -50%;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  box-shadow: 0 0 0 2px rgba(236, 224, 255, 0.95), 0 0 26px 6px rgba(167, 139, 250, 0.6), inset 0 0 26px 6px rgba(167, 139, 250, 0.35);
}

/* The paper dissolves into the space layer, so the ink turns to starlight with it. */
.launch-hero.is-holing {
  --ink: color-mix(in srgb, #f3ede2 calc(var(--sh-k, 0) * 100%), #16140f);
  --ink-soft: color-mix(in srgb, #c9c2d8 calc(var(--sh-k, 0) * 100%), #5a544b);
  --hairline: color-mix(in srgb, rgba(243, 237, 226, 0.2) calc(var(--sh-k, 0) * 100%), rgba(22, 20, 15, 0.14));
}

.launch-hero.is-holing .launch-hero__paper {
  opacity: calc(1 - var(--sh-k, 0));
}

.launch-hero.is-holing .hero-foot {
  border-top-color: transparent;
  transition: border-color 0.4s ease;
}

.launch-hero.is-holing .rocket-btn,
.launch-hero.is-holing .rocket-btn::after {
  background: #16140f;
}

/* Each letter carries its own piece of the violet block into the hole (layout stays identical). */
.launch-hero.is-holing .hero-name__line {
  background: transparent;
  box-shadow: none;
  transform: none;
}

.launch-hero.is-holing .hero-name__char {
  margin: -0.06em 0 -0.1em;
  padding: 0.06em 0 0.1em;
  background: var(--violet);
}

.launch-hero.is-holing .hero-name__char:first-child {
  margin-left: -0.16em;
  padding-left: 0.16em;
}

.launch-hero.is-holing .hero-name__char:last-child {
  margin-right: -0.16em;
  padding-right: 0.16em;
}

.sfx-finale-slot {
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

.sfx-finale-slot:empty {
  display: none;
}
