:root {
  --bg: #02050a;
  --ink: #f7eddb;
  --muted: rgba(247, 237, 219, 0.72);
  --soft: rgba(247, 237, 219, 0.5);
  --blue: #12384a;
  --teal: #75d0d2;
  --amber: #f0b45d;
  --gold: #f5dfb8;
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
  --cursor-x: 50vw;
  --cursor-y: 50vh;
  --scene-hue: 0;
  --warp-opacity: 0;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 74% 8%, rgba(65, 137, 159, 0.2), transparent 30rem),
    linear-gradient(180deg, #02050a 0%, #04101a 42%, #050406 100%);
  font-family: Inter, Avenir, "Segoe UI", system-ui, sans-serif;
  overflow-x: hidden;
}

body.is-loading {
  overflow: hidden;
}

body.is-gated {
  overflow: hidden;
}

body.is-loading .visual-stack,
body.is-loading .immersive-shell,
body.is-loading .cosmic-current,
body.is-loading .scene-warp,
body.is-loading .scroll-progress,
body.is-loading .sound-control,
body.is-loading .memory-timeline,
body.is-loading .experience,
body.is-gated .visual-stack,
body.is-gated .immersive-shell,
body.is-gated .cosmic-current,
body.is-gated .scene-warp,
body.is-gated .scroll-progress,
body.is-gated .sound-control,
body.is-gated .memory-timeline,
body.is-gated .experience {
  opacity: 0;
  pointer-events: none;
}

.launch-loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 72%, rgba(240, 180, 93, 0.18), transparent 18rem),
    radial-gradient(circle at 50% 26%, rgba(117, 208, 210, 0.2), transparent 24rem),
    linear-gradient(180deg, #02050a 0%, #07111a 48%, #02050a 100%);
  transition: opacity 720ms var(--ease), visibility 720ms var(--ease), transform 720ms var(--ease);
}

.launch-loader.is-complete {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.04);
}

.launch-loader__stars {
  position: absolute;
  inset: 0;
  opacity: 0.8;
  background-image:
    radial-gradient(circle, rgba(247, 237, 219, 0.86) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(240, 180, 93, 0.7) 0 1px, transparent 1.4px),
    radial-gradient(circle, rgba(117, 208, 210, 0.6) 0 1px, transparent 1.6px);
  background-position: 0 0, 38px 64px, 82px 18px;
  background-size: 140px 140px, 210px 210px, 260px 260px;
  animation: loaderStars 6s linear infinite;
}

.rocket-stage {
  position: relative;
  width: min(58vw, 360px);
  aspect-ratio: 1;
  transform: translateY(-4vh);
}

.rocket-stage::before {
  position: absolute;
  inset: 6%;
  border: 1px solid rgba(245, 223, 184, 0.18);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 80px rgba(117, 208, 210, 0.12);
  animation: orbitSpin 9s linear infinite;
}

.rocket-trail {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34%;
  height: 70%;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(245, 223, 184, 0.72), rgba(240, 180, 93, 0.28) 36%, rgba(117, 208, 210, 0.08) 68%, transparent),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0 6px, transparent 6px 16px);
  filter: blur(10px);
  opacity: 0.82;
  transform: translate(-50%, -4%) perspective(400px) rotateX(48deg);
  transform-origin: top;
  animation: plumePulse 620ms ease-in-out infinite alternate;
}

.rocket {
  position: absolute;
  top: 19%;
  left: 50%;
  width: 70px;
  height: 152px;
  border-radius: 48% 48% 42% 42%;
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 255, 255, 0.9), transparent 9px),
    linear-gradient(90deg, #d8e4e6, #fff6df 45%, #9aa7aa);
  box-shadow:
    inset -13px 0 22px rgba(2, 5, 10, 0.24),
    0 0 34px rgba(245, 223, 184, 0.38),
    0 28px 72px rgba(0, 0, 0, 0.42);
  transform: translateX(-50%);
  animation: rocketHover 760ms ease-in-out infinite alternate;
}

.rocket::before {
  position: absolute;
  top: -24px;
  left: 50%;
  width: 0;
  height: 0;
  border-right: 35px solid transparent;
  border-bottom: 44px solid #f0b45d;
  border-left: 35px solid transparent;
  content: "";
  transform: translateX(-50%);
}

.rocket__window {
  position: absolute;
  top: 36px;
  left: 50%;
  width: 28px;
  aspect-ratio: 1;
  border: 3px solid rgba(2, 5, 10, 0.36);
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #f7eddb, #75d0d2 42%, #12384a 80%);
  transform: translateX(-50%);
  box-shadow: 0 0 22px rgba(117, 208, 210, 0.7);
}

