.tm-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  min-width: 100vw;
  min-height: 100vh;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  color: #eef7ff;
  background:
    radial-gradient(circle at 50% 48%, rgba(35, 115, 255, 0.24), transparent 32%),
    linear-gradient(145deg, #020713 0%, #071525 54%, #020713 100%);
  overflow: hidden;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 520ms ease, visibility 520ms ease;
}

html.tm-splash-lock,
html.tm-splash-lock body {
  overflow: hidden;
}

body.tm-page-reveal-pending > :not(.tm-splash) {
  opacity: 0 !important;
  transform: translateY(10px) scale(0.992);
  pointer-events: none !important;
}

body.tm-page-revealing > :not(.tm-splash) {
  animation: tmPageReveal 720ms cubic-bezier(.16,.72,.18,1) both;
  will-change: opacity, transform;
}

.tm-splash.is-leaving {
  opacity: 0;
  visibility: hidden;
}

.tm-splash::before,
.tm-splash::after {
  content: "";
  position: absolute;
  inset: -16%;
  pointer-events: none;
}

.tm-splash::before {
  background:
    linear-gradient(rgba(125, 231, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 231, 255, 0.035) 1px, transparent 1px);
  background-size: clamp(48px, 7vw, 96px) clamp(48px, 7vw, 96px);
  mask-image: radial-gradient(circle at center, #000 0 38%, transparent 72%);
  animation: tmSplashGrid 2200ms cubic-bezier(.2,.72,.16,1) both;
}

.tm-splash::after {
  background: linear-gradient(118deg, transparent 0 34%, rgba(125, 231, 255, 0.14) 48%, transparent 62% 100%);
  filter: blur(18px);
  opacity: 0.48;
  animation: tmSplashSweep 2400ms cubic-bezier(.16,.76,.2,1) both;
}

.tm-splash-stage {
  position: relative;
  z-index: 1;
  width: min(960px, calc(100vw - 32px));
  height: min(620px, calc(100svh - 32px));
  min-height: 360px;
  display: grid;
  place-items: center;
  transform: translateZ(0);
}

.tm-splash-orbit {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(58vw, 520px);
  aspect-ratio: 1;
  border: 1px solid rgba(125, 231, 255, 0.16);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.035) inset,
    0 0 70px rgba(27, 125, 255, 0.15);
  animation: tmSplashOrbitIn 1500ms cubic-bezier(.12,.76,.14,1) both;
}

.tm-splash-trace {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(68vw, 640px);
  max-width: calc(100vw - 34px);
  height: auto;
  overflow: visible;
  transform: translate(-50%, -50%);
  opacity: 0.92;
}

.tm-splash-trace path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tm-splash-trace-glow {
  stroke: rgba(125, 231, 255, 0.18);
  stroke-width: 20;
  filter: blur(10px);
  opacity: 0;
  animation: tmTraceGlow 1800ms ease 420ms forwards;
}

.tm-splash-trace-line {
  stroke: url("#tmTraceGradient");
  stroke-width: 4;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: tmTraceDraw 1600ms cubic-bezier(.16,.78,.18,1) 360ms forwards;
}

.tm-splash-trace-dot {
  fill: #7de7ff;
  filter: drop-shadow(0 0 18px rgba(125, 231, 255, 0.86));
  opacity: 0;
  animation: tmTraceDot 720ms ease 1600ms forwards;
}

