.intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(120% 90% at 50% 42%, #0B2246 0%, #061531 46%, #030A18 100%);
  opacity: 1;
  transition: opacity .8s var(--ease), visibility .8s;
}

html.is-loading .intro {
  visibility: visible;
}

.intro[hidden] {
  display: none;
}

.intro.is-finishing {
  opacity: 0;
  visibility: hidden;
}

.intro__grid {
  position: absolute;
  inset: -10%;
  opacity: .3;
  background-image:
    linear-gradient(rgba(120, 170, 255, .12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 170, 255, .12) 1px, transparent 1px);
  background-size: 70px 70px;
  transform: perspective(600px) rotateX(72deg) translateY(28%);
  transform-origin: 50% 100%;
  mask-image: radial-gradient(ellipse 60% 70% at 50% 78%, #000 0%, transparent 76%);
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 78%, #000 0%, transparent 76%);
}

.intro__aura {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(150vw, 1400px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(30, 92, 214, .5) 0%, rgba(16, 52, 122, .26) 38%, transparent 66%);
  opacity: .6;
  animation: introAura 5.6s var(--ease) both;
}

.intro__stage {
  position: relative;
  width: min(92vw, 620px);
  aspect-ratio: 1;
  perspective: 1150px;
  perspective-origin: 50% 50%;
}

.intro__world {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.intro__orbit {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  border: 1px solid rgba(122, 174, 255, .3);
  transform-style: preserve-3d;
  animation: introSpinIn 2.1s var(--ease-out) both, introOrbitSpin 16s linear 2.1s infinite;
}

.intro__orbit::after {
  content: "";
  position: absolute;
  inset: 16%;
  border-radius: 50%;
  border: 1px dashed rgba(122, 174, 255, .2);
}

.intro__block {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--bw, 52px);
  height: var(--bw, 52px);
  margin: calc(var(--bw, 52px) / -2) 0 0 calc(var(--bw, 52px) / -2);
  border-radius: 16px;
  background: linear-gradient(145deg, #6FA8FF 0%, #2A6BF0 42%, #10347F 100%);
  border: 1px solid rgba(190, 220, 255, .55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .75),
    inset 0 -10px 18px rgba(2, 12, 34, .55),
    0 14px 30px rgba(0, 0, 0, .45);
  transform-style: preserve-3d;
  backface-visibility: visible;
  animation: introBlockIn 1.5s var(--ease-out) both, introPulse 3.2s ease-in-out 2.1s infinite;
  animation-delay: calc(var(--i) * 55ms), 2.1s;
}

.intro__block::after {
  content: "";
  position: absolute;
  inset: 18% 18% auto auto;
  width: 26%;
  height: 26%;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  filter: blur(1px);
}

.intro__block--light {
  background: linear-gradient(145deg, #FFFFFF 0%, #D9E8FF 44%, #9DC2F7 100%);
  border-color: rgba(255, 255, 255, .9);
  box-shadow:
    inset 0 1px 0 #fff,
    inset 0 -10px 18px rgba(120, 160, 220, .35),
    0 14px 30px rgba(0, 0, 0, .4);
}

.intro__block--sm {
  --bw: 30px;
  border-radius: 10px;
  background: linear-gradient(145deg, #CFE2FF 0%, #4C86F0 46%, #12346F 100%);
}

.intro__trail {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--tw, 240px);
  height: 2px;
  margin-top: -1px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(90, 150, 255, 0), rgba(150, 200, 255, .85), rgba(90, 150, 255, 0));
  transform-origin: 0 50%;
  transform: rotate(var(--ta)) scaleX(0);
  opacity: .85;
  filter: blur(.4px);
  animation: introTrail 1.5s var(--ease-out) both;
  animation-delay: calc(var(--i) * 55ms);
}

.intro__flash {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46vmax;
  height: 46vmax;
  margin: -23vmax 0 0 -23vmax;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .96) 0%, rgba(168, 206, 255, .7) 16%, rgba(58, 122, 255, .34) 36%, transparent 64%);
  opacity: 0;
  transform: scale(.18);
  animation: introFlash 1.15s var(--ease-out) 2.05s both;
  pointer-events: none;
}

.intro__ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40vmax;
  height: 40vmax;
  margin: -20vmax 0 0 -20vmax;
  border-radius: 50%;
  border: 2px solid rgba(180, 214, 255, .75);
  opacity: 0;
  animation: introRing 1.25s var(--ease-out) 2.1s both;
  pointer-events: none;
}

