/* Tokens visuais da pagina: cores e tempos da animacao. */
:root {
  --bg-top: #233f82;
  --bg-mid: #10224c;
  --bg-deep: #040b1a;
  --copy-strong: #f7faff;
  --copy-soft: rgba(223, 233, 255, 0.76);
  --line-soft: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(208, 221, 255, 0.2);
  --ring-highlight: rgba(207, 222, 255, 0.92);
  --glow-soft: rgba(118, 154, 255, 0.24);
  --glow-strong: rgba(118, 154, 255, 0.44);
  --animation-duration: 3600ms;
  --animation-medium: 2900ms;
  --animation-fast: 2200ms;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--copy-strong);
  background:
    radial-gradient(
      circle at 50% -6%,
      rgba(171, 194, 255, 0.3),
      transparent 28%
    ),
    radial-gradient(
      circle at 50% 18%,
      rgba(111, 146, 244, 0.24),
      transparent 34%
    ),
    linear-gradient(
      180deg,
      var(--bg-top) 0%,
      var(--bg-mid) 46%,
      var(--bg-deep) 100%
    );
  font-family: Bahnschrift, "Aptos", "Segoe UI", sans-serif;
}

/* Fundo em camadas para dar profundidade sem depender de imagens externas. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 140px 140px;
  -webkit-mask-image: radial-gradient(
    circle at center,
    black 24%,
    transparent 78%
  );
  mask-image: radial-gradient(circle at center, black 24%, transparent 78%);
  opacity: 0.45;
}

body::after {
  background: radial-gradient(
    circle at center,
    transparent 44%,
    rgba(5, 9, 20, 0.26) 76%,
    rgba(5, 9, 20, 0.82) 100%
  );
}

/* Estrutura principal da tela de passagem. */
.screen {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(24px, 4vw, 40px);
  isolation: isolate;
}

.screen::before,
.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.screen::before {
  background:
    radial-gradient(
      circle at center,
      rgba(255, 255, 255, 0.08),
      transparent 34%
    ),
    radial-gradient(
      circle at center,
      rgba(118, 154, 255, 0.18),
      transparent 52%
    );
  opacity: 0;
  transform: scale(0.82);
  filter: blur(10px);
}

.screen::after {
  background: repeating-radial-gradient(
    circle at center,
    transparent 0,
    transparent 150px,
    rgba(255, 255, 255, 0.04) 150px,
    rgba(255, 255, 255, 0.04) 152px,
    transparent 152px,
    transparent 264px
  );
  -webkit-mask-image: radial-gradient(
    circle at center,
    black 16%,
    rgba(0, 0, 0, 0.64) 46%,
    transparent 78%
  );
  mask-image: radial-gradient(
    circle at center,
    black 16%,
    rgba(0, 0, 0, 0.64) 46%,
    transparent 78%
  );
  opacity: 0;
  transform: scale(0.9);
}

/* Agrupa a identidade visual e a mensagem de apoio. */
.splash {
  width: min(100%, 760px);
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: clamp(26px, 5vw, 44px);
}

/* Moldura central com os aneis e a logo. */
.brand-stage {
  position: relative;
  width: min(72vw, 420px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(24px) scale(0.84);
  filter: blur(16px);
}

.orb,
.brand-ring {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
}

.orb-a {
  inset: 18%;
  background: radial-gradient(
    circle,
    rgba(132, 168, 255, 0.3),
    transparent 66%
  );
  filter: blur(24px);
}

.orb-b {
  inset: 30%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.18),
    transparent 70%
  );
  filter: blur(18px);
}

.brand-ring {
  border: 1px solid var(--line-soft);
  transform: scale(0.82);
}

.ring-far {
  inset: -18%;
}

.ring-mid {
  inset: 2%;
  border-color: rgba(214, 226, 255, 0.12);
}

.ring-near {
  inset: 18%;
  border-color: rgba(118, 154, 255, 0.22);
}

/* Camada que segura a logo e o brilho de destaque. */
.logo-shell {
  position: relative;
  width: clamp(172px, 25vw, 224px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.76) rotate(-14deg);
}

.logo-shell::before,
.logo-shell::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.logo-shell::before {
  inset: -14px;
  background: conic-gradient(
    from 210deg,
    transparent 0deg,
    transparent 36deg,
    rgba(226, 236, 255, 0.96) 78deg,
    rgba(118, 154, 255, 0.38) 114deg,
    transparent 152deg,
    transparent 286deg,
    rgba(226, 236, 255, 0.76) 326deg,
    transparent 360deg
  );
  -webkit-mask: radial-gradient(
    farthest-side,
    transparent calc(100% - 3px),
    #000 calc(100% - 1px)
  );
  mask: radial-gradient(
    farthest-side,
    transparent calc(100% - 3px),
    #000 calc(100% - 1px)
  );
  opacity: 0;
  transform: rotate(-18deg) scale(0.94);
}

