body {
    margin: 0;
    overflow: hidden;
    background: #000;
    color: #fff;
    font-family: 'Jost', sans-serif;
}

#background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    animation: fadeCycle 60s infinite ease-in-out, driftZoom 90s infinite ease-in-out;
    filter: blur(8px);
}

@keyframes fadeCycle {
    0% { opacity: 0; }
    50% { opacity: 0.75; }
    60% { opacity: 0.75; }
    100% { opacity: 0; }
}

@keyframes driftZoom {
    0% { transform: scale(1.1) translate(0, 0); filter: blur(8px); }
    25% { transform: scale(1.15) translate(2%, -1%); filter: blur(10px); }
    50% { transform: scale(1.2) translate(-1%, 2%); filter: blur(12px); }
    75% { transform: scale(1.15) translate(1%, -2%); filter: blur(10px); }
    100% { transform: scale(1.1) translate(0, 0); filter: blur(8px); }
}

canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.word-sea {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.word {
    position: absolute;
    font-family: 'Raleway', sans-serif;
    font-weight: 300;
    font-size: 1.2em;
    /* Remover cor padrão para usar a definida no JS */
    opacity: 0;
    cursor: pointer;
    animation: fadeWord var(--animation-duration, 8s) ease-in-out forwards;
    animation-delay: var(--animation-delay, 0s);
    text-shadow: 0 0 4px rgba(173, 216, 230, 0.3); /* Brilho sutil */
}

@keyframes fadeWord {
    0% { opacity: 0; transform: translateY(0); }
    20% { opacity: 0.7; }
    80% { opacity: 0.7; }
    100% { opacity: 0; transform: translateY(-20px); }
}

#silencio {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5em;
    font-weight: 300;
    z-index: 2;
    animation: fadeIn 2s ease-in-out;
}

@keyframes fadeIn {
    0% { opacity: 0; transform: translate(-50%, -40%); }
    100% { opacity: 1; transform: translate(-50%, -50%); }
}

#frase {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2em;
    font-weight: 300;
    opacity: 0;
    z-index: 2;
    text-align: center;
    max-width: 80%;
}

.floating-text {
    position: fixed;
    color: #F5F5F5;
    font-family: 'Jost', sans-serif;
    font-size: 1.5em;
    font-weight: 300;
    text-decoration: none;
    z-index: 3;
    padding: 8px 12px;
    border-radius: 15% 40% 25% 55%;
    transition: color 0.5s ease;
}

.floating-text:hover {
    color: #FFD700;
}

.floating-text.chaos8 {
    top: 5%;
    left: 5%;
    animation: subtleChaos8 100s infinite ease-in-out;
}

.floating-text.poetica-link {
    bottom: 10%;
    right: 5%;
    animation: subtleChaos9 96s infinite ease-in-out;
}

.floating-text.reiniciar-button {
    bottom: 5%;
    left: 5%;
    animation: subtleChaos10 90s 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: 5%; left: 5%; transform: rotate(0deg); }
    20% { bottom: 7%; left: 7%; transform: rotate(4deg); }
    40% { bottom: 6%; left: 6%; transform: rotate(-4deg); }
    60% { bottom: 8%; left: 8%; transform: rotate(3deg); }
    80% { bottom: 6%; left: 7%; transform: rotate(-3deg); }
    100% { bottom: 5%; left: 5%; transform: rotate(0deg); }
}

.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: 4;
    opacity: 0;
    transition: opacity 1.5s 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;
}

.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;
}

.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out;
}

.page-transition.fade-in {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 768px) {
    #silencio {
        font-size: 1.8em;
    }
    #frase {
        font-size: 1em;
        max-width: 90%;
    }
    .floating-text {
        font-size: 1.2em;
        padding: 6px 10px;
    }
    .poetica-container {
        max-width: 90%;
        padding: 12px;
    }
    .poetica-text-line {
        font-size: 1.2em;
    }
    .word {
        font-size: 1em;
    }
}