:root {
  --launch-edge: clamp(20px, 4vw, 48px);
  --launch-dock-left: clamp(26px, 7vw, 112px);
  --launch-dock-size: clamp(220px, 40vw, 480px);
  --launch-gradient-top: #ffffff;
  --launch-gradient-bottom: #050505;
  --launch-top-ink: #111111;
  --launch-bottom-ink: #ffffff;
  --launch-border: rgba(255, 255, 255, 0.24);
  --launch-liquid-fallback: #e6e8ee;
  --launch-title-face: #f2f2f2;
  --launch-title-highlight: rgba(255, 255, 255, 0.92);
  --launch-title-depth: rgba(18, 18, 18, 0.42);
  --launch-glass-surface: rgba(244, 244, 244, 0.56);
  --launch-glass-edge: rgba(255, 255, 255, 0.72);
  --launch-glass-ink: #161616;
  }

@media (prefers-color-scheme: dark) {
  :root {
    --launch-gradient-top: #050505;
    --launch-gradient-bottom: #f7f7f7;
    --launch-top-ink: #ffffff;
    --launch-bottom-ink: #111111;
    --launch-border: rgba(0, 0, 0, 0.18);
    --launch-liquid-fallback: #0b0e16;
    --launch-title-face: #e7e7e7;
    --launch-title-highlight: rgba(255, 255, 255, 0.3);
    --launch-title-depth: rgba(0, 0, 0, 0.72);
    --launch-glass-surface: rgba(28, 28, 28, 0.56);
    --launch-glass-edge: rgba(255, 255, 255, 0.22);
    --launch-glass-ink: #f4f4f4;
  }
}

