/* ==========================================================================
   Cloudcom journey: the Earth to moon experience.
   Everything here is scoped to html.in-journey or to journey-only elements,
   so the studio site (studio.css) is untouched once the visitor arrives.
   ========================================================================== */

:root {
  --cc-blue: #18cbfe;
  --cc-navy: #082e4a;
  --cc-deep: #041a2c;
  --cc-ink: #102d46;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Without JavaScript the studio site simply shows. */
.journey,
.intro,
.veil {
  display: none;
}
html.in-journey,
html.in-journey body {
  overflow: hidden;
  height: 100%;
  overscroll-behavior: none;
  background: var(--cc-deep);
}
html.in-journey .journey {
  display: block;
}
html.in-journey .intro {
  display: grid;
}
html.in-journey .studio,
html.in-journey .closing-frame {
  display: none;
}
.veil {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 120;
  background: var(--cc-navy);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s var(--ease-io);
}
.veil.on {
  opacity: 1;
}

/* ---------- The world ---------- */
.journey {
  position: fixed;
  inset: 0;
  overflow: hidden;
  color: #fff;
  background: #0b2f4f;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.world {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.journey.hovering-rocket {
  cursor: pointer;
}
.world-fallback {
  position: absolute;
  inset: 0;
  display: none;
  background: #0b2f4f center/cover no-repeat;
  transition: background-image 0.6s;
}
html.no-webgl .world-fallback {
  display: block;
}
html.no-webgl .world {
  display: none;
}

/* ---------- Copy that lives in the world ---------- */
.beats {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}
.beat {
  position: absolute;
  left: 0;
  top: 0;
  width: min(30rem, 40vw);
  opacity: 0;
  transform-origin: 0 0;
  will-change: transform, opacity;
  text-shadow:
    0 1px 2px rgba(3, 24, 42, 0.38),
    0 6px 26px rgba(3, 24, 42, 0.42);
}
.beat-hero {
  width: min(44rem, 52vw);
}
.beat h1,
.beat h2 {
  margin: 0;
  font-family: Montserrat, Arial, sans-serif;
  color: #fff;
  text-wrap: balance;
}
.beat h1 {
  font-weight: 600;
  font-size: clamp(36px, 4.7vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.beat h1 em {
  display: block;
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.02em;
  margin-bottom: 0.04em;
}
.beat h2 {
  font-weight: 500;
  font-size: clamp(30px, 3.3vw, 54px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.beat p {
  text-shadow:
    0 1px 2px rgba(3, 24, 42, 0.55),
    0 0 14px rgba(3, 24, 42, 0.5);
  text-wrap: balance;
  margin: 0.9em 0 0;
  font: 500 clamp(15px, 1.12vw, 18px) / 1.5 Montserrat, Arial, sans-serif;
  color: rgba(255, 255, 255, 0.94);
  max-width: 26em;
}
.beat-eyebrow {
  margin: 0 0 1.4em !important;
  font: 500 11px/1.6 "IBM Plex Mono", monospace !important;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  max-width: 30em !important;
}
.beat[data-ax="1"] {
  text-align: right;
}
.beat[data-ax="1"] p {
  margin-left: auto;
}
.beat[data-ax="0.5"] {
  text-align: center;
}
.beat[data-ax="0.5"] p {
  margin-left: auto;
  margin-right: auto;
}
.beat-cue {
  display: inline-flex !important;
  align-items: center;
  gap: 0.6em;
  font: 500 11px/1 "IBM Plex Mono", monospace !important;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.85;
}
.beat-cue::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cc-blue);
  box-shadow: 0 0 0 0 rgba(24, 203, 254, 0.6);
  animation: cue-pulse 2.2s infinite;
}
@keyframes cue-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(24, 203, 254, 0.55);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(24, 203, 254, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(24, 203, 254, 0);
  }
}

/* Words arrive with the camera, a little like a game title card. */
.beat .w {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, 0.38em, 0);
  transition:
    opacity 0.5s var(--ease-out),
    transform 0.9s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 38ms);
}
.beat.is-on .w {
  opacity: 1;
  transform: none;
}
.beat:not(.is-on) .w {
  transition-delay: 0ms;
  transition-duration: 0.25s;
}

