.future-portal {
  position: relative;
  min-height: 118vh;
  overflow: hidden;
  color: var(--paper);
  background: var(--obsidian);
  border-top: 1px solid rgba(242, 238, 227, 0.18);
  isolation: isolate;
}

.future-portal::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("./media/260802 Forever Book_Cloud Atlas Hero Poster_MUAPI_v0.1.jpg") center / cover no-repeat;
  filter: saturate(0.66) contrast(1.08) brightness(0.48);
  transform: scale(1.06);
}

.future-portal::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(14, 26, 58, 0.48);
}

.future-portal-copy {
  position: absolute;
  top: clamp(72px, 11vh, 128px);
  left: clamp(20px, 5vw, 72px);
  z-index: 3;
  width: min(570px, calc(100% - 40px));
  pointer-events: none;
}

.future-portal-copy h2 {
  max-width: 560px;
  margin: 12px 0 0;
  font-family: var(--display);
  font-size: clamp(54px, 8vw, 126px);
  font-weight: 400;
  line-height: 0.84;
  letter-spacing: 0;
}

.future-portal-copy p:last-child {
  max-width: 390px;
  margin: 26px 0 0;
  font-size: 15px;
  line-height: 1.55;
}

.future-portal-stage {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: min(680px, 100vh);
  min-height: min(680px, 100svh);
}

#future-canvas {
  width: 100%;
  height: 100%;
  touch-action: none;
}

.future-enter {
  position: absolute;
  right: clamp(18px, 4vw, 54px);
  bottom: clamp(22px, 5vh, 58px);
  z-index: 4;
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  padding: 0;
  color: var(--paper);
  background: var(--orange);
  border: 1px solid rgba(242, 238, 227, 0.6);
  border-radius: 50%;
  box-shadow: 0 22px 62px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  transition: transform 380ms cubic-bezier(0.16, 1, 0.3, 1), background-color 180ms ease;
}

.future-enter::before {
  content: "";
  position: absolute;
  width: 30px;
  height: 30px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: translate(-4px, 4px) rotate(-45deg);
}

.future-enter span {
  position: absolute;
  bottom: 18px;
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.future-enter:hover,
.future-enter:focus-visible {
  background: #f47b21;
  transform: translateY(-7px) rotate(4deg);
}

.future-enter:focus-visible,
.future-exit:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 4px;
}

.future-portal.is-launching .future-portal-copy,
.future-portal.is-launching .future-enter {
  opacity: 0;
  transition: opacity 220ms ease;
}

.future-world {
  position: fixed;
  inset: 0;
  z-index: 2000;
  overflow: hidden;
  color: var(--paper);
  background: #0e1a3a;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 520ms cubic-bezier(0.16, 1, 0.3, 1), visibility 0s linear 520ms;
  isolation: isolate;
}

.future-world.is-open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition-delay: 0s;
}

.future-backgrounds {
  position: absolute;
  inset: 0;
  z-index: -3;
  overflow: hidden;
}

.future-world-video,
.future-world-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: saturate(0.72) contrast(1.08) brightness(0.8);
  transform: scale(1.025);
  transition: opacity 680ms ease, filter 520ms ease, transform 1400ms cubic-bezier(0.16, 1, 0.3, 1);
}

.future-world[data-scene="cloud"] [data-future-background="cloud"],
.future-world[data-scene="forest"] [data-future-background="forest"],
.future-world[data-scene="city"] [data-future-background="city"] {
  opacity: 1;
  transform: scale(1);
}

.future-world-field {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: rgba(14, 26, 58, 0.26);
  transition: background-color 520ms ease;
}

.future-world[data-scene="forest"] .future-world-background {
  filter: saturate(0.86) contrast(1.08) brightness(0.72);
}

.future-world[data-scene="city"] .future-world-background {
  filter: saturate(0.76) contrast(1.1) brightness(0.74);
}