.rocket__fin {
  position: absolute;
  bottom: 10px;
  width: 26px;
  height: 54px;
  background: linear-gradient(180deg, #f0b45d, #8f4f2f);
}

.rocket__fin--left {
  left: -18px;
  border-radius: 24px 0 0 16px;
  transform: skewY(22deg);
}

.rocket__fin--right {
  right: -18px;
  border-radius: 0 24px 16px 0;
  transform: skewY(-22deg);
}

.rocket__flame {
  position: absolute;
  bottom: -56px;
  left: 50%;
  width: 32px;
  height: 74px;
  border-radius: 50% 50% 46% 46%;
  background:
    radial-gradient(circle at 50% 24%, #fff9eb 0 12px, transparent 13px),
    linear-gradient(180deg, #f7eddb, #f0b45d 36%, #e85b35 70%, transparent);
  filter: blur(0.2px);
  transform: translateX(-50%);
  animation: flameStretch 360ms ease-in-out infinite alternate;
}

.launch-loader__copy {
  position: absolute;
  bottom: clamp(86px, 13vh, 132px);
  left: 50%;
  width: min(520px, calc(100% - 44px));
  text-align: center;
  transform: translateX(-50%);
}

.launch-loader__eyebrow {
  margin: 0;
  color: rgba(247, 237, 219, 0.72);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.launch-loader__percent {
  margin: 10px 0 0;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 7vw, 5.4rem);
  line-height: 0.95;
  text-shadow: 0 0 34px rgba(245, 223, 184, 0.38);
}

.launch-loader__bar {
  position: absolute;
  right: clamp(22px, 8vw, 120px);
  bottom: clamp(48px, 8vh, 78px);
  left: clamp(22px, 8vw, 120px);
  height: 2px;
  background: rgba(245, 223, 184, 0.16);
  overflow: hidden;
}

.launch-loader__bar span {
  display: block;
  width: var(--loader-progress, 0%);
  height: 100%;
  background: linear-gradient(90deg, rgba(117, 208, 210, 0.12), var(--gold), var(--amber));
  box-shadow: 0 0 24px rgba(245, 223, 184, 0.7);
  transition: width 260ms var(--ease);
}

.entry-gate {
  position: fixed;
  inset: 0;
  z-index: 96;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--ink);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  background:
    radial-gradient(circle at 50% 74%, rgba(245, 223, 184, 0.22), transparent 17rem),
    linear-gradient(180deg, rgba(2, 5, 10, 0.12), rgba(2, 5, 10, 0.36) 48%, rgba(2, 5, 10, 0.86)),
    url("assets/entry-gate-cosmic-cabin.png") center / cover no-repeat;
  transform: scale(1.04);
  transition:
    opacity 900ms var(--ease),
    visibility 900ms var(--ease),
    transform 1200ms var(--ease),
    filter 900ms var(--ease);
}

.entry-gate::before,
.entry-gate::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
}

.entry-gate::before {
  z-index: 1;
  background:
    radial-gradient(ellipse at 50% 28%, transparent 0 14rem, rgba(245, 223, 184, 0.12) 14.5rem, transparent 31rem),
    conic-gradient(from 250deg at 50% 24%, transparent 0 20deg, rgba(245, 223, 184, 0.24) 44deg, transparent 74deg 360deg);
  mix-blend-mode: screen;
  opacity: 0.74;
  animation: entryGateDrift 9s linear infinite;
}

.entry-gate::after {
  z-index: 2;
  background:
    radial-gradient(circle at 50% 70%, rgba(245, 223, 184, 0.1), transparent 13rem),
    linear-gradient(90deg, rgba(2, 5, 10, 0.6), transparent 28%, transparent 72%, rgba(2, 5, 10, 0.58)),
    radial-gradient(ellipse at center, transparent 0 42%, rgba(2, 5, 10, 0.22) 74%, rgba(2, 5, 10, 0.78) 100%);
}

.entry-gate.is-ready {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.entry-gate.is-leaving {
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  filter: blur(10px);
  transform: scale(1.12);
}

.entry-gate__stars {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.5;
  background-image:
    radial-gradient(circle, rgba(247, 237, 219, 0.82) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(240, 180, 93, 0.62) 0 1px, transparent 1.6px);
  background-position: 16px 22px, 72px 84px;
  background-size: 170px 170px, 270px 270px;
  animation: loaderStars 10s linear infinite;
}

.entry-gate__content {
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  gap: 18px;
  width: min(520px, calc(100% - 44px));
  margin-top: min(32vh, 260px);
  text-align: center;
  transform: translateY(18px);
  opacity: 0;
  transition: opacity 900ms var(--ease) 220ms, transform 900ms var(--ease) 220ms;
}

.entry-gate.is-ready .entry-gate__content {
  opacity: 1;
  transform: translateY(0);
}

.entry-gate__eyebrow {
  max-width: none;
  margin: 0;
  color: rgba(255, 249, 235, 0.78);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1.2;
  text-transform: uppercase;
  text-shadow: 0 2px 18px rgba(2, 5, 10, 0.9);
}

.entry-gate__button {
  position: relative;
  display: inline-grid;
  min-width: 188px;
  min-height: 60px;
  place-items: center;
  padding: 16px 30px;
  color: #fff9eb;
  border: 1px solid rgba(245, 223, 184, 0.74);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 50%, rgba(245, 223, 184, 0.34), transparent 66%),
    rgba(2, 5, 10, 0.62);
  box-shadow:
    0 0 34px rgba(245, 223, 184, 0.5),
    0 0 92px rgba(117, 208, 210, 0.22),
    0 22px 64px rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(18px);
  cursor: pointer;
  font-size: 0.96rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: transform 260ms var(--ease), border-color 220ms ease, box-shadow 220ms ease;
}

.entry-gate__button:hover,
.entry-gate__button:focus-visible {
  border-color: rgba(255, 249, 235, 0.96);
  box-shadow:
    0 0 42px rgba(245, 223, 184, 0.55),
    0 0 110px rgba(117, 208, 210, 0.24),
    0 28px 78px rgba(0, 0, 0, 0.64);
  outline: none;
  transform: translateY(-2px) scale(1.04);
}

.entry-gate__button-orbit {
  position: absolute;
  inset: -10px;
  border: 1px solid rgba(117, 208, 210, 0.3);
  border-top-color: rgba(245, 223, 184, 0.72);
  border-radius: inherit;
  pointer-events: none;
  animation: entryButtonOrbit 3.8s linear infinite;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  content: "";
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 4px 4px, 6px 6px;
  mix-blend-mode: overlay;
}

button {
  font: inherit;
}

#starfield {
  position: fixed;
  inset: 0;
  z-index: 7;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.immersive-shell {
  position: fixed;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  pointer-events: none;
}

.aurora-field,
.cursor-glow,
.depth-vignette,
.scene-warp {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.aurora-field {
  opacity: 0.5;
  background:
    radial-gradient(ellipse at calc(18% + var(--page-progress, 0) * 28%) 18%, rgba(117, 208, 210, 0.18), transparent 24rem),
    radial-gradient(ellipse at calc(82% - var(--page-progress, 0) * 32%) 78%, rgba(240, 180, 93, 0.14), transparent 22rem),
    conic-gradient(from calc(var(--page-progress, 0) * 260deg) at 50% 50%, transparent, rgba(117, 208, 210, 0.1), transparent, rgba(240, 180, 93, 0.08), transparent);
  filter: blur(18px) saturate(1.2);
  mix-blend-mode: screen;
  transform: scale(1.08) rotate(calc(var(--page-progress, 0) * 6deg));
}

.cursor-glow {
  opacity: 0.72;
  background:
    radial-gradient(circle at var(--cursor-x) var(--cursor-y), rgba(245, 223, 184, 0.18), rgba(117, 208, 210, 0.08) 7rem, transparent 18rem);
  mix-blend-mode: screen;
  transition: opacity 220ms ease;
}

.depth-vignette {
  z-index: 8;
  background:
    radial-gradient(ellipse at center, transparent 0 44%, rgba(2, 5, 10, 0.16) 70%, rgba(2, 5, 10, 0.58) 100%),
    linear-gradient(180deg, rgba(2, 5, 10, 0.32), transparent 22%, transparent 72%, rgba(2, 5, 10, 0.7));
}

.scene-warp {
  z-index: 9;
  opacity: calc(var(--warp-opacity) * 0.32);
  background:
    radial-gradient(circle at 50% 50%, transparent 0 12rem, rgba(245, 223, 184, 0.12) 13rem, transparent 24rem),
    repeating-conic-gradient(from 0deg at 50% 50%, rgba(117, 208, 210, 0.045) 0 1.5deg, transparent 1.5deg 9deg);
  filter: blur(1px);
  mix-blend-mode: screen;
  transform: scale(calc(0.9 + var(--warp-opacity) * 0.34)) rotate(calc(var(--page-progress, 0) * 90deg));
  transition: opacity 420ms var(--ease), transform 420ms var(--ease);
}

.visual-stack {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
  background: #02050a;
}

.stack-layer {
  position: absolute;
  inset: -8vh -8vw;
  opacity: var(--layer-opacity, 0);
  filter:
    saturate(calc(0.94 + (var(--layer-opacity, 0) * 0.34)))
    brightness(calc(0.86 + (var(--layer-opacity, 0) * 0.24)))
    contrast(calc(1 + (var(--layer-opacity, 0) * 0.08)));
  transform:
    translate3d(
      calc((var(--layer-progress, 0.5) - 0.5) * -5vw),
      calc((var(--layer-progress, 0.5) - 0.5) * -4vh),
      0
    )
    scale(calc(1.22 - (var(--layer-presence, 0) * 0.15)))
    rotateZ(calc((var(--layer-progress, 0.5) - 0.5) * 0.55deg));
  transform-origin: center;
  transition: opacity 260ms linear, filter 260ms linear, transform 260ms linear;
  will-change: opacity, transform, filter;
}

.stack-layer::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(2, 5, 10, 0.62), rgba(2, 5, 10, 0.06) 48%, rgba(2, 5, 10, 0.22)),
    linear-gradient(180deg, rgba(2, 5, 10, 0.16), transparent 36%, rgba(2, 5, 10, 0.58));
}

