.fv-intro {
  position: fixed;
  z-index: var(--z-dialog);
  inset: 0;
  display: none;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 50%, rgba(57, 123, 255, 0.2), transparent 30%),
    radial-gradient(circle at 64% 36%, rgba(138, 92, 255, 0.14), transparent 28%),
    var(--color-night);
  color: var(--color-white);
  pointer-events: none;
}

.intro-active .fv-intro {
  display: grid;
  animation: fv-intro-out 520ms ease-out 2.58s forwards;
}

.fv-intro::before {
  position: absolute;
  z-index: var(--z-base);
  inset: 0;
  background-image:
    linear-gradient(rgba(155, 168, 199, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(155, 168, 199, 0.08) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at center, #000 8%, transparent 64%);
  content: "";
}

.fv-intro::after {
  position: absolute;
  z-index: var(--z-decoration);
  top: 50%;
  left: 50%;
  width: min(68vw, 880px);
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(46, 231, 255, 0.25),
    var(--color-cyan),
    rgba(138, 92, 255, 0.3),
    transparent
  );
  content: "";
  opacity: 0;
  transform: translate(-50%, -50%) scaleX(0);
}

.intro-active .fv-intro::after {
  animation: fv-intro-contact 680ms ease-out 1.04s both;
}

.fv-intro__top,
.fv-intro__bottom {
  position: absolute;
  z-index: var(--z-content);
  right: max(22px, 4vw);
  left: max(22px, 4vw);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(244, 247, 255, 0.42);
  font: 700 9px/1.4 var(--font-mono);
  text-transform: uppercase;
}

.fv-intro__top {
  top: max(22px, 4vh);
}

.fv-intro__bottom {
  bottom: max(22px, 4vh);
}

.fv-intro__top::before,
.fv-intro__bottom::before {
  width: 42px;
  height: 1px;
  margin-right: 12px;
  background: var(--color-cyan);
  content: "";
}

.fv-intro__top span:first-child,
.fv-intro__bottom span:first-child {
  margin-right: auto;
}

.fv-intro__assembly {
  position: relative;
  z-index: var(--z-content);
  width: min(86vw, 900px);
  height: clamp(150px, 23vw, 260px);
}

.fv-intro__piece,
.fv-intro__complete {
  position: absolute;
  top: 50%;
  color: var(--color-white);
  font-family: var(--font-display);
  font-size: clamp(60px, 11vw, 156px);
  font-weight: 900;
  letter-spacing: -0.085em;
  line-height: 1;
  white-space: nowrap;
}

.fv-intro__piece--dev {
  left: 50%;
  opacity: 0;
  transform: translate(-300%, -50%);
}

.fv-intro__piece--ai {
  left: 50%;
  color: var(--color-cyan);
  opacity: 0;
  transform: translate(250%, -50%);
}

.intro-active .fv-intro__piece--dev {
  animation:
    fv-intro-dev 1.08s ease-out 160ms forwards,
    fv-intro-pieces-out 240ms ease-out 1.34s forwards;
}

.intro-active .fv-intro__piece--ai {
  animation:
    fv-intro-ai 1.08s ease-out 160ms forwards,
    fv-intro-pieces-out 240ms ease-out 1.34s forwards;
}

.fv-intro__plus {
  position: absolute;
  top: 50%;
  left: 50%;
  color: rgba(244, 247, 255, 0.68);
  font: 300 clamp(28px, 4vw, 52px) / 1 Arial, sans-serif;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.4);
}

.intro-active .fv-intro__plus {
  animation: fv-intro-plus 1.18s ease-out 120ms forwards;
}

.fv-intro__complete {
  left: 50%;
  opacity: 0;
  filter: blur(6px);
  transform: translate(-50%, -50%) scale(0.94);
}

.fv-intro__complete strong {
  color: var(--color-cyan);
  font: inherit;
}

.intro-active .fv-intro__complete {
  animation: fv-intro-complete 680ms ease-out 1.36s forwards;
}