.logo-shell::after {
  inset: -36px;
  background: radial-gradient(
    circle,
    rgba(118, 154, 255, 0.22),
    transparent 60%
  );
  filter: blur(26px);
  opacity: 0;
  transform: scale(0.76);
}

.logo-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: radial-gradient(
    circle at 32% 24%,
    #ffffff 0%,
    #f3f7ff 44%,
    #d9e3ff 100%
  );
  border: 1px solid var(--line-strong);
  box-shadow:
    0 34px 80px rgba(1, 4, 12, 0.44),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -18px 34px rgba(125, 155, 235, 0.2);
}

.logo-viewport::before,
.logo-viewport::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.logo-viewport::before {
  inset: 9px;
  border: 1px solid rgba(30, 52, 108, 0.08);
  background: radial-gradient(
    circle at 30% 22%,
    rgba(255, 255, 255, 0.72),
    transparent 42%
  );
}

.logo-viewport::after {
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.28),
    transparent 42%,
    transparent 58%,
    rgba(90, 122, 215, 0.08)
  );
  opacity: 0.9;
}

.logo,
.logo-fallback {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.logo {
  object-fit: cover;
  transform: scale(1.04);
  filter: contrast(1.04) saturate(1.02);
}

.logo-fallback {
  display: grid;
  place-items: center;
  color: #203067;
  font-family: Bahnschrift, "Aptos Display", sans-serif;
  font-size: clamp(0.86rem, 1.7vw, 1rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* Mensagem curta que contextualiza a entrada. */
.text-block {
  width: min(100%, 620px);
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.text-block::before {
  content: "";
  width: 84px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(214, 226, 255, 0.96),
    transparent
  );
  box-shadow: 0 0 20px rgba(118, 154, 255, 0.26);
  opacity: 0;
  transform: scaleX(0.3);
}

h1,
p {
  margin: 0;
  opacity: 0;
  filter: blur(10px);
}

h1 {
  font-family:
    "Aptos Display", Bahnschrift, "Segoe UI Variable Display", sans-serif;
  font-size: clamp(3.3rem, 8.5vw, 5.7rem);
  line-height: 1.05;
  letter-spacing: -0.06em;
  font-weight: 700;
  transform: translateY(18px);
  text-shadow: 0 18px 40px rgba(4, 9, 22, 0.22);
}

p {
  max-width: 36ch;
  font-size: clamp(1.05rem, 2.1vw, 1.32rem);
  line-height: 1.8;
  color: var(--copy-soft);
  transform: translateY(24px);
}

/* Estado acionado quando a experiencia comeca e o redirecionamento se aproxima. */
.screen.is-started {
  pointer-events: none;
}

.screen.is-started::before {
  animation: atmosphereSequence var(--animation-duration) ease-out forwards;
}

.screen.is-started::after {
  animation: gridSequence var(--animation-duration)
    cubic-bezier(0.18, 0.84, 0.24, 1) forwards;
}

.screen.is-started .brand-stage {
  animation: stageSequence var(--animation-duration)
    cubic-bezier(0.2, 0.86, 0.22, 1) forwards;
}

.screen.is-started .orb-a {
  animation: orbASequence var(--animation-duration) ease-out forwards;
}

.screen.is-started .orb-b {
  animation: orbBSequence var(--animation-duration) ease-out forwards;
}

.screen.is-started .ring-far {
  animation: ringFarSequence var(--animation-duration)
    cubic-bezier(0.18, 0.84, 0.24, 1) forwards;
}

.screen.is-started .ring-mid {
  animation: ringMidSequence var(--animation-duration)
    cubic-bezier(0.18, 0.84, 0.24, 1) forwards;
}

.screen.is-started .ring-near {
  animation: ringNearSequence var(--animation-duration)
    cubic-bezier(0.18, 0.84, 0.24, 1) forwards;
}

.screen.is-started .logo-shell {
  animation: logoShellSequence var(--animation-duration)
    cubic-bezier(0.2, 0.86, 0.22, 1) forwards;
}

.screen.is-started .logo-shell::before {
  animation: sweepSequence var(--animation-duration)
    cubic-bezier(0.18, 0.84, 0.24, 1) forwards;
}

.screen.is-started .logo-shell::after {
  animation: shellGlowSequence var(--animation-duration) ease-out forwards;
}

.screen.is-started .text-block::before {
  animation: lineSequence var(--animation-duration)
    cubic-bezier(0.2, 0.86, 0.22, 1) forwards;
}

.screen.is-started h1 {
  animation: headingSequence var(--animation-duration)
    cubic-bezier(0.2, 0.86, 0.22, 1) forwards;
}

.screen.is-started p {
  animation: copySequence var(--animation-duration)
    cubic-bezier(0.2, 0.86, 0.22, 1) forwards;
}

/* Sequencias de animacao usadas durante a transicao de entrada. */
@keyframes atmosphereSequence {
  0% {
    opacity: 0;
    transform: scale(0.82);
  }

  22% {
    opacity: 1;
    transform: scale(1);
  }

  70% {
    opacity: 0.58;
  }

  100% {
    opacity: 0;
    transform: scale(1.18);
  }
}

@keyframes gridSequence {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }

  20% {
    opacity: 0.42;
    transform: scale(0.96);
  }

  76% {
    opacity: 0.18;
  }

  100% {
    opacity: 0;
    transform: scale(1.06);
  }
}

@keyframes stageSequence {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.84);
    filter: blur(16px);
  }

  18% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }

  68% {
    opacity: 1;
    transform: translateY(-2px) scale(1.02);
    filter: blur(0);
  }

  100% {
    opacity: 0;
    transform: translateY(-34px) scale(0.94);
    filter: blur(10px);
  }
}