.stack-layer--image {
  background: var(--image) center / cover no-repeat;
}

.stack-layer--generated,
.stack-layer--gravity {
  background:
    radial-gradient(circle at 72% 34%, rgba(123, 219, 219, 0.16), transparent 16rem),
    radial-gradient(circle at 52% 54%, rgba(240, 180, 93, 0.14), transparent 10rem),
    conic-gradient(from 210deg at 62% 50%, transparent 0deg, rgba(72, 153, 177, 0.2) 80deg, transparent 145deg),
    linear-gradient(140deg, #02050a 0%, #071521 52%, #03070d 100%);
}

.stack-layer--gravity {
  background:
    radial-gradient(circle at 50% 50%, transparent 0 18%, rgba(117, 208, 210, 0.12) 19%, transparent 34%),
    conic-gradient(from 120deg at 50% 50%, transparent, rgba(240, 180, 93, 0.2), transparent, rgba(117, 208, 210, 0.14), transparent),
    radial-gradient(circle at 50% 50%, rgba(245, 223, 184, 0.12), transparent 28rem),
    linear-gradient(180deg, #02050a, #07111a 56%, #02050a);
}

.stack-layer--horizon {
  background:
    radial-gradient(ellipse at 50% 70%, rgba(240, 180, 93, 0.26), transparent 24rem),
    radial-gradient(circle at 30% 20%, rgba(117, 208, 210, 0.14), transparent 16rem),
    linear-gradient(180deg, #02050a, #07111a 54%, #02050a);
}

.stack-layer--blue {
  background:
    radial-gradient(circle at 24% 26%, rgba(104, 209, 217, 0.18), transparent 22rem),
    radial-gradient(circle at 80% 76%, rgba(239, 160, 80, 0.12), transparent 20rem),
    linear-gradient(120deg, rgba(3, 7, 13, 0.92), rgba(8, 28, 44, 0.98)),
    repeating-linear-gradient(108deg, transparent 0 36px, rgba(255, 255, 255, 0.025) 37px 38px);
}

.stack-layer--storm {
  background:
    repeating-linear-gradient(112deg, transparent 0 44px, rgba(247, 237, 219, 0.035) 45px 46px),
    radial-gradient(circle at 78% 32%, rgba(240, 180, 93, 0.14), transparent 16rem),
    linear-gradient(145deg, #02050a, #071421 44%, #030507);
}

.stack-layer--gold {
  background:
    radial-gradient(circle at 50% 44%, rgba(245, 190, 113, 0.24), transparent 14rem),
    radial-gradient(circle at 20% 70%, rgba(114, 211, 210, 0.14), transparent 20rem),
    linear-gradient(180deg, #05080c, #0b1118 52%, #070405);
}

.stack-layer.is-visible {
  opacity: var(--layer-opacity, 1);
}

.cosmic-current {
  position: fixed;
  inset: -20vh -20vw;
  z-index: 5;
  pointer-events: none;
  opacity: 0.34;
  background:
    linear-gradient(112deg, transparent 0 34%, rgba(117, 208, 210, 0.08) 46%, transparent 60%),
    repeating-linear-gradient(112deg, transparent 0 52px, rgba(245, 223, 184, 0.035) 53px 54px);
  filter: blur(0.4px);
  transform: translate3d(calc(var(--page-progress, 0) * -8vw), calc(var(--page-progress, 0) * 10vh), 0);
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 45;
  width: 100%;
  height: 2px;
  pointer-events: none;
  background: rgba(245, 223, 184, 0.08);
}

.scroll-progress span {
  display: block;
  width: calc(var(--page-progress, 0) * 100%);
  height: 100%;
  background: linear-gradient(90deg, rgba(117, 208, 210, 0.12), rgba(245, 223, 184, 0.9), rgba(240, 180, 93, 0.4));
  box-shadow: 0 0 18px rgba(245, 223, 184, 0.7);
}

#backgroundAudio {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.sound-control {
  position: fixed;
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(16px, 3vw, 32px);
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px 14px 8px 9px;
  color: rgba(247, 237, 219, 0.92);
  border: 1px solid rgba(247, 237, 219, 0.24);
  border-radius: 999px;
  background: rgba(2, 5, 10, 0.52);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(18px);
  cursor: pointer;
}

.sound-control.is-blocked {
  border-color: rgba(240, 180, 93, 0.58);
  color: var(--gold);
}

.sound-control__icon {
  position: relative;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(245, 223, 184, 0.36);
  border-radius: 50%;
}

.sound-control__icon::before {
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid currentColor;
  content: "";
  transform: translateX(1px);
}

.sound-control[aria-pressed="true"] .sound-control__icon::before {
  width: 10px;
  height: 12px;
  border: 0;
  background: linear-gradient(90deg, currentColor 0 32%, transparent 32% 68%, currentColor 68%);
  transform: none;
}

.sound-control__label {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
}

.memory-timeline {
  position: fixed;
  top: 50%;
  left: clamp(12px, 2.2vw, 28px);
  z-index: 38;
  display: grid;
  gap: 12px;
  transform: translateY(-50%);
}

.memory-timeline::before {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 17px;
  width: 1px;
  content: "";
  background: linear-gradient(180deg, transparent, rgba(117, 208, 210, 0.22), rgba(245, 223, 184, 0.54), transparent);
  box-shadow: 0 0 18px rgba(245, 223, 184, 0.22);
}

.memory-dot {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  color: rgba(247, 237, 219, 0.64);
  border: 1px solid rgba(247, 237, 219, 0.18);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(2, 5, 10, 0.22), rgba(2, 5, 10, 0.88)),
    var(--thumb, radial-gradient(circle at 62% 38%, rgba(117, 208, 210, 0.58), transparent 34%), radial-gradient(circle at 36% 70%, rgba(240, 180, 93, 0.5), transparent 30%), #06111a)
      center / cover;
  box-shadow: 0 0 0 1px rgba(2, 5, 10, 0.45), 0 12px 28px rgba(0, 0, 0, 0.32);
  cursor: pointer;
  transition: transform 240ms var(--ease), border-color 240ms ease, box-shadow 240ms ease;
}

.memory-dot::after {
  position: absolute;
  inset: -5px;
  border: 1px solid transparent;
  border-top-color: rgba(117, 208, 210, 0.42);
  border-radius: 50%;
  content: "";
  opacity: 0;
  transform: rotate(calc(var(--page-progress, 0) * 240deg));
}

.memory-dot span {
  position: relative;
  z-index: 1;
  font-size: 0.66rem;
  font-weight: 800;
  text-shadow: 0 1px 10px #02050a;
}

.memory-dot.is-active {
  color: var(--ink);
  border-color: rgba(245, 223, 184, 0.82);
  transform: scale(1.08);
  box-shadow:
    0 0 0 1px rgba(245, 223, 184, 0.22),
    0 0 32px rgba(117, 208, 210, 0.28),
    0 18px 42px rgba(0, 0, 0, 0.44);
}

.memory-dot:hover {
  transform: scale(1.12);
  border-color: rgba(245, 223, 184, 0.62);
}

.memory-dot.is-active::after {
  opacity: 1;
}

.experience {
  position: relative;
  z-index: 8;
}

.scene {
  position: relative;
  display: grid;
  min-height: 104vh;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  perspective: 1200px;
}

.scene:first-child {
  min-height: 100vh;
}

.scene::before {
  position: absolute;
  inset: 12vh 8vw;
  z-index: -2;
  border: 1px solid rgba(245, 223, 184, calc(var(--scene-visibility, 0) * 0.12));
  border-radius: 50%;
  content: "";
  opacity: calc(var(--scene-visibility, 0) * 0.42);
  filter: blur(0.2px);
  transform:
    translate3d(0, calc((0.5 - var(--scene-progress, 0)) * 12vh), 0)
    scale(calc(0.82 + var(--scene-visibility, 0) * 0.22))
    rotate(calc(var(--scene-progress, 0) * 20deg));
  pointer-events: none;
}

.scene__image,
.scene__image--generated,
.soft-horizon,
.storm-lines,
.memory-dust {
  position: absolute;
  inset: -10vh -6vw;
  z-index: -4;
  transform:
    translate3d(
      calc((var(--scene-progress, 0) - 0.5) * -7vw),
      calc((var(--scene-progress, 0) - 0.5) * -9vh),
      0
    )
    rotateZ(calc((var(--scene-progress, 0) - 0.5) * 0.45deg));
  transform-origin: center;
  transition: transform 160ms linear;
}

.scene > .scene__image,
.scene > .scene__image--generated,
.scene > .soft-horizon,
.scene > .storm-lines,
.scene > .memory-dust {
  opacity: 0;
}

.scene__image {
  background: var(--image) center / cover no-repeat;
}

.scene__image--generated {
  background:
    radial-gradient(circle at 72% 34%, rgba(123, 219, 219, 0.16), transparent 16rem),
    radial-gradient(circle at 52% 54%, rgba(240, 180, 93, 0.14), transparent 10rem),
    conic-gradient(from 210deg at 62% 50%, transparent 0deg, rgba(72, 153, 177, 0.2) 80deg, transparent 145deg),
    linear-gradient(140deg, #02050a 0%, #071521 52%, #03070d 100%);
}

.scene__image--blue {
  background:
    radial-gradient(circle at 24% 26%, rgba(104, 209, 217, 0.18), transparent 22rem),
    radial-gradient(circle at 80% 76%, rgba(239, 160, 80, 0.12), transparent 20rem),
    linear-gradient(120deg, rgba(3, 7, 13, 0.92), rgba(8, 28, 44, 0.98)),
    repeating-linear-gradient(108deg, transparent 0 36px, rgba(255, 255, 255, 0.025) 37px 38px);
}

.scene__image--gold {
  background:
    radial-gradient(circle at 50% 44%, rgba(245, 190, 113, 0.24), transparent 14rem),
    radial-gradient(circle at 20% 70%, rgba(114, 211, 210, 0.14), transparent 20rem),
    linear-gradient(180deg, #05080c, #0b1118 52%, #070405);
}

.scene__veil {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(2, 5, 10, 0.86), rgba(2, 5, 10, 0.22) 42%, rgba(2, 5, 10, 0.34)),
    linear-gradient(180deg, rgba(2, 5, 10, 0.5), transparent 24%, rgba(2, 5, 10, 0.76));
  opacity: 0;
}

.scene__veil--radial {
  background:
    radial-gradient(circle at 66% 54%, transparent 0 14rem, rgba(2, 5, 10, 0.68) 32rem),
    linear-gradient(90deg, rgba(2, 5, 10, 0.84), rgba(2, 5, 10, 0.36));
}

.scene__veil--left {
  background:
    linear-gradient(90deg, rgba(2, 5, 10, 0.88) 0%, rgba(2, 5, 10, 0.52) 36%, transparent 70%),
    linear-gradient(180deg, rgba(2, 5, 10, 0.7), transparent 30%, rgba(2, 5, 10, 0.78));
}

.scene__veil--final {
  background:
    linear-gradient(90deg, rgba(2, 5, 10, 0.9), rgba(2, 5, 10, 0.32) 60%, transparent),
    linear-gradient(180deg, rgba(2, 5, 10, 0.12), rgba(2, 5, 10, 0.82));
}

.scene__veil--video {
  background:
    radial-gradient(circle at 50% 48%, rgba(245, 223, 184, 0.08) 0 5rem, transparent 14rem),
    radial-gradient(circle at 50% 48%, transparent 0 10rem, rgba(2, 5, 10, 0.2) 22rem, rgba(2, 5, 10, 0.76) 48rem),
    linear-gradient(180deg, rgba(2, 5, 10, 0.2), rgba(2, 5, 10, 0.76));
}

.scene::after {
  position: absolute;
  inset: auto 0 -1px;
  height: 18vh;
  z-index: -1;
  content: "";
  opacity: 0;
  background: linear-gradient(180deg, transparent, #02050a);
  pointer-events: none;
}

.scene__copy {
  width: min(640px, calc(100% - 44px));
  margin-right: auto;
  margin-left: clamp(22px, 9vw, 132px);
  padding-block: 12vh;
  opacity: calc(0.86 + (var(--scene-visibility, 0) * 0.14));
  filter: blur(calc((1 - var(--scene-visibility, 0)) * 0.8px));
  transform:
    translate3d(
      calc((0.5 - var(--scene-progress, 0)) * 4vw),
      calc((1 - var(--scene-visibility, 0)) * 34px),
      calc(var(--scene-visibility, 0) * 28px)
    );
  transition: opacity 700ms var(--ease), filter 700ms var(--ease), transform 700ms var(--ease);
  text-shadow:
    0 2px 24px rgba(2, 5, 10, 0.82),
    0 0 38px rgba(245, 223, 184, calc(var(--scene-visibility, 0) * 0.08));
}

.scene__copy--wide {
  width: min(780px, calc(100% - 44px));
}

.scene__copy--right {
  margin-right: clamp(22px, 9vw, 132px);
  margin-left: auto;
}

.scene__copy--center {
  margin-inline: auto;
  text-align: center;
}

.scene__number {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 0 26px;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 1.5vw, 1.35rem);
}

.scene__number::after {
  display: block;
  width: calc(42px + var(--scene-visibility, 0) * 34px);
  height: 1px;
  background: linear-gradient(90deg, rgba(245, 223, 184, 0.7), transparent);
  content: "";
}

h1,
h2 {
  max-width: 16ch;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.98;
  text-wrap: balance;
}

h1,
h2,
.closing,
.impact,
.video-vow {
  text-shadow:
    0 2px 30px rgba(2, 5, 10, 0.92),
    0 0 44px rgba(245, 223, 184, calc(var(--scene-visibility, 0) * 0.12));
}

h1 {
  font-size: clamp(3.7rem, 8.8vw, 8.1rem);
}

h2 {
  font-size: clamp(2.55rem, 5.8vw, 5.8rem);
}

p {
  max-width: 58ch;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.18vw, 1.22rem);
  line-height: 1.78;
}

.lead {
  max-width: 52ch;
  color: rgba(247, 237, 219, 0.82);
  font-size: clamp(1.08rem, 1.32vw, 1.35rem);
}

.whisper,
.impact,
.closing {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
}

.impact {
  font-size: clamp(1.3rem, 2.2vw, 2.4rem);
  line-height: 1.25;
}

.closing {
  max-width: 36ch;
  font-size: clamp(1.35rem, 2.3vw, 2.45rem);
  line-height: 1.35;
}

.scene--video {
  place-items: center;
}

.heart-portal {
  position: absolute;
  top: 48%;
  left: 50%;
  z-index: 2;
  width: clamp(170px, 20vw, 280px);
  aspect-ratio: 1;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.heart-portal::before,
.heart-portal::after {
  position: absolute;
  inset: 32%;
  border-radius: 50%;
  content: "";
  background: rgba(245, 223, 184, 0.16);
  box-shadow:
    0 0 34px rgba(245, 223, 184, 0.72),
    0 0 78px rgba(240, 180, 93, 0.42),
    0 0 124px rgba(117, 208, 210, 0.22);
  animation: portalPulse 2.8s var(--ease) infinite;
}

.heart-portal::after {
  inset: 18%;
  border: 1px solid rgba(245, 223, 184, 0.26);
  background: transparent;
  animation-delay: -1.1s;
}

.heart-particle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 18px rgba(245, 223, 184, 0.95);
  opacity: 0;
  transform: translate(-50%, -50%);
  animation: heartParticle 3.4s ease-out infinite;
}

.heart-particle:nth-child(1) { --x: -104px; --y: -66px; animation-delay: -0.2s; }
.heart-particle:nth-child(2) { --x: 92px; --y: -84px; animation-delay: -0.5s; }
.heart-particle:nth-child(3) { --x: -118px; --y: 18px; animation-delay: -0.8s; }
.heart-particle:nth-child(4) { --x: 126px; --y: 24px; animation-delay: -1.1s; }
.heart-particle:nth-child(5) { --x: -58px; --y: -124px; animation-delay: -1.4s; }
.heart-particle:nth-child(6) { --x: 44px; --y: 118px; animation-delay: -1.7s; }
.heart-particle:nth-child(7) { --x: -18px; --y: 144px; animation-delay: -2s; }
.heart-particle:nth-child(8) { --x: 14px; --y: -146px; animation-delay: -2.3s; }
.heart-particle:nth-child(9) { --x: -148px; --y: -22px; animation-delay: -2.6s; }
.heart-particle:nth-child(10) { --x: 154px; --y: -14px; animation-delay: -2.9s; }
.heart-particle:nth-child(11) { --x: -82px; --y: 98px; animation-delay: -3.2s; }
.heart-particle:nth-child(12) { --x: 88px; --y: 94px; animation-delay: -3.5s; }

.video-vow {
  position: absolute;
  top: calc(48% + clamp(56px, 6vw, 82px));
  left: 50%;
  z-index: 5;
  width: min(680px, calc(100% - 44px));
  margin: 0;
  color: rgba(255, 249, 235, 0.9);
  font-family: Georgia, "Times New Roman", serif;
  text-align: center;
  text-shadow:
    0 2px 22px rgba(2, 5, 10, 0.92),
    0 0 36px rgba(245, 223, 184, 0.34);
  transform: translate3d(-50%, calc((1 - var(--scene-visibility, 0)) * 24px), 0);
  transition: transform 600ms var(--ease), opacity 600ms var(--ease);
}

.video-vow p {
  max-width: none;
  margin: 0;
  color: rgba(255, 249, 235, 0.9);
  font-size: clamp(1.05rem, 1.55vw, 1.45rem);
  font-style: italic;
  line-height: 1.42;
}

.video-vow p + p {
  margin-top: 12px;
  color: var(--gold);
  font-size: clamp(1.42rem, 2.4vw, 2.6rem);
  line-height: 1.12;
}

.video-link {
  position: relative;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 178px;
  min-height: 58px;
  padding: 14px 22px 14px 16px;
  color: #fff9eb;
  text-decoration: none;
  border: 1px solid rgba(245, 223, 184, 0.7);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 50%, rgba(245, 223, 184, 0.24), transparent 68%),
    rgba(2, 5, 10, 0.42);
  box-shadow:
    0 0 36px rgba(245, 223, 184, 0.42),
    0 22px 68px rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(18px);
  font-size: clamp(0.92rem, 1.1vw, 1.08rem);
  font-weight: 800;
  letter-spacing: 0;
  transform: translateY(calc((1 - var(--scene-visibility, 0)) * 18px)) scale(calc(0.96 + (var(--scene-visibility, 0) * 0.04)));
  transition: transform 500ms var(--ease), border-color 220ms ease, box-shadow 220ms ease;
}

.video-link:hover,
.video-link:focus-visible {
  border-color: rgba(255, 249, 235, 0.96);
  box-shadow:
    0 0 44px rgba(245, 223, 184, 0.58),
    0 0 96px rgba(117, 208, 210, 0.24),
    0 28px 78px rgba(0, 0, 0, 0.64);
  transform: translateY(calc((1 - var(--scene-visibility, 0)) * 18px)) scale(1.04);
}

.video-link__icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 249, 235, 0.58);
  border-radius: 50%;
}

.video-link__icon::before {
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid currentColor;
  content: "";
  transform: translateX(2px);
}

.orbital-ring {
  position: absolute;
  width: min(82vw, 980px);
  aspect-ratio: 1;
  z-index: -3;
  border: 1px solid rgba(117, 208, 210, 0.14);
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 0 38%, rgba(117, 208, 210, 0.08) 39%, transparent 54%),
    conic-gradient(from 120deg, transparent, rgba(240, 180, 93, 0.18), transparent, rgba(117, 208, 210, 0.12), transparent);
  filter: blur(0.2px);
  transform: rotate(calc(var(--page-progress, 0) * 80deg)) scale(1.1);
}

