:root {
  color-scheme: dark;
  font-family: "Space Grotesk", sans-serif;
  color: #f5f2e9;
  background: #090b10;
  font-synthesis: none;
  --orange: #f4623a;
  --paper: #f5f2e9;
  --muted: #aca99f;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  background: #090b10;
}

body {
  min-width: 320px;
  min-height: 100%;
  min-height: 100vh;
  margin: 0;
  background: #090b10;
}

a {
  color: inherit;
}

.cosmos {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 68% 32%, rgb(244 98 58 / 13%), transparent 30%),
    radial-gradient(circle at 25% 85%, rgb(71 102 255 / 11%), transparent 30%),
    #090b10;
  contain: paint style;
  isolation: isolate;
}

.cosmos::after {
  position: absolute;
  inset: 0;
  z-index: 12;
  background: linear-gradient(to bottom, rgb(9 11 16 / 8%), transparent 25%, rgb(9 11 16 / 28%));
  content: "";
}

.starfield {
  position: absolute;
  inset: -18%;
  will-change: transform;
}

.starfield--far {
  background:
    radial-gradient(ellipse at 14% 68%, rgb(68 83 173 / 18%), transparent 31%),
    radial-gradient(ellipse at 78% 28%, rgb(156 69 119 / 10%), transparent 25%),
    radial-gradient(ellipse at 52% 52%, rgb(244 98 58 / 7%), transparent 19%);
  opacity: 0.66;
  transform: translate3d(0, 0, 0) rotate(-7deg) scale(1.08);
}

.starfield--near {
  background:
    radial-gradient(ellipse at 22% 18%, rgb(116 132 255 / 10%), transparent 18%),
    radial-gradient(ellipse at 82% 72%, rgb(244 98 58 / 8%), transparent 21%),
    radial-gradient(ellipse at 42% 86%, rgb(91 61 145 / 10%), transparent 24%);
  opacity: 0.52;
  transform: translate3d(0, 0, 0) rotate(5deg) scale(1.05);
}

.warp-field {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.88;
  transition: opacity 0.8s ease;
}

.nebula {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(120vw, 72rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 45% 48%, rgb(244 98 58 / 17%), transparent 18%),
    radial-gradient(circle at 55% 52%, rgb(66 74 147 / 21%), transparent 42%);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.3);
  transition: opacity 1.2s ease, transform 1.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform;
}

.portal {
  position: absolute;
  top: 46%;
  left: 50%;
  z-index: 4;
  width: min(108vw, 58rem);
  aspect-ratio: 1.72;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.25) rotate(-9deg);
  transition:
    opacity 1.2s ease,
    transform 1.8s cubic-bezier(0.16, 1, 0.3, 1);
  contain: layout paint style;
  will-change: opacity, transform;
}

.portal__canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.celestial {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  will-change: opacity, transform;
  transition: opacity 1s ease, transform 1.4s cubic-bezier(0.2, 0.75, 0.2, 1);
}