.intro__reveal {
  position: absolute;
  left: 50%;
  top: 50%;
  /* Full-screen reveal: cover the whole viewport instead of the old 980px cap
     (extraction edit; everything else in this rule unchanged) */
  width: 100vw;
  height: 100vh;
  transform: translate(-50%, -50%);
  perspective: 1200px;
  opacity: 0;
  mix-blend-mode: screen;
  transform-style: preserve-3d;
  animation: introReveal 1.25s var(--ease-out) 2.25s both;
}

.intro__glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  transform: translate(-50%, -50%) scale(.45);
  opacity: 0;
  filter: blur(26px);
  animation: introGlow 1.5s var(--ease-out) 2.12s both;
}

.intro__mark {
  position: relative;
  display: block;
  /* Fill the reveal container edge-to-edge, covering the whole screen
     (extraction edit: was width:100%; height:auto) */
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translateZ(0);
}

.intro__particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.intro__particle {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 32%, #FFFFFF 0%, rgba(150, 195, 255, .9) 42%, rgba(70, 130, 255, 0) 72%);
  opacity: 0;
  animation: introParticle var(--dur) ease-in-out var(--delay) infinite;
}

.intro__floor {
  position: absolute;
  left: 50%;
  bottom: 6%;
  width: min(90vw, 1100px);
  height: 190px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(120, 175, 255, .3) 0%, transparent 70%);
  opacity: 0;
  animation: introFloor 2.4s var(--ease) .6s both;
}

@keyframes introBlockIn {
  0% {
    opacity: 0;
    transform: translate3d(var(--sx), var(--sy), var(--sz)) rotateX(240deg) rotateY(-180deg) scale(.28);
  }
  22% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translate3d(var(--fx), var(--fy), 0) rotateX(0deg) rotateY(0deg) rotateZ(var(--frz)) scale(1);
  }
}

@keyframes introTrail {
  0% {
    opacity: 0;
    transform: rotate(var(--ta)) scaleX(0);
  }
  30% {
    opacity: .9;
  }
  100% {
    opacity: 0;
    transform: rotate(var(--ta)) scaleX(1);
  }
}

@keyframes introSpinIn {
  from {
    opacity: 0;
    transform: rotateX(72deg) rotateZ(-140deg) scale(.6);
  }
  to {
    opacity: 1;
    transform: rotateX(0deg) rotateZ(0deg) scale(1);
  }
}

@keyframes introOrbitSpin {
  from {
    transform: rotateZ(0deg);
  }
  to {
    transform: rotateZ(360deg);
  }
}

@keyframes introPulse {
  0%, 100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.22);
  }
}

@keyframes introAura {
  0% {
    opacity: .25;
    transform: translate(-50%, -50%) scale(.7);
  }
  35% {
    opacity: .7;
  }
  55% {
    opacity: .95;
    transform: translate(-50%, -50%) scale(1.08);
  }
  100% {
    opacity: .45;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes introFlash {
  0% {
    opacity: 0;
    transform: scale(.18);
  }
  14% {
    opacity: 1;
    transform: scale(.55);
  }
  100% {
    opacity: 0;
    transform: scale(2.5);
  }
}

@keyframes introRing {
  0% {
    opacity: 0;
    transform: scale(.2);
  }
  18% {
    opacity: .9;
  }
  100% {
    opacity: 0;
    transform: scale(1.9);
  }
}

@keyframes introFloor {
  0% {
    opacity: 0;
  }
  40% {
    opacity: 1;
  }
  100% {
    opacity: .5;
  }
}

@keyframes introReveal {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) translateZ(-880px) scale(.32) rotateX(46deg);
    filter: blur(10px);
  }
  45% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) translateZ(0) scale(1) rotateX(0deg);
    filter: blur(0);
  }
}

@keyframes introGlow {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.4);
    filter: blur(30px);
  }
  45% {
    opacity: .85;
  }
  100% {
    opacity: .5;
    transform: translate(-50%, -50%) scale(1);
    filter: blur(12px);
  }
}

@keyframes introZoom {
  from {
    transform: translate(-50%, -50%) translateZ(0) scale(1);
    opacity: 1;
    filter: blur(0);
  }
  to {
    transform: translate(-50%, -50%) translateZ(620px) scale(2.55);
    opacity: 0;
    filter: blur(13px);
  }
}

@keyframes introParticle {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(.5);
  }
  18% {
    opacity: var(--o, .7);
  }
  82% {
    opacity: var(--o, .7);
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--dx), var(--dy), 0) scale(1.15);
  }
}

@media (max-width: 640px) {
  .intro__stage {
    width: min(96vw, 420px);
  }

  .intro__grid {
    background-size: 48px 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro {
    display: none;
  }
}