body, html {
    height: 100%;
    margin: 0;
    font-family: 'Arial', sans-serif;
    overflow: hidden;
    background-color: #000;
}

.controls {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.4);
    padding: 0.5rem 1rem;
    border-radius: 1rem;
    backdrop-filter: blur(5px);
}

.controls button {
    background: white;
    border: none;
    padding: 0.75rem 1.25rem;
    font-size: 1.5rem;
    border-radius: 0.75rem;
    cursor: pointer;
    opacity: 0.9;
    transition: background 0.2s, opacity 0.2s;
}

.controls button:hover {
    background: #ddd;
    opacity: 1;
}

.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center top;
    opacity: 0;
     transition: opacity 1s ease-in-out;
    animation: backgroundScroll 28s ease-in-out forwards; /* Match 2x SLIDE_DURATION */
}

@keyframes backgroundScroll {
    from {
        background-position: center 20%;
    }
    to {
        background-position: center 80%;
    }
}

@media (orientation: landscape) {
    .background {
        animation: backgroundScroll 28s ease-in-out forwards;
    }
}

.background.scrolling {
    animation: backgroundScroll 28s ease-in-out forwards;
}

@keyframes backgroundScroll {
    from {
        background-position: center 20%;
    }
    to {
        background-position: center 80%;
    }
}

.active {
    opacity: 1;
    z-index: 1;
}

.slide-in-right {
    animation: slideInRight 1.5s forwards;
}

.slide-in-left {
    animation: slideInLeft 1.5s forwards;
}

.slide-in-up {
    animation: slideInUp 1.5s forwards;
}

.slide-in-down {
    animation: slideInDown 1.5s forwards;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes slideInLeft {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

@keyframes slideInUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes slideInDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.text-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    color: white;
    text-align: center;
    width: 80%;
    max-width: 1200px;
    padding: 2rem;
    background-color: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 50px 50px rgba(0, 0, 0, 0.6);
    border-radius: 2rem;
    opacity: 0;
    transition: opacity 1s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    max-height: 80vh;
    overflow: hidden;
}

.text-overlay.visible {
    opacity: 1;
}

.quote {
    font-size: 3rem; /* Starting size, will be adjusted by JS */
    margin-bottom: 1rem;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    //white-space: nowrap;
    //text-overflow: ellipsis;
    //overflow: hidden;
}

.author {
    font-size: 2rem; /* Starting size, will be adjusted by JS */
    font-style: italic;
    word-wrap: break-word;
    overflow-wrap: break-word;
    //white-space: nowrap;
    //text-overflow: ellipsis;
    //overflow: hidden;
}

/*
@media (max-width: 600px) {
    .quote {
        font-size: 3.5rem;
    }
    .author {
        font-size: 2.5rem;
    }
}

@media (min-width: 1200px) {
    .quote {
        font-size: 4rem;
    }
    .author {
        font-size: 3rem;
    }
}
*/