.future-world[data-scene="forest"] .future-world-field {
  background: rgba(8, 25, 22, 0.24);
}

.future-world[data-scene="city"] .future-world-field {
  background: rgba(14, 22, 34, 0.2);
}

.future-world[data-scene="city"] .future-world-copy {
  max-width: 360px;
}

.future-world[data-scene="city"] .future-world-copy h2 {
  font-size: clamp(58px, 6vw, 90px);
  line-height: 0.88;
}

.future-world[data-scene="city"] .future-world-copy > p:last-child {
  max-width: 250px;
  margin-top: 16px;
}

.future-stage-host {
  position: absolute;
  inset: 0;
}

.future-stage-host #future-canvas {
  cursor: grab;
}

.future-stage-host #future-canvas:active {
  cursor: grabbing;
}

.future-world-copy {
  position: absolute;
  top: clamp(74px, 10vh, 112px);
  left: clamp(20px, 4vw, 58px);
  z-index: 4;
  max-width: 470px;
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: opacity 600ms 1150ms ease, transform 900ms 1100ms cubic-bezier(0.16, 1, 0.3, 1);
}

.future-world.has-landed .future-world-copy {
  opacity: 1;
  transform: translateY(0);
}

.future-world-copy h2 {
  margin: 10px 0 0;
  font-family: var(--display);
  font-size: clamp(58px, 7.4vw, 118px);
  font-weight: 400;
  line-height: 0.84;
  letter-spacing: 0;
}

.future-world-copy > p:last-child {
  max-width: 350px;
  margin: 24px 0 0;
  font-size: 14px;
  line-height: 1.55;
}

.future-world-index {
  position: absolute;
  right: clamp(18px, 4vw, 54px);
  bottom: clamp(22px, 4vh, 44px);
  z-index: 4;
  display: grid;
  width: min(360px, calc(100% - 36px));
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 500ms 1500ms ease, transform 800ms 1450ms cubic-bezier(0.16, 1, 0.3, 1);
}

.future-world.has-landed .future-world-index {
  opacity: 1;
  transform: translateY(0);
}

.future-world-index span {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 14px;
  padding: 11px 0;
  border-top: 1px solid rgba(242, 238, 227, 0.38);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.35;
  text-shadow: 0 1px 7px rgba(14, 26, 58, 0.92);
}

.future-world-index em {
  color: var(--orange);
  font-style: normal;
}

.future-object-note {
  position: absolute;
  left: clamp(20px, 4vw, 58px);
  bottom: clamp(22px, 4vh, 44px);
  z-index: 4;
  width: min(330px, calc(100% - 40px));
  padding: 15px 0 0;
  color: var(--paper);
  background: transparent;
  border-top: 1px solid rgba(242, 238, 227, 0.46);
  pointer-events: none;
}

.future-object-note[hidden] { display: none; }

.future-object-note strong,
.future-object-note span {
  display: block;
}

.future-object-note strong {
  font-family: var(--display);
  font-size: 25px;
  font-weight: 400;
}

.future-object-note span {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.5;
  text-transform: uppercase;
}