.tm-splash-token {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: clamp(42px, 6.2vw, 64px);
  height: clamp(42px, 6.2vw, 64px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  color: #07111f;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(125, 231, 255, 0.88));
  box-shadow:
    0 18px 52px rgba(0, 0, 0, 0.28),
    0 0 28px rgba(125, 231, 255, 0.18);
  font-size: clamp(12px, 1.75vw, 17px);
  font-weight: 950;
  letter-spacing: 0;
  opacity: 0;
  transform: translate(-50%, -50%) rotate(var(--angle)) translateX(var(--radius)) rotate(calc(var(--angle) * -1)) scale(0.34);
  animation: tmSplashToken 2300ms cubic-bezier(.12,.78,.18,1) both;
}

.tm-splash-token:nth-of-type(1) { --angle: -154deg; --radius: min(25vw, 218px); animation-delay: 180ms; }
.tm-splash-token:nth-of-type(2) { --angle: -26deg; --radius: min(24vw, 206px); animation-delay: 300ms; }
.tm-splash-token:nth-of-type(3) { --angle: 126deg; --radius: min(23vw, 196px); animation-delay: 420ms; }

.tm-splash-brand {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: clamp(12px, 2.2vw, 20px);
  width: min(780px, 92vw);
  text-align: center;
  transform: translateY(22px);
  animation: tmSplashBrand 1600ms cubic-bezier(.1,.74,.14,1) 980ms both;
}

.tm-splash-logo {
  display: grid;
  place-items: center;
  width: clamp(78px, 13vw, 126px);
  height: clamp(78px, 13vw, 126px);
  border: 0;
  border-radius: clamp(18px, 3vw, 30px);
  color: #07111f;
  background: transparent;
  box-shadow:
    0 24px 86px rgba(0, 0, 0, 0.4),
    0 0 52px rgba(125, 231, 255, 0.24);
  font-size: clamp(26px, 4.5vw, 46px);
  font-weight: 950;
  overflow: hidden;
}

.tm-splash-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tm-splash-title {
  margin: 0;
  padding: 0.08em 0 0.18em;
  max-width: 100%;
  color: #f7fbff;
  font-size: clamp(34px, 7vw, 78px);
  line-height: 1.08;
  font-weight: 950;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  text-shadow: 0 20px 70px rgba(125, 231, 255, 0.22);
}

.tm-splash-subtitle {
  max-width: min(440px, 88vw);
  color: rgba(224, 237, 255, 0.76);
  font-size: clamp(12px, 2.4vw, 16px);
  font-weight: 850;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
}

.tm-splash-progress {
  position: relative;
  width: min(380px, 72vw);
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  overflow: hidden;
}

.tm-splash-progress::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #00d8aa, #7de7ff 48%, #f5b73e);
  transform: translateX(-100%);
  animation: tmSplashProgress 1500ms cubic-bezier(.16,.72,.2,1) 1180ms forwards;
}

.tm-splash-scan {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(125, 231, 255, 0.09), transparent);
  transform: translateY(-100%);
  animation: tmSplashScan 2100ms ease-in-out 520ms both;
  mix-blend-mode: screen;
}

@keyframes tmSplashGrid {
  0% { opacity: 0; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes tmSplashSweep {
  0% { opacity: 0; transform: translateX(-18%) rotate(3deg); }
  100% { opacity: 0.48; transform: translateX(18%) rotate(3deg); }
}

@keyframes tmSplashOrbitIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.64); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes tmSplashToken {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateX(calc(var(--radius) * 1.1)) rotate(calc(var(--angle) * -1)) scale(0.32);
  }
  34% {
    opacity: 0.96;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateX(var(--radius)) rotate(calc(var(--angle) * -1)) scale(1);
  }
  76% {
    opacity: 0.88;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateX(calc(var(--radius) * 0.82)) rotate(calc(var(--angle) * -1)) scale(0.9);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--angle)) translateX(0) rotate(calc(var(--angle) * -1)) scale(0.42);
  }
}

@keyframes tmTraceDraw {
  0% { stroke-dashoffset: 900; opacity: 0; }
  12% { opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 1; }
}

@keyframes tmTraceGlow {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes tmTraceDot {
  0% { opacity: 0; transform: scale(0.4); transform-origin: center; }
  100% { opacity: 1; transform: scale(1); transform-origin: center; }
}

@keyframes tmSplashBrand {
  0% { opacity: 0; transform: translateY(22px) scale(0.94); filter: blur(10px); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes tmSplashProgress {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(0); }
}

@keyframes tmSplashScan {
  0% { transform: translateY(-100%); opacity: 0; }
  18% { opacity: 1; }
  100% { transform: translateY(100%); opacity: 0; }
}

@keyframes tmPageReveal {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.992);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 700px) {
  .tm-splash {
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }

  .tm-splash-stage {
    width: calc(100vw - 24px);
    height: calc(100svh - 24px);
    min-height: 320px;
  }

  .tm-splash-orbit {
    width: min(78vw, 400px);
  }

  .tm-splash-trace {
    width: min(88vw, 430px);
  }

  .tm-splash-token:nth-of-type(1) { --radius: min(34vw, 156px); }
  .tm-splash-token:nth-of-type(2) { --radius: min(32vw, 148px); }
  .tm-splash-token:nth-of-type(3) { --radius: min(31vw, 140px); }
}

@media (max-width: 390px), (max-height: 560px) {
  .tm-splash-brand {
    gap: 10px;
  }

  .tm-splash-title {
    font-size: clamp(25px, 10.5vw, 40px);
  }

  .tm-splash-subtitle {
    max-width: 82vw;
    font-size: 11px;
  }

  .tm-splash-token {
    width: 38px;
    height: 38px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tm-splash,
  .tm-splash *,
  .tm-splash::before,
  .tm-splash::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
  }
}
