/* Kinetic zero-click brand intro: four quadrants snap together, pulse, and part. */
html:has(.welcome),
body.welcome-visible {
  overflow: hidden;
  scrollbar-gutter: auto;
}

html:has(.welcome) {
  background: #11152f;
}

.welcome {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  z-index: 100;
  background: radial-gradient(90% 80% at 50% 45%, #1d2452 0%, #11152f 72%);
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.welcome::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(168, 200, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 200, 255, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 50%, #000 10%, transparent 62%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 10%, transparent 62%);
}

.welcome-center {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.welcome-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 210px;
  height: 210px;
  margin: -122px 0 0 -105px;
  border-radius: 50%;
  border: 1px solid rgba(168, 200, 255, 0.22);
  box-shadow: 0 0 60px rgba(88, 140, 255, 0.25);
  transform: scale(0.72);
  opacity: 0;
  animation: intro-ring 1300ms cubic-bezier(0.22, 1, 0.36, 1) 80ms forwards;
}

.welcome-mark {
  width: 112px;
  height: 115px;
  overflow: visible;
  fill: #ffffff;
  filter: drop-shadow(0 16px 36px rgba(10, 14, 38, 0.6));
}

.corner {
  transform-origin: 215px 220px;
  transition: transform 600ms cubic-bezier(0.7, 0, 0.2, 1), opacity 440ms ease;
}

.corner-a {
  animation: snap-a 720ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.corner-b {
  fill: #a8c8ff;
  animation: snap-b 720ms cubic-bezier(0.22, 1, 0.36, 1) 70ms backwards;
}
.corner-c {
  animation: snap-c 720ms cubic-bezier(0.22, 1, 0.36, 1) 140ms backwards;
}
.corner-d {
  animation: snap-d 720ms cubic-bezier(0.22, 1, 0.36, 1) 210ms backwards;
}

.welcome-word {
  color: #ffffff;
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 24px;
  font-weight: 760;
  letter-spacing: -0.035em;
  opacity: 0;
  transform: translateY(8px);
  animation: intro-word 520ms cubic-bezier(0.22, 1, 0.36, 1) 360ms forwards;
}

.welcome.departing .corner-a {
  transform: translate(-180px, -180px) scale(1.35) rotate(-10deg);
  opacity: 0;
}
.welcome.departing .corner-b {
  transform: translate(180px, -180px) scale(1.35) rotate(10deg);
  opacity: 0;
}
.welcome.departing .corner-c {
  transform: translate(180px, 180px) scale(1.35) rotate(-10deg);
  opacity: 0;
}
.welcome.departing .corner-d {
  transform: translate(-180px, 180px) scale(1.35) rotate(10deg);
  opacity: 0;
}
.welcome.departing .welcome-word,
.welcome.departing .welcome-ring {
  opacity: 0;
  transition: opacity 240ms ease;
}

.welcome.leaving {
  opacity: 0;
}

@keyframes snap-a {
  from { transform: translate(-68px, -68px) rotate(-14deg); opacity: 0; }
  to { transform: translate(0, 0) rotate(0); opacity: 1; }
}
@keyframes snap-b {
  from { transform: translate(68px, -68px) rotate(14deg); opacity: 0; }
  to { transform: translate(0, 0) rotate(0); opacity: 1; }
}
@keyframes snap-c {
  from { transform: translate(68px, 68px) rotate(-14deg); opacity: 0; }
  to { transform: translate(0, 0) rotate(0); opacity: 1; }
}
@keyframes snap-d {
  from { transform: translate(-68px, 68px) rotate(14deg); opacity: 0; }
  to { transform: translate(0, 0) rotate(0); opacity: 1; }
}
@keyframes intro-word {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes intro-ring {
  0% { opacity: 0; transform: scale(0.68); }
  55% { opacity: 1; transform: scale(1); }
  100% { opacity: 0.35; transform: scale(1.08); }
}

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