.future-scene-switcher {
  position: absolute;
  top: 18px;
  right: 76px;
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(3, 62px);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 400ms 1550ms ease, transform 600ms 1500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.future-world.has-landed .future-scene-switcher {
  opacity: 1;
  transform: translateY(0);
}

.future-scene-switcher button {
  height: 44px;
  padding: 0;
  color: rgba(242, 238, 227, 0.62);
  background: rgba(14, 26, 58, 0.68);
  border: 1px solid rgba(242, 238, 227, 0.34);
  border-right: 0;
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  cursor: pointer;
}

.future-scene-switcher button:last-child {
  border-right: 1px solid rgba(242, 238, 227, 0.34);
}

.future-scene-switcher button[aria-pressed="true"] {
  color: var(--obsidian);
  background: var(--paper);
}

.future-scene-switcher button:disabled {
  cursor: wait;
  opacity: 0.52;
}

.future-exit {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 6;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  color: var(--paper);
  background: rgba(14, 26, 58, 0.78);
  border: 1px solid rgba(242, 238, 227, 0.42);
  border-radius: 50%;
  cursor: pointer;
}

.future-exit span {
  font-size: 24px;
  line-height: 1;
  transform: translateY(-1px);
}

.future-cloud-wipe {
  position: absolute;
  inset: -8%;
  z-index: 5;
  background: url("./media/260802 Forever Book_Cloud Atlas Hero Poster_MUAPI_v0.1.jpg") center / cover no-repeat;
  filter: brightness(1.34) saturate(0.55);
  opacity: 0;
  pointer-events: none;
  transform: scale(1.18) translateY(10%);
}

.future-world.is-arriving .future-cloud-wipe {
  animation: future-cloud-pass 1250ms cubic-bezier(0.76, 0, 0.24, 1) both;
}

.future-world.is-scene-changing .future-cloud-wipe {
  animation: future-scene-pass 760ms cubic-bezier(0.76, 0, 0.24, 1) both;
}

.future-status {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 7;
  margin: 0;
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  transform: translateX(-50%);
}

.future-world.has-landed .future-status {
  opacity: 0;
  transition: opacity 300ms ease;
}

body.future-world-open {
  overflow: hidden;
}

@keyframes future-cloud-pass {
  0% { opacity: 0; transform: scale(1.18) translateY(14%); }
  28% { opacity: 1; }
  62% { opacity: 0.96; }
  100% { opacity: 0; transform: scale(1.02) translateY(-14%); }
}

@keyframes future-scene-pass {
  0% { opacity: 0; transform: scale(1.08) translateX(8%); }
  40% { opacity: 0.88; }
  58% { opacity: 0.88; }
  100% { opacity: 0; transform: scale(1.03) translateX(-8%); }
}

@media (max-width: 760px) {
  .future-portal { min-height: 105vh; }
  .future-portal-stage { min-height: min(620px, 100vh); min-height: min(620px, 100svh); }
  .future-portal-copy h2 { font-size: clamp(54px, 18vw, 78px); }
  .future-portal-copy p:last-child { max-width: 280px; font-size: 13px; }
  .future-enter { width: 84px; height: 84px; }
  .future-enter::before { width: 23px; height: 23px; }
  .future-enter span { bottom: 12px; font-size: 8px; }
  .future-world-copy { top: 70px; max-width: 290px; }
  .future-world-copy h2 { font-size: clamp(54px, 17vw, 78px); }
  .future-world[data-scene="city"] .future-world-copy h2 { font-size: clamp(50px, 15vw, 68px); }
  .future-world-copy > p:last-child { max-width: 250px; font-size: 12px; }
  .future-world-index { right: 18px; bottom: 18px; width: min(310px, calc(100% - 36px)); }
  .future-world-index span { grid-template-columns: 28px 1fr; }
  .future-world-index span b { display: none; }
  .future-object-note { bottom: 104px; max-width: 260px; }
  .future-scene-switcher { right: 72px; grid-template-columns: repeat(3, 52px); }
  .future-scene-switcher button { height: 42px; font-size: 8px; }
  .future-status { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .future-enter,
  .future-world,
  .future-world-copy,
  .future-world-index {
    transition: none;
  }

  .future-world.is-arriving .future-cloud-wipe {
    animation: none;
    display: none;
  }

  .future-world.is-scene-changing .future-cloud-wipe {
    animation: none;
    display: none;
  }
}

html.future-reduced-motion .future-enter,
html.future-reduced-motion .future-world,
html.future-reduced-motion .future-world-copy,
html.future-reduced-motion .future-world-index,
html.future-reduced-motion .future-scene-switcher {
  transition: none;
}

html.future-reduced-motion .future-cloud-wipe {
  animation: none;
  display: none;
}