.fv-intro__pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  aspect-ratio: 1;
  border: 1px solid var(--color-cyan);
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0);
}

.intro-active .fv-intro__pulse {
  animation: fv-intro-pulse 760ms ease-out 1.02s forwards;
}

.fv-intro__tagline {
  position: absolute;
  top: calc(50% + clamp(66px, 9vw, 116px));
  left: 50%;
  color: rgba(244, 247, 255, 0.56);
  font: 800 clamp(8px, 0.9vw, 11px) / 1.5 var(--font-mono);
  opacity: 0;
  text-transform: uppercase;
  transform: translate(-50%, 14px);
  white-space: nowrap;
}

.intro-active .fv-intro__tagline {
  animation: fv-intro-tagline 560ms ease-out 1.86s forwards;
}

.fv-intro-replay {
  position: absolute;
  z-index: var(--z-content);
  right: max(88px, 7vw);
  bottom: 24px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(155, 168, 199, 0.35);
  background: rgba(6, 11, 26, 0.76);
  color: var(--color-white);
  font: 800 9px/1 var(--font-mono);
  text-transform: uppercase;
  cursor: pointer;
  transition:
    border-color 160ms ease-out,
    background-color 160ms ease-out;
}

.fv-intro-replay:hover {
  border-color: var(--color-cyan);
  background: rgba(11, 20, 40, 0.96);
}

@keyframes fv-intro-dev {
  0% {
    opacity: 0;
    filter: blur(6px);
    transform: translate(-300%, -50%);
  }

  20% {
    opacity: 1;
  }

  72% {
    filter: blur(0);
    transform: translate(-108%, -50%);
  }

  86% {
    transform: translate(-96%, -50%);
  }

  100% {
    opacity: 1;
    transform: translate(-100%, -50%);
  }
}

@keyframes fv-intro-ai {
  0% {
    opacity: 0;
    filter: blur(6px);
    transform: translate(250%, -50%);
  }

  20% {
    opacity: 1;
  }

  72% {
    filter: blur(0);
    transform: translate(8%, -50%);
  }

  86% {
    transform: translate(-4%, -50%);
  }

  100% {
    opacity: 1;
    transform: translate(0, -50%);
  }
}

@keyframes fv-intro-plus {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4) rotate(-45deg);
  }

  24%,
  68% {
    opacity: 0.82;
    transform: translate(-50%, -50%) scale(1) rotate(0);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(3.2) rotate(45deg);
  }
}

@keyframes fv-intro-pieces-out {
  to {
    opacity: 0;
    filter: blur(6px);
  }
}

@keyframes fv-intro-pulse {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
  }

  26% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(12);
  }
}

@keyframes fv-intro-contact {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scaleX(0);
  }

  38% {
    opacity: 1;
    transform: translate(-50%, -50%) scaleX(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scaleX(1.15);
  }
}

@keyframes fv-intro-complete {
  from {
    opacity: 0;
    filter: blur(6px);
    transform: translate(-50%, -50%) scale(0.94);
  }

  to {
    opacity: 1;
    filter: blur(0);
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes fv-intro-tagline {
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes fv-intro-out {
  to {
    visibility: hidden;
    opacity: 0;
  }
}

@media (max-width: 600px) {
  .fv-intro-replay {
    top: 84px;
    right: 14px;
    bottom: auto;
    min-height: 36px;
    background: rgba(6, 11, 26, 0.68);
  }

  .fv-intro::before {
    background-size: 38px 38px;
  }

  .fv-intro__assembly {
    width: 94vw;
    height: 180px;
  }

  .fv-intro__piece,
  .fv-intro__complete {
    font-size: clamp(58px, 19vw, 86px);
  }

  .fv-intro__tagline {
    top: calc(50% + 68px);
    max-width: calc(100vw - 40px);
    overflow: hidden;
    font-size: 8px;
    text-overflow: ellipsis;
  }

  .fv-intro__top span:last-child,
  .fv-intro__bottom span:last-child {
    display: none;
  }
}

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

  .fv-intro-replay {
    display: none;
  }
}
