/* Home intro splash — cinematic, GPU-only (opacity / transform). */

/* ——— Desk under the splash ——— */
.home-desk.is-splash-pending {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.home-desk.is-splash-reveal {
  visibility: visible;
  pointer-events: auto;
  opacity: 1;
}

/* Widgets rise one after another when desk is handed over */
.home-desk.is-splash-reveal .widgets > * {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  animation: home-splash-rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(0.12s + var(--i, 0) * 90ms);
}

.home-desk.is-splash-pending .assistant-ask,
.home-desk.is-splash-hold-ask .assistant-ask {
  opacity: 0;
}

/* ——— Splash root ——— */
.home-splash {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1.25rem 4.5rem;
  background: transparent;
  color: #f5f8fc;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.6s ease;
}

.home-splash.is-done {
  opacity: 0;
  pointer-events: none;
}

/* ——— Aurora background ——— */
.home-splash__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(160deg, #070e17 0%, #0f2033 45%, #0b1726 75%, #080f1a 100%);
  opacity: 1;
  transition: opacity 1.4s ease;
  overflow: hidden;
}

.home-splash__blob {
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.home-splash__blob--a {
  left: -20vmax;
  top: -24vmax;
  background: radial-gradient(circle at 50% 50%, rgba(45, 212, 191, 0.42) 0%, rgba(45, 212, 191, 0.12) 38%, transparent 68%);
  animation: home-splash-drift-a 16s ease-in-out infinite alternate;
}

.home-splash__blob--b {
  right: -26vmax;
  bottom: -28vmax;
  background: radial-gradient(circle at 50% 50%, rgba(251, 146, 60, 0.30) 0%, rgba(251, 146, 60, 0.09) 40%, transparent 68%);
  animation: home-splash-drift-b 19s ease-in-out infinite alternate;
}

.home-splash__blob--c {
  left: 30vw;
  top: 25vh;
  width: 55vmax;
  height: 55vmax;
  background: radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.26) 0%, rgba(56, 189, 248, 0.07) 42%, transparent 70%);
  animation: home-splash-drift-c 22s ease-in-out infinite alternate;
}

.home-splash.is-out .home-splash__bg {
  opacity: 0;
}

/* ——— Stage ——— */
.home-splash__stage {
  position: relative;
  z-index: 1;
  width: 80vw;
  max-width: 80vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  transform: translate3d(0, 0, 0);
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Whole stage drifts up gently as decor leaves */
.home-splash.is-out .home-splash__stage {
  transform: translate3d(0, -24px, 0);
}

.home-splash__brand,
.home-splash__welcome {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* ——— Company: letter cascade ——— */
.home-splash__company {
  margin: 0;
  font-family: var(--display, inherit);
  font-weight: 800;
  font-size: clamp(2rem, 10vw, 5.5rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #f8fafc;
  white-space: normal;
  overflow: hidden;
  max-width: 100%;
  text-shadow: 0 2px 28px rgba(45, 212, 191, 0.18);
}

.home-splash__word {
  display: inline-block;
  white-space: nowrap;
}

.home-splash__ch {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, 0.55em, 0) rotate(3deg) scale(0.92);
  transform-origin: 50% 100%;
  will-change: opacity, transform;
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--i, 0) * 38ms);
}

.home-splash.is-brand .home-splash__ch {
  opacity: 1;
  transform: translate3d(0, 0, 0) rotate(0) scale(1);
}

.home-splash.is-out .home-splash__ch {
  opacity: 0;
  transform: translate3d(0, -0.45em, 0) rotate(-2deg) scale(0.96);
  transition-duration: 0.6s, 0.7s;
  transition-delay: calc(var(--i, 0) * 14ms);
}