@keyframes orbASequence {
  0% {
    opacity: 0;
    transform: scale(0.7);
  }

  24% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.24);
  }
}

@keyframes orbBSequence {
  0% {
    opacity: 0;
    transform: scale(0.82);
  }

  28% {
    opacity: 0.8;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.16);
  }
}

@keyframes ringFarSequence {
  0% {
    opacity: 0;
    transform: scale(0.72);
  }

  18% {
    opacity: 0.42;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.12);
  }
}

@keyframes ringMidSequence {
  0%,
  8% {
    opacity: 0;
    transform: scale(0.76);
  }

  26% {
    opacity: 0.5;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.12);
  }
}

@keyframes ringNearSequence {
  0%,
  14% {
    opacity: 0;
    transform: scale(0.82);
  }

  34% {
    opacity: 0.62;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.16);
  }
}

@keyframes logoShellSequence {
  0% {
    opacity: 0;
    transform: scale(0.76) rotate(-14deg);
  }

  20% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }

  62% {
    opacity: 1;
    transform: scale(1.04) rotate(0deg);
  }

  100% {
    opacity: 0;
    transform: scale(0.94) rotate(0deg);
  }
}

@keyframes sweepSequence {
  0% {
    opacity: 0;
    transform: rotate(-26deg) scale(0.92);
  }

  14% {
    opacity: 0.96;
  }

  62% {
    opacity: 0.72;
  }

  100% {
    opacity: 0;
    transform: rotate(206deg) scale(1.06);
  }
}

@keyframes shellGlowSequence {
  0% {
    opacity: 0;
    transform: scale(0.76);
  }

  22% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.26);
  }
}

@keyframes lineSequence {
  0%,
  18% {
    opacity: 0;
    transform: scaleX(0.3);
  }

  30% {
    opacity: 1;
    transform: scaleX(1);
  }

  100% {
    opacity: 0;
    transform: scaleX(0.7);
  }
}

@keyframes headingSequence {
  0%,
  20% {
    opacity: 0;
    transform: translateY(18px);
    filter: blur(10px);
  }

  34% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }

  68% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }

  100% {
    opacity: 0;
    transform: translateY(-16px);
    filter: blur(8px);
  }
}

@keyframes copySequence {
  0%,
  26% {
    opacity: 0;
    transform: translateY(24px);
    filter: blur(10px);
  }

  40% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }

  68% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }

  100% {
    opacity: 0;
    transform: translateY(-12px);
    filter: blur(8px);
  }
}

/* Ajustes para telas menores sem mudar o fluxo visual. */
@media (max-width: 700px) {
  .brand-stage {
    width: min(82vw, 360px);
  }

  .logo-shell {
    width: clamp(160px, 42vw, 204px);
  }

  h1 {
    font-size: clamp(2.55rem, 11vw, 4.1rem);
  }

  p {
    max-width: 28ch;
    font-size: clamp(0.94rem, 3.4vw, 1.04rem);
  }
}

/* Remove animacoes longas para quem prefere menos movimento. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
