/* CSS isolado apenas para o botão interativo */
.interactive-button-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 4rem;
}

.interactive-button-container button {
  font-family: "Geist Mono", monospace;
  text-transform: uppercase;
  color: white;
  padding: 1rem 2rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
  transform-style: preserve-3d;
  font-size: 1rem;
  line-height: 1;
}

.interactive-button-container button::after {
  content: ""; 
  position: absolute;
  inset: 0;
  background: hsl(0 0% 100%);
  opacity: calc(var(--intent, 0) * 0.0875);
  transition: opacity 0.2s;
}

.interactive-button-container button:is(:hover, :focus-visible) {
  --intent: 1;
}

.interactive-button-container .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.interactive-button-container button > span:not(.sr-only) {
  position: relative;
  color: transparent;
}

.interactive-button-container button > span:not(.sr-only)::after {
  content: attr(data-char);
  position: absolute;
  display: inline-block;
  inset: 0;
  color: white;
  z-index: 1;
}

.interactive-button-container button:is(:hover, :focus-visible) > span:not(.sr-only)::after {
  animation: interactive-flash calc(var(--speed, 0.5) * 0.5s) calc(var(--index, 0) * 0.15s) steps(1, end);
}

@keyframes interactive-flash {
  0%, 20%   { content: '_'; }
  40%  { content: var(--char-1); }
  60%  { content: var(--char-2); }
  80%  { content: var(--char-3); }
}

.interactive-button-container button:is(:hover, :focus-visible) {
  --intent: 0;
}

.interactive-button-container:has(button:is(:hover, :focus-visible)) .dummy {
  --intent: 1;
}

/* Estado inicial - sem explode */
.interactive-button-container #app {
  transform: translate3d(0, 0, 100vmin) rotateX(0deg) rotateY(0deg);
  transition: transform 0.5s 2s;
}

.interactive-button-container button {
  scale: 1;
  transition: transform 0.5s 1s, scale 0.5s 3s, opacity 0s 3s;
}

/* Explode no hover */
.interactive-button-container:has(button:is(:hover, :focus-visible)) #app {
  transform: translate3d(0, 0, 100vmin) rotateX(-24deg) rotateY(40deg);
  transition: transform 0.5s 1s;
}

.interactive-button-container:has(button:is(:hover, :focus-visible)) button {
  scale: 2.4;
  transform: translate3d(0, 0, 50px);
  transition: transform 0.5s 2s, scale 0.5s 0s;
}

.interactive-button-container button:not(.dummy)::before {
  content: "lets go, baby";
  position: absolute;
  left: 100%;
  white-space: nowrap;
  translate: 0 -50%;
  transform-origin: 0 50%;
  scale: 0.5;
  top: 50%;
  text-transform: none;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s 0s;
  color: white;
}

.interactive-button-container:has(button:is(:hover, :focus-visible)) button:not(.dummy)::before {
  opacity: 1;
  transition: opacity 1s 3s;
}

.interactive-button-container .dummy {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  color: hsl(0 0% 100% / 0.5);
  transform: translate3d(0, 0, -50px);
  transition: transform 0.5s 2s, scale 0.5s 0s, opacity 0s 0s;
  font-family: "Geist Mono", monospace;
  text-transform: uppercase;
  font-size: 1rem;
  line-height: 1;
  padding: 1rem 2rem;
  box-sizing: border-box;
}

.interactive-button-container:has(button:is(:hover, :focus-visible)) .dummy {
  opacity: 1;
  transform: translate3d(0, 0, -50px);
  transition: transform 0.5s 2s, scale 0.5s 0s, opacity 0s 0s;
}

.interactive-button-container .bear-link {
  color: white;
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  width: 48px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  opacity: 0.8;
}

.interactive-button-container .bear-link:is(:hover, :focus-visible) {
  opacity: 1;
}

.interactive-button-container .bear-link svg {
  width: 75%;
}