#preloader {
    position: fixed;
    inset: 0;
    background: #2E4832;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.6s ease-out;
}


.preloader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
}


/* DESKTOP / PADRÃO: tudo em uma linha */
.preloader-title {
    font-size: 3.2rem;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    padding: 0 1.5rem;
    line-height: 1.3;
    font-family: "Lato", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    max-width: 100%;
    box-sizing: border-box;
}


.preloader-title-text {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    box-sizing: border-box;
    font-family: "Lato", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;


    width: 0;
    animation: preloaderTyping 1.5s steps(28, end) 0s forwards;
}


/* animação desktop, 1 linha */
@keyframes preloaderTyping {
    from { width: 0; }
    to   { width: 28ch; }
}


.preloader-main {
    font-weight: 900;
}


.preloader-sub {
    font-size: 0.9em;
    font-weight: 300;
}


.preloader-sep {
    margin: 0 0.5em;
    opacity: 0.6;
    font-weight: 300;
}


/* barra sob o título */
.preloader-bar {
    margin-top: 14px;
    width: min(600px, 80vw);
    height: 2px;
    background: rgba(255,255,255,0.25);
    border-radius: 999px;
    overflow: hidden;
    margin-left: auto;
    margin-right: auto;
}


.preloader-bar-fill {
    width: 0;
    height: 100%;
    background: #ffffff;
    border-radius: inherit;
    transform-origin: left center;
    animation: preloaderBarFill 1.5s ease-out 0s 1 forwards;
}


@keyframes preloaderBarFill {
    from { width: 0; }
    to   { width: 100%; }
}


/* crédito */
.preloader-credit {
    position: absolute;
    right: 16px;
    bottom: 12px;
    font-size: 13px;
    color: #ffffff;
    opacity: 0.7;
    font-family: "Lato", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    pointer-events: none;
}


/* ========================= */
/* MOBILE: quebrar em duas linhas */
/* ========================= */
/* DESKTOP: igual ao que você já usa */
.preloader-title {
    font-size: 3.2rem;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    padding: 0 1.5rem;
    line-height: 1.3;
    font-family: "Lato", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    max-width: 100%;
    box-sizing: border-box;
}


.preloader-title-text {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    box-sizing: border-box;
    font-family: "Lato", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    width: 0;
    animation: preloaderTyping 1.5s steps(28, end) 0s forwards;
}


@keyframes preloaderTyping {
    from { width: 0; }
    to   { width: 28ch; }
}


/* ========================= */
/* MOBILE: 2 linhas fixas    */
/* ========================= */
@media (max-width: 600px) {
    .preloader-title {
        font-size: 1.6rem;
        padding: 0 1rem;
    }


    /* bloco com largura fixa, já com quebra em 2 linhas */
    .preloader-title-text {
        display: inline-block;
        overflow: hidden;
        box-sizing: border-box;


        white-space: normal;     /* permite quebra */
        max-width: 12em;         /* largura final das duas linhas */
        width: 0;                /* começa fechado */
        animation: preloaderTypingMobile 1.5s steps(30, end) 0s forwards;
    }


    /* garante 2 linhas exatas */
    .preloader-main {
        display: block;          /* 1ª linha: Carnaubais */
    }


    .preloader-sep {
        display: none;           /* some com o "|" no mobile */
    }


    .preloader-sub {
        display: block;          /* 2ª linha: Revista de Literatura */
        margin-top: 0.1em;
        font-size: 0.95em;
        font-weight: 300;
    }


    @keyframes preloaderTypingMobile {
        from { width: 0; }
        to   { width: 12em; }    /* mesma largura do max-width */
    }


    .preloader-bar {
        width: 70vw;
    }


    .preloader-credit {
        font-size: 11px;
        right: 10px;
        bottom: 8px;
    }
}

/* Só na página inicial (.pkp_page_index) o título começa fora da tela */
.pkp_page_index .pkp_site_name {
  opacity: 1;
  transform: translateY(-200px);
  transition: opacity 0.5s ease-out,
              transform 3.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* E só na home ele recebe a animação de entrada */
.pkp_page_index .pkp_site_name.pkp_site_name--visible {
  opacity: 1;
  transform: translateY(0);
}