.earth {
  bottom: -34rem;
  left: 50%;
  width: min(145vw, 68rem);
  aspect-ratio: 1;
  background:
    radial-gradient(ellipse at 38% 18%, rgb(236 236 203 / 40%) 0 4%, transparent 5%),
    radial-gradient(ellipse at 61% 27%, rgb(82 125 92 / 65%) 0 8%, transparent 9%),
    radial-gradient(ellipse at 31% 34%, rgb(82 125 92 / 48%) 0 11%, transparent 12%),
    radial-gradient(circle at 38% 22%, #718ab3, #243855 48%, #101622 70%);
  box-shadow:
    0 -0.25rem 1.5rem rgb(143 184 255 / 55%),
    0 -2rem 8rem rgb(54 93 167 / 22%);
  transform: translateX(-50%) scale(0.72);
}

.moon {
  top: 24%;
  right: 8%;
  width: clamp(7rem, 19vw, 12rem);
  aspect-ratio: 1;
  background:
    radial-gradient(circle at 33% 28%, rgb(81 82 84 / 28%) 0 5%, transparent 6%),
    radial-gradient(circle at 62% 58%, rgb(65 66 69 / 30%) 0 9%, transparent 10%),
    radial-gradient(circle at 38% 38%, #d8d5cb, #777a82 62%, #2d3038 100%);
  box-shadow: -1.5rem 0 4rem rgb(222 226 255 / 12%);
  transform: translate(45vw, -12vh) scale(0.45);
}

.mars {
  top: 18%;
  left: -3rem;
  width: clamp(11rem, 29vw, 20rem);
  aspect-ratio: 1;
  background:
    radial-gradient(ellipse at 58% 33%, rgb(87 42 31 / 46%) 0 11%, transparent 12%),
    radial-gradient(ellipse at 38% 64%, rgb(107 48 34 / 35%) 0 15%, transparent 16%),
    radial-gradient(circle at 62% 35%, #d26943, #8f382b 58%, #281416 100%);
  box-shadow: 1rem 0 6rem rgb(222 79 48 / 22%);
  transform: translate(-45vw, 18vh) scale(0.5);
}

.saturn {
  top: 48%;
  right: 1%;
  width: clamp(8rem, 22vw, 15rem);
  aspect-ratio: 1;
  background: radial-gradient(circle at 38% 32%, #d2b47d, #7d6548 60%, #2f261f);
  box-shadow: 0 0 5rem rgb(211 171 101 / 11%);
  transform: translate(45vw, 15vh) rotate(-16deg) scale(0.5);
}

.saturn span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 165%;
  height: 35%;
  border: 0.55rem solid rgb(200 178 135 / 58%);
  border-right-color: rgb(92 75 54 / 45%);
  border-left-color: rgb(237 216 166 / 58%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.cosmos[data-stage="0"] .earth {
  opacity: 0.68;
  transform: translateX(-50%) scale(0.78);
}

.cosmos[data-stage="1"] .earth {
  opacity: 0.82;
  transform: translateX(-50%) translateY(9rem) scale(1.1);
}

.cosmos[data-stage="2"] .earth {
  opacity: 0.3;
  transform: translateX(-72%) translateY(18rem) scale(0.62);
}

.cosmos[data-stage="2"] .moon,
.cosmos[data-stage="3"] .moon {
  opacity: 0.85;
  transform: translate(0, 0) scale(1);
}

.cosmos[data-stage="3"] .moon {
  opacity: 0.4;
  transform: translate(-54vw, 32vh) scale(1.45);
}

.cosmos[data-stage="3"] .mars,
.cosmos[data-stage="4"] .mars {
  opacity: 0.84;
  transform: translate(0, 0) scale(1);
}

.cosmos[data-stage="4"] .mars {
  opacity: 0.28;
  transform: translate(42vw, 35vh) scale(0.68);
}

.cosmos[data-stage="4"] .saturn {
  opacity: 0.74;
  transform: translate(0, 0) rotate(-16deg) scale(1);
}

.cosmos[data-stage="4"] .portal {
  opacity: 0.24;
  transform: translate(-50%, -50%) scale(0.62) rotate(-5deg);
}

.cosmos[data-stage="5"] .saturn {
  opacity: 0.2;
  transform: translate(-60vw, -30vh) rotate(-28deg) scale(0.55);
}

.cosmos[data-stage="5"] .nebula {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.cosmos[data-stage="5"] .portal {
  opacity: 0.98;
  transform: translate(-50%, -50%) scale(1) rotate(0deg);
}

.cosmos[data-stage="5"] .warp-field {
  opacity: 0.95;
}

.flight-path {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(42vw, 20rem);
  height: min(74vh, 42rem);
  border: 1px solid rgb(255 255 255 / 9%);
  border-right-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(22deg);
}

.prayer-smoke {
  position: absolute;
  inset: 0;
  z-index: 8;
  overflow: hidden;
  pointer-events: none;
}

.prayer-smoke__emoji {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  font-size: var(--prayer-size, 1rem);
  line-height: 1;
  opacity: 0;
  transform:
    translate3d(-50%, -50%, 0)
    scale(0.5)
    rotate(var(--prayer-start-rotation, 0deg));
  animation: prayerSmoke var(--prayer-duration, 1.8s) ease-out forwards;
  filter: drop-shadow(0 0 0.45rem rgb(255 181 102 / 28%));
  will-change: opacity, transform;
}

.craft-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 10;
  width: 1.8rem;
  will-change: transform;
}

.craft {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 1.8rem;
  transform: translate3d(-50%, calc(-50% + 18vh), 0) scale(0.88);
  will-change: transform;
}

.craft__body {
  position: relative;
  display: block;
  width: 1.55rem;
  height: 3.7rem;
  border: 1px solid rgb(255 255 255 / 48%);
  border-radius: 55% 55% 30% 30%;
  background: linear-gradient(90deg, #777b84, #f2eee5 45%, #8c8d91);
  box-shadow:
    inset -0.25rem 0 0.4rem rgb(22 26 35 / 35%),
    0 0 1rem rgb(255 255 255 / 12%);
}

.craft__body::before,
.craft__body::after {
  position: absolute;
  bottom: 0.15rem;
  width: 0.65rem;
  height: 1.1rem;
  background: #cb4e31;
  content: "";
}

.craft__body::before {
  left: -0.48rem;
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.craft__body::after {
  right: -0.48rem;
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}

.craft__body i {
  position: absolute;
  top: 1rem;
  left: 50%;
  width: 0.62rem;
  height: 0.62rem;
  border: 1px solid rgb(255 255 255 / 72%);
  border-radius: 50%;
  background: #25334b;
  transform: translateX(-50%);
}

.craft__flame {
  z-index: 2;
  width: 0.58rem;
  height: 1.55rem;
  margin-top: -0.1rem;
  border-radius: 20% 20% 70% 70%;
  background: linear-gradient(#fff3bb, #f4623a 50%, transparent);
  filter: blur(0.4px);
  animation: flame 0.18s ease-in-out infinite alternate;
  transform-origin: top;
}

.craft__trail {
  position: absolute;
  top: 4.7rem;
  left: 50%;
  z-index: -1;
  width: 0.18rem;
  height: 10.8rem;
  border-radius: 50%;
  background: linear-gradient(to bottom, rgb(255 229 174 / 85%), rgb(244 98 58 / 42%) 25%, transparent);
  filter: blur(1.2px);
  opacity: 0.18;
  transform: translateX(-50%) scaleY(0.28);
  transform-origin: top;
  transition: transform 0.18s ease-out, opacity 0.18s ease-out;
  will-change: transform, opacity;
}

.stage-burst {
  position: absolute;
  inset: -25%;
  z-index: 9;
  border-radius: 50%;
  background: radial-gradient(circle, transparent 22%, rgb(255 255 255 / 26%) 22.5%, rgb(244 98 58 / 13%) 24%, transparent 32%);
  opacity: 0;
  transform: scale(0.18);
}

.cosmos.is-jumping .stage-burst {
  animation: jumpBurst 0.9s cubic-bezier(0.12, 0.75, 0.2, 1);
}

.flight-ui {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: max(1.2rem, env(safe-area-inset-top)) max(1.4rem, env(safe-area-inset-right)) 1rem max(1.4rem, env(safe-area-inset-left));
  background: linear-gradient(to bottom, rgb(9 11 16 / 74%), transparent);
  pointer-events: none;
}

.mini-brand {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.055em;
  text-decoration: none;
  pointer-events: auto;
}

.mini-brand span {
  color: var(--orange);
}

.journey-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #77766f;
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.journey-progress__track {
  position: relative;
  display: block;
  width: clamp(4rem, 10vw, 7rem);
  height: 1px;
  overflow: hidden;
  background: rgb(255 255 255 / 16%);
}

.journey-progress__track i {
  position: absolute;
  inset: 0;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left;
}

.journey-next {
  position: fixed;
  right: max(1.25rem, env(safe-area-inset-right));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.75rem;
  padding: 0.7rem 0.8rem 0.7rem 1rem;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 2rem;
  color: #aca99f;
  background: rgb(9 11 16 / 92%);
  box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 18%);
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.journey-next b {
  display: grid;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  color: #090b10;
  background: var(--orange);
  font-size: 0.8rem;
  place-items: center;
}

.not-found {
  display: grid;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 65% 38%, rgb(244 98 58 / 13%), transparent 28%),
    radial-gradient(circle at 20% 80%, rgb(71 102 255 / 12%), transparent 30%),
    #090b10;
  place-items: center;
}

.not-found::before {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgb(255 255 255 / 48%) 0.6px, transparent 0.8px);
  background-size: 47px 47px;
  content: "";
  opacity: 0.32;
}

.not-found__card {
  position: relative;
  z-index: 1;
  width: min(100%, 56rem);
  padding: 2rem;
}

.not-found__return {
  position: static;
  width: max-content;
  margin-top: 2rem;
}

.encounter[hidden] {
  display: none;
}

.encounter {
  --encounter-x: 80vw;
  --encounter-y: 28vh;
  --encounter-tilt: -2deg;
  --encounter-scale: 1;

  position: fixed;
  top: var(--encounter-y);
  left: var(--encounter-x);
  z-index: 14;
  display: grid;
  width: 9rem;
  height: 9rem;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  filter:
    blur(0.65rem)
    saturate(0.65)
    drop-shadow(0 0 1.8rem rgb(129 148 255 / 0%));
  transform:
    translate3d(-50%, -50%, 0)
    rotate(calc(var(--encounter-tilt) - 14deg))
    scale(0.12);
  transform-origin: center;
  transition:
    opacity 0.65s ease,
    filter 0.85s ease,
    transform 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}

.encounter.is-visible {
  opacity: 0.96;
  filter:
    blur(0)
    saturate(1)
    drop-shadow(0 0 1.8rem rgb(129 148 255 / 24%));
  transform:
    translate3d(-50%, -50%, 0)
    rotate(var(--encounter-tilt))
    scale(var(--encounter-scale));
}

.encounter::before {
  position: absolute;
  inset: -1.35rem;
  z-index: -1;
  border: 1px solid rgb(149 170 255 / 34%);
  border-radius: 50%;
  background: radial-gradient(circle, rgb(112 135 255 / 9%), transparent 66%);
  content: "";
  opacity: 0;
  animation: encounterRipple 2.8s ease-out infinite;
}

.encounter__porthole {
  position: relative;
  display: grid;
  width: 6.5rem;
  aspect-ratio: 1;
  overflow: visible;
  transform: scale(1.25);
  place-items: center;
}

.encounter__porthole::after {
  position: absolute;
  inset: 0.55rem;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgb(98 120 225 / 22%),
    rgb(44 59 126 / 7%) 46%,
    transparent 72%
  );
  content: "";
  filter: blur(0.65rem);
  animation: encounterHalo 2.2s ease-in-out infinite alternate;
}

.visitor {
  position: relative;
  display: none;
  width: 4.8rem;
  height: 4.8rem;
  animation: visitorFloat 2.6s ease-in-out infinite alternate;
}

.encounter[data-character="eridian"] .visitor--eridian,
.encounter[data-character="logical"] .visitor--logical,
.encounter[data-character="homesick"] .visitor--homesick {
  display: block;
}

.visitor--eridian i {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 2.35rem;
  height: 2rem;
  background:
    linear-gradient(135deg, transparent 22%, rgb(255 255 255 / 12%) 23% 27%, transparent 28%),
    linear-gradient(45deg, #8a7969, #413b38 62%, #222326);
  clip-path: polygon(12% 19%, 64% 0, 100% 34%, 87% 88%, 34% 100%, 0 69%);
  filter: drop-shadow(0 0 0.6rem rgb(239 192 139 / 18%));
  transform: translate(-50%, -50%);
}

.visitor--eridian b {
  --arm-angle: 0deg;
  position: absolute;
  top: 50%;
  left: calc(50% - 0.28rem);
  width: 0.56rem;
  height: 2rem;
  border-radius: 60% 60% 30% 30%;
  background: linear-gradient(#77685c, #302e2e);
  transform: rotate(var(--arm-angle)) translateY(-2.05rem);
  transform-origin: 50% 100%;
}

.visitor--eridian b:nth-of-type(2) { --arm-angle: 72deg; }
.visitor--eridian b:nth-of-type(3) { --arm-angle: 144deg; }
.visitor--eridian b:nth-of-type(4) { --arm-angle: 216deg; }
.visitor--eridian b:nth-of-type(5) { --arm-angle: 288deg; }

.visitor--logical::before {
  position: absolute;
  right: 0.75rem;
  bottom: -0.2rem;
  left: 0.75rem;
  height: 2.5rem;
  border-radius: 50% 50% 15% 15%;
  background: linear-gradient(90deg, #182939, #4b6571 50%, #14222f);
  content: "";
}

.visitor--logical i {
  position: absolute;
  top: 0.25rem;
  left: 50%;
  z-index: 2;
  width: 2.35rem;
  height: 3rem;
  border-radius: 46% 46% 52% 52%;
  background:
    linear-gradient(154deg, #15171c 0 22%, transparent 23%),
    linear-gradient(90deg, #a87968, #d5aa94 52%, #8d5f56);
  box-shadow: inset 0 -0.8rem 0 rgb(92 54 52 / 15%);
  transform: translateX(-50%);
}

.visitor--logical i::before,
.visitor--logical i::after {
  position: absolute;
  top: 0.9rem;
  width: 1.05rem;
  height: 1.35rem;
  background: #a9796a;
  content: "";
}

.visitor--logical i::before {
  left: -0.72rem;
  clip-path: polygon(100% 28%, 0 0, 100% 100%);
}

.visitor--logical i::after {
  right: -0.72rem;
  clip-path: polygon(0 28%, 100% 0, 0 100%);
}

.visitor--logical b {
  position: absolute;
  right: -0.15rem;
  bottom: -0.1rem;
  z-index: 3;
  font-size: 1.45rem;
  filter: grayscale(0.35) drop-shadow(0 0 0.5rem rgb(143 179 255 / 28%));
  transform: rotate(-10deg);
}

.visitor--homesick::before {
  position: absolute;
  bottom: -0.6rem;
  left: 50%;
  width: 2rem;
  height: 3.35rem;
  border-radius: 70% 70% 35% 35%;
  background: linear-gradient(90deg, #5f5145, #9b826d 50%, #443b36);
  content: "";
  transform: translateX(-50%);
}

.visitor--homesick i {
  position: absolute;
  top: 0.1rem;
  left: 50%;
  z-index: 2;
  width: 3.2rem;
  height: 2.05rem;
  border-radius: 58% 58% 48% 48%;
  background:
    radial-gradient(ellipse at 28% 48%, #07090c 0 10%, transparent 12%),
    radial-gradient(ellipse at 72% 48%, #07090c 0 10%, transparent 12%),
    linear-gradient(90deg, #776354, #b0957c 50%, #5c4d45);
  transform: translateX(-50%);
}

.visitor--homesick b {
  position: absolute;
  right: 0.1rem;
  bottom: 0.6rem;
  z-index: 3;
  width: 2.6rem;
  height: 0.42rem;
  border-radius: 1rem;
  background: #8c725e;
  transform: rotate(-24deg);
  transform-origin: left;
}

.visitor--homesick b::after {
  position: absolute;
  top: 50%;
  right: -0.2rem;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: #ffb45e;
  box-shadow: 0 0 1rem #ff9c4a;
  content: "";
  transform: translateY(-50%);
}

.encounter__copy {
  position: absolute;
  top: calc(50% + 4.4rem);
  left: 50%;
  width: 12rem;
  padding: 0;
  text-align: center;
  text-shadow: 0 0 0.8rem #05060a, 0 0 1.8rem #05060a;
  opacity: 0;
  transform: translate(-50%, 0.6rem);
  transition:
    opacity 0.65s ease 0.3s,
    transform 0.8s ease 0.25s;
}

.encounter.is-visible .encounter__copy {
  opacity: 0.78;
  transform: translate(-50%, 0);
}

.encounter__copy span {
  display: block;
  margin-bottom: 0.28rem;
  color: #8c96ba;
  font-family: "DM Mono", monospace;
  font-size: 0.45rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.encounter__copy strong {
  display: block;
  color: rgb(240 240 234 / 88%);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.encounter__copy p {
  margin: 0.25rem 0 0;
  color: rgb(185 187 199 / 72%);
  font-size: 0.59rem;
  line-height: 1.4;
}

@keyframes encounterRipple {
  0% {
    opacity: 0;
    transform: scale(0.22);
  }

  28% {
    opacity: 0.48;
  }

  100% {
    opacity: 0;
    transform: scale(1.18);
  }
}

@keyframes encounterHalo {
  to {
    opacity: 0.58;
    transform: scale(1.12);
  }
}

@keyframes visitorFloat {
  to { transform: translateY(-0.3rem) rotate(1deg); }
}

.journey {
  position: relative;
  z-index: 20;
}

.chapter {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 112vh;
  min-height: 112svh;
  padding: 7rem max(2rem, env(safe-area-inset-right)) 5rem max(2rem, env(safe-area-inset-left));
}

.chapter--hero,
.chapter--final {
  min-height: 100vh;
  min-height: 100svh;
}

.chapter__copy {
  width: min(100%, 35rem);
  margin: 0 max(0rem, calc((100vw - 70rem) / 2));
}

.chapter__copy--right {
  margin-right: max(0rem, calc((100vw - 70rem) / 2));
  margin-left: auto;
  text-align: right;
}

.js .chapter__copy {
  opacity: 0.18;
  transform: translateY(2.5rem);
  transition: opacity 0.65s ease, transform 0.8s cubic-bezier(0.2, 0.75, 0.2, 1);
}

.js .chapter.is-active .chapter__copy {
  opacity: 1;
  transform: translateY(0);
}

.js .chapter.is-active .chapter-label,
.js .chapter.is-active .eyebrow,
.js .chapter.is-active .distance,
.js .chapter.is-active h1,
.js .chapter.is-active h2,
.js .chapter.is-active .lede,
.js .chapter.is-active .waitlist-form,
.js .chapter.is-active .status,
.js .chapter.is-active .scroll-cue {
  animation: copyArrive 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.js .chapter.is-active h1,
.js .chapter.is-active h2 {
  animation-delay: 0.06s;
}

.js .chapter.is-active .lede,
.js .chapter.is-active .chapter__copy > p:last-child {
  animation-delay: 0.13s;
}

.js .chapter.is-active .waitlist-form {
  animation-delay: 0.17s;
}

.js .chapter.is-active .status,
.js .chapter.is-active .scroll-cue {
  animation-delay: 0.2s;
}

.hero-copy,
.final-copy {
  width: min(100%, 56rem);
}

.eyebrow,
.chapter-label {
  margin: 0 0 2rem;
  color: var(--muted);
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.eyebrow span {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0.8rem var(--orange);
  animation: pulse 2s ease-in-out infinite;
}

h1 {
  margin: 0;
  font-size: clamp(4rem, 14vw, 10.5rem);
  font-weight: 500;
  letter-spacing: -0.085em;
  line-height: 0.78;
}

h1 span {
  color: var(--orange);
  text-shadow: 0 0 2.5rem rgb(244 98 58 / 18%);
}

h2 {
  max-width: 34rem;
  margin: 0 0 1.2rem;
  font-size: clamp(2.4rem, 6vw, 5.6rem);
  font-weight: 500;
  letter-spacing: -0.065em;
  line-height: 0.96;
}

.chapter__copy--right h2 {
  margin-left: auto;
}

.chapter__copy > p:last-child:not(.scroll-cue),
.lede {
  color: #c8c4ba;
  font-size: clamp(1rem, 2vw, 1.35rem);
  line-height: 1.55;
}

.chapter__copy > p:last-child:not(.scroll-cue) {
  max-width: 29rem;
  margin-bottom: 0;
}

.chapter__copy--right > p:last-child {
  margin-left: auto;
}

.lede {
  max-width: 34rem;
  margin: 2.5rem 0 4rem;
}

.hero-copy .lede,
.final-copy .lede {
  margin-bottom: 2rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

.waitlist-form {
  position: relative;
  width: min(100%, 34rem);
  margin: 0 0 2.3rem;
}

.waitlist-form__trap {
  position: absolute;
  top: auto;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.waitlist-form__controls {
  display: flex;
  align-items: stretch;
  padding: 0.32rem;
  border: 1px solid rgb(255 255 255 / 19%);
  border-radius: 2.8rem;
  background: rgb(9 11 16 / 78%);
  box-shadow:
    0 0.8rem 2.5rem rgb(0 0 0 / 22%),
    inset 0 0 1.5rem rgb(255 255 255 / 2%);
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.waitlist-form__controls:focus-within {
  border-color: rgb(244 98 58 / 72%);
  box-shadow:
    0 0 0 3px rgb(244 98 58 / 11%),
    0 0.8rem 2.5rem rgb(0 0 0 / 22%);
}

.waitlist-form input[type="email"] {
  min-width: 0;
  min-height: 3.1rem;
  flex: 1;
  padding: 0.75rem 1.1rem;
  border: 0;
  outline: 0;
  color: var(--paper);
  background: transparent;
  font: 500 0.82rem/1.2 "DM Mono", monospace;
  letter-spacing: 0.02em;
}

.waitlist-form input[type="email"]::placeholder {
  color: #77766f;
  opacity: 1;
}

.waitlist-form button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 3.1rem;
  padding: 0.75rem 0.75rem 0.75rem 1.25rem;
  border: 0;
  border-radius: 2.2rem;
  color: #090b10;
  background: var(--orange);
  font: 500 0.65rem/1 "DM Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.2s ease,
    opacity 0.2s ease,
    transform 0.2s ease;
}

.waitlist-form button:hover {
  background: #ff7852;
  transform: translateY(-1px);
}

.waitlist-form button:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 3px;
}

.waitlist-form button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.waitlist-form button b {
  display: grid;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  color: var(--orange);
  background: #090b10;
  font-size: 0.86rem;
  place-items: center;
}

.waitlist-form__message {
  min-height: 1rem;
  margin: 0.68rem 1.1rem 0;
  color: #77766f;
  font-family: "DM Mono", monospace;
  font-size: 0.58rem;
  letter-spacing: 0.045em;
  line-height: 1.5;
}

.waitlist-form[data-state="submitting"] .waitlist-form__message {
  color: var(--muted);
}

.waitlist-form[data-state="success"] .waitlist-form__message {
  color: #c8dfb7;
}

.waitlist-form[data-state="error"] .waitlist-form__message {
  color: #ff8b68;
}

.distance {
  margin: 0 0 0.7rem;
  color: var(--orange);
  font-family: "DM Mono", monospace;
  font-size: clamp(0.75rem, 1.5vw, 0.95rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgb(255 255 255 / 14%);
  color: #77766f;
  font-family: "DM Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status a {
  text-underline-offset: 0.25rem;
}

.scroll-cue {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 2rem 0 0;
  color: #77766f;
  font-family: "DM Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
}

.scroll-cue__thumb {
  position: relative;
  display: block;
  width: 1rem;
  height: 1.45rem;
  border: 1px solid rgb(255 255 255 / 34%);
  border-radius: 0.7rem;
}

.scroll-cue__thumb::after {
  position: absolute;
  top: 0.22rem;
  left: 50%;
  width: 0.18rem;
  height: 0.18rem;
  border-radius: 50%;
  background: var(--orange);
  content: "";
  animation: thumb 1.8s ease-in-out infinite;
  transform: translateX(-50%);
}

@keyframes pulse {
  50% {
    opacity: 0.4;
  }
}

@keyframes copyArrive {
  from {
    opacity: 0;
    transform: translateY(1.6rem);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes jumpBurst {
  0% {
    opacity: 0;
    transform: scale(0.12);
  }

  22% {
    opacity: 0.68;
  }

  100% {
    opacity: 0;
    transform: scale(1.35);
  }
}

@keyframes flame {
  to {
    opacity: 0.72;
    transform: scaleY(0.72);
  }
}

@keyframes thumb {
  60%,
  100% {
    opacity: 0;
    transform: translate(-50%, 0.65rem);
  }
}

@keyframes prayerSmoke {
  0% {
    opacity: 0;
    transform:
      translate3d(-50%, -50%, 0)
      scale(0.45)
      rotate(var(--prayer-start-rotation, 0deg));
  }

  12% {
    opacity: 0.92;
  }

  58% {
    opacity: 0.68;
  }

  100% {
    opacity: 0;
    transform:
      translate3d(
        calc(-50% + var(--prayer-drift-x, 0px)),
        calc(-50% + var(--prayer-drift-y, 6rem)),
        0
      )
      scale(1.18)
      rotate(var(--prayer-end-rotation, 25deg));
  }
}

@keyframes journeyProgress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes farStarJourney {
  from { transform: translate3d(0, 0, 0) rotate(-7deg) scale(1.08); }
  to { transform: translate3d(0, -90px, 0) rotate(-7deg) scale(1.08); }
}

@keyframes nearStarJourney {
  from { transform: translate3d(0, 0, 0) rotate(5deg) scale(1.05); }
  to { transform: translate3d(0, -210px, 0) rotate(5deg) scale(1.05); }
}

@keyframes craftJourney {
  0% {
    transform: translate3d(-50%, calc(-50% + 20vh), 0) rotate(13deg);
  }

  12.5% {
    transform: translate3d(
      calc(-50% + clamp(-178px, 21.7vw, 178px)),
      calc(-50% + 14.5vh),
      0
    ) rotate(-2deg);
  }

  25% {
    transform: translate3d(
      calc(-50% + clamp(-56px, -6.8vw, 56px)),
      calc(-50% + 9vh),
      0
    ) rotate(-12.4deg);
  }

  37.5% {
    transform: translate3d(
      calc(-50% + clamp(-160px, -19.6vw, 160px)),
      calc(-50% + 3.5vh),
      0
    ) rotate(5.9deg);
  }

  50% {
    transform: translate3d(
      calc(-50% + clamp(-106px, 12.9vw, 106px)),
      calc(-50% - 2vh),
      0
    ) rotate(10.5deg);
  }

  62.5% {
    transform: translate3d(
      calc(-50% + clamp(-127px, 15.6vw, 127px)),
      calc(-50% - 7.5vh),
      0
    ) rotate(-9.2deg);
  }

  75% {
    transform: translate3d(
      calc(-50% + clamp(-146px, -17.8vw, 146px)),
      calc(-50% - 13vh),
      0
    ) rotate(-7.6deg);
  }

  87.5% {
    transform: translate3d(
      calc(-50% + clamp(-82px, -10vw, 82px)),
      calc(-50% - 18.5vh),
      0
    ) rotate(11.6deg);
  }

  100% {
    transform: translate3d(
      calc(-50% + clamp(-171px, 20.9vw, 171px)),
      calc(-50% - 24vh),
      0
    ) rotate(4deg);
  }
}

@keyframes earthSceneJourney {
  0%,
  11% {
    opacity: 0.68;
    transform: translateX(-50%) scale(0.78);
  }

  22%,
  29% {
    opacity: 0.82;
    transform: translateX(-50%) translateY(9rem) scale(1.1);
  }

  40% {
    opacity: 0.3;
    transform: translateX(-72%) translateY(18rem) scale(0.62);
  }

  49%,
  100% {
    opacity: 0;
    transform: translateX(-92%) translateY(24rem) scale(0.45);
  }
}

@keyframes moonSceneJourney {
  0%,
  30% {
    opacity: 0;
    transform: translate(45vw, -12vh) scale(0.45);
  }

  40%,
  51% {
    opacity: 0.85;
    transform: translate(0, 0) scale(1);
  }

  63% {
    opacity: 0.4;
    transform: translate(-54vw, 32vh) scale(1.45);
  }

  72%,
  100% {
    opacity: 0;
    transform: translate(-70vw, 42vh) scale(1.6);
  }
}

@keyframes marsSceneJourney {
  0%,
  49% {
    opacity: 0;
    transform: translate(-45vw, 18vh) scale(0.5);
  }

  60%,
  71% {
    opacity: 0.84;
    transform: translate(0, 0) scale(1);
  }

  82% {
    opacity: 0.28;
    transform: translate(42vw, 35vh) scale(0.68);
  }

  91%,
  100% {
    opacity: 0;
    transform: translate(58vw, 42vh) scale(0.5);
  }
}

@keyframes saturnSceneJourney {
  0%,
  68% {
    opacity: 0;
    transform: translate(45vw, 15vh) rotate(-16deg) scale(0.5);
  }

  79%,
  87% {
    opacity: 0.74;
    transform: translate(0, 0) rotate(-16deg) scale(1);
  }

  100% {
    opacity: 0.2;
    transform: translate(-60vw, -30vh) rotate(-28deg) scale(0.55);
  }
}

@keyframes portalSceneJourney {
  0%,
  71% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.25) rotate(-9deg);
  }

  82% {
    opacity: 0.24;
    transform: translate(-50%, -50%) scale(0.62) rotate(-5deg);
  }

  100% {
    opacity: 0.98;
    transform: translate(-50%, -50%) scale(1) rotate(0);
  }
}

@keyframes nebulaSceneJourney {
  0%,
  78% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.3);
  }

  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes warpSceneJourney {
  0%,
  78% {
    opacity: 0.88;
  }

  100% {
    opacity: 0.95;
  }
}

@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .journey-progress__track i {
      animation: journeyProgress linear both;
      animation-timeline: scroll(root block);
    }

    .starfield--far {
      animation: farStarJourney linear both;
      animation-timeline: scroll(root block);
    }

    .starfield--near {
      animation: nearStarJourney linear both;
      animation-timeline: scroll(root block);
    }

    .craft-orbit {
      animation: craftJourney linear both;
      animation-timeline: scroll(root block);
    }

    .earth {
      animation: earthSceneJourney linear both;
      animation-timeline: scroll(root block);
    }

    .moon {
      animation: moonSceneJourney linear both;
      animation-timeline: scroll(root block);
    }

    .mars {
      animation: marsSceneJourney linear both;
      animation-timeline: scroll(root block);
    }

    .saturn {
      animation: saturnSceneJourney linear both;
      animation-timeline: scroll(root block);
    }

    .portal {
      animation: portalSceneJourney linear both;
      animation-timeline: scroll(root block);
    }

    .nebula {
      animation: nebulaSceneJourney linear both;
      animation-timeline: scroll(root block);
    }

    .warp-field {
      animation: warpSceneJourney linear both;
      animation-timeline: scroll(root block);
    }
  }
}

@media (max-width: 700px) {
  .flight-ui {
    padding-top: max(1.1rem, env(safe-area-inset-top));
  }

  .chapter {
    align-items: flex-end;
    min-height: 108vh;
    min-height: 108svh;
    padding-top: 6.5rem;
    padding-bottom: max(5rem, calc(env(safe-area-inset-bottom) + 3rem));
  }

  .chapter--hero {
    align-items: center;
  }

  .chapter__copy,
  .chapter__copy--right {
    width: 100%;
    margin: 0;
    text-align: left;
  }

  .chapter__copy--right h2,
  .chapter__copy--right > p:last-child {
    margin-left: 0;
  }

  h1 {
    width: 100%;
    font-size: clamp(3.4rem, 18vw, 6.6rem);
    letter-spacing: -0.075em;
  }

  h2 {
    max-width: 20rem;
  }

  .lede {
    margin: 2rem 0 3rem;
  }

  .status {
    flex-direction: column;
  }

  .waitlist-form__controls {
    display: grid;
    border-radius: 1.4rem;
  }

  .waitlist-form button {
    width: 100%;
    padding-left: 1rem;
  }

  .waitlist-form__message {
    margin-right: 0.65rem;
    margin-left: 0.65rem;
  }

  .scroll-cue {
    margin-top: 1.5rem;
  }

  .journey-next {
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .encounter {
    width: 7.5rem;
    height: 7.5rem;
  }

  .encounter__porthole {
    transform: scale(1.08);
  }

  .encounter__copy {
    top: calc(50% + 3.8rem);
    width: 10.5rem;
  }

  .earth {
    bottom: -25rem;
    width: 165vw;
  }

  .moon {
    top: 17%;
    right: -1.5rem;
  }

  .mars {
    top: 15%;
    left: -3.5rem;
  }

  .saturn {
    top: 23%;
    right: -1.5rem;
  }

  .flight-path {
    width: 68vw;
    height: 55vh;
  }

  .portal {
    top: 38%;
    width: 128vw;
  }
}

@media (max-height: 680px) and (max-width: 700px) {
  .chapter--hero {
    align-items: flex-end;
  }

  .eyebrow,
  .chapter-label {
    margin-bottom: 1.2rem;
  }

  .lede {
    margin: 1.5rem 0 2rem;
  }

  .scroll-cue {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .eyebrow span,
  .craft__flame,
  .earth,
  .scroll-cue__thumb::after {
    animation: none;
  }

  .js .chapter.is-active .chapter-label,
  .js .chapter.is-active .eyebrow,
  .js .chapter.is-active .distance,
  .js .chapter.is-active h1,
  .js .chapter.is-active h2,
  .js .chapter.is-active .lede,
  .js .chapter.is-active .waitlist-form,
  .js .chapter.is-active .status,
  .js .chapter.is-active .scroll-cue {
    animation: none;
  }

  .celestial,
  .nebula,
  .chapter__copy {
    transition: none !important;
  }

  .starfield,
  .craft-orbit,
  .craft {
    will-change: auto;
  }

  .warp-field {
    opacity: 0.28;
  }

  .stage-burst {
    display: none;
  }

  .prayer-smoke {
    display: none;
  }

  .encounter,
  .encounter::before,
  .encounter__porthole::after,
  .encounter__copy,
  .visitor {
    animation: none;
    transition: none;
  }
}
