/* Boas-vindas: o logotipo se monta peça por peça e pousa no menu.
   O livro se abre, o globo nasce dele, o nome se escreve em volta e a tela branca vira o menu. */

@property --bv-escrita {
    syntax: '<angle>';
    inherits: true;
    initial-value: -18deg;
}

.bv {
    position: fixed;
    z-index: 99999;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(18px, 3.5vh, 36px);
    overflow: hidden;
    cursor: pointer;
}

/* A folha branca sobe inteira até virar o menu: só transform, sem repintar a tela */
.bv__fundo {
    position: absolute;
    inset: 0;
    background: radial-gradient(70% 60% at 50% 42%, #ffffff 30%, #f5f7fc 100%);
    will-change: transform;
}

.bv__luz {
    position: absolute;
    top: 42%;
    left: 50%;
    width: min(150vw, 150vh);
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        radial-gradient(closest-side, rgba(245, 176, 65, 0.3), rgba(245, 176, 65, 0.1) 45%, transparent 72%),
        repeating-conic-gradient(rgba(245, 176, 65, 0.11) 0deg 5deg, transparent 5deg 15deg);
    -webkit-mask-image: radial-gradient(closest-side, #000 18%, transparent 92%);
    mask-image: radial-gradient(closest-side, #000 18%, transparent 92%);
    translate: -50% -50%;
    opacity: 0;
    will-change: opacity, rotate;
    animation:
        bv-luz 2s ease-in-out 0.3s forwards,
        bv-raios 70s linear infinite;
}

@keyframes bv-luz {
    to { opacity: 1; }
}

@keyframes bv-raios {
    from { rotate: 0deg; }
    to { rotate: 360deg; }
}

.bv__logo {
    position: relative;
    width: min(80vw, 76vh, 560px);
    aspect-ratio: 1000 / 695;
    transform-origin: center;
    will-change: transform;
}

.bv__logo img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

/* 1. O livro se abre a partir da dobra */
.bv__livro {
    z-index: 3;
    transform-origin: 50% 88%;
    opacity: 0;
    transform: scale(0.05, 0.35);
    will-change: transform, opacity;
    animation: bv-livro 1.25s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}

@keyframes bv-livro {
    0% { opacity: 0; transform: scale(0.05, 0.35); }
    25% { opacity: 1; }
    100% { opacity: 1; transform: none; }
}

/* 2. O globo nasce do livro */
.bv__globo {
    z-index: 1;
    transform-origin: 50% 88%;
    opacity: 0;
    transform: translateY(16%) scale(0.5);
    will-change: transform, opacity;
    animation: bv-globo 1.45s cubic-bezier(0.22, 1, 0.36, 1) 0.45s forwards;
}

@keyframes bv-globo {
    0% { opacity: 0; transform: translateY(16%) scale(0.5); }
    35% { opacity: 1; }
    100% { opacity: 1; transform: none; }
}

/* 3. O nome da igreja se escreve em volta do globo */
.bv__anel {
    z-index: 2;
    -webkit-mask-image: conic-gradient(from 228deg at 49.8% 51%, #000 var(--bv-escrita), transparent calc(var(--bv-escrita) + 14deg));
    mask-image: conic-gradient(from 228deg at 49.8% 51%, #000 var(--bv-escrita), transparent calc(var(--bv-escrita) + 14deg));
    animation: bv-escreve 1.35s cubic-bezier(0.37, 0, 0.63, 1) 1.05s forwards;
}

@keyframes bv-escreve {
    to { --bv-escrita: 275deg; }
}

/* 4. O lema e a saudação */
.bv__lema {
    z-index: 3;
    opacity: 0;
    transform: translateY(5%);
    animation: bv-sobe 0.9s cubic-bezier(0.22, 1, 0.36, 1) 2.1s forwards;
}

.bv__texto {
    position: relative;
    margin: 0;
    color: var(--navy-900, #0c2151);
    font: 800 clamp(1rem, 2.4vw, 1.5rem)/1.2 'Montserrat', Arial, sans-serif;
    letter-spacing: 0.16em;
    text-align: center;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(12px);
    animation: bv-sobe 0.9s cubic-bezier(0.22, 1, 0.36, 1) 2.3s forwards;
}

@keyframes bv-sobe {
    to { opacity: 1; transform: none; }
}

/* Um brilho atravessa o logotipo pronto, só onde há logotipo */
.bv__brilho {
    position: absolute;
    z-index: 4;
    inset: 0;
    background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.85) 50%, transparent 62%) no-repeat;
    background-size: 260% 100%;
    background-position: 130% 0;
    -webkit-mask: url('/assets/images/logos/LOGO_INJ_COLOR.png') center / 100% 100% no-repeat;
    mask: url('/assets/images/logos/LOGO_INJ_COLOR.png') center / 100% 100% no-repeat;
    pointer-events: none;
    animation: bv-brilho 1.2s ease-in-out 2.4s forwards;
}

@keyframes bv-brilho {
    to { background-position: -40% 0; }
}
