:root {
  color-scheme: dark;
  font-family: "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  background: #030405;
  color: #f2f3f5;
  --safe-top: max(20px, env(safe-area-inset-top));
  --safe-right: max(24px, env(safe-area-inset-right));
  --safe-bottom: max(24px, env(safe-area-inset-bottom));
  --safe-left: max(24px, env(safe-area-inset-left));
  --p2m-duration: 1500ms;
  --p2m-ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
  --p2m-ease-settle: cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #030405;
}

body {
  position: fixed;
  inset: 0;
  touch-action: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.experience,
#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.experience {
  overflow: hidden;
  background: #030405;
}

#stage {
  display: block;
  opacity: 0;
  outline: 0;
  transition: opacity 520ms ease;
}

#stage.is-ready {
  opacity: 1;
}

.system-message {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(34rem, calc(100% - 48px));
  margin: 0;
  transform: translate(-50%, -50%);
  color: #d8dbdf;
  font-size: 15px;
  line-height: 1.6;
  text-align: center;
}

.site-header {
  position: fixed;
  z-index: 20;
  top: var(--safe-top);
  right: var(--safe-right);
  left: var(--safe-left);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
}

.logo-button,
.icon-button {
  border: 0;
  border-radius: 4px;
  color: #f2f3f5;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
}

.logo-button {
  display: block;
  width: 150px;
  aspect-ratio: 760 / 220;
  margin: 0;
  padding: 0;
}

.magiccore-logo {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.magiccore-logo #module-top,
.magiccore-logo #module-left,
.magiccore-logo #module-bottom {
  stroke: #f2f3f5;
}

.magiccore-logo #module-right {
  stroke: #12b8a6;
}

.magiccore-logo #core {
  fill: #ff2d6f;
}

.magiccore-logo #wordmark {
  fill: #f2f3f5;
}

.magiccore-logo #module-top,
.magiccore-logo #module-left,
.magiccore-logo #module-bottom,
.magiccore-logo #module-right,
.magiccore-logo #core,
.magiccore-logo #wordmark-magic,
.magiccore-logo #wordmark-core {
  transform-box: fill-box;
  transform-origin: center;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  padding: 0;
}

.icon-button svg {
  width: 22px;
  height: 22px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logo-button:hover,
.icon-button:hover {
  color: #ffffff;
  background: rgba(242, 243, 245, 0.08);
}

.logo-button:focus-visible,
.icon-button:focus-visible,
.navigation-links a:focus-visible {
  outline: 2px solid #12b8a6;
  outline-offset: 4px;
}

.navigation-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  min-width: 320px;
  min-height: 100%;
  place-items: center;
  padding: calc(var(--safe-top) + 64px) var(--safe-right) calc(var(--safe-bottom) + 32px) var(--safe-left);
  overflow: auto;
  overscroll-behavior: contain;
  background: rgba(3, 4, 5, 0.97);
  touch-action: pan-y;
}

.navigation-close {
  position: fixed;
  z-index: 1;
  top: var(--safe-top);
  right: var(--safe-right);
}

.navigation-content {
  width: min(640px, 100%);
}

.navigation-links {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.navigation-links a {
  position: relative;
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  color: #f2f3f5;
  font-size: 36px;
  font-weight: 430;
  line-height: 1.2;
  letter-spacing: 0;
  text-decoration: none;
  border-bottom: 1px solid rgba(242, 243, 245, 0.16);
}

.navigation-links a::after {
  width: 9px;
  height: 9px;
  margin-left: 24px;
  content: "";
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 180ms ease;
}

.navigation-links a:hover {
  color: #ff2d6f;
}

.navigation-links a:hover::after,
.navigation-links a:focus-visible::after {
  transform: translateX(4px) rotate(45deg);
}

body.menu-open {
  overflow: hidden;
}

@media (max-width: 600px) {
  :root {
    --safe-top: max(16px, env(safe-area-inset-top));
    --safe-right: max(16px, env(safe-area-inset-right));
    --safe-bottom: max(20px, env(safe-area-inset-bottom));
    --safe-left: max(16px, env(safe-area-inset-left));
  }

  .logo-button {
    width: 136px;
  }

  .navigation-links a {
    min-height: 58px;
    font-size: 29px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .magiccore-logo.is-animating #core {
    animation: p2m-core var(--p2m-duration) cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .magiccore-logo.is-animating #module-top {
    animation: p2m-module-top var(--p2m-duration) cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .magiccore-logo.is-animating #module-left {
    animation: p2m-module-left var(--p2m-duration) cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .magiccore-logo.is-animating #module-bottom {
    animation: p2m-module-bottom var(--p2m-duration) cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .magiccore-logo.is-animating #module-right {
    animation: p2m-module-right var(--p2m-duration) cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .magiccore-logo.is-animating #wordmark-magic {
    animation: p2m-wordmark-magic var(--p2m-duration) cubic-bezier(0.16, 1, 0.3, 1) both;
  }

  .magiccore-logo.is-animating #wordmark-core {
    animation: p2m-wordmark-core var(--p2m-duration) cubic-bezier(0.16, 1, 0.3, 1) both;
  }
}

@media (prefers-reduced-motion: reduce) {
  #stage {
    transition: none;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .logo-button,
  .icon-button,
  .navigation-links a {
    forced-color-adjust: none;
  }
}

@keyframes p2m-core {
  0%, 8% {
    opacity: 0;
    transform: scale(0.72) rotate(-18deg);
  }
  8% {
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  }
  25% {
    opacity: 1;
    transform: scale(1.04) rotate(0deg);
  }
  36%, 72% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
  72% {
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  }
  82% {
    transform: scale(1.035);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes p2m-module-top {
  0%, 18% {
    opacity: 0;
    transform: translateY(28px) scale(0.72);
  }
  18% {
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  }
  48% {
    opacity: 1;
    transform: translateY(-1px) scale(1.015);
  }
  58%, 100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes p2m-module-left {
  0%, 24% {
    opacity: 0;
    transform: translateX(28px) scale(0.72);
  }
  24% {
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  }
  54% {
    opacity: 1;
    transform: translateX(-1px) scale(1.015);
  }
  64%, 100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes p2m-module-bottom {
  0%, 30% {
    opacity: 0;
    transform: translateY(-28px) scale(0.72);
  }
  30% {
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  }
  60% {
    opacity: 1;
    transform: translateY(1px) scale(1.015);
  }
  70%, 100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes p2m-module-right {
  0%, 36% {
    opacity: 0;
    transform: translateX(-28px) scale(0.72);
  }
  36% {
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  }
  66% {
    opacity: 1;
    transform: translateX(1px) scale(1.015);
  }
  76%, 100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes p2m-wordmark-magic {
  0%, 48% {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
    transform: translateX(-8px);
  }
  48% {
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  }
  80%, 100% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transform: translateX(0);
  }
}

@keyframes p2m-wordmark-core {
  0%, 58% {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
    transform: translateX(-6px);
  }
  58% {
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
  }
  90%, 100% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transform: translateX(0);
  }
}