.site-interface {
  opacity: 1;
  visibility: visible;
  transition: opacity 640ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.launch-active .site-interface {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.launch-revealing .site-interface {
  opacity: 1;
  visibility: visible;
}

.launch-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
  isolation: isolate;
  opacity: 1;
  color: var(--launch-top-ink);
  transition: opacity 640ms cubic-bezier(0.4, 0, 0.2, 1);
}

.launch-screen[hidden] {
  display: none;
}

body.launch-revealing .launch-screen {
  opacity: 0;
  pointer-events: none;
}

.launch-backdrop,
.launch-liquid {
  position: absolute;
  pointer-events: none;
}

.launch-backdrop {
  inset: 0;
  z-index: -2;
  background: var(--launch-liquid-fallback);
}

.launch-liquid {
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.launch-brand,
.launch-dock-target,
.launch-emblem,
.launch-hint {
  z-index: 1;
}

.launch-brand {
  position: fixed;
  top: calc(50% - clamp(220px, 24vw, 300px));
  left: var(--launch-dock-left);
  margin: 0;
  color: var(--launch-title-face);
  font-family: inherit;
  font-size: clamp(42px, 8vw, 120px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.025em;
  text-shadow:
    0 1px 0 var(--launch-title-highlight),
    0 2px 1px color-mix(in srgb, var(--launch-title-depth) 42%, transparent),
    0 12px 28px var(--launch-title-depth);
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  transition:
    opacity 520ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.launch-dock-target {
  position: fixed;
  top: 50%;
  left: var(--launch-dock-left);
  width: var(--launch-dock-size);
  aspect-ratio: 1;
  transform: translateY(-32%);
  visibility: hidden;
  pointer-events: none;
}

.launch-emblem {
  --dock-x: 0px;
  --dock-y: 0px;
  --dock-scale: 0.25;
  position: fixed;
  top: 50%;
  left: 50%;
  width: clamp(260px, 42vmin, 470px);
  aspect-ratio: 1;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center;
  cursor: default;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.launch-emblem:focus-visible {
  outline: 2px solid var(--launch-bottom-ink);
  outline-offset: 8px;
  border-radius: 22%;
}

.launch-screen[data-state='ready'] .launch-emblem {
  cursor: pointer;
}

.launch-icon-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.launch-icon-frame {
  display: block;
  transform: translateZ(0);
}

.launch-piece {
  position: absolute;
  display: block;
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  transform-origin: center;
  transition: opacity 160ms linear;
  will-change: transform, opacity;
}

.launch-piece img {
  display: block;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.launch-piece img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.launch-piece--browser {
  z-index: 1;
  top: -9%;
  left: 0;
  width: 98%;
  height: 86%;
}

.launch-piece--bubble {
  z-index: 2;
  top: 24%;
  left: 21%;
  width: 70%;
  height: 70%;
}

.launch-piece--puzzle {
  z-index: 3;
  top: 51%;
  left: 56%;
  width: 42%;
  height: 39%;
}

.launch-piece--cursor {
  --cursor-center-x: 82%;
  --cursor-center-y: -51%;
  z-index: 4;
  top: 50%;
  left: 10%;
  width: 30.5%;
  height: 33%;
  opacity: 0;
}

.launch-piece--browser img,
.launch-piece--bubble img,
.launch-piece--puzzle img,
.launch-piece--cursor img {
  object-fit: fill;
}

.launch-screen[data-state='preparing'] .launch-piece--browser {
  opacity: 0;
  transform: translate3d(-78vw, -64vh, 0) scale(0.18);
}

.launch-screen[data-state='preparing'] .launch-piece--bubble {
  opacity: 0;
  transform: translate3d(60vw, 70vh, 0) scale(0.16);
}

.launch-screen[data-state='preparing'] .launch-piece--puzzle {
  opacity: 0;
  transform: translate3d(78vw, -4vh, 0) scale(0.2);
}

.launch-screen[data-state='assembling'] .launch-piece--browser {
  animation: launch-browser-in 1000ms cubic-bezier(0.45, 0, 0.2, 1) both;
}

.launch-screen[data-state='assembling'] .launch-piece--bubble {
  animation: launch-bubble-in 1000ms cubic-bezier(0.45, 0, 0.2, 1) both;
}

.launch-screen[data-state='assembling'] .launch-piece--puzzle {
  animation: launch-puzzle-in 1000ms cubic-bezier(0.45, 0, 0.2, 1) both;
}

.launch-screen[data-state='pointer-arriving'] .launch-piece--cursor {
  animation: launch-cursor-in 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.launch-screen[data-state='ready'] .launch-piece--cursor {
  opacity: 1;
  transform: translate3d(var(--cursor-center-x), var(--cursor-center-y), 0) scale(1);
}

.launch-screen[data-state='cursor-returning'] .launch-piece--cursor {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  transition: transform 380ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.launch-screen[data-state='burst'] .launch-piece--cursor,
.launch-screen[data-state='docking'] .launch-piece--cursor,
.launch-screen[data-state='docked'] .launch-piece--cursor,
.launch-screen[data-state='exiting'] .launch-piece--cursor {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  transition: none;
}

.launch-screen[data-state='burst'] .launch-emblem {
  transform: translate(-50%, -50%) scale(1.64);
  transition-duration: 300ms;
  transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

.launch-screen[data-state='docking'] .launch-emblem,
.launch-screen[data-state='docked'] .launch-emblem,
.launch-screen[data-state='exiting'] .launch-emblem {
  transform:
    translate(-50%, -50%)
    translate3d(var(--dock-x), var(--dock-y), 0)
    scale(var(--dock-scale));
}

.launch-screen[data-state='docking'] .launch-emblem {
  transition-duration: 720ms;
  transition-timing-function: cubic-bezier(0.55, 0.04, 0.86, 0.36);
}

.launch-screen[data-state='docked'] .launch-emblem,
.launch-screen[data-state='exiting'] .launch-emblem {
  transition-duration: 280ms;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.launch-hint {
  position: fixed;
  left: 50%;
  top: calc(50% + clamp(146px, 24vmin, 250px));
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-family: inherit;
  font-size: 13px;
  font-weight: 550;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translate3d(-50%, 8px, 0);
  transition:
    opacity 380ms ease,
    transform 380ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  white-space: nowrap;
}

.launch-screen[data-state='ready'] .launch-hint {
  opacity: 0.86;
  transform: translate3d(-50%, 0, 0);
}

.launch-screen[data-state='docked'] .launch-hint,
.launch-screen[data-state='exiting'] .launch-hint {
  left: 69%;
  top: calc(50% + clamp(132px, 23vw, 276px));
  color: rgba(255, 255, 255, 0.76);
  font-size: clamp(12px, 1.15vw, 15px);
  letter-spacing: 0.13em;
  opacity: 0.74;
  transform: translate3d(-50%, 0, 0);
}

.launch-screen[data-state='docked'] .launch-brand,
.launch-screen[data-state='exiting'] .launch-brand {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.launch-screen[data-state='docked'] .launch-emblem {
  animation: launch-docked-emblem-float 5.8s ease-in-out infinite;
}

.launch-screen[data-state='docked'] .launch-brand {
  animation: launch-docked-brand-float 6.6s ease-in-out 360ms infinite;
}

@keyframes launch-docked-emblem-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -6px; }
}

@keyframes launch-docked-brand-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -4px; }
}

@keyframes launch-browser-in {
  from { opacity: 0; transform: translate3d(-78vw, -64vh, 0) scale(0.18); }
  55% { opacity: 1; transform: translate3d(-28vw, -14vh, 0) scale(0.62); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes launch-bubble-in {
  from { opacity: 0; transform: translate3d(60vw, 70vh, 0) scale(0.16); }
  55% { opacity: 1; transform: translate3d(25vw, 15vh, 0) scale(0.64); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes launch-puzzle-in {
  from { opacity: 0; transform: translate3d(78vw, -4vh, 0) scale(0.2); }
  55% { opacity: 1; transform: translate3d(26vw, -22vh, 0) scale(0.66); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes launch-cursor-in {
  from {
    opacity: 0;
    transform: translate3d(-14%, 34%, 0) scale(0.72);
  }
  to {
    opacity: 1;
    transform: translate3d(var(--cursor-center-x), var(--cursor-center-y), 0) scale(1);
  }
}

@media (max-width: 600px) {
  :root {
    --launch-edge: 20px;
    --launch-dock-left: 7vw;
    --launch-dock-size: clamp(162px, 53vw, 260px);
  }

  .launch-brand {
    top: 22%;
    font-size: clamp(34px, 10vw, 52px);
  }

  .launch-emblem {
    width: clamp(248px, 74vw, 320px);
  }

  .launch-hint {
    top: calc(50% + 154px);
  }

  .launch-screen[data-state='docked'] .launch-hint,
  .launch-screen[data-state='exiting'] .launch-hint {
    left: 69%;
    top: calc(50% + 148px);
    font-size: 11px;
  }
}

@media (max-height: 560px) {
  :root {
    --launch-edge: 16px;
    --launch-dock-size: clamp(160px, 38vw, 260px);
  }

  .launch-emblem {
    width: min(58vh, 300px);
  }

  .launch-hint {
    top: calc(50% + min(32vh, 158px));
  }

}


@media (prefers-reduced-motion: reduce) {
  .launch-screen,
  .site-interface,
  .launch-emblem,
  .launch-piece,
  .launch-brand,
  .launch-hint {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }
}
