/* ==========================================================================
   Estilos Gerais
   ========================================================================== */
body {
    background: #1A2525;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* ==========================================================================
   Imagem de Fundo
   ========================================================================== */
.bg-img {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    transform: scale(1.15);
    animation: driftZoom 60s infinite ease-in-out, pulseOpacity 30s infinite ease-in-out;
    opacity: 0.75;
}

@keyframes driftZoom {
    0% { transform: scale(1.15) translate(0, 0); }
    50% { transform: scale(1.35) translate(-4%, 4%); }
    100% { transform: scale(1.15) translate(0, 0); }
}

@keyframes pulseOpacity {
    0% { opacity: 0.65; }
    50% { opacity: 0.95; }
    100% { opacity: 0.65; }
}

/* ==========================================================================
   Word-Sea
   ========================================================================== */
.word-sea {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 8;
    opacity: 0; /* Começa invisível */
    transition: opacity 15s ease-in-out; /* Transição de 15s */
}

.word-sea:empty::before {
    content: "Iniciando palavras...";
    color: rgba(255, 215, 150, 0.6);
    font-family: 'Raleway', sans-serif;
    font-size: 1em;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.word-sea .word {
    position: absolute;
    font-family: 'Raleway', sans-serif;
    text-transform: lowercase;
    user-select: none;
    transition: opacity 2s ease-in-out, transform 2s ease-in-out;
    opacity: 1;
    will-change: transform, opacity;
}

.word-sea .word.color1 { color: rgba(180, 210, 240, 0.6); }
.word-sea .word.color2 { color: rgba(240, 200, 210, 0.6); }
.word-sea .word.color3 { color: rgba(190, 230, 210, 0.6); }

.word-sea .word.entering {
    opacity: 0;
    transform: translateY(20px);
}

.word-sea .word.exiting {
    opacity: 0;
    transform: translateY(-20px);
}

@keyframes wave {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

/* ==========================================================================
   Canvas para Linhas da Constelação
   ========================================================================== */
.constellation-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9;
}

/* ==========================================================================
   Container de Aquarelas
   ========================================================================== */
.aquarelas-container {
    position: relative;
    width: 100%;
    height: 100vh;
    z-index: 10;
    opacity: 0; /* Começa invisível */
    transition: opacity 15s ease-in-out; /* Transição de 15s */
}

.aquarela-reflexo {
    position: absolute;
    width: 120px;
    height: 90px;
    opacity: 0.8;
    transition: opacity 0.3s ease, box-shadow 0.3s ease;
    animation: ripple 6s infinite ease-in-out;
    cursor: pointer;
    background: radial-gradient(circle at center, rgba(255, 215, 150, 0.8) 0%, rgba(255, 215, 150, 0.5) 100%);
}

.aquarela-reflexo:hover {
    opacity: 1;
    transform: scale(1.2);
    box-shadow: 0 0 15px #FFD700;
}

.aquarela-reflexo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
}

@keyframes ripple {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ==========================================================================
   Popup e Galeria
   ========================================================================== */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(28, 37, 38, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.popup.active {
    display: flex;
    opacity: 1;
}

.gallery-container {
    width: 90vw;
    max-height: 90vh;
    padding: 20px;
    background: rgba(10, 20, 40, 0.2);
    backdrop-filter: blur(4px);
    overflow: auto;
    border: 1px solid rgba(255, 215, 150, 0.3);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery {
    position: relative;
    width: 100%;
    min-height: 80vh;
    text-align: center;
}

.gallery-img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    opacity: 0;
    transition: opacity 1s ease-in-out, filter 1s ease-in-out;
}

.gallery-img.active {
    opacity: 1;
    filter: blur(0);
}

.gallery-img.exiting {
    opacity: 0;
    filter: blur(2px);
}

.gallery-prev, .gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #FFD700;
    font-size: 1.8em;
    text-decoration: none;
    z-index: 101;
    padding: 10px;
}

.gallery-prev { left: 10px; }
.gallery-next { right: 10px; }

/* ==========================================================================
   Poetica Popup
   ========================================================================== */
.poetica-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(28, 37, 38, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 102;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.poetica-popup.active {
    display: flex;
    opacity: 1;
}

.poetica-container {
    max-width: 600px;
    width: 90%;
    padding: 16px;
    background: rgba(10, 20, 40, 0.2);
    text-align: center;
    backdrop-filter: blur(4px);
    overflow: auto;
    border: 1px solid rgba(255, 215, 150, 0.3);
}

.poetica-text-line {
    display: block;
    font-family: 'Raleway', sans-serif;
    font-weight: 300;
    font-size: 1.4em;
    color: rgba(255, 215, 150, 0.9);
    margin: 8px 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.poetica-text-line.active {
    opacity: 1;
    transform: translateY(0);
}

.poetica-text:empty::before {
    content: "Carregando texto...";
    color: rgba(255, 215, 150, 0.9);
    font-family: 'Raleway', sans-serif;
    font-weight: 300;
    font-size: 1.4em;
}

/* ==========================================================================
   Links Flutuantes e Botão de Reinício
   ========================================================================== */
.floating-text, .gallery-reset-button {
    position: fixed;
    color: #F5F5F5;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5em;
    font-weight: 300;
    text-decoration: none;
    z-index: 101;
    
    padding: 8px 12px;
    border-radius: 15% 40% 25% 55%;
    transition: all 0.5s ease;
}

.floating-text:hover, .gallery-reset-button:hover {
    color: #FFD700;
   
}

.floating-text.chaos8 {
    top: 5%;
    left: 5%;
    animation: subtleChaos8 100s infinite ease-in-out;
}

.floating-text.poetica-link.chaos9 {
    bottom: 10%;
    right: 5%;
    animation: subtleChaos9 96s infinite ease-in-out;
}

.gallery-reset-button.chaos10 {
    bottom: 10%;
    left: 5%;
    animation: subtleChaos10 98s infinite ease-in-out;
}

/* NOVO: Estilo para o botão de Iniciar */
.start-button.chaos11 {
    top: 5%;
    right: 5%;
    animation: subtleChaos11 94s infinite ease-in-out;
}


@keyframes subtleChaos8 {
    0% { top: 5%; left: 5%; transform: rotate(0deg); }
    20% { top: 7%; left: 7%; transform: rotate(5deg); }
    40% { top: 9%; left: 6%; transform: rotate(-3deg); }
    60% { top: 6%; left: 8%; transform: rotate(4deg); }
    80% { top: 8%; left: 6%; transform: rotate(-2deg); }
    100% { top: 5%; left: 5%; transform: rotate(0deg); }
}

@keyframes subtleChaos9 {
    0% { bottom: 10%; right: 5%; transform: rotate(0deg); }
    20% { bottom: 12%; right: 7%; transform: rotate(-5deg); }
    40% { bottom: 14%; right: 6%; transform: rotate(4deg); }
    60% { bottom: 11%; right: 8%; transform: rotate(-3deg); }
    80% { bottom: 13%; right: 6%; transform: rotate(2deg); }
    100% { bottom: 10%; right: 5%; transform: rotate(0deg); }
}

@keyframes subtleChaos10 {
    0% { bottom: 10%; left: 5%; transform: rotate(0deg); }
    20% { bottom: 12%; left: 7%; transform: rotate(-4deg); }
    40% { bottom: 14%; left: 6%; transform: rotate(3deg); }
    60% { bottom: 11%; left: 8%; transform: rotate(-5deg); }
    80% { bottom: 13%; left: 6%; transform: rotate(2deg); }
    100% { bottom: 10%; left: 5%; transform: rotate(0deg); }
}

@keyframes subtleChaos11 {
    0% { top: 5%; right: 5%; transform: rotate(0deg); }
    20% { top: 7%; right: 7%; transform: rotate(-4deg); }
    40% { top: 6%; right: 6%; transform: rotate(3deg); }
    60% { top: 8%; right: 8%; transform: rotate(-3deg); }
    80% { top: 6%; right: 7%; transform: rotate(2deg); }
    100% { top: 5%; right: 5%; transform: rotate(0deg); }
}

/* ==========================================================================
   Responsividade
   ========================================================================== */
@media (max-width: 768px) {
    .gallery-container {
        width: 95vw;
        max-height: 80vh;
        padding: 12px;
    }
    .gallery {
        min-height: 70vh;
    }
    .gallery-img {
        max-height: 70vh;
    }
    .poetica-container {
        max-width: 90%;
        padding: 12px;
    }
    .poetica-text-line {
        font-size: 1.2em;
    }
    .aquarela-reflexo {
        width: 96px;
        height: 72px;
    }
    .aquarela-reflexo img {
        max-width: 96px;
        max-height: 72px;
    }
    .gallery-prev, .gallery-next {
        font-size: 1.5em;
        padding: 8px;
    }
    .word-sea .word {
        font-size: 0.7em;
    }
}