/* ---------- Launch control: an in-world interaction prompt ---------- */
.launch-studio {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px 10px 10px;
  border: 0;
  border-radius: 999px;
  background: var(--cc-blue);
  color: var(--cc-navy);
  font: 600 15px/1 Montserrat, Arial, sans-serif;
  letter-spacing: -0.01em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  box-shadow:
    0 10px 30px rgba(3, 20, 38, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.35) inset;
  transition:
    background-color 0.25s,
    box-shadow 0.25s;
  will-change: transform, opacity;
}
.launch-studio.ready {
  pointer-events: auto;
}
.launch-studio::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  border: 1.5px solid rgba(24, 203, 254, 0.7);
  animation: launch-ring 2.4s var(--ease-out) infinite;
  pointer-events: none;
}
@keyframes launch-ring {
  0% {
    transform: scale(0.94);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.28, 1.5);
    opacity: 0;
  }
}
.launch-key {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--cc-navy);
  color: #fff;
  font: 500 14px/1 "IBM Plex Mono", monospace;
}
.launch-arrow {
  font-weight: 500;
  transition: transform 0.3s var(--ease-out);
}
.launch-studio:hover,
.launch-studio.rocket-hover {
  background: #fff;
  box-shadow:
    0 14px 40px rgba(3, 20, 38, 0.5),
    0 0 40px rgba(24, 203, 254, 0.55);
}
.launch-studio:hover .launch-arrow,
.launch-studio.rocket-hover .launch-arrow {
  transform: translate(3px, -3px);
}
.launch-studio:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 5px;
}
.launch-studio.launching {
  pointer-events: none;
}
.launch-studio.launching::before {
  animation: none;
  opacity: 0;
}

/* ---------- Light-touch journey UI ---------- */
.journey-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
.journey-rail {
  position: absolute;
  right: max(22px, env(safe-area-inset-right));
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.8s;
}
html.entered .journey-rail {
  opacity: 1;
}
.journey-rail button {
  position: relative;
  display: grid;
  place-items: center;
  width: 22px;
  height: 16px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.journey-rail button::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 6px rgba(3, 24, 42, 0.5);
  transition:
    height 0.5s var(--ease-out),
    background-color 0.4s;
}
.journey-rail button.near::before {
  background: rgba(255, 255, 255, 0.8);
}
.journey-rail button.active::before {
  height: 16px;
  background: #fff;
}
.journey-rail button.gap {
  margin-top: 14px;
}
.journey-rail button:hover::before {
  background: var(--cc-blue);
}
.journey-rail button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  border-radius: 6px;
}
.journey-rail button span {
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translate(6px, -50%);
  white-space: nowrap;
  font: 500 10px/1 "IBM Plex Mono", monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 1px 6px rgba(3, 24, 42, 0.7);
  transition:
    opacity 0.25s,
    transform 0.35s var(--ease-out);
}
.journey-rail button:hover span,
.journey-rail button:focus-visible span {
  opacity: 1;
  transform: translate(0, -50%);
}

