:root {
  color-scheme: dark;
  font-family: "Space Grotesk", sans-serif;
  color: #f5f2e9;
  background: #090b10;
  font-synthesis: none;
  --orange: #f4623a;
  --paper: #f5f2e9;
  --muted: #aca99f;
  --star-far-y: 0px;
  --star-near-y: 0px;
  --craft-x: 0px;
  --craft-y: 18vh;
  --craft-rotation: 0deg;
  --craft-scale: 0.88;
  --trail-length: 3rem;
  --trail-opacity: 0.18;
  --journey-progress: 0;
}

* {
  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;
}

.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-image:
    radial-gradient(rgb(255 255 255 / 60%) 0.6px, transparent 0.8px),
    radial-gradient(rgb(132 156 255 / 40%) 0.5px, transparent 0.7px);
  background-position: 0 0, 24px 17px;
  background-size: 47px 47px, 83px 83px;
  opacity: 0.45;
  transform: translate3d(0, var(--star-far-y), 0);
}

.starfield--near {
  background-image:
    radial-gradient(rgb(255 255 255 / 85%) 0.8px, transparent 1px),
    radial-gradient(rgb(244 98 58 / 65%) 0.7px, transparent 1px);
  background-position: 13px 11px, 71px 49px;
  background-size: 131px 131px, 197px 197px;
  opacity: 0.5;
  transform: translate3d(0, var(--star-near-y), 0);
}

.warp-field {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.74;
  mix-blend-mode: screen;
  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%);
  filter: blur(28px);
  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);
}

.portal {
  position: absolute;
  top: 46%;
  left: 50%;
  z-index: 4;
  width: min(82vw, 42rem);
  aspect-ratio: 1;
  opacity: 0;
  filter: drop-shadow(0 0 3rem rgb(100 111 255 / 18%));
  transform: translate(-50%, -50%) scale(0.25) rotate(-28deg);
  transition: opacity 1.2s ease, transform 1.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.portal::before {
  position: absolute;
  inset: 26%;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(9 11 16 / 8%), rgb(9 11 16 / 85%) 68%);
  box-shadow:
    inset 0 0 2rem rgb(244 98 58 / 22%),
    0 0 5rem rgb(91 106 255 / 15%);
  content: "";
}

.portal span {
  position: absolute;
  inset: 15%;
  border: 1px solid rgb(255 255 255 / 17%);
  border-top-color: rgb(244 98 58 / 88%);
  border-right-color: rgb(105 127 255 / 48%);
  border-radius: 48% 52% 46% 54%;
  animation: portalSpin 8s linear infinite;
}

.portal span:nth-child(2) {
  inset: 22%;
  border-top-color: rgb(255 255 255 / 62%);
  border-bottom-color: rgb(244 98 58 / 38%);
  animation-direction: reverse;
  animation-duration: 5.5s;
}

.portal span:nth-child(3) {
  inset: 29%;
  border-left-color: rgb(112 130 255 / 68%);
  animation-duration: 3.5s;
}

.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);
  animation: earthLight 18s ease-in-out infinite alternate;
}

.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.18;
  transform: translate(-50%, -50%) scale(0.58) rotate(-12deg);
}

.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.9;
  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);
}

.craft {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 1.8rem;
  filter: drop-shadow(0 0 1.1rem rgb(244 98 58 / 32%));
  transform: translate(calc(-50% + var(--craft-x)), calc(-50% + var(--craft-y))) rotate(var(--craft-rotation)) scale(var(--craft-scale));
  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: var(--trail-length);
  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: var(--trail-opacity);
  transform: translateX(-50%);
  transform-origin: top;
  transition: height 0.18s ease-out, opacity 0.18s ease-out;
}

.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(var(--journey-progress));
  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 / 72%);
  backdrop-filter: blur(12px);
  font-family: "DM Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  -webkit-backdrop-filter: blur(12px);
}

.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;
}

.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 .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 .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;
}

.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 portalSpin {
  to {
    transform: rotate(360deg) scale(1.04);
  }
}

@keyframes earthLight {
  to {
    filter: saturate(1.16) brightness(1.08);
  }
}

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

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

@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;
  }

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

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

  .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: 112vw;
  }
}

@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,
  .portal span,
  .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 .status,
  .js .chapter.is-active .scroll-cue {
    animation: none;
  }

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

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

  .warp-field {
    opacity: 0.28;
  }

  .stage-burst {
    display: none;
  }
}