/* ——— by FreeSaaS: tracking-in ——— */
.home-splash__by {
  margin: 0.55rem 0 0;
  font-size: clamp(0.75rem, 1.6vw, 0.95rem);
  letter-spacing: 0.42em;
  color: rgba(248, 250, 252, 0.78);
  opacity: 0;
  transform: translate3d(0, 6px, 0);
  will-change: opacity, transform, letter-spacing;
  transition:
    opacity 0.9s ease,
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    letter-spacing 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.home-splash.is-by .home-splash__by {
  opacity: 1;
  letter-spacing: 0.14em;
  transform: translate3d(0, 0, 0);
}

.home-splash.is-out .home-splash__by {
  opacity: 0;
  transform: translate3d(0, -8px, 0);
  transition-duration: 0.5s, 0.6s, 0.6s;
}

/* ——— Welcome ——— */
.home-splash__welcome {
  margin: 1rem 0 0;
  font-family: var(--display, inherit);
  font-weight: 800;
  font-size: clamp(2.4rem, 12vw, 6.5rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  max-width: 100%;
  text-shadow: 0 2px 30px rgba(56, 189, 248, 0.22);
  opacity: 0;
  transform: translate3d(0, 26px, 0) scale(0.96);
  will-change: opacity, transform;
  transition:
    opacity 1s cubic-bezier(0.22, 1, 0.36, 1),
    transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.home-splash.is-welcome .home-splash__welcome {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.home-splash.is-out .home-splash__welcome {
  opacity: 0;
  transform: translate3d(0, -18px, 0) scale(0.985);
  transition-duration: 0.65s, 0.75s;
}

/* ——— Ask strip ——— */
.home-splash__ask {
  width: 100%;
  max-width: 100%;
  margin-top: 2rem;
  text-align: left;
  opacity: 0;
  transform: translate3d(0, 22px, 0) scale(0.97);
  will-change: opacity, transform;
  transition:
    opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.95s cubic-bezier(0.22, 1, 0.36, 1);
}

.home-splash.is-ask .home-splash__ask {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

/* Breathing glow while Max "talks" */
.home-splash.is-ask .home-splash__ask .assistant-ask__input {
  border-color: rgba(45, 212, 191, 0.55);
  animation: home-splash-breathe 2.6s ease-in-out 0.4s infinite;
  background: rgba(255, 255, 255, 0.06);
  color: #f5f8fc;
}

.home-splash__ask .assistant-ask__input::placeholder {
  color: rgba(248, 250, 252, 0.72);
}

/* Send button pops in after the strip settles */
.home-splash__ask .assistant-ask__send {
  transform: scale(0.4);
  opacity: 0;
  transition:
    transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s,
    opacity 0.4s ease 0.35s;
}

.home-splash.is-ask .home-splash__ask .assistant-ask__send {
  transform: scale(1);
  opacity: 1;
}

/* Flight to the desk */
.home-splash__ask.is-flying {
  position: fixed;
  z-index: 90;
  margin: 0;
  opacity: 1;
  transition:
    transform 1.15s cubic-bezier(0.65, 0, 0.2, 1),
    width 1.15s cubic-bezier(0.65, 0, 0.2, 1);
  will-change: transform, width;
}

/* During flight the strip morphs into the desk theme look so landing is seamless */
.home-splash.is-ask .home-splash__ask.is-flying .assistant-ask__input {
  animation: none;
  border-color: var(--line);
  background: var(--bg-input);
  color: var(--text);
  box-shadow: 0 0 0 0 rgba(45, 212, 191, 0);
  transition: border-color 1s ease, background-color 1s ease, color 1s ease, box-shadow 1s ease;
}

.home-desk.is-splash-reveal .assistant-ask {
  transition: opacity 0.25s ease;
}

/* ——— Skip ——— */
.home-splash__skip {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 91;
  border: 1px solid rgba(248, 250, 252, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  transform: translate3d(0, 6px, 0);
  transition: opacity 0.35s ease, transform 0.35s ease, background-color 0.15s ease;
}

.home-splash__skip.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.home-splash__skip:hover {
  background: rgba(255, 255, 255, 0.14);
}

.home-splash__skip[hidden] {
  display: none !important;
}

/* ——— Keyframes ——— */
@keyframes home-splash-drift-a {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(14vw, 10vh, 0) scale(1.18); }
}

@keyframes home-splash-drift-b {
  0%   { transform: translate3d(0, 0, 0) scale(1.05); }
  100% { transform: translate3d(-12vw, -14vh, 0) scale(1.22); }
}

@keyframes home-splash-drift-c {
  0%   { transform: translate3d(-6vw, 4vh, 0) scale(0.95); }
  100% { transform: translate3d(8vw, -8vh, 0) scale(1.15); }
}

@keyframes home-splash-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.0), 0 12px 40px rgba(45, 212, 191, 0.10); }
  50%      { box-shadow: 0 0 0 6px rgba(45, 212, 191, 0.16), 0 16px 56px rgba(45, 212, 191, 0.26); }
}

@keyframes home-splash-rise {
  from { opacity: 0; transform: translate3d(0, 18px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* ——— Reduced motion ——— */
@media (prefers-reduced-motion: reduce) {
  .home-splash,
  .home-splash *,
  .home-desk.is-splash-reveal .widgets > * {
    transition: none !important;
    animation: none !important;
    opacity: 1;
    transform: none !important;
  }

  .home-splash.is-done {
    opacity: 0;
  }
}