.journey-hint {
  position: absolute;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 8px 10px;
  border-radius: 999px;
  background: rgba(4, 26, 44, 0.32);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font: 500 10px/1 "IBM Plex Mono", monospace;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 1px 8px rgba(3, 24, 42, 0.65);
  opacity: 0;
  transition: opacity 0.8s;
}
.journey-hint.show {
  opacity: 0.92;
}
.hint-mouse {
  position: relative;
  width: 18px;
  height: 27px;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(3, 24, 42, 0.35);
}
.hint-mouse i {
  position: absolute;
  left: 50%;
  top: 5px;
  width: 2px;
  height: 6px;
  margin-left: -1px;
  border-radius: 2px;
  background: #fff;
  animation: hint-wheel 1.8s var(--ease-io) infinite;
}
@keyframes hint-wheel {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  70% {
    transform: translateY(8px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 0;
  }
}
html.touch .hint-mouse {
  width: 26px;
  border: 0;
  box-shadow: none;
}
html.touch .hint-mouse::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  animation: hint-swipe 1.8s var(--ease-io) infinite;
}
html.touch .hint-mouse i {
  display: none;
}
@keyframes hint-swipe {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    transform: translateY(-12px);
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

/* ---------- Header while travelling ---------- */
html.in-journey header {
  text-shadow: 0 1px 10px rgba(3, 24, 42, 0.45);
  transition:
    opacity 0.6s,
    transform 0.6s var(--ease-out);
}
html.in-journey header .logo img {
  filter: drop-shadow(0 1px 8px rgba(3, 24, 42, 0.4));
}
html.in-journey header .talk {
  background: rgba(8, 46, 74, 0.28);
  border-color: rgba(255, 255, 255, 0.72);
  color: #fff;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background-color 0.25s, color 0.25s;
}
html.in-journey header .talk:hover {
  background: #fff;
  color: var(--cc-navy);
  text-shadow: none;
}
html.entry-locked header {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}
html.launching header,
html.launching .journey-ui {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}

/* ---------- Title screen ---------- */
.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  color: #fff;
  text-align: center;
  background:
    radial-gradient(120% 90% at 50% 40%, rgba(8, 46, 74, 0.18), rgba(4, 26, 44, 0.62) 70%),
    linear-gradient(180deg, rgba(8, 46, 74, 0.25), rgba(4, 26, 44, 0.5));
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  backdrop-filter: blur(16px) saturate(1.1);
  transition:
    opacity 1.1s var(--ease-io),
    visibility 1.1s,
    -webkit-backdrop-filter 1.1s,
    backdrop-filter 1.1s;
}
.intro.hidden {
  opacity: 0;
  visibility: hidden;
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  pointer-events: none;
}
.intro-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
}
.intro-logo {
  width: clamp(150px, 15vw, 200px);
  height: auto;
  filter: drop-shadow(0 4px 24px rgba(3, 24, 42, 0.35));
}
.intro-line {
  margin: 26px 0 38px;
  font: 500 11px/1.8 "IBM Plex Mono", monospace;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.92;
}
.intro-enter {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 16px 16px 16px 28px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font: 600 15px/1 Montserrat, Arial, sans-serif;
  letter-spacing: -0.005em;
  transition:
    background-color 0.3s,
    color 0.3s,
    border-color 0.3s,
    transform 0.4s var(--ease-out);
}
.intro-enter kbd {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cc-blue);
  color: var(--cc-navy);
  font: 500 13px/1 "IBM Plex Mono", monospace;
}
.intro-enter-ring {
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1px solid rgba(24, 203, 254, 0.8);
  animation: launch-ring 2.6s var(--ease-out) infinite;
  pointer-events: none;
}
.intro-enter:hover {
  background: #fff;
  color: var(--cc-navy);
  border-color: #fff;
  transform: translateY(-2px);
}
.intro-enter:focus-visible,
.intro-skip:focus-visible {
  outline: 3px solid var(--cc-blue);
  outline-offset: 4px;
}
.intro-enter.loading {
  cursor: progress;
}
.intro-enter.loading .intro-enter-ring {
  animation: none;
  opacity: 0;
}
.intro-load {
  width: 140px;
  height: 2px;
  margin-top: 22px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
  transition: opacity 0.6s;
}
.intro-load i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--cc-blue);
  transition: width 0.3s;
}
.intro-load.done {
  opacity: 0;
}
.intro-skip {
  margin-top: 18px;
  padding: 8px 4px;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.86);
  font: 500 13px/1 Montserrat, Arial, sans-serif;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.4);
  text-underline-offset: 5px;
}
.intro-skip:hover {
  color: #fff;
  text-decoration-color: var(--cc-blue);
}
.intro-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(24px, env(safe-area-inset-bottom));
  margin: 0;
  padding: 0 24px;
  font: 500 10px/1.6 "IBM Plex Mono", monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
}

/* ---------- Fallback when WebGL is unavailable ---------- */
html.no-webgl .beat {
  transition: opacity 0.6s;
}
.fallback-rocket {
  position: absolute;
  left: 56%;
  bottom: 18%;
  height: 42%;
  opacity: 0;
  transition: opacity 0.6s;
  filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.45)) saturate(0.9);
}
@media (max-width: 760px) {
  .fallback-rocket {
    left: 50%;
    transform: translateX(-50%);
    bottom: 24%;
    height: 34%;
  }
}

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
  .beat,
  .beat-hero {
    width: calc(100vw - 48px);
  }
  .beat h1 {
    font-size: clamp(34px, 9.6vw, 44px);
  }
  .beat h2 {
    font-size: clamp(28px, 8.2vw, 36px);
  }
  .beat p {
    font-size: 15px;
  }
  .beat-eyebrow {
    font-size: 11px !important;
    margin-bottom: 1.1em !important;
  }
  .beat[data-ax="1"],
  .beat[data-ax="0.5"] {
    text-align: left;
  }
  .beat[data-ax="1"] p,
  .beat[data-ax="0.5"] p {
    margin-left: 0;
  }
  .journey-rail {
    right: 6px;
  }
  .journey-rail button {
    width: 16px;
    height: 13px;
  }
  .journey-rail button.gap {
    margin-top: 10px;
  }
  .journey-rail button span {
    display: none;
  }
  .launch-studio {
    font-size: 15px;
    padding: 9px 18px 9px 9px;
  }
  .intro-line {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .beat .w {
    transition: opacity 0.3s;
    transform: none;
  }
  .launch-studio::before,
  .intro-enter-ring,
  .beat-cue::before,
  .hint-mouse i,
  html.touch .hint-mouse::before {
    animation: none;
  }
  .intro,
  .veil {
    transition-duration: 0.3s;
  }
}