.memory-dust {
  background:
    radial-gradient(circle at 20% 30%, rgba(245, 223, 184, 0.18) 0 1px, transparent 2px),
    radial-gradient(circle at 70% 62%, rgba(117, 208, 210, 0.18) 0 1px, transparent 2px);
  background-size: 70px 70px, 110px 110px;
  opacity: 0.9;
}

.soft-horizon {
  background:
    radial-gradient(ellipse at 50% 70%, rgba(240, 180, 93, 0.26), transparent 24rem),
    radial-gradient(circle at 30% 20%, rgba(117, 208, 210, 0.14), transparent 16rem),
    linear-gradient(180deg, #02050a, #07111a 54%, #02050a);
}

.storm-lines {
  background:
    repeating-linear-gradient(112deg, transparent 0 44px, rgba(247, 237, 219, 0.035) 45px 46px),
    radial-gradient(circle at 78% 32%, rgba(240, 180, 93, 0.14), transparent 16rem),
    linear-gradient(145deg, #02050a, #071421 44%, #030507);
}

@media (max-width: 860px) {
  .aurora-field {
    opacity: 0.38;
    filter: blur(24px);
  }

  .cursor-glow {
    display: none;
  }

  .entry-gate {
    background:
      radial-gradient(circle at 50% 74%, rgba(245, 223, 184, 0.2), transparent 15rem),
      linear-gradient(180deg, rgba(2, 5, 10, 0.06), rgba(2, 5, 10, 0.32) 48%, rgba(2, 5, 10, 0.78)),
      url("assets/entry-gate-cosmic-cabin-mobile.png") center / cover no-repeat;
  }

  .entry-gate__content {
    margin-top: min(42vh, 310px);
  }

  .entry-gate__button {
    min-width: 170px;
    min-height: 56px;
    padding: 14px 24px;
    font-size: 0.86rem;
  }

  .depth-vignette {
    background:
      radial-gradient(ellipse at center, transparent 0 40%, rgba(2, 5, 10, 0.22) 72%, rgba(2, 5, 10, 0.66) 100%),
      linear-gradient(180deg, rgba(2, 5, 10, 0.16), transparent 25%, rgba(2, 5, 10, 0.76));
  }

  .scene {
    min-height: 106vh;
    place-items: end start;
  }

  .scene__copy,
  .scene__copy--right,
  .scene__copy--center {
    width: min(100% - 36px, 620px);
    margin-inline: 18px;
    padding-block: 12vh 24vh;
    text-align: left;
  }

  .scene__copy--center h2,
  .scene__copy--center p {
    margin-inline: 0;
  }

  h1 {
    font-size: clamp(3.2rem, 17vw, 5rem);
  }

  h2 {
    max-width: 11.8ch;
    font-size: clamp(2.35rem, 12vw, 4.2rem);
  }

  p {
    font-size: 1rem;
    line-height: 1.68;
  }

  .sound-control {
    max-width: calc(100% - 32px);
  }

  .sound-control__label {
    display: none;
  }

  .memory-timeline {
    top: auto;
    right: 80px;
    bottom: 17px;
    left: 12px;
    grid-auto-flow: column;
    grid-template-columns: repeat(11, minmax(0, 1fr));
    gap: 4px;
    transform: none;
  }

  .memory-timeline::before {
    top: 50%;
    right: 18px;
    bottom: auto;
    left: 18px;
    width: auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(245, 223, 184, 0.34), transparent);
  }

  .memory-dot {
    width: 26px;
    height: 26px;
    justify-self: center;
  }

  .memory-dot span {
    font-size: 0.54rem;
  }

  .heart-portal {
    top: 47%;
    width: min(58vw, 220px);
  }

  .scene--video {
    min-height: 100vh;
    place-items: center;
  }

  .video-link {
    position: absolute;
    top: 57%;
    left: 50%;
    min-width: 152px;
    min-height: 52px;
    padding: 11px 18px 11px 12px;
    transform: translate(-50%, -50%) scale(calc(0.96 + (var(--scene-visibility, 0) * 0.04)));
  }

  .video-vow {
    top: calc(57% + 42px);
    width: min(340px, calc(100% - 28px));
  }

  .video-vow p {
    font-size: 1rem;
    line-height: 1.28;
  }

  .video-vow p + p {
    margin-top: 8px;
    font-size: clamp(1.24rem, 6.4vw, 1.72rem);
  }

  .video-link__icon {
    width: 30px;
    height: 30px;
  }

  .scene__image,
  .scene__image--generated,
  .soft-horizon,
  .storm-lines,
  .memory-dust {
    inset: -8vh -34vw;
    transform:
      translate3d(
        calc((var(--scene-progress, 0) - 0.5) * -14vw),
        calc((var(--scene-progress, 0) - 0.5) * -7vh),
        0
      );
  }

  .scene--flower .scene__image,
  .stack-layer[data-layer="09"] {
    background-position: 44% center;
  }

  .scene__veil,
  .scene__veil--left,
  .scene__veil--radial,
  .scene__veil--final,
  .scene__veil--video {
    background:
      linear-gradient(180deg, rgba(2, 5, 10, 0.18), rgba(2, 5, 10, 0.76) 48%, rgba(2, 5, 10, 0.94)),
      linear-gradient(90deg, rgba(2, 5, 10, 0.82), rgba(2, 5, 10, 0.22));
  }
}

@keyframes portalPulse {
  0% {
    opacity: 0.42;
    transform: scale(0.78);
  }
  55% {
    opacity: 0.88;
  }
  100% {
    opacity: 0;
    transform: scale(1.82);
  }
}

@keyframes heartParticle {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4);
  }
  16% {
    opacity: 1;
  }
  78% {
    opacity: 0.84;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1.2);
  }
}

