/*
 * Gracinha — identidade e animação do rodapé.
 * Não modifica cabeçalho, hero ou área editorial.
 */

.bc-footer-identity {
    min-width: 0;
}

.bc-gracinha-stage {
    position: relative;
    width: min(100%, 280px);
    margin: 0 0 18px;
    isolation: isolate;
}

.bc-gracinha-stage::before {
    position: absolute;
    inset: 14%;
    z-index: -1;
    content: "";
    pointer-events: none;
    background: radial-gradient(
        circle,
        rgba(34, 211, 238, 0.10),
        rgba(139, 92, 246, 0.06) 45%,
        transparent 72%
    );
}

.bc-gracinha-link {
    display: block;
    border-radius: 24px;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.bc-gracinha-link:focus-visible {
    outline: 2px solid #67e8f9;
    outline-offset: 6px;
}

.bc-gracinha-svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.bc-gracinha-stage #gracinha-orbitas {
    opacity: 0.50;
    filter: drop-shadow(0 0 3px rgba(34, 211, 238, 0.32));
}

.bc-gracinha-stage #gracinha-eletrons {
    filter: drop-shadow(0 0 5px rgba(34, 211, 238, 0.65));
}

.bc-gracinha-stage #gracinha-holograma {
    opacity: 0.6;
}

.bc-gracinha-stage #gracinha-flutuacao {
    animation: bc-gracinha-float 6s ease-in-out infinite;
    animation-play-state: paused;
}

.bc-gracinha-stage #gracinha-holograma {
    animation: bc-gracinha-hologram 5s ease-in-out infinite;
    animation-play-state: paused;
}

/* Transição de cores exclusiva das órbitas. */
.bc-gracinha-stage #gracinha-degrade-orbitas stop {
    animation: bc-gracinha-orbit-colors 12s linear infinite;
    animation-play-state: paused;
}

.bc-gracinha-stage .bc-gracinha-stop-1 {
    animation-delay: 0s;
}

.bc-gracinha-stage .bc-gracinha-stop-2 {
    animation-delay: -3s;
}

.bc-gracinha-stage .bc-gracinha-stop-3 {
    animation-delay: -6s;
}

.bc-gracinha-stage .bc-gracinha-stop-4 {
    animation-delay: -9s;
}

.bc-gracinha-stage.is-running #gracinha-flutuacao,
.bc-gracinha-stage.is-running #gracinha-holograma,
.bc-gracinha-stage.is-running #gracinha-degrade-orbitas stop {
    animation-play-state: running;
}

.bc-gracinha-stage #gracinha-olhos circle {
    transform-box: fill-box;
    transform-origin: center;
}

.bc-gracinha-stage.is-blinking #gracinha-olhos circle {
    animation: bc-gracinha-blink 180ms ease-in-out both;
    animation-play-state: paused;
}

.bc-gracinha-stage.is-running.is-blinking #gracinha-olhos circle {
    animation-play-state: running;
}

.bc-gracinha-stage.is-glitching #gracinha-personagem {
    animation: bc-gracinha-glitch 140ms steps(1, end) both;
    animation-play-state: paused;
}

.bc-gracinha-stage.is-running.is-glitching #gracinha-personagem {
    animation-play-state: running;
}

/* Controle discreto, exibido somente quando o JavaScript inicia. */
.bc-gracinha-toggle {
    display: block;
    margin: 8px auto 0;
    padding: 6px 10px;
    border: 1px solid rgba(103, 232, 249, 0.16);
    border-radius: 999px;
    background: transparent;
    color: var(--muted, #a6a4b4);
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    line-height: 1.4;
    cursor: pointer;
}

.bc-gracinha-toggle[hidden] {
    display: none;
}

.bc-gracinha-toggle:hover,
.bc-gracinha-toggle:focus-visible {
    border-color: rgba(103, 232, 249, 0.6);
    color: #67e8f9;
}

.bc-gracinha-toggle:focus-visible {
    outline: 2px solid #67e8f9;
    outline-offset: 3px;
}

@keyframes bc-gracinha-float {
    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

@keyframes bc-gracinha-hologram {
    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 0.8;
    }
}

@keyframes bc-gracinha-orbit-colors {
    0%,
    100% {
        stop-color: #a78bfa;
    }

    25% {
        stop-color: #ec4899;
    }

    50% {
        stop-color: #22d3ee;
    }

    75% {
        stop-color: #5eead4;
    }
}

@keyframes bc-gracinha-blink {
    0%,
    100% {
        transform: scaleY(1);
    }

    45%,
    55% {
        transform: scaleY(0.08);
    }
}

@keyframes bc-gracinha-glitch {
    0%,
    100% {
        transform: translateX(0);
        filter: none;
    }

    25% {
        transform: translateX(-2px);
        filter:
            drop-shadow(2px 0 0 rgba(34, 211, 238, 0.45))
            drop-shadow(-2px 0 0 rgba(236, 72, 153, 0.35));
    }

    55% {
        transform: translateX(2px);
        filter: drop-shadow(-2px 0 0 rgba(34, 211, 238, 0.4));
    }

    80% {
        transform: translateX(-1px);
        filter: none;
    }
}

@media (max-width: 820px) {
    .bc-gracinha-stage {
        width: min(100%, 250px);
        margin-inline: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bc-gracinha-stage #gracinha-flutuacao,
    .bc-gracinha-stage #gracinha-holograma,
    .bc-gracinha-stage #gracinha-olhos circle,
    .bc-gracinha-stage #gracinha-personagem,
    .bc-gracinha-stage #gracinha-degrade-orbitas stop {
        animation: none !important;
    }
}