@keyframes loaderStars {
  0% {
    background-position: 0 0, 38px 64px, 82px 18px;
  }
  100% {
    background-position: 0 180px, 38px 344px, 82px 418px;
  }
}

@keyframes entryGateDrift {
  0% {
    opacity: 0.58;
    transform: scale(1) rotate(0deg);
  }
  50% {
    opacity: 0.86;
    transform: scale(1.04) rotate(4deg);
  }
  100% {
    opacity: 0.58;
    transform: scale(1) rotate(8deg);
  }
}

@keyframes entryButtonOrbit {
  0% {
    transform: rotate(0deg) scale(1);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

@keyframes orbitSpin {
  0% {
    transform: rotate(0deg) scale(0.92);
  }
  100% {
    transform: rotate(360deg) scale(0.92);
  }
}

@keyframes rocketHover {
  0% {
    transform: translate(-50%, -4px) rotate(-1.4deg);
  }
  100% {
    transform: translate(-50%, 5px) rotate(1.4deg);
  }
}

@keyframes plumePulse {
  0% {
    opacity: 0.58;
    transform: translate(-50%, 0) perspective(400px) rotateX(48deg) scaleX(0.78);
  }
  100% {
    opacity: 0.95;
    transform: translate(-50%, 2%) perspective(400px) rotateX(48deg) scaleX(1.08);
  }
}

@keyframes flameStretch {
  0% {
    height: 62px;
    opacity: 0.72;
    transform: translateX(-50%) scaleX(0.82);
  }
  100% {
    height: 86px;
    opacity: 1;
    transform: translateX(-50%) scaleX(1.12);
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .scene__image,
  .scene__image--generated,
  .soft-horizon,
  .storm-lines,
  .memory-dust,
  .cosmic-current {
    transform: none;
  }
}
